AUTOTHRESHOLD_CVIP
autothreshold_cvip() - Automatic thresholding of an image.
Contents
SYNTAX
outImage = autothreshold_cvip(inImage, limit)
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.
- limit - Limit to stop the threshold update. Usually,it is small value that ranges from 0 to 20.0. limit = 10.0 (default)
Output Parameter include :
- outImage - Thresholded image having same size and same class of input image.
DESCRIPTION
The function performs the automatic threshold operation of an image. The threshold value depends on the limit. The threshold value will be updated repeatedly until the error between new threshold and old threshold is equal or less than limit. Usually the limit value is the small value (typically 0 to 20.0).If the limit value is less, the threshold value is good.
REFERENCE
1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.
EXAMPLE
% Read Image I = imread('raphael.jpg'); %original image % Call function O1 = autothreshold_cvip(I); %default: limit = 10.0 limit = 2.5; %new limit O2 = autothreshold_cvip(I,limit); %user specified limit % Display Input Image figure;imshow(I);title('Input Image 1'); % Display Output Image figure;imshow(O1,[]);title('Output Image - Default Limit'); figure;imshow(O2,[]);title('Output Image - User Specified Limit');
CREDITS
Author: Norsang Lama, March 2017
Copyright © 2017-2018 Scott
E Umbaugh
For updates visit CVIP Toolbox Website