calcMaxRadius: Compute maximum radius.

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Compute maximum distance of all pixels from the centroid of the image. Alternatively, it is the radius of the the smallest disk that covers the entire image with its origin at the centroid. The radius is determined by:

r = \frac{m_{00}}{2} √{\frac{N}{M}+ \frac{M}{N}}

where

m_{pq} = ∑_{1}^{N} ∑_{1}^{M} (x^p)(y^q)f(x,y)

Usage

1
calcMaxRadius(I, center)

Arguments

I

A 2-dimensional image matrix.

center

The x and y coordinates of the image centroid, input as c(x0, y0). If missing, the centroid will be calculated automatically.

Value

maxRadius

The radius of the the smallest disk that covers the entire image with its origin at the centroid.

Note

The value calculated by this function is used to obtain the polar coordinates of the pixels in the image. The coordinates of the pixels are scaled with this value so that they will be between -1 and 1 before the polar coordinates are calculated. This is necessary because complex moments are only defined on the unit disk.

Author(s)

Tan Dang

See Also

CmplxIm,calcCentroid,polarXY

Examples

1
2
3
4
5
data(mandril)
I=rowSums(img,dims=2);

maxRadius= calcMaxRadius(I);
maxRadius= calcMaxRadius(I, calcCentroid(I));

Example output

Loading required package: png
Loading required package: jpeg
Loading required package: bmp

IM documentation built on May 2, 2019, 8:55 a.m.