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
9ab1f7cc
Commit
9ab1f7cc
authored
Nov 05, 2013
by
Davis King
Browse files
Added tests for new zero_border_pixels() overload.
parent
4329935f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
dlib/test/image.cpp
dlib/test/image.cpp
+59
-0
No files found.
dlib/test/image.cpp
View file @
9ab1f7cc
...
@@ -1036,6 +1036,65 @@ namespace
...
@@ -1036,6 +1036,65 @@ namespace
DLIB_TEST
(
img
[
1
][
2
]
==
1
);
DLIB_TEST
(
img
[
1
][
2
]
==
1
);
DLIB_TEST
(
img
[
2
][
2
]
==
1
);
DLIB_TEST
(
img
[
2
][
2
]
==
1
);
rectangle
rect
=
get_rect
(
img
);
rect
.
left
()
+=
2
;
rect
.
top
()
+=
1
;
rect
.
right
()
-=
2
;
rect
.
bottom
()
-=
1
;
assign_all_pixels
(
img
,
1
);
zero_border_pixels
(
img
,
rect
);
DLIB_TEST
(
img
[
0
][
0
]
==
0
);
DLIB_TEST
(
img
[
1
][
0
]
==
0
);
DLIB_TEST
(
img
[
2
][
0
]
==
0
);
DLIB_TEST
(
img
[
3
][
0
]
==
0
);
DLIB_TEST
(
img
[
0
][
1
]
==
0
);
DLIB_TEST
(
img
[
1
][
1
]
==
0
);
DLIB_TEST
(
img
[
2
][
1
]
==
0
);
DLIB_TEST
(
img
[
3
][
1
]
==
0
);
DLIB_TEST
(
img
[
0
][
3
]
==
0
);
DLIB_TEST
(
img
[
1
][
3
]
==
0
);
DLIB_TEST
(
img
[
2
][
3
]
==
0
);
DLIB_TEST
(
img
[
3
][
3
]
==
0
);
DLIB_TEST
(
img
[
0
][
4
]
==
0
);
DLIB_TEST
(
img
[
1
][
4
]
==
0
);
DLIB_TEST
(
img
[
2
][
4
]
==
0
);
DLIB_TEST
(
img
[
3
][
4
]
==
0
);
DLIB_TEST
(
img
[
0
][
2
]
==
0
);
DLIB_TEST
(
img
[
3
][
2
]
==
0
);
DLIB_TEST
(
img
[
1
][
2
]
==
1
);
DLIB_TEST
(
img
[
2
][
2
]
==
1
);
rect
.
right
()
+=
1
;
assign_all_pixels
(
img
,
1
);
zero_border_pixels
(
img
,
rect
);
DLIB_TEST
(
img
[
0
][
0
]
==
0
);
DLIB_TEST
(
img
[
1
][
0
]
==
0
);
DLIB_TEST
(
img
[
2
][
0
]
==
0
);
DLIB_TEST
(
img
[
3
][
0
]
==
0
);
DLIB_TEST
(
img
[
0
][
1
]
==
0
);
DLIB_TEST
(
img
[
1
][
1
]
==
0
);
DLIB_TEST
(
img
[
2
][
1
]
==
0
);
DLIB_TEST
(
img
[
3
][
1
]
==
0
);
DLIB_TEST
(
img
[
0
][
3
]
==
0
);
DLIB_TEST
(
img
[
1
][
3
]
==
1
);
DLIB_TEST
(
img
[
2
][
3
]
==
1
);
DLIB_TEST
(
img
[
3
][
3
]
==
0
);
DLIB_TEST
(
img
[
0
][
4
]
==
0
);
DLIB_TEST
(
img
[
1
][
4
]
==
0
);
DLIB_TEST
(
img
[
2
][
4
]
==
0
);
DLIB_TEST
(
img
[
3
][
4
]
==
0
);
DLIB_TEST
(
img
[
0
][
2
]
==
0
);
DLIB_TEST
(
img
[
3
][
2
]
==
0
);
DLIB_TEST
(
img
[
1
][
2
]
==
1
);
DLIB_TEST
(
img
[
2
][
2
]
==
1
);
}
}
...
...
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