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
9e290dce
Commit
9e290dce
authored
Sep 05, 2016
by
Davis King
Browse files
Added an overload of upsample_image_dataset() for mmod_rect annotated datasets.
parent
70619d2f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
0 deletions
+57
-0
dlib/image_transforms/interpolation.h
dlib/image_transforms/interpolation.h
+30
-0
dlib/image_transforms/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
...
@@ -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
<
template
<
typename
pyramid_type
,
typename
pyramid_type
,
typename
image_array_type
typename
image_array_type
...
...
dlib/image_transforms/interpolation_abstract.h
View file @
9e290dce
...
@@ -651,6 +651,33 @@ namespace dlib
...
@@ -651,6 +651,33 @@ namespace dlib
#objects[i].size() == objects[i].size()
#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
<
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