Camera calibration via Homography
The transformation that exists between a marker model and its image in the scene can be computed by means of an homography.
For the 3D case, an homography H is a linear transformation that relates points between two planes.
Then, this transformation can be decomposed into a rotation R and a translation t. This parameters are known as the extrisic camera parameters.[https://mathworks.com/help/vision/ug/camera-calibration.html]
The camera calibration can be achieved via the OpenCV tool: ‘camera calibration application’, which estimates the intrinsic camera matrix K, and said extrinsic parameters [R|t].
Also, a light solution can be used if we match the points between the marker model and the marker detected in the scene using a Order Type fiducial marker. [https://www.mendeley.com/catalogue/fiducial-tag-invariant-rotation-translation-perspective-transformations/]
Using the λ matrix calculated by order type, it is possible to label and tie the points of the proposed marker model, with those detected in the image.
In this way, there is a one-to-one relationship for each of the seven points, regardless of the pose of the marker in the scene that the camera captures.
With this information, we can reproject a 3D scene into the image as follows:
More info & source code at: [Vision 2017 Course Page].