First you defined the conversion between your images. It can be as simple as shear or complexity as non-linear deformation. The focusing operation can not only shift, but also slightly scale and even shift the image. In this case, you need to use homography to match them.
Secondly, the easiest way you should try is to manually select at least 4 pairs of corresponding points, write down their coordinates and pass them to findHomography () . The resulting 3x3 transformation can be used in warpPerspective () to match the images. If the result is good, you can automate the matching process by using, say, SURF points and matching their descriptors.
Finally, if the result is unsatisfactory, you should have a more general transformation than homography. I would try a piece of Affinity, trying to match the individual parts of the images. In any case, more detailed information about your contribution and ultimate goal will help to solve the problem correctly.
Vlad
source share