Exercise 1, Problem 2

Moderator: Computer Vision

robert.n
Nerd
Nerd
Beiträge: 673
Registriert: 29. Sep 2008 19:17

Exercise 1, Problem 2

Beitrag von robert.n »

Do you get a reasonable 2D image? Mine looks broken. It seems that the sensor/image plane intersects with the object itself. Do you encounter the same problem? Am I missing some translation step here?

Note: I tried moving the object along the z axis and I managed to get good results (i.e. a clean and nice picture). So either the assignment is mean, because the image is meant to look broken, or I'm missing some translation step somehere...

Benutzeravatar
leviathan
Computerversteher
Computerversteher
Beiträge: 307
Registriert: 30. Jul 2008 14:26
Wohnort: Darmstadt
Kontaktdaten:

Re: Exercise 1, Problem 2

Beitrag von leviathan »

I have the same problem at this point. If I change the image translation in step 1 along the z-axis, I get a nice clear picture of a cow in my projection. But if I transform it as it prescribed, the cow actually intersects the image plane, and thus the projection doesn't display anything meaningful at all. Are we both missing something here? Has anyone managed to produce good results in this part of the exercise?

Update The projection in task c-3 suffers the same problem. I would really like to know whether this is an error in my code somewhere or the exercise data indeed is like this...
Ein Programmierer hat immer eine Lösung. Die passt nur nicht immer zum Problem.

Hiwi für Weiterentwicklung des Lernportals (Moodle).

engee
Neuling
Neuling
Beiträge: 3
Registriert: 8. Mai 2011 02:38

Re: Exercise 1, Problem 2

Beitrag von engee »

Same issue here. In the original data set there are a lot of points with negative z coordinates which I guess is causing this. If the image is translated along the z axis by fair amount the image is clear.

qgao
Moderator
Moderator
Beiträge: 33
Registriert: 7. Apr 2009 11:38

Re: Exercise 1, Problem 2

Beitrag von qgao »

If the z coordinates of the transformed points are all positive, there should be no problem.

It does not matter that the transformed object intersects the (virtual) image plane. Projection could still be done.

robert.n
Nerd
Nerd
Beiträge: 673
Registriert: 29. Sep 2008 19:17

Re: Exercise 1, Problem 2

Beitrag von robert.n »

Basic linear algebra fail. The matrices are applied from right to left.
So I applied the transformations in the wrong order.

Before:
M = M_translation * M_rot_z * M_rot_y * M_rot_x;

After, fixed:
M = M_rot_x * M_rot_y * M_rot_z * M_translation;

@qgao:
Your comment did not help. And it came awfully late, too.

"If the z coordinates of the transformed points are all positive, there should be no problem."
I think what you actually wanted to express is this: The transformed object should not intersect the xy-plane. Otherwise, your transformations may be broken.

qgao
Moderator
Moderator
Beiträge: 33
Registriert: 7. Apr 2009 11:38

Re: Exercise 1, Problem 2

Beitrag von qgao »

To robert.n:
"I think what you actually wanted to express is this: The transformed object should not intersect the xy-plane. Otherwise, your transformations may be broken."

Not really. I meant that if you find non-positive transformed coordinates, either your implementation or the exercise problem itself may be broken.

robert.n
Nerd
Nerd
Beiträge: 673
Registriert: 29. Sep 2008 19:17

Re: Exercise 1, Problem 2

Beitrag von robert.n »

qgao hat geschrieben:To robert.n:
"I think what you actually wanted to express is this: The transformed object should not intersect the xy-plane. Otherwise, your transformations may be broken."

Not really. I meant that if you find non-positive transformed coordinates, either your implementation or the exercise problem itself may be broken.
Apologies, but that sounds exactly like what I've written.

engee
Neuling
Neuling
Beiträge: 3
Registriert: 8. Mai 2011 02:38

Re: Exercise 1, Problem 2

Beitrag von engee »

Ya, I got the angles mixed up. The projection 'seems' correct now.
Thanks

banshee
Nerd
Nerd
Beiträge: 684
Registriert: 22. Okt 2006 18:46

Re: Exercise 1, Problem 2

Beitrag von banshee »

I'm a bit puzzled by part b) and c) of our assignment. In part c) we should express the transformation with one single matrix in homogeneous coordinates. So this suggests that we shouldn't use homogeneous coordinates in part b). But if that's the case, how can we then output a single inverse transformation matrix? I thought it wouldn't be possible to express the translation part without homogeneous coords?!

robert.n
Nerd
Nerd
Beiträge: 673
Registriert: 29. Sep 2008 19:17

Re: Exercise 1, Problem 2

Beitrag von robert.n »

banshee hat geschrieben:I'm a bit puzzled by part b) and c) of our assignment. In part c) we should express the transformation with one single matrix in homogeneous coordinates. So this suggests that we shouldn't use homogeneous coordinates in part b). But if that's the case, how can we then output a single inverse transformation matrix? I thought it wouldn't be possible to express the translation part without homogeneous coords?!
In part c) we should combine transformation plus projection in a single matrix.
In part b), however, transformation and projection are separate steps and we should only output the inverse of the transformation matrix. :wink:

Benutzeravatar
leviathan
Computerversteher
Computerversteher
Beiträge: 307
Registriert: 30. Jul 2008 14:26
Wohnort: Darmstadt
Kontaktdaten:

Re: Exercise 1, Problem 2

Beitrag von leviathan »

robert.n hat geschrieben:In part b), however, transformation and projection are separate steps and we should only output the inverse of the transformation matrix. :wink:
Yes, projection is a separate part and should not be included in the inverse matrix. But the translation is part of the transformations, and one can only express a translation together with rotations in a single matrix by using homogeneous coordinates. So technically, I think it's impossible not to use HC in part b).
Ein Programmierer hat immer eine Lösung. Die passt nur nicht immer zum Problem.

Hiwi für Weiterentwicklung des Lernportals (Moodle).

robert.n
Nerd
Nerd
Beiträge: 673
Registriert: 29. Sep 2008 19:17

Re: Exercise 1, Problem 2

Beitrag von robert.n »

leviathan hat geschrieben:
robert.n hat geschrieben:In part b), however, transformation and projection are separate steps and we should only output the inverse of the transformation matrix. :wink:
Yes, projection is a separate part and should not be included in the inverse matrix. But the translation is part of the transformations, and one can only express a translation together with rotations in a single matrix by using homogeneous coordinates. So technically, I think it's impossible not to use HC in part b).
Yes, I think so, too.

The point is that different matrices are asked for in b) and c).

b): Matrix reversing all the transformation steps.
c): Transformation plus projection matrix (i.e. a single matrix).

Thus, the task of c) does no more imply that we should *not* use homogenous coordinates in b), as suggested by banshee. Problem solved.

Antworten

Zurück zu „Computer Vision“