Re: rotate image around all axes



ImageAnalyst <imageanalyst@xxxxxxxxxxxxxx> wrote in message <df31a29f-0103-4c3a-b199-dbcd72196fb3@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>...
On Nov 26, 8:25=A0pm, "benjamin m?ller" <pern...@xxxxxxx> wrote:
hi,

at first sorry if my english is not perfect. I got pictures of an object =
taken from a camera which angle is not normal to the object plane. I got th=
e angles to rotate the image around the x,y and z axes. For that purpose i =
thought i can use maketform and imtransform. Now i got 2 problems. The rota=
tion of the Image around the Z axes works good with following rotation matr=
ix:

T =3D [cosd(angle) -sind(angle) 0; sind(angle) cosd(angle) 0;0 0 1];

Problem 1:
when i try the same with the x and y axes with the following matrixs

T =3D [1 0 0; 0 cosd(angle) -sind(angle);0 sind(angle) cosd(angle)], %x-a=
xes
T =3D [cosd(angle) 0 sind(angle); 0 1 0;-sind(angle) 0 cosd(angle)], %y-a=
xes

it works too, but the result is not right. when im trying to rotate with =
0.5 degrees the result looks like it has been rotated with more than 45 deg=
rees.

Problem2:
I want the pictures to look like there were taken from a camera which ang=
le is normal to the image plane, but for this purpose I need the axes which=
i want to rotate around in the middle of the picture. Got anybody an idea =
how to realize that?

thank you very, very much for answering!!

at last: for testing i used following code:

I=3Dimread('testpic.jpg');
angle=3D0.05;

figure;
imshow(I)

% T =3D [1 0 0; 0 cosd(angle) -sind(angle);0 sind(angle) cosd(angle)], %x
=A0T =3D [cosd(angle) 0 sind(angle); 0 1 0;-sind(angle) 0 cosd(angle)], %=
y
% T =3D [cosd(angle) -sind(angle) 0; sind(angle) cosd(angle) 0;0 0 1], %z

t_proj =3D maketform('projective',T);
I_projective =3D imtrangleform(I,t_proj);
figure;
imshow(I_projective);

-----------------------------------
benjamin:
For problem #1, are you sure you're passing in radians? Sin and cos
want radians so if you pass in 0.5 you're not passing in half a degree
but .5 radians which would be around 30 degrees.
Regards,
ImageAnalyst

hello imageanalyst,

thanks for your answer! I used sind and cosd so i can give the arguments in degrees...so that shouldnt be the problem:/ thank you anyway:)

regards,
benjamin
.



Relevant Pages

  • Re: rotate image around all axes
    ... I want the pictures to look like there were taken from a camera which angle is normal to the image plane, but for this purpose I need the axes which i want to rotate around in the middle of the picture. ... want radians so if you pass in 0.5 you're not passing in half a degree ...
    (comp.soft-sys.matlab)
  • rotate image around all axes
    ... when i try the same with the x and y axes with the following matrixs ... I want the pictures to look like there were taken from a camera which angle is normal to the image plane, but for this purpose I need the axes which i want to rotate around in the middle of the picture. ...
    (comp.soft-sys.matlab)
  • Re: write protected??
    ... If I download say 40 pictures from the camera, ... some files when I rotate them Win Pic fax viewer says it has to save ... that need rotating by 90deg, it might do the first one without complaint, ... I have even gone to a does box and used the attrib ...
    (comp.graphics.apps.photoshop)
  • Re: how can I return nothing?
    ... All you have to do is rotate the coordintes and you can ... alter the sign of the real portion. ... numbers are not arbitrary coordinate axes. ... At PI/2 it is pure ...
    (comp.lang.c)
  • Problem with rotate3d and re-creating axes
    ... I am having a problem with rotate3d when I set certain axes to rotate ... a rotation capable axes when I click on it it creates an error. ... createPanel2; %create a plot that we want to rotate ...
    (comp.soft-sys.matlab)