GRAY_QUANT_CVIP

gray_quant_cvip() - performs Gray level quantization of an image.

Contents

SYNTAX

[ outImage ] = gray_quant_cvip( inImage, graylevel)

Input Parameters include :

Output Parameter includes :

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