Search code examples
imageopencvimage-processingemgucvperspective

Perspective transform given point (x,y) in quadrilateral plane to Rectangle plane's point (x', y')?


I am trying to transform quadrilateral to rectangular plane And need to extract coordinate of 1 specific point (in quadrilateral plane), to that in respect to rectangular plane..

I'm using EmguCV for image processing purpose in my .NET project

What I've tried is:

1) Calculate Homography matrix between quadrilateral and rectangular plane (specifying points in clockwise order from left top corner for both planes)

2) Multiply above Homography matrix by 3 x 1 matrix [x,y,1] to get final coordinates.

However, the resultant coordinate (x', y') does not seem in concordance with given point (x,y).

enter image description here


Solution

  • As Micka suggested, after having resultant matrix (3x1), all that is needed to solve this problem was this: p' = (x'/z', y'/z')

    Steps as below:

    1. Calculate Homography matrix between quadrilateral and rectangular plane
    2. Multiply this homography mat. with candidate point [x,y,1]T and get [x',y',z']T
    3. Now, Dehomogenize above [x',y',z']T i.e. [(x'/z'), (y'/z'), 1]T

      thus, the required final coordinate of rectangular plane.