Good algorithm for finding similar areas in images?

I want to look for similar areas in two images, but I don't know what works best. The areas are not scaled or transformed in any way, but can be displayed anywhere on both images (I want to know where). There are other things around them.

This is an example of what I want:

two images with overlap showing

How can i do this?

+5
source share
1 answer
  • segmented image

    To get connected rectangles / polygon / mask of found areas

  • for each area calculation

    • bar chart
    • FFT or DCT and filter out non-essential data (mostly high frequencies ... similar to JPEG).
    • size (width, height, area, perimeter length ...)
  • find a match

    So, compare each area between the images. Treat the data from # 2 as a single dataset and calculate the similarity between the compared regions based on one of the following:

  • for certain images you can create your own custom comparison

    • for example here for OCR
    • if you want to have the same size, you can easily add size comparison +/- some treshold.
  • to increase accuracy

    You can divide each region into several subregions and compute # 2 so that they have a more reliable dataset, but beware of turns.

    Also, if the segmentation is based on a color homogeneity coefficient, then you can also include this in the data set.

  • rotated images

    To do this, you need to use rotation-dependent functions, for example:

    • bar chart
    • color uniformity
    • use forms for rotation-invariant subregions as concentric circles ...

    Or find the base function / edge and rotate one image in accordance with another position ...

  • polygons

    For polygon images, you can insert the vector image back into the vector shape, and then use any polygon matching algorithm

+2
source

Source: https://habr.com/ru/post/1209629/


All Articles