Ask Your Question

Revision history [back]

How to counteract the scalling of the x and y coordinate when getting closer to the object

At the moment I am working on a computer vision project for a asignment. In this project I am trying to create a 3d marker tracking system with stereo vision. I am able to calibrate both camera's at the same time using a chessboard pattern. After that both camera's are stereo calibrated. when the calibration is complied, both cameras video's are tracked, points undistorted and rectified. The last step is the triangulation function in OpenCV of both the marker positions. This determent the z coordinate with good enough precision. Only when a object gets closer to the camera lens the distance between the objects changes because of the pin hole principle. only when your working with body segment lengths they should not change this will lead to invalid results.

When comparing the size change of the two markers when getting closer. it seems that the change in size correlates precisely with the z coordinate behavier(see figure 1). What happend in this graph is a stick with two markers moving closer and further away from the camera lenses(see figure2)image description

figure 1

image description

With this knowledge there should be a way to correct the x and y position when something gets closer or further away from the lens. I tried findholography but the results where horrendous. My question is: is there a function in OpenCV witch can adjust the scaling problem of the x and y coordinate accordingly to the z axis changes, otherwise is there a reliable methode of changing the x an y coordinates? or am I forgetting a key point in the process, ia m quite new to computer vision and OpenCVso this could wel be the case.