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
62ee92e3
Commit
62ee92e3
authored
Aug 15, 2017
by
Rostislav Vasilikhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ColorLab_full test fixed
parent
375ec5ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
15 deletions
+18
-15
test_color.cpp
modules/imgproc/test/test_color.cpp
+17
-15
test_precomp.hpp
modules/imgproc/test/test_precomp.hpp
+1
-0
No files found.
modules/imgproc/test/test_color.cpp
View file @
62ee92e3
...
...
@@ -2297,7 +2297,7 @@ static void validateResult(const Mat& reference, const Mat& actual, const Mat& s
ssize
.
width
*=
cn
;
bool
next
=
true
;
//RGB2Lab_f works throug LUT and brings additional error
static
const
float
maxErr
=
1.
f
/
200
.
f
;
static
const
float
maxErr
=
1.
f
/
192
.
f
;
for
(
int
y
=
0
;
y
<
ssize
.
height
&&
next
;
++
y
)
{
...
...
@@ -2335,20 +2335,22 @@ TEST(Imgproc_ColorLab_Full, accuracy)
Size
ssize
=
src
.
size
();
CV_Assert
(
ssize
.
width
==
ssize
.
height
);
RNG
&
rng
=
cvtest
::
TS
::
ptr
()
->
get_rng
();
int
blueInd
=
rng
.
uniform
(
0.
,
1.
)
>
0.5
?
0
:
2
;
bool
srgb
=
rng
.
uniform
(
0.
,
1.
)
>
0.5
;
// Convert test image to LAB
cv
::
Mat
lab
;
int
forward_code
=
blueInd
?
srgb
?
CV_BGR2Lab
:
CV_LBGR2Lab
:
srgb
?
CV_RGB2Lab
:
CV_LRGB2Lab
;
int
inverse_code
=
blueInd
?
srgb
?
CV_Lab2BGR
:
CV_Lab2LBGR
:
srgb
?
CV_Lab2RGB
:
CV_Lab2LRGB
;
cv
::
cvtColor
(
src
,
lab
,
forward_code
);
// Convert LAB image back to BGR(RGB)
cv
::
Mat
recons
;
cv
::
cvtColor
(
lab
,
recons
,
inverse_code
);
validateResult
(
src
,
recons
,
src
,
forward_code
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
int
blueInd
=
(
i
%
2
)
>
0
?
0
:
2
;
bool
srgb
=
i
>
1
;
// Convert test image to LAB
cv
::
Mat
lab
;
int
forward_code
=
blueInd
?
srgb
?
CV_BGR2Lab
:
CV_LBGR2Lab
:
srgb
?
CV_RGB2Lab
:
CV_LRGB2Lab
;
int
inverse_code
=
blueInd
?
srgb
?
CV_Lab2BGR
:
CV_Lab2LBGR
:
srgb
?
CV_Lab2RGB
:
CV_Lab2LRGB
;
cv
::
cvtColor
(
src
,
lab
,
forward_code
);
// Convert LAB image back to BGR(RGB)
cv
::
Mat
recons
;
cv
::
cvtColor
(
lab
,
recons
,
inverse_code
);
validateResult
(
src
,
recons
,
src
,
forward_code
);
}
}
static
void
test_Bayer2RGB_EdgeAware_8u
(
const
Mat
&
src
,
Mat
&
dst
,
int
code
)
...
...
modules/imgproc/test/test_precomp.hpp
View file @
62ee92e3
...
...
@@ -14,6 +14,7 @@
#include "opencv2/core/private.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/core/softfloat.hpp"
#include "opencv2/imgproc/imgproc_c.h"
...
...
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