I implemented a function that makes use of OpenCV's estimateRigitTransform(). I store the result in a OpenCV Mat called T:
Mat T = cv::estimateRigitTransform(image, reference, false);
I know that by setting the last argument to false
I get a partial Affine
transformation that combines rotation, scaling, translation and has 4 degrees of freedom. ('true' would output a 6 degrees of freedom fullAffine transformation that includes shearing.)
When I print the Mat T
, I get the following result:
[1.050438, 0.044571, -37.17997;
0.059126, 0.952621, -3.825856]
I have problems interpreting this transformation matrix. From what I understand the matrix represents the following:
[cos(theta)s, -sin(theta)s, tx;
sin(theta)s, cos(theta)s, ty]
which is a combination of a rotation matrix cos() and sin()
, a scaling matrix s
and a translation vector tx and ty
.
So as the scaling factor s
and the angle theta
are constant, shouldn't the two cos(theta)s
values be the same? In my out output one is 1.050438
and the other 0.952621
?
When I display the image transformation using OpenCV's wrapAffine()
and passing that matrix T
, the output seems quite reasonable but beside of that I have no possibility the check T
for correctness.