Converting an image from Spherical coordinate system to cartesian coordinate systems

7 次查看(过去 30 天)
Hello
I am wanting to convert an image converted from Cartesian to Spherical coordinates (hard coded, so can't change that). However, after processing and conversion, the image changes shape (curved edges). I wanted convert the processed image back to a rectangle(its original shape). I wanted to know if I could be given a proper direction. I was looking at possibility of using the imtransform and maketform commands since they take care of the image locations automatically and will save me time but I haven't been able to formulate a function for the conversion. I have read Steve's blog post:
It seems to be using one argument for the (inverse) mapping function where as for conversion (as I understand) I will require two different mappings for each of the x and y values of the output image.
I wanted to know if any of you guys could direct me on this. Thanks

回答(3 个)

Azzi Abdelmalek
Azzi Abdelmalek 2013-7-14
编辑:Azzi Abdelmalek 2013-7-14
Use sph2cart function
[X,Y,Z] = sph2cart(TH,PHI,R)
  1 个评论
Azzi Abdelmalek
Azzi Abdelmalek 2013-7-14
wond3rbo commented
Hello
Thanks for your reply. I have been trying to use the above command but it requires three inputs where as I only have knowledge of the theta and phi values. I used the example posted here as a reference:
It converts an image from Polar Coordinates to Cartesian. I have been able to form matrices for my theta and phi but can't seem to get it working for my images.

请先登录,再进行评论。


Alex Taylor
Alex Taylor 2013-7-15
In order to map from a spherical coordinate system, you are going to need to know the limits of Rho that exist in your dataset before you are going to be able to resample your data in a cartesian coordinate system. You are also going to need to know the cartesian center Xc,Yc,Zc that was used to define your dataset.
  1 个评论
wond3rboy
wond3rboy 2013-7-16
Hello
Thanks for your reply, I do know the limits of Rho and Theta. All images are centered at the middle of the images so I know that as well. What I am confused on is the formulation of the conversion.

请先登录,再进行评论。


Aditya Manolkar
Aditya Manolkar 2019-6-11
Hi, I am facing the same problem as mentioned above. I am trying to construct an ultrasound image from the reflected signals from the surfaces. for this I'm focusing my beam at various thetas and finding rhos from reflected signals at that point. now I have an image in rho and theta, but I cannot directly place them in a 2D matrix and reconstruct back the image as it would give me curved edges.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by