Identifying 2 same images using Java

前端 未结 10 2363
别那么骄傲
别那么骄傲 2020-12-28 21:10

I have a problem in my web crawler where I am trying to retrieve images from a particular website. Problem is that often I see images that are exactly same but different in

10条回答
  •  被撕碎了的回忆
    2020-12-28 21:16

    I've done something very similar to this before in Java and I found that the PixelGrabber class inside the java.awt.image package of the api is extremely helpful (if not downright necessary).

    Additionally you would definitely want to check out the ColorConvertOp class which can performs a pixel-by-pixel color conversion of the data in the source image and the resulting color values are scaled to the precision of the destination image. The documentation goes on to say that the images can even be the same image in which case it would be quite simple to detect if they are identical.

    If you were detecting similarity, you need to use some form of averaging method as mentioned in the answer to this question

    If you can, also check out Volume 2 chapter 7 of Horstman's Core Java (8th ed) because there's a whole bunch of examples on image transformations and the like, but again, make sure to poke around the java.awt.image package because you should find you have almost everything prepared for you :)

    G'luck!

提交回复
热议问题