I have a webcam pointing to a table on a slope, and with it I track markers. I have transformMatrix in OpenSceneGraph, and its translation part contains the relative coordinates from the tracked object to the camera. Since the camera is pointed at the slope, when I move the marker around the table, the Y and Z axes are updated, although all I want to update is the Z axis, because the height of the marker does not change only its distance from the camera. This is true when the model is slightly turned off when the project model on the marker in OpenSceneGraph, and when I move the marker, the values โโof Y and Z are updated incorrectly.
So, I assume that I need a transformation matrix with which I multiply each point, so I have a new coordinate system that lies orthogonally on the table surface. Something like this: A * v1 = v2 v1 is the camera coordinates, and v2 are my โtable coordinatesโ. So, what I did now, 4 points were selected to โcalibrateโ my system. So I placed the marker in the upper left corner of the screen and defined v1 as the current camera coordinates and v2 as (0,0,0), and I did it for 4 different points. And then, taking the linear equations obtained from the unknown Matrix and two known vectors, I solved the matrix.
I thought that the values โโthat I would get for the matrix would be the values โโthat I would need to multiply by the coordinates of the camera so that the model updates correctly on the marker. But when I multiply the known coordinates of the camera that I collected earlier, with the matrix, I did not get anything close to the fact that my "table coordinates" were proposed.
I am completely mistaken in my aproach, did I just run something in the equations? (solved by wolframalpha.com) Is there an easier or better way to do this? Any help would be greatly appreciated, as I partly lose and under some pressure of time: - / Thanks, David
David
source
share