2016-12-01 8 views

Antwort

0

Versuchen Sie mit Bild-Arrays zu arbeiten. Es ist nicht Ihre Lösung, aber hier ist ein Beispiel:

from PIL import Image 
import numpy as np 

book_a = Image.open('booka.png') 
book_b = Image.open('bookb.png') 

#Which image do you like to compare? 
input = book_b #book_a of book_b 

print('*** Numpy array Book A') 

book_a_ar = np.asarray(book_a) 
print(book_a_ar) 

print('*** Numpy array Book B') 

book_b_ar = np.asarray(book_b) 
print(book_b_ar) 

#BOOK C is in use to compare those images 

print('*** Numpy array Book C') 
book_C_ar = np.asarray(input) 
print(book_C_ar) 

#compare 

if np.all(book_b_ar == book_C_ar): 
    print('True') 

else: 
    print('False') 

auch einen Blick auf diese: Microcontrollers