Matching similar images in OpenCV

前端 未结 3 1375
野性不改
野性不改 2021-01-15 23:23

I have two sets of images, {H} and {L}. {H} consists of 512x512 images. {L} consists of all of the images in {H}, but scaled down to 32x32-128x128 and with compression artif

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-15 23:54

    I have 15 years of experience doing image processing, and usually when I have to precisely align two almost same (but maybe slightly different) image layers in Photoshop, I set the top layer’s blending mode to be Exclusion (ie. XOR). This makes the image all black, when all the pixels are precisely the same values.

    You could do something similar with OpenCV.

    Make sure you downsample the larger image to match the dimensions of the smaller image with the same interpolation as the thumbnail has been scaled down with. This can be Nearest Neighbor ie. pick every nth pixel in a grid (rounded to whole pixels or pixel boundaries) or Bicubic (one pixel is calculated form interpolated between a 4*n pixels) type. Nearest Neighbour is obviously faster...

    Then make a histogram and calculate some statistics or even an FFT of the difference.

提交回复
热议问题