HIST_SPEC_CVIP

hist_spec_cvip() - Hisotogram specification of an input image.

Contents

SYNTAX

[ outImage ] = hist_spec_cvip( inImage, histFunc, A, B)

Input Parameters include :

Output Parameter includes :

DESCRIPTION

The function performs a histogram specification on an image. For single or multi-band images, the histograms can be specified separately for each band. The specified histogram is computed by calculating the cumulative distribution function of both the original histogram and the desired histogram. The cdf for the original histogram is then mapped to the desired histogram using the inverse cdf. If Pr(x) is the original histogram, and Pz(x) is the desired histogram, then the cdf[Pr(x)] = T(r) = s, and cdf[Pz(x)] = G(z) = v. The inverse of this is z = inv[G(v)]. Therefore z = inv[G(T(r))]. Where r is the original gray-level, and z is the new gray-level.

REFERENCE

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

EXAMPLE

% Read image

 I = imread('butterfly.tif');

% calling function with default parameters.

 O1 = hist_spec_cvip(I);

% calling function with user defined parameters.

 O2 = hist_spec_cvip(I,[1 2 4], [0.025 1 0.03], [1 0.5 1]);

% Display input image

 figure;imshow(I);title('Input Image');

% Dispaly output images

 figure; imshow(O1/255);title('Output Image with default parameters');

 figure; imshow(O2/255);title('Output Image with user defined parameters');

CREDITS

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