Another area of image processing that has up to now been covered only for grayscale images is the one of contrast enhancement and handling of illumination problems. The basic method of generalization to color images is pretty much identical to all the other techniques presented in this chapter that is, repeating the grayscale process for all color channels. Since, the functions used in Chapter 2, Working with Pixels in Grayscale Images, for such tasks are used only for grayscale images (with an exception of imadjust
, which also does not work for color images without defining extra inputs), we will write a function that incorporates all the contrast enhancement techniques visited so far:
function output = ColorContrastEnhance(input, method) % Function for color contrast enhancement of input image % Inputs: % input - Input image % method – Enhancement method selection (0: histeq % 1: adapthisteq % 2: imadjust) % Output: % output - Output...