Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Finding an area of one image within another image...

Engaged ,
Jun 29, 2023 Jun 29, 2023

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 ???

TOPICS
Actions and scripting
484
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Jun 29, 2023 Jun 29, 2023

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. 

Screenshot 2023-06-29 at 12.53.00.pngScreenshot 2023-06-29 at 12.53.06.pngScreenshot 2023-06-29 at 12.53.12.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 29, 2023 Jun 29, 2023

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 

Screenshot 2023-06-29 at 13.32.34.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 29, 2023 Jun 29, 2023

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 29, 2023 Jun 29, 2023

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? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 29, 2023 Jun 29, 2023

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...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 29, 2023 Jun 29, 2023

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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 29, 2023 Jun 29, 2023

Screenshot 2023-06-29 at 18.02.31.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 29, 2023 Jun 29, 2023

I've never used this feature, I'll try it now...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 29, 2023 Jun 29, 2023
LATEST

Yes, that's what you need. Thank you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines