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
2fc92448
Commit
2fc92448
authored
May 18, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4024 from jet47:cuda-minmaxloc-one-row-input
parents
8b791477
e22979f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
test_reductions.cpp
modules/cudaarithm/test/test_reductions.cpp
+38
-0
minmaxloc.hpp
...les/cudev/include/opencv2/cudev/grid/detail/minmaxloc.hpp
+1
-1
No files found.
modules/cudaarithm/test/test_reductions.cpp
View file @
2fc92448
...
...
@@ -587,6 +587,44 @@ CUDA_TEST_P(MinMaxLoc, WithoutMask)
}
}
CUDA_TEST_P
(
MinMaxLoc
,
OneRowMat
)
{
cv
::
Mat
src
=
randomMat
(
cv
::
Size
(
size
.
width
,
1
),
depth
);
double
minVal
,
maxVal
;
cv
::
Point
minLoc
,
maxLoc
;
cv
::
cuda
::
minMaxLoc
(
loadMat
(
src
,
useRoi
),
&
minVal
,
&
maxVal
,
&
minLoc
,
&
maxLoc
);
double
minVal_gold
,
maxVal_gold
;
cv
::
Point
minLoc_gold
,
maxLoc_gold
;
minMaxLocGold
(
src
,
&
minVal_gold
,
&
maxVal_gold
,
&
minLoc_gold
,
&
maxLoc_gold
);
EXPECT_DOUBLE_EQ
(
minVal_gold
,
minVal
);
EXPECT_DOUBLE_EQ
(
maxVal_gold
,
maxVal
);
expectEqual
(
src
,
minLoc_gold
,
minLoc
);
expectEqual
(
src
,
maxLoc_gold
,
maxLoc
);
}
CUDA_TEST_P
(
MinMaxLoc
,
OneColumnMat
)
{
cv
::
Mat
src
=
randomMat
(
cv
::
Size
(
1
,
size
.
height
),
depth
);
double
minVal
,
maxVal
;
cv
::
Point
minLoc
,
maxLoc
;
cv
::
cuda
::
minMaxLoc
(
loadMat
(
src
,
useRoi
),
&
minVal
,
&
maxVal
,
&
minLoc
,
&
maxLoc
);
double
minVal_gold
,
maxVal_gold
;
cv
::
Point
minLoc_gold
,
maxLoc_gold
;
minMaxLocGold
(
src
,
&
minVal_gold
,
&
maxVal_gold
,
&
minLoc_gold
,
&
maxLoc_gold
);
EXPECT_DOUBLE_EQ
(
minVal_gold
,
minVal
);
EXPECT_DOUBLE_EQ
(
maxVal_gold
,
maxVal
);
expectEqual
(
src
,
minLoc_gold
,
minLoc
);
expectEqual
(
src
,
maxLoc_gold
,
maxLoc
);
}
CUDA_TEST_P
(
MinMaxLoc
,
Async
)
{
cv
::
Mat
src
=
randomMat
(
size
,
depth
);
...
...
modules/cudev/include/opencv2/cudev/grid/detail/minmaxloc.hpp
View file @
2fc92448
...
...
@@ -156,7 +156,7 @@ namespace grid_minmaxloc_detail
__host__
void
minMaxLoc
(
const
SrcPtr
&
src
,
ResType
*
minVal
,
ResType
*
maxVal
,
int
*
minLoc
,
int
*
maxLoc
,
const
MaskPtr
&
mask
,
int
rows
,
int
cols
,
cudaStream_t
stream
)
{
dim3
block
,
grid
;
getLaunchCfg
<
Policy
>
(
cols
,
row
s
,
block
,
grid
);
getLaunchCfg
<
Policy
>
(
rows
,
col
s
,
block
,
grid
);
const
int
patch_x
=
divUp
(
divUp
(
cols
,
grid
.
x
),
block
.
x
);
const
int
patch_y
=
divUp
(
divUp
(
rows
,
grid
.
y
),
block
.
y
);
...
...
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