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
5c81b598
Commit
5c81b598
authored
Apr 06, 2013
by
Davis King
Browse files
added more tests
parent
dd9804dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
dlib/test/image.cpp
dlib/test/image.cpp
+25
-0
No files found.
dlib/test/image.cpp
View file @
5c81b598
...
...
@@ -1394,6 +1394,29 @@ namespace
DLIB_TEST
(
max
(
abs
(
mat
(
img
)
-
matrix_cast
<
T
>
(
mat
(
img3
))))
<
scale
*
std
::
numeric_limits
<
long
double
>::
epsilon
());
}
void
test_dng_float_int
()
{
dlog
<<
LINFO
<<
"in test_dng_float_int"
;
print_spinner
();
array2d
<
uint16
>
img
;
assign_image
(
img
,
gaussian_randm
(
101
,
100
)
*
10000
);
ostringstream
sout
;
save_dng
(
img
,
sout
);
istringstream
sin
(
sout
.
str
());
array2d
<
double
>
img2
;
load_dng
(
img2
,
sin
);
sout
.
clear
();
sout
.
str
(
""
);
save_dng
(
img2
,
sout
);
sin
.
clear
();
sin
.
str
(
sout
.
str
());
array2d
<
uint16
>
img3
;
load_dng
(
img3
,
sin
);
// this whole thing should have been totally lossless.
DLIB_TEST
(
mat
(
img
)
==
mat
(
img3
));
}
// ----------------------------------------------------------------------------------------
...
...
@@ -1443,6 +1466,8 @@ namespace
test_dng_floats
<
float
>
(
1e30
);
test_dng_floats
<
double
>
(
1e30
);
test_dng_floats
<
long
double
>
(
1e30
);
test_dng_float_int
();
}
}
a
;
...
...
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