Good algorithm to find similar areas in images?

前端 未结 1 332
天命终不由人
天命终不由人 2020-12-31 22:02

I want to search 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 may appear anywhere in both imag

1条回答
  •  北海茫月
    2020-12-31 22:44

    1. segmentate image

      To obtain bound rectangles/polygon/mask of found areas

    2. per each region compute

      • histogram
      • FFT or DCT and filter out unsignificant data (mostly high frequencies ... similar to JPEG comprimation)
      • size (width,heigth,area,perimeter length...)
    3. find matches

      So compare each regions between images. Handle data from #2 as single dataset and compute the similarity between compared regions based on one from the following:

      • correlation coefficient
      • distance + tresholding
      • size coefficients (aspect ratio,perimeter/area,...)
    4. for specific images you can create own custom comparison

      • for example here is mine for OCR
      • if you want the same size then you can easily add comparison of the sizes +/- some treshold
    5. to improve precision

      You can divide each region to few subregions and compute #2 also for them to have more robust dataset but beware of the rotations.

      Also if you segmentation is based on color homogenity coefficient then you can also include that to the dataset

    6. rotated images

      For that you need use features independend on rotation like:

      • histogram
      • color homogenity
      • use shapes for subregions invariant to rotation like co-centric circles ...

      Or find base feature/edge and rotate one image to match the other one position ...

    7. polygons

      For polygon images you can vectorise image back to vector form and then use any polygon comparison algorithm

    0 讨论(0)
提交回复
热议问题