Image comparison algorithm

前端 未结 9 1613
礼貌的吻别
礼貌的吻别 2020-11-28 00:48

I\'m trying to compare images to each other to find out whether they are different. First I tried to make a Pearson correleation of the RGB values, which works also quite go

9条回答
  •  迷失自我
    2020-11-28 01:18

    I guess you could do something like this:

    • estimate vertical / horizontal displacement of reference image vs the comparison image. a simple SAD (sum of absolute difference) with motion vectors would do to.

    • shift the comparison image accordingly

    • compute the pearson correlation you were trying to do

    Shift measurement is not difficult.

    • Take a region (say about 32x32) in comparison image.
    • Shift it by x pixels in horizontal and y pixels in vertical direction.
    • Compute the SAD (sum of absolute difference) w.r.t. original image
    • Do this for several values of x and y in a small range (-10, +10)
    • Find the place where the difference is minimum
    • Pick that value as the shift motion vector

    Note:

    If the SAD is coming very high for all values of x and y then you can anyway assume that the images are highly dissimilar and shift measurement is not necessary.

提交回复
热议问题