enhance contrast of image by piecewise affine histogram equalization
Usage
EqualizePiecewise(im, N, smax = 255, smin = 0, range = c(0, 255))
Arguments
im
a grayscale image of class cimg
N
number of subintervals of partition. N controls how the input gray levels will be mapped in the output image.
if N is large, Piecewise Affine Equalization and Histogram Equalization are very similar.
smax
maximum value of slopes. if smax is small, contrast enhancement is suppressed.
smin
minimum value of slopes. if smin is large, contrast enhancement is propelled, and saturations occur excessively.
range
range of the pixel values of image. this function assumes that the range of pixel values of of an input image is [0,255] by default. you may prefer [0,1].
if you change range, you should change smax. one example is this (smax = range[2] - range[1]).
Value
a grayscale image of class cimg
References
Jose-Luis Lisani, Ana-Belen Petro, and Catalina Sbert, Color and Contrast Enhancement by Controlled Piecewise Affine Histogram Equalization, Image Processing On Line, 2 (2012), pp. 243-265. https://doi.org/10.5201/ipol.2012.lps-pae