Copy link to clipboard
Copied
Hi all.
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 ???
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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...
Copy link to clipboard
Copied
Again:
• 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.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I've never used this feature, I'll try it now...
Copy link to clipboard
Copied
Yes, that's what you need. Thank you