Add SURF examples

This commit is contained in:
iabdalkader 2014-03-22 19:41:53 +02:00
parent 2390c8bb4b
commit 03d99e2a1b
2 changed files with 26 additions and 0 deletions

View File

@ -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)

View File

@ -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())