mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Add SURF examples
This commit is contained in:
parent
2390c8bb4b
commit
03d99e2a1b
11
usr/examples/surf_detect_and_draw.py
Normal file
11
usr/examples/surf_detect_and_draw.py
Normal 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)
|
||||||
15
usr/examples/surf_detect_and_match.py
Normal file
15
usr/examples/surf_detect_and_match.py
Normal 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())
|
||||||
Loading…
Reference in New Issue
Block a user