I am trying to convert an image in polar to cartesian coordinates.
examples to convert image to polar coordinates do it explicitly - want a slick matrix method
I thought using the method used above would be a piece of cake but it really isn't!! If anyone finds an error into my code please let me know!
phi=(0:.01:1)*2*pi;
r=0:.01:2;
psi=r<0.5;
psi_c=cos(phi).'*psi;
[P R z]=find(psi_c);
L=500;
X=R.*cos(P);
Y=R.*sin(P);
Xmin=min(X);Xmax=max(X);
Ymin=min(Y);Ymax=max(Y);
F=TriScatteredInterp(X,Y,z);
[Xi,Yi]=meshgrid(linspace(-Xmax,Xmax,L),linspace(-Ymax,Ymax,L));
Zi=F(Xi,Yi);
What I find very odd is the fact that when I change phi, it makes radical changes and not in the way I expect!
Cheers!