mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Co-authored-by: Kwabena W Agyeman <kwagyeman@users.noreply.github.com> Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
23 lines
663 B
Python
23 lines
663 B
Python
def unittest(data_path, temp_path):
|
|
import image
|
|
|
|
# Load image and find keypoints
|
|
img = image.Image(data_path + "/graffiti.pgm", copy_to_fb=True)
|
|
kpts1 = img.find_keypoints(max_keypoints=50, threshold=20, normalized=False)
|
|
|
|
# Load descriptor
|
|
kpts2 = image.load_descriptor(data_path + "/graffiti.orb")
|
|
|
|
# Match keypoints
|
|
match = image.match_descriptor(kpts1, kpts2, threshold=85)
|
|
return (
|
|
match.cx() == 143
|
|
and match.cy() == 108
|
|
and match.x() == 36
|
|
and match.y() == 34
|
|
and match.w() == 251
|
|
and match.h() == 141
|
|
and match.count() == 50
|
|
and match.theta() == 0
|
|
)
|