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
a4e63d29
Commit
a4e63d29
authored
Mar 25, 2013
by
Davis King
Browse files
made code slightly more robust
parent
db5171c4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
dlib/image_processing/scan_image_boxes.h
dlib/image_processing/scan_image_boxes.h
+4
-1
No files found.
dlib/image_processing/scan_image_boxes.h
View file @
a4e63d29
...
@@ -567,6 +567,9 @@ namespace dlib
...
@@ -567,6 +567,9 @@ namespace dlib
rectangle
mapped_rect
=
get_best_matching_rect
(
obj
.
get_rect
());
rectangle
mapped_rect
=
get_best_matching_rect
(
obj
.
get_rect
());
mapped_rect
=
feats
.
image_to_feat_space
(
mapped_rect
).
intersect
(
get_rect
(
feats
));
mapped_rect
=
feats
.
image_to_feat_space
(
mapped_rect
).
intersect
(
get_rect
(
feats
));
if
(
mapped_rect
.
is_empty
())
return
;
std
::
vector
<
rectangle
>
regions
;
std
::
vector
<
rectangle
>
regions
;
get_feature_extraction_regions
(
mapped_rect
,
regions
);
get_feature_extraction_regions
(
mapped_rect
,
regions
);
...
@@ -574,7 +577,7 @@ namespace dlib
...
@@ -574,7 +577,7 @@ namespace dlib
for
(
unsigned
long
j
=
0
;
j
<
regions
.
size
();
++
j
)
for
(
unsigned
long
j
=
0
;
j
<
regions
.
size
();
++
j
)
{
{
const
rectangle
rect
=
regions
[
j
];
const
rectangle
rect
=
regions
[
j
];
DLIB_CASSERT
(
get_rect
(
feats
).
contains
(
regions
[
j
]),
""
);
DLIB_CASSERT
(
get_rect
(
feats
).
contains
(
regions
[
j
]),
regions
[
j
]
<<
" "
<<
mapped_rect
);
const
unsigned
long
template_region_id
=
j
;
const
unsigned
long
template_region_id
=
j
;
const
unsigned
long
offset
=
feats
.
get_num_dimensions
()
*
template_region_id
;
const
unsigned
long
offset
=
feats
.
get_num_dimensions
()
*
template_region_id
;
...
...
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