HISTEQ_CVIP

histeq_cvip() - Performs a histogram equalization on an input image.

Contents

SYNTAX

Z = histeq_cvip(X, Band)

Input parameters include:

NOTE: For gray-scale image use 0 band or pass only image as input parameter.

Output parameter includes:

DESCRIPTION

This function performs a histogram equalization on an input image. Histogram equalization distributes the gray level values within an image as evenly as possible. The goal of histeq is a flat histogram. The function works with color or grayscale images. With a color image, the user specifies band 0, 1, or 2 as the band to use for histogram calculations. For a grayscale image, specify band '0' or pass only image as input parameter.

REFERENCE

1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.

EXAMPLE

% Read image

 X = imread('Cam.bmp');

% Performing histogram equalization on gray scale image

 S = histeq_cvip(X);

 figure;imshow(S,[]);

% Perform histogram equalization on a color image with user specified
% band value

% Read image

 X = imread('Car.bmp');

% Bands

 band0 = 0;

 band1 = 1;

 band2 = 2;

% Call function

 S1 = histeq_cvip(X,0);

 S2 = histeq_cvip(X,1);

 S3 = histeq_cvip(X,2);

% Display output image

 figure;imshow(remap_cvip(S1),[]);

 figure;imshow(remap_cvip(S2),[]);

 figure;imshow(remap_cvip(S3),[]);

CREDITS

Author: Deependra Mishra, March 2017
Copyright © 2017-2018 Scott E Umbaugh
For updates visit CVIP Toolbox Website