C ++ coordinate transformation

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

+3
source share
2 answers

, Y Z , , , - Z, .

, Y ( Z). Y, , X, , Y Z .

, , , , , .

, . 2 :

  • T_table ,
  • T_camera .

T_camera 2d- , .

- โ€‹โ€‹ - . :

  • , 4 " " (, , " 25 " ", 1995 );
  • , "POSIT (C Matlab)".

, OpenCv DeMenthon. -. : OpenCv

+2

, , , - .

, ? , , , , .

?

0

Source: https://habr.com/ru/post/1717636/


All Articles