R: Represent an image by plotting radius against angle
polarTransform
R Documentation
Represent an image by plotting radius against angle
Description
Perform a polar transform of an image by calculating the polar coordinates of the pixels in an image and rearranging the pixels
into a plot of angle (theta) against radius. The polar coordinates are calculated with respect to the centroid, determined by
calcCentroid or the center of the image space. All transformed images will be shifted to principal axis determined by:
with (x0, y0) are centroid computed by calcCentroid
Usage
polarTransform(I, resolution, scale, center)
Arguments
I
Image represented as a matrix or numeric array
resolution
An integer which determines the number of angle values between 0 and 2pi to be represented in the transform.
scale
Integer. Default is 0, no scaling in the transformation. If set to a positive integer, the maximum radius
used in the transformation will be set to scale, and the transformed image will have dimensions
scale, (scale*resolution)
center
The x and y coordinates of the centroid to be used in the transform. If this argument is not provided,
the center of the image space will be the centroid.
Details
This transformation is performed by finding the Euclidean coordinates of points which are contained within the
smallest circle with origin at the centroid or center of image which can be contained within the image boundaries.
The pixels whose coordinates most closely match these Euclidean coordinates are plotted at the corresponding polar coordinates.
At each radius, the perimeter is divided into radius * resolution equally spaced point. Then, the Euclidean coordinates
of the points will be used in the transformation. This results in a upper-triangular matrix.
This transform was created to approximate rotational invariance for orthogonal moments.
revPolar is the inverse transform of polarTransform.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(IM)
Loading required package: png
Loading required package: jpeg
Loading required package: bmp
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/IM/polarTransform.Rd_%03d_medium.png", width=480, height=480)
> ### Name: polarTransform
> ### Title: Represent an image by plotting radius against angle
> ### Aliases: polarTransform polarTransform-methods
> ### polarTransform,matrix,numeric,numeric,numeric-method
> ### polarTransform,matrix,numeric-method
> ### Keywords: utilities
>
> ### ** Examples
>
> data(circles);
> I=rowSums(img,dims=2)
> R=polarTransform(I, 6, 100);
> displayImg(list(I,R[[1]]));
>
>
>
>
>
> dev.off()
null device
1
>