Compare two PIL images in Python


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. h1 = Image.open("image1").histogram()
  2. h2 = Image.open("image2").histogram()
  3.  
  4. rms = math.sqrt(reduce(operator.add,
  5. map(lambda a,b: (a-b)**2, h1, h2))/len(h1))

URL: http://mail.python.org/pipermail/image-sig/1997-March/000223.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.