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
5a69878b
Commit
5a69878b
authored
Sep 15, 2014
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added map_det_to_chip()
parent
5b3e76b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
interpolation.h
dlib/image_transforms/interpolation.h
+22
-0
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