Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
64e437a3
Commit
64e437a3
authored
Aug 05, 2016
by
sutr90
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test for RGB to Lab to RGB conversion.
parent
fa865c21
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
4 deletions
+78
-4
pixel.cpp
dlib/test/pixel.cpp
+78
-4
No files found.
dlib/test/pixel.cpp
View file @
64e437a3
...
...
@@ -36,7 +36,7 @@ namespace
long
p_int
;
float
p_float
;
signed
char
p_schar
;
rgb_pixel
p_rgb
;
rgb_pixel
p_rgb
,
p_rgb2
;
hsi_pixel
p_hsi
,
p_hsi2
;
rgb_alpha_pixel
p_rgba
;
lab_pixel
p_lab
,
p_lab2
;
...
...
@@ -255,9 +255,9 @@ namespace
//Lab limit values test
//red, green, blue, yellow, black, white
p_lab
.
l
=
0
;
p_lab
.
a
=
0
;
p_lab
.
b
=
0
;
p_lab
.
l
=
84
;
p_lab
.
a
=
164
;
p_lab
.
b
=
56
;
assign_pixel
(
p_rgb
,
p_lab
);
DLIB_TEST
(
p_rgb
.
red
==
0
);
DLIB_TEST
(
p_rgb
.
green
==
64
);
...
...
@@ -321,6 +321,80 @@ namespace
DLIB_TEST
(
p_rgb
.
green
==
70
);
DLIB_TEST
(
p_rgb
.
blue
==
0
);
//RGB limit tests
p_rgb
.
red
=
0
;
p_rgb
.
green
=
0
;
p_rgb
.
blue
=
0
;
assign_pixel
(
p_lab
,
p_rgb
);
assign_pixel
(
p_rgb2
,
p_lab
);
DLIB_TEST
(
p_rgb2
.
red
<
3
);
DLIB_TEST
(
p_rgb2
.
green
<
3
);
DLIB_TEST
(
p_rgb2
.
blue
<
3
);
p_rgb
.
red
=
255
;
p_rgb
.
green
=
0
;
p_rgb
.
blue
=
0
;
assign_pixel
(
p_lab
,
p_rgb
);
assign_pixel
(
p_rgb2
,
p_lab
);
DLIB_TEST
(
p_rgb2
.
red
>
252
);
DLIB_TEST
(
p_rgb2
.
green
<
3
);
DLIB_TEST
(
p_rgb2
.
blue
<
3
);
p_rgb
.
red
=
0
;
p_rgb
.
green
=
255
;
p_rgb
.
blue
=
0
;
assign_pixel
(
p_lab
,
p_rgb
);
assign_pixel
(
p_rgb2
,
p_lab
);
DLIB_TEST
(
p_rgb2
.
red
<
8
);
DLIB_TEST
(
p_rgb2
.
green
>
252
);
DLIB_TEST
(
p_rgb2
.
blue
<
5
);
p_rgb
.
red
=
0
;
p_rgb
.
green
=
0
;
p_rgb
.
blue
=
255
;
assign_pixel
(
p_lab
,
p_rgb
);
assign_pixel
(
p_rgb2
,
p_lab
);
DLIB_TEST
(
p_rgb2
.
red
<
3
);
DLIB_TEST
(
p_rgb2
.
green
<
3
);
DLIB_TEST
(
p_rgb2
.
blue
>
252
);
p_rgb
.
red
=
255
;
p_rgb
.
green
=
255
;
p_rgb
.
blue
=
0
;
assign_pixel
(
p_lab
,
p_rgb
);
assign_pixel
(
p_rgb2
,
p_lab
);
DLIB_TEST
(
p_rgb2
.
red
>
252
);
DLIB_TEST
(
p_rgb2
.
green
>
252
);
DLIB_TEST
(
p_rgb2
.
blue
<
9
);
p_rgb
.
red
=
0
;
p_rgb
.
green
=
255
;
p_rgb
.
blue
=
255
;
assign_pixel
(
p_lab
,
p_rgb
);
assign_pixel
(
p_rgb2
,
p_lab
);
DLIB_TEST
(
p_rgb2
.
red
<
5
);
DLIB_TEST
(
p_rgb2
.
green
>
252
);
DLIB_TEST
(
p_rgb2
.
blue
>
252
);
p_rgb
.
red
=
255
;
p_rgb
.
green
=
0
;
p_rgb
.
blue
=
255
;
assign_pixel
(
p_lab
,
p_rgb
);
assign_pixel
(
p_rgb2
,
p_lab
);
DLIB_TEST
(
p_rgb2
.
red
>
252
);
DLIB_TEST
(
p_rgb2
.
green
<
6
);
DLIB_TEST
(
p_rgb2
.
blue
>
252
);
p_rgb
.
red
=
255
;
p_rgb
.
green
=
255
;
p_rgb
.
blue
=
255
;
assign_pixel
(
p_lab
,
p_rgb
);
assign_pixel
(
p_rgb2
,
p_lab
);
DLIB_TEST
(
p_rgb2
.
red
>
252
);
DLIB_TEST
(
p_rgb2
.
green
>
252
);
DLIB_TEST
(
p_rgb2
.
blue
>
252
);
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