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
b6a093fb
Commit
b6a093fb
authored
May 15, 2016
by
Tomoaki Teshima
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accept multiple channels image for threshold on cuda
* modify test, too
parent
d6b85635
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
threshold.cu
modules/cudaarithm/src/cuda/threshold.cu
+3
-1
test_element_operations.cpp
modules/cudaarithm/test/test_element_operations.cpp
+8
-5
No files found.
modules/cudaarithm/src/cuda/threshold.cu
View file @
b6a093fb
...
...
@@ -101,10 +101,12 @@ double cv::cuda::threshold(InputArray _src, OutputArray _dst, double thresh, dou
const int depth = src.depth();
CV_Assert(
src.channels() == 1 &&
depth <= CV_64F );
CV_Assert( depth <= CV_64F );
CV_Assert( type <= 4 /*THRESH_TOZERO_INV*/ );
GpuMat dst = getOutputMat(_dst, src.size(), src.type(), stream);
src = src.reshape(1);
dst = dst.reshape(1);
if (depth == CV_32F && type == 2 /*THRESH_TRUNC*/)
{
...
...
modules/cudaarithm/test/test_element_operations.cpp
View file @
b6a093fb
...
...
@@ -2532,11 +2532,12 @@ INSTANTIATE_TEST_CASE_P(CUDA_Arithm, AddWeighted, testing::Combine(
CV_ENUM
(
ThreshOp
,
cv
::
THRESH_BINARY
,
cv
::
THRESH_BINARY_INV
,
cv
::
THRESH_TRUNC
,
cv
::
THRESH_TOZERO
,
cv
::
THRESH_TOZERO_INV
)
#define ALL_THRESH_OPS testing::Values(ThreshOp(cv::THRESH_BINARY), ThreshOp(cv::THRESH_BINARY_INV), ThreshOp(cv::THRESH_TRUNC), ThreshOp(cv::THRESH_TOZERO), ThreshOp(cv::THRESH_TOZERO_INV))
PARAM_TEST_CASE
(
Threshold
,
cv
::
cuda
::
DeviceInfo
,
cv
::
Size
,
MatType
,
ThreshOp
,
UseRoi
)
PARAM_TEST_CASE
(
Threshold
,
cv
::
cuda
::
DeviceInfo
,
cv
::
Size
,
MatType
,
Channels
,
ThreshOp
,
UseRoi
)
{
cv
::
cuda
::
DeviceInfo
devInfo
;
cv
::
Size
size
;
int
type
;
int
channel
;
int
threshOp
;
bool
useRoi
;
...
...
@@ -2545,8 +2546,9 @@ PARAM_TEST_CASE(Threshold, cv::cuda::DeviceInfo, cv::Size, MatType, ThreshOp, Us
devInfo
=
GET_PARAM
(
0
);
size
=
GET_PARAM
(
1
);
type
=
GET_PARAM
(
2
);
threshOp
=
GET_PARAM
(
3
);
useRoi
=
GET_PARAM
(
4
);
channel
=
GET_PARAM
(
3
);
threshOp
=
GET_PARAM
(
4
);
useRoi
=
GET_PARAM
(
5
);
cv
::
cuda
::
setDevice
(
devInfo
.
deviceID
());
}
...
...
@@ -2554,7 +2556,7 @@ PARAM_TEST_CASE(Threshold, cv::cuda::DeviceInfo, cv::Size, MatType, ThreshOp, Us
CUDA_TEST_P
(
Threshold
,
Accuracy
)
{
cv
::
Mat
src
=
randomMat
(
size
,
type
);
cv
::
Mat
src
=
randomMat
(
size
,
CV_MAKE_TYPE
(
type
,
channel
)
);
double
maxVal
=
randomDouble
(
20.0
,
127.0
);
double
thresh
=
randomDouble
(
0.0
,
maxVal
);
...
...
@@ -2570,7 +2572,8 @@ CUDA_TEST_P(Threshold, Accuracy)
INSTANTIATE_TEST_CASE_P
(
CUDA_Arithm
,
Threshold
,
testing
::
Combine
(
ALL_DEVICES
,
DIFFERENT_SIZES
,
testing
::
Values
(
MatType
(
CV_8UC1
),
MatType
(
CV_16SC1
),
MatType
(
CV_32FC1
)),
testing
::
Values
(
MatDepth
(
CV_8U
),
MatDepth
(
CV_16S
),
MatDepth
(
CV_32F
)),
ALL_CHANNELS
,
ALL_THRESH_OPS
,
WHOLE_SUBMAT
));
...
...
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