reference
labkit.image.adjustHueSaturation
Apply HSV hue and saturation adjustment.
Syntax
imageOut = labkit.image.adjustHueSaturation(imageIn, hueDeg, saturationPct)Description
Converts imageIn to clamped RGB double and then to HSV. hueDeg rotates the hue circle and wraps at 360 degrees. Saturation is multiplied by 1 + saturationPct/100 and limited to [0,1]. The HSV value channel is not changed directly.
A saturationPct of -100 or less produces grayscale. Positive saturation increases colorfulness until individual saturation values reach 1.
Inputs
imageIn- Numeric or logical grayscale, RGB, or multichannel image.
hueDeg- Numeric scalar hue rotation in degrees. Values outside one turn are wrapped.
saturationPct- Numeric scalar percent change in HSV saturation.
Outputs
imageOut- M-by-N-by-3 double image with values in [0,1].
Failure Behavior
Unsupported image classes or channel shapes propagate errors from im2double or ensureRgb. hueDeg and saturationPct must participate in scalar numeric arithmetic; incompatible MATLAB values raise the originating conversion or array-size error.
Example
imageIn = cat(3, ones(2), 0.4*ones(2), zeros(2));
imageOut = labkit.image.adjustHueSaturation(imageIn, 30, 25);Related APIs
labkit.image.adjustBrightnessContrast— Apply simple brightness and contrast adjustment.labkit.image.grayWorldWhiteBalance— Apply generic gray-world white balance.labkit.image.assertSupportedPaths— Throw when any path has an unsupported image extension.labkit.image.displayName— Return a short image-file display name.labkit.image.ensureRgb— Return image data with exactly three color channels.labkit.image.fileDialogFilter— Return a file-chooser-compatible image filter.labkit.image.im2double— Convert image data to double using MATLAB's im2double contract.labkit.image.isSupportedPath— Return true when a path has a supported image extension.
Source
This page is generated from the MATLAB help text in +labkit/+image/adjustHueSaturation.m.