How do I transform image data recorded in polar coordinates so that I can view the image in MATLAB 7.0 (R14)?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 27 de Jun. de 2009
Editada: MathWorks Support Team
el 1 de Abr. de 2023
I would like to automatically transform image data recorded in polar coordinates so I can view the image in MATLAB 7.0 (R14).
Respuesta aceptada
MathWorks Support Team
el 20 de Feb. de 2023
Editada: MathWorks Support Team
el 1 de Abr. de 2023
The ability to transform image data recorded in polar coordinates automatically is not present in the Image Processing Toolbox.
The following example will perform the conversion on data in the attached im2.mat file. Please download the attached file and place it in your working directory:
load im2.mat
[nrows, ncols] = size(im2);
increment = 0.0818;
startAngle = 4.0433;
%prepare matrices containing the polar coordinate data
rho = repmat([1:nrows]',1,ncols);
theta = repmat([startAngle:increment:startAngle + increment*(ncols-1)],nrows,1);
%convert the polar coordinates to cartesian
[x,y] = pol2cart(theta,rho);
%use ffgrid to prepare the data
[zz, xx, yy] = ffgrid(x, y, im2, 1, 1);
%use griddata to produce the final image
Z = griddata(x,y,im2,xx,yy');
imagesc(Z)
This procedure requires FFGRID and BIN, two functions which can be downloaded from Matlab Central, at:
Note that MathWorks does not guarantee or warrant the use or content of these submissions. Any questions, issues, or complaints should be directed to the contributing author.
0 comentarios
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!