Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
91913364
Commit
91913364
authored
Nov 24, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reintegrate warp shuffle based integral
parent
5460cee9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
36 deletions
+11
-36
integral_image.cu
modules/gpu/src/cuda/integral_image.cu
+1
-7
imgproc.cpp
modules/gpu/src/imgproc.cpp
+10
-29
No files found.
modules/gpu/src/cuda/integral_image.cu
View file @
91913364
...
...
@@ -361,14 +361,8 @@ namespace cv { namespace gpu { namespace device
{
{
// each thread handles 16 values, use 1 block/row
int block = img.cols / 16;
// save, becouse step is actually can't be less 512 bytes
int align = img.cols % 4;
if ( align != 0)
{
block += (4 - align);
}
int block = integral.cols / 16;
// launch 1 block / row
const int grid = img.rows;
...
...
modules/gpu/src/imgproc.cpp
View file @
91913364
...
...
@@ -553,44 +553,25 @@ void cv::gpu::integralBuffered(const GpuMat& src, GpuMat& sum, GpuMat& buffer, S
src
.
locateROI
(
whole
,
offset
);
if
(
info
.
supports
(
WARP_SHUFFLE_FUNCTIONS
)
&&
src
.
cols
<=
2048
)
if
(
info
.
supports
(
WARP_SHUFFLE_FUNCTIONS
)
&&
src
.
cols
<=
2048
&&
offset
.
x
%
16
==
0
&&
(
src
.
cols
+
63
)
/
64
<=
(
src
.
step
-
offset
.
x
)
)
{
GpuMat
srcAlligned
;
ensureSizeIsEnough
(((
src
.
rows
+
7
)
/
8
)
*
8
,
((
src
.
cols
+
63
)
/
64
)
*
64
,
CV_32SC1
,
buffer
)
;
if
(
src
.
cols
%
16
==
0
&&
src
.
rows
%
8
==
0
&&
offset
.
x
%
16
==
0
&&
offset
.
y
%
8
==
0
)
srcAlligned
=
src
;
else
{
ensureSizeIsEnough
(((
src
.
rows
+
7
)
/
8
)
*
8
,
((
src
.
cols
+
15
)
/
16
)
*
16
,
src
.
type
(),
buffer
);
GpuMat
inner
=
buffer
(
Rect
(
0
,
0
,
src
.
cols
,
src
.
rows
));
if
(
s
)
{
s
.
enqueueMemSet
(
buffer
,
Scalar
::
all
(
0
));
s
.
enqueueCopy
(
src
,
inner
);
}
else
{
buffer
.
setTo
(
Scalar
::
all
(
0
));
src
.
copyTo
(
inner
);
}
srcAlligned
=
buffer
;
}
sum
.
create
(
srcAlligned
.
rows
+
1
,
srcAlligned
.
cols
+
4
,
CV_32SC1
);
cv
::
gpu
::
device
::
imgproc
::
shfl_integral_gpu
(
src
,
buffer
,
stream
);
sum
.
create
(
src
.
rows
+
1
,
src
.
cols
+
1
,
CV_32SC1
);
if
(
s
)
s
.
enqueueMemSet
(
sum
,
Scalar
::
all
(
0
));
else
sum
.
setTo
(
Scalar
::
all
(
0
));
GpuMat
inner
=
sum
(
Rect
(
4
,
1
,
srcAlligned
.
cols
,
srcAlligned
.
rows
));
cv
::
gpu
::
device
::
imgproc
::
shfl_integral_gpu
(
srcAlligned
,
inner
,
stream
);
GpuMat
inner
=
sum
(
Rect
(
1
,
1
,
src
.
cols
,
src
.
rows
));
GpuMat
res
=
buffer
(
Rect
(
0
,
0
,
src
.
cols
,
src
.
rows
));
sum
=
sum
(
Rect
(
3
,
0
,
src
.
cols
+
1
,
src
.
rows
+
1
));
if
(
s
)
s
.
enqueueCopy
(
res
,
inner
);
else
res
.
copyTo
(
inner
);
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment