Add template and eye unit-tests.

This commit is contained in:
iabdalkader 2017-08-10 16:02:19 +02:00
parent 7d05519518
commit b65bd2cb87
4 changed files with 37 additions and 0 deletions

25
usr/unittest/data/eye.pgm Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,7 @@
def unittest(data_path, temp_path):
import image
from image import SEARCH_EX, SEARCH_DS
img = image.Image("unittest/data/graffiti.pgm", copy_to_fb=True)
temp = image.Image("unittest/data/template.pgm", copy_to_fb=False)
r = img.find_template(temp, 0.70, step=4, search=SEARCH_DS)
return r == (150, 128, 40, 40)

View File

@ -0,0 +1,5 @@
def unittest(data_path, temp_path):
import image
img = image.Image("unittest/data/eye.pgm", copy_to_fb=True)
iris = img.find_eye((100, 70, 250, 100))
return iris == (159, 114)