GRAY_QUANT_CVIP
gray_quant_cvip() - performs Gray level quantization of an image.
Contents
SYNTAX
[ outImage ] = gray_quant_cvip( inImage, graylevel)
Input Parameters include :
- inImage - 1-band input image of MxN size or 3-band input image of MxNx3 size.The input image can be of uint8 or double class.If double class, the function assumes the data range of image is from 0 to 1.
- graylevel - Number of gray levels.It must be a power of 2, but not greater than 256.
Output Parameter includes :
- outImage - Quantized image having same size and same class of input image.
DESCRIPTION
The function performs the gray level quantization of an image using standard method.The number of gray-level must be a power of 2.
Reference
1.Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.
Examples
%Read image I = imread('butterfly.tif'); % default graylevel = 4,Calling function with default parameters O1 = gray_quant_cvip(I); % new graylevel graylevel = 16; % Calling function with user specified graylevel O2 = gray_quant_cvip(I,graylevel); % Display input image figure; imshow(I);title('Input Image'); % Display Output image figure; imshow(histstretch_cvip(O1,0,1,0,0)); title('Output image with Default parameters'); figure; imshow(histstretch_cvip(O1,0,1,0,0)); 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