Converting an image from Spherical coordinate system to cartesian coordinate systems

조회 수: 5 (최근 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