Skip to main content
Participant
August 3, 2021
Question

Superimpose two very different images and align along same object

  • August 3, 2021
  • 3 replies
  • 754 views

Hello, I try to align/superimpose two very different images along a common structure (see attachments) without doing the obvious manual Transform operations.

 

How can I superimpose Image 2 (in Layer 2) onto Image 1 (in Layer 1) so that I get “automatically” Image 3?

 

Somehow some kind of “pattern recognition” may need to happen and then some kind of AutoAlign. The regular AutoAlign feature does not seem to work here. Thank You.

This topic has been closed for replies.

3 replies

ajabon grinsmith
Community Expert
Community Expert
August 4, 2021

In order to achieve this, it seems that operations such as OpenCV using Python will be required.

Template Matching

Hacki5C13Author
Participant
August 16, 2021

Hello:

Sorry for my late reply and thank you for your suggestion. This looks interesting and I'll have friends looking into this.

Many Thanks Again

Legend
August 3, 2021

This can be done using a script.
In both images, you can highlight the central subject using select subject, tnen convert selection to path. Find the extreme points in the corners of the left, top, right, bottom, take them as outside boundaries of the object. Based on the deviation of the lines between the specified points from the horizontal / vertical, roughly calculate the angle of inclination of the entire object. Then you can move the layer and compensate rotation.
However, the result of the work will depend on what the select subject decides to select and on the form of the object, that is, it will often be unpredictable. I don’t think it is worth solving the issue in this direction.

Hacki5C13Author
Participant
August 16, 2021

Hello:

Sorry for my late reply and many thanks for your suggestion. The select subject command only worked for one image and I think it is worth solving the issue in this direction, as you also indicated.

Many Thanks Again

Bojan Živković11378569
Community Expert
Community Expert
August 3, 2021

Do you have multiple images? If yes then the next question is whether they share dimensions and exactly same pattern that should be rotated/aligned? If yes then please provide us with more samples. If not then task is very difficult, at least using Photoshop actions alone. 

Hacki5C13Author
Participant
August 16, 2021

Hello:

Sorry for my late reply and thank you for your comments. I have only these two images right now, but could possibly generate more. Let me look into this.

Many Thanks Again