I have an image which contains a trapezoid section which I need to transform into a square shape (deskew). I'm am really struggling to understand 3D transformation matrices and have no idea where to start with this.
At present I have 4 CGPoints which represent a skewed shape, I also have 4 CGPoints which represent a uniform rectangle. How would I convert the initial 4 CGPoints into a 3D transform matrix to deskew the image?
I'm basically looking for the inverse of this: iPhone image stretching (skew)
Where the first image would be the input shape and a square image would be the output.
Can anyone point me in the right direction?