The image points expressed in the normalized camera can be computed from the corner points and by applying a reverse perspective transformation using the camera intrinsics and the distortion coefficients:
To check the correctness of the calculation, the matching lines are displayed:
@ -295,13 +295,13 @@ To transform a 3D point expressed in the camera 1 frame to the camera 2 frame:
In this example, we will compute the camera displacement between two camera poses with respect to the chessboard object. The first step consists to compute the camera poses for the two images:
The homography related to a specific plane computed from the camera displacement is:
@ -320,11 +320,11 @@ the translation vector between the two camera frames.
Here the normal vector `n` is the plane normal expressed in the camera frame 1 and can be computed as the cross product of 2 vectors (using 3 non collinear points that lie on the plane) or in our case directly with:
The distance `d` can be computed as the dot product between the plane normal and a point on the plane or by computing the [plane equation](http://mathworld.wolfram.com/Plane.html) and using the D coefficient:
The projective homography matrix \f$ \textbf{G} \f$ can be computed from the Euclidean homography \f$ \textbf{H} \f$ using the intrinsic matrix \f$ \textbf{K} \f$ (see @cite Malis), here assuming the same camera between the two plane views:
@ -332,7 +332,7 @@ The projective homography matrix \f$ \textbf{G} \f$ can be computed from the Euc
We will now compare the projective homography computed from the camera displacement with the one estimated with @ref cv::findHomography
@ -368,11 +368,11 @@ Visually, it is hard to distinguish a difference between the result image from t
OpenCV 3 contains the function @ref cv::decomposeHomographyMat which allows to decompose the homography matrix to a set of rotations, translations and plane normals.
First we will decompose the homography matrix computed from the camera displacement: