Learn R Programming

IM (version 1.0)

calcMaxRadius: Compute maximum radius.

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} \sqrt{\frac{N}{M}+ \frac{M}{N}}$$ where $$m_{pq} = \sum_{1}^{N} \sum_{1}^{M} (x^p)(y^q)f(x,y)$$

Usage

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

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

See Also

CmplxIm,calcCentroid,polarXY

Examples

Run this code
data(mandril)
I=rowSums(img,dims=2);

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

Run the code above in your browser using DataLab