mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Add template and eye unit-tests.
This commit is contained in:
parent
7d05519518
commit
b65bd2cb87
25
usr/unittest/data/eye.pgm
Normal file
25
usr/unittest/data/eye.pgm
Normal file
File diff suppressed because one or more lines are too long
BIN
usr/unittest/data/template.pgm
Normal file
BIN
usr/unittest/data/template.pgm
Normal file
Binary file not shown.
7
usr/unittest/script/18-find_template.py
Normal file
7
usr/unittest/script/18-find_template.py
Normal 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)
|
||||
5
usr/unittest/script/19-find_eye.py
Normal file
5
usr/unittest/script/19-find_eye.py
Normal 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)
|
||||
Loading…
Reference in New Issue
Block a user