mirror of https://github.com/davisking/dlib.git
Minor optimization: add shortcut to in-place image resize if size_scale is 1 (#2076)
This commit is contained in:
parent
64ba66e1c7
commit
c7062aa363
|
@ -1062,7 +1062,7 @@ namespace dlib
|
|||
<< "\n\t Invalid inputs were given to this function."
|
||||
<< "\n\t size_scale: " << size_scale
|
||||
);
|
||||
|
||||
if (size_scale == 1.0) return; // no need to do anything at all
|
||||
image_type temp;
|
||||
set_image_size(temp, std::round(size_scale*num_rows(img)), std::round(size_scale*num_columns(img)));
|
||||
resize_image(img, temp);
|
||||
|
|
|
@ -435,6 +435,7 @@ namespace dlib
|
|||
- #img.nr() == std::round(size_scale*img.nr())
|
||||
- #img.nc() == std::round(size_scale*img.nc())
|
||||
- #img == a bilinearly interpolated copy of the input image.
|
||||
- Returns immediately, if size_scale == 1.0
|
||||
!*/
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue