Question

I currently have an image(A) say iWidth by iHeight with certain data points mapped onto it. What I want to do is add another image(B) on top of it with a different width and height say nWidth and nHeight and transform the points from image A to correspond to points on image B. I want to do this by selecting control points on image A to map to target points on image B.

For example: I want to say- Let (0,0) in image A be (20,40) in image B, and let (1000,1000) in A be (4000,2300) in B. One thing to note is that there could be multiple of these defined.

I know there is a mathematical concept that would be of great help and I would appreciate if someone could point it out to me as I am guessing I am not the only one who came upon this problem and struggled.

Thank You!

Was it helpful?

Solution

Here is the library I coded to make this happen. It took a lot of research and looking around, but in the end it all paid off. The concept is called Affine Fit Transformation. More info can be found here: https://github.com/clockwork189/Affinity

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top