Ask Your Question

Revision history [back]

cv::solvePNP will solve that problem for you:

http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#solvepnp

You pass the coordinates of the corners of your QR-Code in the coordinate system of your marker (e.g. if your QR-code has a size of 3cm, the topleft corner could have the coordinates (-0.015,-0.015,0) and the corresponding pixels in your camera.