Python Forum
How to align two 2D images?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to align two 2D images?
#1
Hello, I have total of 400 images that should be aligned, it would be a pain if I align them manually by mouse because there are a lot of images, and because I like precision.

As I shown in the image below, there is a big image on the left and a cropped version of it on the right, cropped means no scaling, no rotation. And I want to align that cropped image to the big image, but how to do it with Python?

If nobody knows how to do it then I will force to write my own algorithm which will take a lot of days unfortunately, if I explain how I will do it in an exaggerated way, the computer will position the cropped image on top left first and compares the two images by difference but in that position, the sum of the difference is high which means a bad position, then the computer moves that cropped image one pixel to the right and compare, and so on, … and after 100000 pixels moves, the computer finally found a position where the sum of the difference between the two images is close to zero or minimum which means that it’s at good position, but that’s an exaggerated way that would take an eternity but in reality I will use very low resolution first which finds an approximate position, and increase the resolution again and again for accurate position.

So, it would take many days to complete that algorithm about increasing resolution, that’s very hard to do. But do you know an existing module or code which aligns the cropped image to the big image? Thanks.

[Image: K0n66rw.jpg]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to automatically align an image robrod26 1 1,970 May-09-2020, 04:04 PM
Last Post: ThomasL

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020