UPS-CS240-F12 / augmented-reality

A repo for the augmented reality team.
2 stars 0 forks source link

Calculating Secondary Target Location #6

Open matthewcburke opened 11 years ago

matthewcburke commented 11 years ago

So I couldn't help but think about this while I was running this morning. I think I've got our solution:

Given the pose matrix for the main target,

P1 = [R1 | t1]

and a pose matrix for a secondary target,

P2 = [R2 | t2],

where 'R' and 't' are the rotation matrix and translation vector respectively,

let 'a' be the phone's location on the main target coordinate system where

a = - R1-1t1.

Then define

b = - R1-1t2.

Then the secondary targets location on the main coordinate system should be

a - b.

Note that we used R1 to calculate 'b'. If the two targets are in the same plane (on a table) and oriented the same way then I believe R1 and R2 will be the same. Regardless, we are only interested in the the location of the secondary target not it's rotation.

Recall the definition of the pose matrix. Also, I reviewed the example that we were looking at on the board the other day, and I think I figured out where we were going wrong. When the phone is parallell to the target with the camera down, 'R' is not the identity, it is a 180° rotation around either the 'x' or the 'y' axis. Let's chat in class if you want.