I have a picture like this, taken with Google Street View app and cropped to the top half:
I use Gimp polar coordinates filter to obtain this new image:
I would like to do the same within R, keeping all the pixel values information.
Here I found a similar question but the results is not exactly what I need (the center of the transformation is a corner). The adjusted code (there was an issue with radians) is:
# Load the image
library(png)
library(RCurl)
d <- readPNG( getBinaryURL( "https://i.stack.imgur.com/rMR3C.png" ) )
image(d)
x0 = as.vector(col(d))
y0 = as.vector(row(d))
r = sqrt( (x0^2) + (y0^2) ) #x
a = atan(y0/x0) * 215 / (pi/2) #y
m = as.matrix(data.frame(y=a, x=r))
m = round(m)
m[m>215] = NA
m[m==0] = NA
xn = d[m]
xn = matrix(xn, 215, 215)
image(xn)
The answer to that question expands on the issue and show a code to do a polar to cartesian transformation but I cannot do the reverse.