I am trying to estimate the motion of an object (marker M) in 3D with the help of 2 non-static cameras (See attached Figure). Apart from the moving marker, M , there are 4 static co-planar markers as well in the scene (m1, m2, m3 and m4). Absolute distance (in centimeters) between static markers is known.
The two cameras can move around, but are fixed relative to each other. The cameras take images of the scene simultaneously. I can detect all the markers (static as well as mobile) in 2D images from both the cameras.
The goal is to calculate the motion of M in 3D across frames. One way to do this is to assume m1 as origin (0,0,0) of the world coordinate system, and find 3D position of M (x,y,z) across two frames, and then find the distance between these two positions.
Hence, the problem resolves to calculating position of M wrt to m1 in 3D, across frames. This means that ego-motion (motion due to camera) across frames should have no effect on the position of M as it is relative to m1, which is origin.
I am looking for someone to guide me towards the right direction to solve this problem using OpenCV.
What I would try is the following:
The coordinate frame will be decided by the 3d positions of the markers, so m1 will be your origin.
This requires that
You should be able to find the OpenCV functions that perform the two steps above.