Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
fa865c21
Commit
fa865c21
authored
Aug 03, 2016
by
sutr90
Browse files
Added tests for Lab pixels.
parent
933ab009
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
0 deletions
+68
-0
dlib/test/pixel.cpp
dlib/test/pixel.cpp
+68
-0
No files found.
dlib/test/pixel.cpp
View file @
fa865c21
...
...
@@ -253,6 +253,74 @@ namespace
DLIB_TEST
(
p_rgb
.
green
==
119
);
DLIB_TEST
(
p_rgb
.
blue
==
119
);
//Lab limit values test
//red, green, blue, yellow, black, white
p_lab
.
l
=
0
;
p_lab
.
a
=
0
;
p_lab
.
b
=
0
;
assign_pixel
(
p_rgb
,
p_lab
);
DLIB_TEST
(
p_rgb
.
red
==
0
);
DLIB_TEST
(
p_rgb
.
green
==
64
);
DLIB_TEST
(
p_rgb
.
blue
==
194
);
p_lab
.
l
=
255
;
p_lab
.
a
=
0
;
p_lab
.
b
=
0
;
assign_pixel
(
p_rgb
,
p_lab
);
DLIB_TEST
(
p_rgb
.
red
==
0
);
DLIB_TEST
(
p_rgb
.
green
==
255
);
DLIB_TEST
(
p_rgb
.
blue
==
255
);
p_lab
.
l
=
0
;
p_lab
.
a
=
255
;
p_lab
.
b
=
0
;
assign_pixel
(
p_rgb
,
p_lab
);
DLIB_TEST
(
p_rgb
.
red
==
0
);
DLIB_TEST
(
p_rgb
.
green
==
0
);
DLIB_TEST
(
p_rgb
.
blue
==
195
);
p_lab
.
l
=
0
;
p_lab
.
a
=
0
;
p_lab
.
b
=
255
;
assign_pixel
(
p_rgb
,
p_lab
);
DLIB_TEST
(
p_rgb
.
red
==
0
);
DLIB_TEST
(
p_rgb
.
green
==
45
);
DLIB_TEST
(
p_rgb
.
blue
==
0
);
p_lab
.
l
=
255
;
p_lab
.
a
=
255
;
p_lab
.
b
=
0
;
assign_pixel
(
p_rgb
,
p_lab
);
DLIB_TEST
(
p_rgb
.
red
==
255
);
DLIB_TEST
(
p_rgb
.
green
==
139
);
DLIB_TEST
(
p_rgb
.
blue
==
255
);
p_lab
.
l
=
0
;
p_lab
.
a
=
255
;
p_lab
.
b
=
255
;
assign_pixel
(
p_rgb
,
p_lab
);
DLIB_TEST
(
p_rgb
.
red
==
132
);
DLIB_TEST
(
p_rgb
.
green
==
0
);
DLIB_TEST
(
p_rgb
.
blue
==
0
);
p_lab
.
l
=
255
;
p_lab
.
a
=
0
;
p_lab
.
b
=
255
;
assign_pixel
(
p_rgb
,
p_lab
);
DLIB_TEST
(
p_rgb
.
red
==
0
);
DLIB_TEST
(
p_rgb
.
green
==
255
);
DLIB_TEST
(
p_rgb
.
blue
==
0
);
p_lab
.
l
=
255
;
p_lab
.
a
=
255
;
p_lab
.
b
=
255
;
assign_pixel
(
p_rgb
,
p_lab
);
DLIB_TEST
(
p_rgb
.
red
==
255
);
DLIB_TEST
(
p_rgb
.
green
==
70
);
DLIB_TEST
(
p_rgb
.
blue
==
0
);
assign_pixel
(
p_rgba
,
100
);
assign_pixel
(
p_gray
,
10
);
assign_pixel
(
p_schar
,
10
);
...
...
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