Learn R Programming

IM (version 1.0)

polarXY: Calculate polar coordinates of elements in a matrix

Description

Computes the radius and and angle of each element's location in a matrix with respect to the centroid.

Usage

polarXY(I, centroid)

Arguments

I
"Matrix" representation of an image, or any matrix.
centroid
two numbers, the x coordinate of the centroid and the y coordinate of the centroid. The function calcCentroid may be used to estimate the image centroid.

Value

"list"
radius
The radius of the polar coordinates of each element in the input matrix.
theta
The angle of the polar coordinates of each element in the input matrix.

See Also

polarTransform, calcCentroid

Examples

Run this code
data(lena);
I=rowSums(img,dims=2);
center= calcCentroid(I);
result= polarXY(I, center);

Run the code above in your browser using DataLab