0

I have a square and its 4 corner coordinates $(x_1,y_1),(x_2,y_2),(x_3,y_3),(x_4,y_4)$. And I have a quadrilateral with corner coordinates $(x_1',y_1'),(x_2',y_2'),(x_3',y_3'),(x_4',y_4')$ where $(x_i,y_i)$ maps to $(x_i',y_i')$.

I am looking for a way to take a coordinate from inside the boundaries of the quadrilateral and map it to the corresponding coordinate in the square. I found this page http://mathinsight.org/determinant_linear_transformation but I am unsure how to do it. It seems to give an example of how to map from the square to the quadrilateral but I want the opposite.

Also in their second example with

A=[−1 −1] [ 1 3]

How do they obtain this matrix, it is not clear to me..

Does anyone know?

Thanks

Edit I found this article http://www.fmwconcepts.com/imagemagick/bilinearwarp/FourCornerImageWarp2.pdf But I don't understand how to solve for a0,a1,b0,b1,c0,c1,d0,d1...

omega
  • 751
  • Please see the accepted answer in this thread: https://math.stackexchange.com/questions/296794/finding-the-transform-matrix-from-4-projected-points-with-javascript – user106688 Feb 09 '20 at 01:45

1 Answers1

0

This is a change of basis problem. I wish I could comment on your answer, so I'll give you guidance here.

Assuming you're working in 2d space, you will have to do up to three types of transformations:

  • linearly scaling axis values
  • translation (moving additively along each axis)
  • rotation

From there, you should be able to construct a change of basis matrix that includes any of those transformation types. This matrix should be convertible, where you'll be able to get the reverse transformation as well.