AREA_CVIP
area_cvip() - calculates the area of an object.
Contents
SYNTAX
a = area_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 :
- a - The area of the object in pixels.
DESCRIPTION
Area_cvip gets the sum of pixels whose gray level value equals to a specific label. This label is the gray level value of the point of the co-ordinates on the labeled image.
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 area = area_cvip(lab_image, [125,125]); % Display input image figure; imshow(input_img,[]); fprintf('Area of the binary object: %d',area);
Area of the binary object: 3209
CREDITS
Author: Mehrdad Alvandipour, March 2017
Copyright © 2017-2018 Scott
E Umbaugh
For updates visit CVIP Toolbox Website