diff --git a/usr/examples/surf_detect_and_draw.py b/usr/examples/surf_detect_and_draw.py new file mode 100644 index 000000000..194bc605c --- /dev/null +++ b/usr/examples/surf_detect_and_draw.py @@ -0,0 +1,11 @@ +import sensor, imlib, time +clock = time.clock() +# Set sensor to grayscale +sensor.set_pixformat(sensor.GRAYSCALE) + +while (True): + image = sensor.snapshot() + clock.tick() + surf1 = imlib.surf_detector(image, False, 0.0008) + print (clock.avg()) + imlib.surf_draw_ipts(image, surf1) \ No newline at end of file diff --git a/usr/examples/surf_detect_and_match.py b/usr/examples/surf_detect_and_match.py new file mode 100644 index 000000000..873887505 --- /dev/null +++ b/usr/examples/surf_detect_and_match.py @@ -0,0 +1,15 @@ +import sensor, imlib, time +clock = time.clock() +# Set sensor to grayscale +sensor.set_pixformat(sensor.GRAYSCALE) +sensor.set_brightness(-2) +image = sensor.snapshot() +surf1 = imlib.surf_detector(image, False, 0.0004) +imlib.surf_draw_ipts(image, surf1) +time.sleep(2000) +while (True): + image = sensor.snapshot() + clock.tick() + surf2 = imlib.surf_detector(image, False, 0.0004) + imlib.surf_match(image, surf1, surf2) + print (clock.avg()) \ No newline at end of file