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
9e290dce
Commit
9e290dce
authored
Sep 05, 2016
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added an overload of upsample_image_dataset() for mmod_rect annotated datasets.
parent
70619d2f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
0 deletions
+57
-0
interpolation.h
dlib/image_transforms/interpolation.h
+30
-0
interpolation_abstract.h
dlib/image_transforms/interpolation_abstract.h
+27
-0
No files found.
dlib/image_transforms/interpolation.h
View file @
9e290dce
...
...
@@ -1275,6 +1275,36 @@ namespace dlib
}
}
template
<
typename
pyramid_type
,
typename
image_array_type
>
void
upsample_image_dataset
(
image_array_type
&
images
,
std
::
vector
<
std
::
vector
<
mmod_rect
>>&
objects
)
{
// make sure requires clause is not broken
DLIB_ASSERT
(
images
.
size
()
==
objects
.
size
(),
"
\t
void upsample_image_dataset()"
<<
"
\n\t
Invalid inputs were given to this function."
<<
"
\n\t
images.size(): "
<<
images
.
size
()
<<
"
\n\t
objects.size(): "
<<
objects
.
size
()
);
typename
image_array_type
::
value_type
temp
;
pyramid_type
pyr
;
for
(
unsigned
long
i
=
0
;
i
<
images
.
size
();
++
i
)
{
pyramid_up
(
images
[
i
],
temp
,
pyr
);
swap
(
temp
,
images
[
i
]);
for
(
unsigned
long
j
=
0
;
j
<
objects
[
i
].
size
();
++
j
)
{
objects
[
i
][
j
].
rect
=
pyr
.
rect_up
(
objects
[
i
][
j
].
rect
);
}
}
}
template
<
typename
pyramid_type
,
typename
image_array_type
...
...
dlib/image_transforms/interpolation_abstract.h
View file @
9e290dce
...
...
@@ -651,6 +651,33 @@ namespace dlib
#objects[i].size() == objects[i].size()
!*/
// ----------------------------------------------------------------------------------------
template
<
typename
pyramid_type
,
typename
image_array_type
>
void
upsample_image_dataset
(
image_array_type
&
images
,
std
::
vector
<
std
::
vector
<
mmod_rect
>>&
objects
);
/*!
requires
- image_array_type == a dlib::array or std::vector of image objects that each
implement the interface defined in dlib/image_processing/generic_image.h
- images.size() == objects.size()
ensures
- This function replaces each image in images with an upsampled version of that
image. Each image is upsampled using pyramid_up() and the given
pyramid_type. Therefore, #images[i] will contain the larger upsampled
version of images[i]. It also adjusts all the rectangles in objects so that
they still bound the same visual objects in each image.
- #images.size() == image.size()
- #objects.size() == objects.size()
- for all valid i:
#objects[i].size() == objects[i].size()
!*/
// ----------------------------------------------------------------------------------------
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