Add find_codes unit-tests.

This commit is contained in:
iabdalkader 2017-08-09 00:16:35 +02:00
parent db4d47c67f
commit 246a39d2c5
8 changed files with 25 additions and 0 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,5 @@
def unittest(data_path, temp_path):
import image
img = image.Image("unittest/data/qrcode.pgm", copy_to_fb=True)
codes = img.find_qrcodes()
return len(codes) == 1 and codes[0][0:] == (76, 36, 168, 168, 'https://openmv.io', 1, 1, 3, 4, 0)

View File

@ -0,0 +1,5 @@
def unittest(data_path, temp_path):
import image
img = image.Image("unittest/data/apriltags.pgm", copy_to_fb=True)
tags = img.find_apriltags()
return len(tags) == 1 and tags[0][0:8] == (45, 27, 69, 69, 255, 16, 80, 61)

View File

@ -0,0 +1,5 @@
def unittest(data_path, temp_path):
import image
img = image.Image("unittest/data/datamatrix.pgm", copy_to_fb=True)
matrices = img.find_datamatrices()
return len(matrices) == 1 and matrices[0][0:] == (34, 15, 90, 89, 'https://openmv.io/', 0.0, 18, 18, 18, 0)

View File

@ -0,0 +1,5 @@
def unittest(data_path, temp_path):
import image
img = image.Image("unittest/data/barcode.pgm", copy_to_fb=True)
codes = img.find_barcodes()
return len(codes) == 1 and codes[0][0:] == (61, 46, 514, 39, 'https://openmv.io/', 15, 0.0, 40)