Created
May 29, 2015 08:15
-
-
Save anonymous/b0bc5d3b952dfdef76d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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