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
86a515fd
Commit
86a515fd
authored
Aug 19, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imgproc: fix accuracy check for HLS cvtColor
parent
bf4c5bef
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
test_color.cpp
modules/imgproc/test/ocl/test_color.cpp
+22
-0
No files found.
modules/imgproc/test/ocl/test_color.cpp
View file @
86a515fd
...
...
@@ -98,9 +98,31 @@ PARAM_TEST_CASE(CvtColor, MatDepth, bool)
OCL_OFF
(
cv
::
cvtColor
(
src_roi
,
dst_roi
,
code
,
channelsOut
));
OCL_ON
(
cv
::
cvtColor
(
usrc_roi
,
udst_roi
,
code
,
channelsOut
));
int
h_limit
=
256
;
switch
(
code
)
{
case
COLOR_RGB2HLS
:
case
COLOR_BGR2HLS
:
h_limit
=
180
;
case
COLOR_RGB2HLS_FULL
:
case
COLOR_BGR2HLS_FULL
:
{
ASSERT_EQ
(
dst_roi
.
type
(),
udst_roi
.
type
());
ASSERT_EQ
(
dst_roi
.
size
(),
udst_roi
.
size
());
Mat
gold
,
actual
;
dst_roi
.
convertTo
(
gold
,
CV_32FC3
);
udst_roi
.
getMat
(
ACCESS_READ
).
convertTo
(
actual
,
CV_32FC3
);
Mat
absdiff1
,
absdiff2
,
absdiff3
;
cv
::
absdiff
(
gold
,
actual
,
absdiff1
);
cv
::
absdiff
(
gold
,
actual
+
h_limit
,
absdiff2
);
cv
::
absdiff
(
gold
,
actual
-
h_limit
,
absdiff3
);
Mat
diff
=
cv
::
min
(
cv
::
min
(
absdiff1
,
absdiff2
),
absdiff3
);
EXPECT_LE
(
cvtest
::
norm
(
diff
,
NORM_INF
),
threshold
);
break
;
}
default:
Near
(
threshold
);
}
}
}
};
#define CVTCODE(name) COLOR_ ## name
...
...
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