ASPECT_CVIP
aspect_cvip() - finds the aspect ratio of a binary object.
Contents
SYNTAX
asp = aspect_cvip(labeledImage, [r,c])
Input Parameters include :
- labelImage - Label image of MxN size with single object or multiple objects. Each object has unique gray value.
- r - The row number of a pixel on the object. positive integer.
- c - The column number of a pixel on the object. positive integer.
Output Parameter Include :
- asp - The aspect ratio of the object.
DESCRIPTION
Aspect ratio is equal to the difference between maximum column value and the minimum column value of the object divided by the difference between the maximum row value and minimum row value of the object.
REFERENCE
1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.
EXAMPLE
% Read image input_img = imread('Shapes.bmp'); % Label image lab_image = label_cvip(input_img); % Calling function asp = aspect_cvip(lab_image, [33,27]); % Display input image figure; imshow(input_img,[]); fprintf('Aspect Ratio: %d', asp);
Aspect Ratio: 4
CREDITS
Author: Mehrdad Alvandipour, May 2017
Copyright © 2017-2018 Scott
E Umbaugh
For updates visit CVIP Toolbox Website