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
c7062aa3
Unverified
Commit
c7062aa3
authored
May 05, 2020
by
Juha Reunanen
Committed by
GitHub
May 04, 2020
Browse files
Minor optimization: add shortcut to in-place image resize if size_scale is 1 (#2076)
parent
64ba66e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
dlib/image_transforms/interpolation.h
dlib/image_transforms/interpolation.h
+1
-1
dlib/image_transforms/interpolation_abstract.h
dlib/image_transforms/interpolation_abstract.h
+1
-0
No files found.
dlib/image_transforms/interpolation.h
View file @
c7062aa3
...
@@ -1062,7 +1062,7 @@ namespace dlib
...
@@ -1062,7 +1062,7 @@ namespace dlib
<<
"
\n\t
Invalid inputs were given to this function."
<<
"
\n\t
Invalid inputs were given to this function."
<<
"
\n\t
size_scale: "
<<
size_scale
<<
"
\n\t
size_scale: "
<<
size_scale
);
);
if
(
size_scale
==
1.0
)
return
;
// no need to do anything at all
image_type
temp
;
image_type
temp
;
set_image_size
(
temp
,
std
::
round
(
size_scale
*
num_rows
(
img
)),
std
::
round
(
size_scale
*
num_columns
(
img
)));
set_image_size
(
temp
,
std
::
round
(
size_scale
*
num_rows
(
img
)),
std
::
round
(
size_scale
*
num_columns
(
img
)));
resize_image
(
img
,
temp
);
resize_image
(
img
,
temp
);
...
...
dlib/image_transforms/interpolation_abstract.h
View file @
c7062aa3
...
@@ -435,6 +435,7 @@ namespace dlib
...
@@ -435,6 +435,7 @@ namespace dlib
- #img.nr() == std::round(size_scale*img.nr())
- #img.nr() == std::round(size_scale*img.nr())
- #img.nc() == std::round(size_scale*img.nc())
- #img.nc() == std::round(size_scale*img.nc())
- #img == a bilinearly interpolated copy of the input image.
- #img == a bilinearly interpolated copy of the input image.
- Returns immediately, if size_scale == 1.0
!*/
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
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