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
5a69878b
Commit
5a69878b
authored
Sep 14, 2014
by
Davis King
Browse files
Added map_det_to_chip()
parent
5b3e76b1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
dlib/image_transforms/interpolation.h
dlib/image_transforms/interpolation.h
+22
-0
dlib/image_transforms/interpolation_abstract.h
dlib/image_transforms/interpolation_abstract.h
+18
-0
No files found.
dlib/image_transforms/interpolation.h
View file @
5a69878b
...
...
@@ -1508,6 +1508,28 @@ namespace dlib
return
find_similarity_transform
(
from
,
to
);
}
// ----------------------------------------------------------------------------------------
inline
full_object_detection
map_det_to_chip
(
const
full_object_detection
&
det
,
const
chip_details
&
details
)
{
point_transform_affine
tform
=
get_mapping_to_chip
(
details
);
full_object_detection
res
(
det
);
// map the parts
for
(
unsigned
long
l
=
0
;
l
<
det
.
num_parts
();
++
l
)
res
.
part
(
l
)
=
tform
(
det
.
part
(
l
));
// map the main rectangle
rectangle
rect
;
rect
+=
tform
(
det
.
get_rect
().
tl_corner
());
rect
+=
tform
(
det
.
get_rect
().
tr_corner
());
rect
+=
tform
(
det
.
get_rect
().
bl_corner
());
rect
+=
tform
(
det
.
get_rect
().
br_corner
());
res
.
get_rect
()
=
rect
;
return
res
;
}
// ----------------------------------------------------------------------------------------
template
<
...
...
dlib/image_transforms/interpolation_abstract.h
View file @
5a69878b
...
...
@@ -1039,6 +1039,24 @@ namespace dlib
to the pixels in the cropped image defined by the given details object.
!*/
// ----------------------------------------------------------------------------------------
full_object_detection
map_det_to_chip
(
const
full_object_detection
&
det
,
const
chip_details
&
details
);
/*!
ensures
- Maps the given detection into the pixel space of the image chip defined by
the given details object. That is, this function returns an object D such
that:
- D.get_rect() == a box that bounds the same thing in the image chip as
det.get_rect() bounds in the original image the chip is extracted from.
- for all valid i:
- D.part(i) == the location in the image chip corresponding to
det.part(i) in the original image.
!*/
// ----------------------------------------------------------------------------------------
template
<
...
...
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