Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created May 29, 2015 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/b0bc5d3b952dfdef76d0 to your computer and use it in GitHub Desktop.
Save anonymous/b0bc5d3b952dfdef76d0 to your computer and use it in GitHub Desktop.
import numpy as np
import cv2
global n
n = 0
img1 = cv2.imread('testimg.jpg', 0)
img2 = cv2.imread('testimg_diff.jpg', 0)
height, width = img1.shape
for line in range(height):
for pixel in range(width):
if img1[line][pixel] != img2[line][pixel]:
n = n + 1
print n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment