Salaar Khan
Salaar Khan

Reputation: 35

Finding Affine Transformation between 2 images in Python without specific input points

image 1: enter image description here

image 2: enter image description here

By looking at my images, I can not exactly tell if the transformation is only translation, rotation, stretch, shear or little bits of them all.

From what I understand, if I could mark some points between the two images, the getAffineTransformation function in python can get me the transformation matrix.

However, I do not want to mark points (as it is not easy to do so in images like these).

Is there a generic function that could take my two images and give me the transformation matrix? If not, how do I go about making one?

Upvotes: 1

Views: 5332

Answers (1)

fblthp
fblthp

Reputation: 98

I know it's a bit late but I have been trying to solve the same problem as you and I think I found a solution.

The findTransformECC method from the opencv2 library might be what you are looking for. It finds the motion between two images, no need to specify points. It supports different kinds of transformations -- affine is one of them. There is a good article about image alignment with examples that use this method: Image Alignment (ECC) in OpenCV ( C++ / Python )

Upvotes: 1

Related Questions