There are two images.
There is an area in the FIRST image that is the SECOND image.
The task is to select the area on the FIRST image where the SECOND image is located.
Proposed algorithm of actions.
From the colors contained in the SECOND image, we get the average color.
From the known height and width of the SECOND image, we obtain the side of the average square of the image.
To the FIRST image we apply the mosaic filter with the parameter of the averaged square of the SECOND image.
We are looking for an area of the FIRST image that matches in color with the average color of the SECOND image.
It is clear that this task is from the field of Artificial Intelligence, it will be necessary to change the value of the average square of the SECOND image, and compare the probabilities of color matching ...
It is likely that someone has already solved a similar problem ...
Can anyone share information from this area ???
If this is purely academic I have nothing to add, but if it is about automation in Photoshop then Edit > Auto-Align Layers (at »Auto«) seems to work fine with these sample-images.
The averaged color seems a potentially problematic criterion.
• there could potentially be false positives
• the matching square could »start« at any position along the y- and x-axis, so the mosaic-filter might not produce any matching square
Yes, if you use the color of the average square on a straight line, then such problems will definitely arise. But if you select areas from the FIRST image that potentially match the parameters of the average color, in your image these are all the squares that the square with the average color overlaps, then crop such an area, reduce the value of the mosaic filter, select in this cropped area, another area where the percentage of color matching above... (recursive calculation). It is quite possible that there is a partial mismatch, but this approach will give more accurate results.
What is the point here really?
What are you trying to automate or otherwise achieve?
How does »Align Layers« fall short of your needs?
Is the image an exact part of the large image or may there be slight differences?
In case 1 have you considered a Work Path-approach?
Let's say that the area of the FIRST image, on the second image is slightly changed (stretched, transformed, rotated). I'm interested in this option...
• What is the point here really?
• What are you trying to automate or otherwise achieve?
• How does »Align Layers« fall short of your needs?
Even slight differences would pretty much rule out a Work Path-approach.
I've never used this feature, I'll try it now...
Yes, that's what you need. Thank you