Image comparison with php + gd

后端 未结 4 1763
眼角桃花
眼角桃花 2020-12-28 21:15

What\'s the best approach to comparing two images with php and the Graphic Draw (GD) Library?

This is the scenario:

I have an image, and I want to

4条回答
  •  清酒与你
    2020-12-28 21:54

    I would suggest, like middaparka, that you do not downsample to a 1 pixel only image, because you loose all the spatial information. Downsampling to 16x16 (or 32x32, etc.) would certainly provide better results.

    Then it also depends on whether color information is important or not to you. From what I understand you could actually do without it and compute a gray-level image starting from your color image (e.g. luma) and compute the cross-correlation. If, like you said, there is a couple of images that matches exactly (except for color information) this should give you a pretty good reliability.

提交回复
热议问题