Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Homography to Projective transform

I've been attempting to figure out how to take a homography between two planes and convert it into an projective transform. Matlab does this automatically, but I've been trying to figure out how matlab implements the conversion.

like image 599
ct_ Avatar asked Sep 17 '11 18:09

ct_


2 Answers

You can look at the source code in toolbox\images\images\maketform.m

At least within the editor you can get to this by hitting F4 on the function name.

like image 160
Alex Avatar answered Oct 15 '22 01:10

Alex


A homography is a projective transform that maps lines to lines, keeps cross ratio, but does not keep parallelism or other similarity magnitudes (angles, distances, etc). A homography can be expressed as a homogeneous 3x3 matrix, and computed in many (really, many) different ways according to your problem.

The most typical one is to determine 4 point correspondences between the two planes and use the Direct Linear Transform (DLT). There are also many implementations of the DLT. If you are familiar with OpenCV, you can easily obtain such homography matrix using cv::findHomography (http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html?highlight=findhomography#findhomography).

In general, I recommend you to take a look to the "Multiple View Geometry" book from Hartley & Zisserman, which explain in detail the concept of homographies in the context of computer vision.

like image 25
marcos.nieto Avatar answered Oct 15 '22 01:10

marcos.nieto