mirror of
https://github.com/openmv/openmv.git
synced 2025-09-26 23:09:13 +08:00
scripts/examples: Add FLIR Boson examples.
This commit is contained in:
parent
5ef4e0d0b5
commit
ef0a089948
@ -0,0 +1,33 @@
|
||||
# This work is licensed under the MIT license.
|
||||
# Copyright (c) 2013-2024 OpenMV LLC. All rights reserved.
|
||||
# https://github.com/openmv/openmv/blob/master/LICENSE
|
||||
#
|
||||
# Single Color Grayscale Blob Tracking Example
|
||||
#
|
||||
# This example shows off single color grayscale tracking using the OpenMV Cam using the FLIR Boson.
|
||||
|
||||
import sensor
|
||||
import time
|
||||
|
||||
# Color Tracking Thresholds (Grayscale Min, Grayscale Max)
|
||||
threshold_list = [(220, 255)]
|
||||
|
||||
sensor.reset()
|
||||
sensor.set_pixformat(sensor.GRAYSCALE)
|
||||
sensor.set_framesize(sensor.VGA)
|
||||
sensor.skip_frames(time=5000)
|
||||
clock = time.clock()
|
||||
|
||||
# Only blobs that with more pixels than "pixel_threshold" and more area than "area_threshold" are
|
||||
# returned by "find_blobs" below. Change "pixels_threshold" and "area_threshold" if you change the
|
||||
# camera resolution. "merge=True" merges all overlapping blobs in the image.
|
||||
|
||||
while True:
|
||||
clock.tick()
|
||||
img = sensor.snapshot()
|
||||
for blob in img.find_blobs(
|
||||
threshold_list, pixels_threshold=200, area_threshold=200, merge=True
|
||||
):
|
||||
img.draw_rectangle(blob.rect(), color=127)
|
||||
img.draw_cross(blob.cx(), blob.cy(), color=127)
|
||||
print(clock.fps())
|
@ -0,0 +1,21 @@
|
||||
# This work is licensed under the MIT license.
|
||||
# Copyright (c) 2013-2024 OpenMV LLC. All rights reserved.
|
||||
# https://github.com/openmv/openmv/blob/master/LICENSE
|
||||
#
|
||||
# This example shows off streaming the default grayscale 8-bit AGC image from the FLIR Boson.
|
||||
|
||||
import sensor
|
||||
import time
|
||||
|
||||
sensor.reset()
|
||||
sensor.set_pixformat(sensor.GRAYSCALE) # Must always be grayscale.
|
||||
sensor.set_framesize(sensor.VGA) # Must always be VGA or QVGA.
|
||||
|
||||
clock = time.clock()
|
||||
|
||||
while True:
|
||||
clock.tick()
|
||||
|
||||
img = sensor.snapshot()
|
||||
|
||||
print(clock.fps())
|
@ -0,0 +1,35 @@
|
||||
# This work is licensed under the MIT license.
|
||||
# Copyright (c) 2013-2024 OpenMV LLC. All rights reserved.
|
||||
# https://github.com/openmv/openmv/blob/master/LICENSE
|
||||
#
|
||||
# Single Color RGB565 Blob Tracking Example
|
||||
#
|
||||
# This example shows off single color RGB565 tracking using the OpenMV Cam using the FLIR BOSON.
|
||||
|
||||
import sensor
|
||||
import time
|
||||
import image
|
||||
|
||||
# Color Tracking Thresholds (L Min, L Max, A Min, A Max, B Min, B Max)
|
||||
threshold_list = [(70, 100, -30, 40, 20, 100)]
|
||||
|
||||
sensor.reset()
|
||||
sensor.set_pixformat(sensor.GRAYSCALE)
|
||||
sensor.set_framesize(sensor.VGA)
|
||||
sensor.set_color_palette(image.PALETTE_IRONBOW)
|
||||
sensor.skip_frames(time=5000)
|
||||
clock = time.clock()
|
||||
|
||||
# Only blobs that with more pixels than "pixel_threshold" and more area than "area_threshold" are
|
||||
# returned by "find_blobs" below. Change "pixels_threshold" and "area_threshold" if you change the
|
||||
# camera resolution. "merge=True" merges all overlapping blobs in the image.
|
||||
|
||||
while True:
|
||||
clock.tick()
|
||||
img = sensor.snapshot()
|
||||
for blob in img.find_blobs(
|
||||
threshold_list, pixels_threshold=200, area_threshold=200, merge=True
|
||||
):
|
||||
img.draw_rectangle(blob.rect())
|
||||
img.draw_cross(blob.cx(), blob.cy())
|
||||
print(clock.fps())
|
@ -0,0 +1,23 @@
|
||||
# This work is licensed under the MIT license.
|
||||
# Copyright (c) 2013-2024 OpenMV LLC. All rights reserved.
|
||||
# https://github.com/openmv/openmv/blob/master/LICENSE
|
||||
#
|
||||
# This example shows off streaming an ironbow image from the FLIR Boson.
|
||||
|
||||
import sensor
|
||||
import time
|
||||
import image
|
||||
|
||||
sensor.reset()
|
||||
sensor.set_pixformat(sensor.GRAYSCALE) # Must always be grayscale.
|
||||
sensor.set_framesize(sensor.VGA) # Must always be VGA or QVGA.
|
||||
sensor.set_color_palette(image.PALETTE_IRONBOW)
|
||||
|
||||
clock = time.clock()
|
||||
|
||||
while True:
|
||||
clock.tick()
|
||||
|
||||
img = sensor.snapshot()
|
||||
|
||||
print(clock.fps())
|
@ -8,6 +8,7 @@
|
||||
"examples/01-Camera/03-Event-Cameras/02-Genx320", ".+", "(GENX320)", ""
|
||||
"examples/01-Camera/04-Global-Shutter", ".+", "(MT9V0X2|MT9V0X2-C|MT9V0X4|MT9V0X4-C)", ""
|
||||
"examples/01-Camera/05-Thermal-Cameras/01-FLIR-Lepton", ".+", "(LEPTON|LEPTON-1.5|LEPTON-1.6|LEPTON-2.0|LEPTON-2.5|LEPTON-3.0|LEPTON-3.5)", ""
|
||||
"examples/01-Camera/05-Thermal-Cameras/02-FLIR-Boson", ".+", "(BOSON|BOSON-320|BOSON-640)", ""
|
||||
"examples/01-Camera/06-Time-of-Flight", ".+", "^(?!None).*$", ""
|
||||
"examples/01-Camera/07-Sensor-Control", ".+", "^(?!None).*$", ""
|
||||
"examples/01-Camera/08-Readout-Control", ".+", "^(?!None).*$", ""
|
||||
|
Can't render this file because it contains an unexpected character in line 1 and column 3.
|
Loading…
Reference in New Issue
Block a user