How do projective transformation matrices work?

55 Views Asked by At

I've been working on a tool to turn photos of graphs into digital data (I know there are already tools out there, I wanted to understand the mechanism and I find learning by doing the easiest), but I cannot get my head around the maths involved.

I've had a bit of a read and I think I understand the matrix stuff involved in affine transformations, but I seem to be at a bit of a roadblock with projections, which is what I think I need (but could be wrong there too).

I've got the following image and I know the pixel coordinates of the axes (red) and the data that I want to extract (blue). I also, obviously, know the axis limits that I need to transform the data to.

Graph with points displayed

What I cannot work out at all is how to do that transformation! If anyone has any advice for how to understand how to get from the projected image to an un-projected set of data I would be massively appreciative.

1

There are 1 best solutions below

0
On BEST ANSWER

This is answered very eloquently here and so this is the method I've used to solve the problem I'm having, demonstrated below (without the maths).

I've gone from the following projected graph of a known curve that I created, so that I can test my maths:

With the data points for the axes used to map the transformation of the axes and data:

I used the transformation matrix between the marked up axes and the axis limits on the image to obtain the marked up data points' "real" values, as compared to a plot of the known curve:

Obviously the points I've selected might not be dead on so any error is more likely due to that than numerical errors.