With reference to the paper I am trying to calculate the orientation of the camera with respect to a test pattern. The test pattern looks like
when the camera is viewing it perpendicular to the test pattern plain. When viewed from an unknown orientation the test pattern looks like
.
I am able to calculate the angle around x (alpha) and y (beta) axis. Now i need to deskew the test pattern to get the rotation angle about z (gamma) axis (optical axis of camera) . This is to be done by rotating the test pattern image around x and y by the negative values of alpha and beta. So how to get the homography matrix only for rotation. I have gone through virtual camera rotation and the wiki link. The virtual camera rotation code produces good result but is dependent on distance of the camera from the test pattern which in my case is unknown. I tried cv::warpPerspective
by passing only the rotation matrix but results were weird.