THRESHOLD_CVIP
threshold_cvip() - Performs binary thresholding of an image.
Contents
SYNTAX
outImage = threshold_cvip(inImage, threshval)
Input Parameter 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 uint16 or double class.
- threshval - Threshold value.
Output Parameter include :
- outImage - Binary thresholded image of uint8 class.
DESCRIPTION
This function performs the binary thresholding of an image. The user has option to define threshold value or use the default threshold value. The default threshold value is the average of minimum and maximum gray level of the image. The class of output image will be uint8.
REFERENCE
1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.
EXAMPLE
% Read image I = imread('butterfly.tif'); % Call function O1 = threshold_cvip(I); %default threshold value O2 = threshold_cvip(I,200); %user defined threshold value % Display input image figure;imshow(I);title('Input image'); % Display output image figure;imshow(O1,[]);title('Output image with default parameters'); figure;imshow(O2,[]);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