Ask Your Question

Revision history [back]

With one camera is more or less impossible (or very difficult in some context). Because, the depth is loss in the 2D sensor of the camera. Finding depth, with a unique camera (if it's what you want) is very difficult, and often not accurate. You could Google it, but to the best of my knowledge, there is not such think in OpenCV. If you find a good algorithm, and implement it, make a pull request... ;-)

But you could use two cameras. With stereo matching approach, you could estimate the 3D position of your keypoint. I think you don't have to compute the keypoints on both image, just one, and reproject them in 3D. See the stereo doc here, and the samples in cpp/stereo_calib.cpp cpp/stereo_match.cpp.