Comparing images with different resolutions

前端 未结 2 1826
無奈伤痛
無奈伤痛 2020-12-06 12:15

Is there possible to compare two images with different resolutions?

I mean here some algorithmic/programming approach. For instance, now I calculate hash co

2条回答
  •  情话喂你
    2020-12-06 13:03

    Two very simple perceptual hashing methods you might give a try before venturing into more complicated territory are based on the Discrete Cosine Transform and the local vs glocal mean of an image:

    1. Convert image to grayscale

      1.1 (EDIT) Make your image zero mean

    2. Crush your image down to thumbnail size, say [32x32]
    3. Run the two dimensional Discrete Cosine Transform
    4. Keep the top left [8 x 8], most significant low frequency components
    5. Binarize the block, based on the sign of the components
    6. Result is a 64 bit hash

    And a variant on this theme would be

    1. Convert image to grayscale
    2. Optionally re-size to a predefined size.
    3. Partition the image in a fixed number of blocks
    4. Determine the global mean
    5. Determine the local mean per block
    6. For the hash, write out a 1 or a 0 per block, pending if the local mean was larger or smaller than the global mean.

    Also, have a look at phash.

提交回复
热议问题