utilities/other_utils/HamlinBeachStatePark/unet/utils.py
def histeq(im):
        """  Histogram equalization of a grayscale image. """
        nbr_bins = 256
        # get image histogram
        imhist, bins = np.histogram(im.flatten(), nbr_bins, normed=True)
        cdf = imhist.cumsum()  # cumulative distribution function
        cdf = 255 * cdf / cdf[-1]  # normalize

        # use linear interpolation of cdf to find new pixel values
        im2 = np.interp(im.flatten(), bins[:-1], cdf)

        return im2.reshape(im.shape)
  Histogram equalization of a grayscale image. 
Histogram equalization of a grayscale image.
Histogram equalization of a grayscale image .
def histeq(im):
        nbr_bins = 256
        imhist, bins = np.histogram(im.flatten(), nbr_bins, normed=True)
        cdf = imhist.cumsum()  
        cdf = 255 * cdf / cdf[-1]  
        im2 = np.interp(im.flatten(), bins[:-1], cdf)
        return im2.reshape(im.shape)
def histeq ( im ) : nbr_bins = 256 imhist , bins = np . histogram ( im . flatten ( ) , nbr_bins , normed = True ) cdf = imhist . cumsum ( ) cdf = 255 * cdf / cdf [ - 1 ] im2 = np . interp ( im . flatten ( ) , bins [ : - 1 ] , cdf ) return im2 . reshape ( im . shape )
Histogram equalization of a grayscale image.
Histogram equalization of a grayscale image .
"""  Histogram equalization of a grayscale image. """ # get image histogram # cumulative distribution function # normalize # use linear interpolation of cdf to find new pixel values
im