How to rotate a line about center point??
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Heera Bhadrecha
el 20 de Oct. de 2014
Comentada: Image Analyst
el 22 de Oct. de 2014
I have an image i want to rotate line between two point by center point .
1 comentario
Image Analyst
el 22 de Oct. de 2014
It's not clear to me. Post an image (screenshot) showing the image, the "center point" and the line. Then explain if you just want to "rotate line" (rotate the line itself and not the image) like you said, or if you want to rotate the image . And what does "between two point" mean? Do you mean a line segment where the line is defined just as going between one point and another point rather than off to infinity in both directions? And that line rotates around the "center point"? And is that "center point" the center point of the whole image, or the center point of the line segment?
Respuesta aceptada
Mohammad Abouali
el 21 de Oct. de 2014
Let's say you want to rotate around and arbitrary points designated by (ro,co);
Here how you can do it:
% Top left corner as center of rotation
ro=1;
co=1;
I=imread('peppers.png');
[r,c,nB]=size(I);
I2=zeros(2*r,2*c,nB,'like', I);
I2(r-ro+1:2*r-ro,c-co+1:2*c-co,:)=I;
Irotated=imrotate(I2,45);
0 comentarios
Más respuestas (2)
Heera Bhadrecha
el 21 de Oct. de 2014
1 comentario
Mohammad Abouali
el 22 de Oct. de 2014
Editada: Mohammad Abouali
el 22 de Oct. de 2014
use dot (inner) product
Ver también
Categorías
Más información sobre Geometric Transformation and Image Registration 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!