InGAN icon indicating copy to clipboard operation
InGAN copied to clipboard

homography_based_on_top_corners_x_shift

Open qingweisong opened this issue 5 years ago • 1 comments

Hi,author,Thanks for your share . I have a quenstion,what's the meaning of p?

qingweisong avatar Jan 17 '20 07:01 qingweisong

Thanks, p is the matrix representing the equation system for calculating a homography from 4 pairs of corresponding points.
To have a homogrpahy that we understand and can easily modify we express it as shifting of the corners of the image.
SO given that homography matrix should comply for this correspondence for each of the pairs: image

If we apply for each of the pairs then each time we get two equations (for x and y). This makes 8 equations. Another equation is simply assuming that h_9 is 1 because homography is scale-invariant. So if we flatten the homography matrix to a vector we now have 9 variables that we need to calculate, and 9 eqautions. This is a solvable system (assuming no 3 points are co-linear) and can be formulated this way: image

This is what we call p.
In our p, we use random modifications of the the target points x' y' matching the source points that are corners.

The images I used are taken from: https://math.stackexchange.com/questions/494238/how-to-compute-homography-matrix-h-from-corresponding-points-2d-2d-planar-homog where you can also read more about that.

assafshocher avatar Jan 17 '20 08:01 assafshocher