MORPH_THINNING_CVIP
morph_thinning_cvip() - Morphological thinning of a binary image.
Contents
SYNTAX
[outImage] = morph_thinning_cvip(inImage, thinningFilt)
Input Parameters include :
- inImage - Binary image of MxN size. If not binary image, binary thresholding is performed on input image before thinning operation.
- thinningFilt - Thinning filter or Structure Element of K*K size. And k must be a positive odd integer. (use structel_cvip function to create structuring element) (Default: thinningFilt = [0 0 0; nan 1 nan; 1 1 1];)
Output Parameter includes:
- outImage - Output image of Morphological thinning operation.It is of logical class. It will be a binary image even if input image is color or grayscale image.
DESCRIPTION
The function performs morphological thinning operation on a binary image. If input image is a color or gray-scale image, binary thresholding is performed before the thinning operation. The thinning filter is a structuring element containing 0's, 1's and NaN's or "don't care". Don't care element is represented by NaN value in this case. And, don't care elements in the structuring element match with either 0s or 1s.
REFERENCE
1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.
EXAMPLE
Read image
I = imread('Shapes.bmp'); % Call function using default parameters O1 = morph_thinning_cvip(I); %Square kernel with size 3 % Call function using user specified parameters kernel = [0 0 nan; 0 1 1; nan 1 1]; O2 = morph_thinning_cvip(I,kernel); % Display input image figure;imshow(I);title('Input image'); % Display output image figure;imshow(O1,[]);title('Output image using default parameters'); figure;imshow(O2,[]);title('Output image user-specified parameters');
CREDITS
Author: Norsang Lama, June 2017
Copyright © 2017-2018 Scott
E Umbaugh
For updates visit CVIP Toolbox Website