I would like to compare two web pages images using computer vision techniques. Show what are non-unique portions comparing both images. Which part image1 not exist in image2 vice versa.

Web page image 1

Webpage Image 2


1 Answer 1


A simple and time efficent solution is the computation of the absoulte values of the difference image. This can be done as follows:

import cv2
img_a = cv2.imload([first_image_filename])
img_b = cv2.imload([second_image_filename])
img_diff = cv2.absdiff(img_a, img_b)
cv2.imshow('abs difference', img_diff)
  • $\begingroup$ Thank you I can see the difference. Is it possible to ignore the same alphabets with different font sizes(Can we show as no difference)? $\endgroup$
    – prashanth
    Apr 29, 2020 at 19:19
  • $\begingroup$ With such a low level analysis not. To ignore alphabets you would have to apply an optical character recognition (OCR) and than set regions with detected characters to 0. $\endgroup$ May 1, 2020 at 8:48
  • $\begingroup$ Thank you, I will try to apply OCR and is there any similar kind of work or any blog. $\endgroup$
    – prashanth
    May 1, 2020 at 14:19
  • $\begingroup$ I have got no specific blog in mind. Maybe learnopencv.com/tag/ocr $\endgroup$ May 1, 2020 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.