for a quite while now I've been trying to calibrate the ARToolKit output with a projector. For the calibration I'm trying to find the necessary homography using OpenCVs getPerspectiveTransfrom. The process I'm currently using is as follows:
- Detect the checkerboard and its outer corners. (attachment circle_desk.png)
- Project four points onto the outer corners, which are now offset through the projector. (attachment circle_wall.png)
- Use OpenCVs getProjectiveTransform with the four corner points from the checkerboard and the four projected circles on the wall.
- Transform the retrived 3x3 homography matrix to a 4x4 matrix usable in OpenGL (I know OpenGLs matricies are column major).
- Right before drawing, use glMultMatrix to move OpenGLs matrix to incooperate the homography. (attachment circle_wall_calib.png)
As you can see in the circle_wall_calib.png image the points get moved but are displayed at the wrong position. If I'm using the calculated homography matrix on a simple picture and display it through the projector the offsets are correct. Somehow simply using glMultMatrix doesn't produce the result I'm hoping for.
Do you have any tips on what I'm doing wrong here? Should I be using another way to calibrate my camera and projector?
- circle_desk.png and circle_wall.png are basically showing the same. The first is the direct output on the desktop screen, the second shows the resulting projection via the projector.
- circle_desk.png and circle_wall_calib.png SHOULD be the same. After applying the homography I'd expect the projectors projection to be at correct position. (except the colors)