Last data update: 2014.03.03

R: Inverse transform of the 'polarTransform' method
revPolarR Documentation

Inverse transform of the polarTransform method

Description

Performs an inverse polar transform of an image by calculating the Euclidean coordinates of the rearranged pixels in an image transformed by the polarTransform method. See the documentation for polarTransform for details on the calculation of the polar image coordinates.

Usage

	revPolar(d,params)

Arguments

d

The dimensions of the original image in Euclidean space.

params

A list containing the resulting transformed image and parameters from the polarTransform method. This list contains the following items: PI: The transformed image returned by the function polarTransform. pAxis: The principal axis used to shift the polar coordinates of the pixels in the transformed image. resolution: An integer which determines the number of angle values between 0 and 2pi which was used to create the transform. center: The x and y coordinates of the centroid used in the transform. scale: The scaling factor used to transform the image.

Details

This function is only for recovering the original image from an image transformed using the polarTransform method. The input arguments to revPolar, PI,pAxis,resolution,center,scale are returned by the polarTransform method in a list. Note that the dimensions of the original image, the first argument d, must also be specified.

Value

IR

The inverse transformed image; an approximation of the original image from the polar transformed image.

Author(s)

Allison Irvine, Tan Dang

See Also

polarTransform, polarXY, calcCentroid

Examples

#perform a polar transform on the original image
data(circles);
I=rowSums(img,dims=2)
R=polarTransform(I, 20, 100);
## Not run: displayImg(R[[1]]);

#now reverse the transform
IR = revPolar(dim(I),R);
## Not run: displayImg(IR);

Results


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/revPolar.Rd_%03d_medium.png", width=480, height=480)
> ### Name: revPolar
> ### Title: Inverse transform of the 'polarTransform' method
> ### Aliases: revPolar revPolar-methods revPolar,numeric,list-method
> ### Keywords: utilities
> 
> ### ** Examples
> 
> #perform a polar transform on the original image
> data(circles);
> I=rowSums(img,dims=2)
> R=polarTransform(I, 20, 100);
> ## Not run: displayImg(R[[1]]);
> 
> #now reverse the transform
> IR = revPolar(dim(I),R);
> ## Not run: displayImg(IR);
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>