mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Update MLX example
This commit is contained in:
parent
7358952c14
commit
3eddaa5c10
@ -21,18 +21,22 @@ sensor.__write_reg(0x18, 0x43)
|
|||||||
|
|
||||||
# FPS clock
|
# FPS clock
|
||||||
clock = time.clock()
|
clock = time.clock()
|
||||||
|
ta=to_min=to_max=0.0
|
||||||
|
|
||||||
while (True):
|
while (True):
|
||||||
clock.tick()
|
clock.tick()
|
||||||
# Capture an image
|
# Capture an image
|
||||||
image = sensor.snapshot()
|
image = sensor.snapshot()
|
||||||
|
image.draw_string(0, 0, "Ta: %0.2f"%ta, (0xFF, 0x00, 0x00))
|
||||||
|
image.draw_string(0, 5, "To min: %0.2f"%(to_min+ta), (0xFF, 0x00, 0x00))
|
||||||
|
image.draw_string(0, 10, "To max: %0.2f"%(to_max+ta), (0xFF, 0x00, 0x00))
|
||||||
|
|
||||||
# Capture an FIR image
|
# Capture an FIR image
|
||||||
ir = mlx.read(mlx.RAINBOW)
|
ta, to_min, to_max, ir = mlx.read(mlx.RAINBOW, 50, 0.90)
|
||||||
|
|
||||||
# Scale the image and belnd it with the framebuffer
|
# Scale the image and belnd it with the framebuffer
|
||||||
ir.scale((160, 32))
|
ir.scale((160, 32))
|
||||||
image.blend(ir, (0, 48, 0.6))
|
image.blend(ir, (0, int(120/2-32/2), 0.6))
|
||||||
|
|
||||||
# Print FPS.
|
# Print FPS.
|
||||||
print(clock.fps())
|
print(clock.fps())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user