Skip to content

Commit

Permalink
Return shortcut in disturb_colors (davisking#2909)
Browse files Browse the repository at this point in the history
* 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...
  • Loading branch information
arrufat authored Jan 28, 2024
1 parent b0f6be8 commit 85aa29a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dlib/image_transforms/random_color_transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ namespace dlib
const double color_magnitude = 0.2
)
{
if (gamma_magnitude == 0 && color_magnitude == 0)
return;

image_view<image_type> img(img_);
random_color_transform tform(rnd, gamma_magnitude, color_magnitude);
for (long r = 0; r < img.nr(); ++r)
Expand Down

0 comments on commit 85aa29a

Please sign in to comment.