I need to construct a homography out of a 3x3 rotation matrix. I am fundamentally misunderstanding some part of how homographies are constructed. I have been assuming that a homography is constructed as follows.
hom(0,2) = x translation hom(1,2) = y translation hom(2,2) = scale, I can divide the entire matrix by this to normalize
The first two columns I assumed were the first two columns of a 3x3 rotation matrix. This essentially amounts to taking a 3x4 transform and throwing away column(2). I have discovered however that this is not true. The test case showing me the error of my ways was trying to make a homography which rotates points some small angle around the y axis.
//rotate by .0175 rad about y axis rot_mat = (1,0,.0174, 0,1,0, -.0174,0,1); //my conversion method to make this a homography gives homography = (1,0,0, 0,1,0, -.0174,0,1);
The above homography does not work at all. Take for example a point x,y,1 where x > 58. The result will be x,y,some_negative_number. When I convert from homogeneous coordinates back to cartesian my x and y values will both flip signs.
How do I construct a homography that rotates 2D homogeneous points by some angle around the x and y axis?