mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Add find_codes unit-tests.
This commit is contained in:
parent
db4d47c67f
commit
246a39d2c5
BIN
usr/unittest/data/apriltags.pgm
Normal file
BIN
usr/unittest/data/apriltags.pgm
Normal file
Binary file not shown.
5
usr/unittest/data/barcode.pgm
Normal file
5
usr/unittest/data/barcode.pgm
Normal file
File diff suppressed because one or more lines are too long
BIN
usr/unittest/data/datamatrix.pgm
Normal file
BIN
usr/unittest/data/datamatrix.pgm
Normal file
Binary file not shown.
BIN
usr/unittest/data/qrcode.pgm
Normal file
BIN
usr/unittest/data/qrcode.pgm
Normal file
Binary file not shown.
5
usr/unittest/script/14-find_qrcodes.py
Normal file
5
usr/unittest/script/14-find_qrcodes.py
Normal 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)
|
||||
5
usr/unittest/script/15-find_apriltags.py
Normal file
5
usr/unittest/script/15-find_apriltags.py
Normal 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)
|
||||
5
usr/unittest/script/16-find_datamatrices.py
Normal file
5
usr/unittest/script/16-find_datamatrices.py
Normal 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)
|
||||
5
usr/unittest/script/17-find_barcodes.py
Normal file
5
usr/unittest/script/17-find_barcodes.py
Normal 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)
|
||||
Loading…
Reference in New Issue
Block a user