MORPH_HITMISS_CVIP
morph_hitmiss_cvip() - perfoms morphological hit-miss transform of a binary image.
Contents
SYNTAX
[outImage] = morph_hitmiss_cvip(inImage, hitmissFilt)
Input Parameters include :
- inImage - Binary image of MxN size. If not binary image, binary thresholding is performed on input image before hit-miss transform.
- hitmissFilt - hit-miss filter or Structure Element of K*K size. And k must be a positive odd integer. (use structel_cvip function to create structuring elements) (Default: hitmissFilt = [nan 0 0; 1 1 0; nan 1 nan];)
Output Parameter includes:
- OutImage - Output image of Morphological hit-miss transform. 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 hit-miss transform on a binary image. If input image is a color or gray-scale image, binary thresholding is performed before the hit-miss operation. The hit-miss 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 hit-miss filter O1 = morph_hitmiss_cvip(I); % Call function using user specified hit-miss filter kernel = [0 0 0; nan 1 nan; 1 nan 1]; O2 = morph_hitmiss_cvip(I,kernel); % Display input image figure;imshow(I);title('Input image'); % Display output image figure;imshow(O1,[]);title('Output image using default hit-miss filter'); figure;imshow(O2,[]);title('Output image using user-specified hit-miss filter');
CREDITS
Author: Norsang Lama, June 2017
Copyright © 2017-2018 Scott
E Umbaugh
For updates visit CVIP Toolbox Website