Return shortcut in disturb_colors (#2909)

* Return shortcut in disturb_colors

No need to do anything if both gamma and color magnitudes are set to 0.

* Fix typo

This happens for being lazy and making the change directly from GitHub...
pull/2918/head
Adrià Arrufat 8 months ago committed by GitHub
parent b0f6be8058
commit 85aa29a4e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -75,6 +75,9 @@ namespace dlib
const double color_magnitude = 0.2 const double color_magnitude = 0.2
) )
{ {
if (gamma_magnitude == 0 && color_magnitude == 0)
return;
image_view<image_type> img(img_); image_view<image_type> img(img_);
random_color_transform tform(rnd, gamma_magnitude, color_magnitude); random_color_transform tform(rnd, gamma_magnitude, color_magnitude);
for (long r = 0; r < img.nr(); ++r) for (long r = 0; r < img.nr(); ++r)

Loading…
Cancel
Save