Good algorithm to find similar areas in images?

可紊 提交于 2019-12-18 16:56:58

问题


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 images (I want to know where). There is other stuff around them.

This is an example of what i want:

How can I do this?


回答1:


  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



来源:https://stackoverflow.com/questions/27585328/good-algorithm-to-find-similar-areas-in-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!