Search code examples
matlabprojectionaffinetransform

Function for 2D Point Projection


I have two sets of points stored in 2x9 matrices. One set is input points, and the other set is the desired output. How can I determine a transform between these two matrices, then generate an equation that could allow me to plug in any point and receive a corresponding output point relative to the other points? I'd prefer answers that are do-able in MatLab. Thanks!


Solution

  • So you have

    OUTPUT = INPUT * SOME_TRANSFORM
    

    Assuming that it is linear.

    Matlab has a matrix division operation : http://www.mathworks.nl/help/matlab/ref/mldivide.html

    So for given input and output:

    SOME_TRANSFORM = INPUT \ OUTPUT
    

    Then you can calculate for new input:

    NEW_OUTPUT = NEW_INPUT * SOME_TRANSFORM