CENTRAL_MOMENTS_CVIP
central_moments_cvip()- computes the central moment of order (p+q) of a binary object.
Contents
SYNTAX
mu = central_moments_cvip(labeledImage,[r,c],p,q)
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.
- p - The exponent of the moment in the vertical direction.
- q - The exponent of the moment in the horizontal direction.
Output Parameter include :
- mu - The central moment of order (p+q)
DESCRIPTION
This function provides information about the central moments of the binary object. Central moments are simply the standard moments shifted to the center of the area of the object or the centroid of the object. Central moments help in determining the RST-invariant features of the binary 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); % row and column number of a pixel r= 247; c=224; % (247,224) is a location on the ellipse with a hole. % Exponent of the moment p=1; % The central moment for p=1 and q=2 should turn out to be 0 because of the symmetry of the object q=2; % Call function mu = central_moments_cvip(lab_image, [r,c],p,q); % Display input image figure; imshow(input_img,[]); fprintf('Central Moment : %d', mu);
Central Moment : 0
CREDITS
Author: Mehrdad Alvandipour, March 2017
Copyright © 2017-2018 Scott
E Umbaugh
For updates visit CVIP Toolbox Website