Converting an image from Spherical coordinate system to cartesian coordinate systems

26 visualizaciones (últimos 30 días)
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

Respuestas (3)

Azzi Abdelmalek
Azzi Abdelmalek el 14 de Jul. de 2013
Editada: Azzi Abdelmalek el 14 de Jul. de 2013
Use sph2cart function
[X,Y,Z] = sph2cart(TH,PHI,R)
  1 comentario
Azzi Abdelmalek
Azzi Abdelmalek el 14 de Jul. de 2013
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.

Iniciar sesión para comentar.


Alex Taylor
Alex Taylor el 15 de Jul. de 2013
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 comentario
wond3rboy
wond3rboy el 16 de Jul. de 2013
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.

Iniciar sesión para comentar.


Aditya Manolkar
Aditya Manolkar el 11 de Jun. de 2019
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.

Categorías

Más información sobre Convert Image Type en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by