Can I use calculated Homography for transforming 2D coordinates from one camera to the other stereo camera?

StackOverflow https://stackoverflow.com/questions/11488543

Sorry if it sounds stupid but I really need to ask this.

Once homography is calculated, can I use this to project 2D coordinate of an object's center detected in one camera to the other stereo camera as 2D coordinate?

有帮助吗?

解决方案

Once you have the homography that maps the transformation between the two cameras, the conversion is really straightforward.

All you have to do is to call

cv::perspectiveTransform(leftCamPts, rightCamPts, H );

It will fill the rightCamPts with the correct points.

But you must make sure you have the correct homography (the one that describes the transform between left and right camera, and not one of the many transforms that are calculated in a stereo engine). Also, check the correct order for left-to-right calls. you may need to invert your matrix before applying it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top