# MLX90621 Camera Demo # # This example shows off how to overlay a heatmap onto your OpenMV Cam's # live video output from the main camera. import image, time, fir, lcd # Initialize the thermal sensor fir.init(type=fir.FIR_MLX90621) # Init the lcd. lcd.init() # FPS clock clock = time.clock() while (True): clock.tick() img = fir.snapshot(copy_to_fb=True) lcd.display(img) # Print FPS. print(clock.fps())
# AMG8833 Camera Demo # # This example shows off how to overlay a heatmap onto your OpenMV Cam's # live video output from the main camera. import image, time, fir # Initialize the thermal sensor fir.init(type=fir.FIR_AMG8833) # FPS clock clock = time.clock() while (True): clock.tick() img = fir.snapshot(copy_to_fb=True) # Print FPS. print(clock.fps())
# Set sensor settings sensor.set_contrast(1) sensor.set_brightness(0) sensor.set_saturation(2) sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QQVGA) # The following registers fine-tune the image # sensor window to align it with the FIR sensor. if (sensor.get_id() == sensor.OV2640): sensor.__write_reg(0xFF, 0x01) # switch to reg bank sensor.__write_reg(0x17, 0x19) # set HSTART sensor.__write_reg(0x18, 0x43) # set HSTOP # Initialize the thermal sensor fir.init() # FPS clock clock = time.clock() while (True): clock.tick() # Capture an image image = sensor.snapshot() # Capture FIR data # ta: Ambient temperature # ir: Object temperatures (IR array) # to_min: Minimum object temperature # to_max: Maximum object temperature
# MLX90621 Camera Demo # # This example shows off how to overlay a heatmap onto your OpenMV Cam's # live video output from the main camera. import image, time, fir # Initialize the thermal sensor fir.init(type=fir.FIR_MLX90621) # FPS clock clock = time.clock() while (True): clock.tick() img = fir.snapshot(copy_to_fb=True) # Print FPS. print(clock.fps())
# Thermal Camera Demo # # This example shows off how to overlay a heatmap onto your OpenMV Cam's # live video output from the main camera. import image, time, fir drawing_hint = image.BICUBIC # or image.BILINEAR or 0 (nearest neighbor) # Initialize the thermal sensor fir.init() w = fir.width() h = fir.height() if (fir.type() == fir.FIR_MLX90621): w = w * 10 h = h * 10 elif (fir.type() == fir.FIR_MLX90640): w = w * 10 h = h * 10 elif (fir.type() == fir.FIR_AMG8833): w = w * 20 h = h * 20 # FPS clock clock = time.clock() while (True): clock.tick() try:
# This example shows off how to overlay a heatmap onto your OpenMV Cam's # live video output from the main camera. import sensor, image, time, fir, lcd drawing_hint = image.BICUBIC # or image.BILINEAR or 0 (nearest neighbor) ALT_OVERLAY = False # Set to True to allocate a second ir image. sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QQVGA2) sensor.skip_frames(time=2000) # Initialize the thermal sensor fir.init(type=fir.FIR_MLX90640, refresh=32) # 16Hz, 32Hz or 64Hz. # Init the lcd. lcd.init() # Allocate another frame buffer for smoother video. extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565) # FPS clock clock = time.clock() while (True): clock.tick() # Capture an image
# MLX90640 Overlay Demo # # This example shows off how to overlay a heatmap onto your OpenMV Cam's # live video output from the main camera. import sensor, image, time, fir ALT_OVERLAY = False # Set to True to allocate a second ir image. sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QQVGA) sensor.skip_frames(time = 2000) # Initialize the thermal sensor fir.init(type=fir.FIR_MLX90640, refresh=16) # Hz (higher end OpenMV Cam's may be able to run faster) # Allocate another frame buffer for smoother video. extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565) # FPS clock clock = time.clock() while (True): clock.tick() # Capture an image img = sensor.snapshot() # Capture FIR data # ta: Ambient temperature
# AMG8833 Overlay Demo # # This example shows off how to overlay a heatmap onto your OpenMV Cam's # live video output from the main camera. import sensor, image, time, fir ALT_OVERLAY = False # Set to True to allocate a second ir image. sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QQVGA) sensor.skip_frames(time = 2000) # Initialize the thermal sensor fir.init(type=fir.FIR_AMG8833) # Allocate another frame buffer for smoother video. extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565) # FPS clock clock = time.clock() while (True): clock.tick() # Capture an image img = sensor.snapshot() # Capture FIR data # ta: Ambient temperature
# MLX90640 Camera Demo # # This example shows off how to overlay a heatmap onto your OpenMV Cam's # live video output from the main camera. import image, time, fir, lcd # Initialize the thermal sensor fir.init(type=fir.FIR_MLX90640, refresh=16) # Hz (higher end OpenMV Cam's may be able to run faster) # Init the lcd. lcd.init() # FPS clock clock = time.clock() while (True): clock.tick() img = fir.snapshot(copy_to_fb=True) lcd.display(img) # Print FPS. print(clock.fps())
# Thermal Camera Demo # # This example shows how to use common low-res FIR sensors (like MLX or AMG). # NOTE: Only the AMG8833 is currently enabled for NANO RP2040. import image, time, fir IMAGE_SCALE = 5 # Higher scaling uses more memory. drawing_hint = image.BICUBIC # or image.BILINEAR or 0 (nearest neighbor) # Initialize the thermal sensor fir.init() #Auto-detects the connected sensor. w = fir.width() * IMAGE_SCALE h = fir.height() * IMAGE_SCALE # FPS clock clock = time.clock() while (True): clock.tick() try: img = fir.snapshot(x_size=w, y_size=h, color_palette=fir.PALETTE_IRONBOW, hint=drawing_hint, copy_to_fb=True) except OSError: continue # Print FPS.
# MLX90640 Camera Demo # # This example shows off how to overlay a heatmap onto your OpenMV Cam's # live video output from the main camera. import image, time, fir drawing_hint = image.BICUBIC # or image.BILINEAR or 0 (nearest neighbor) # Initialize the thermal sensor fir.init(type=fir.FIR_MLX90640) w = fir.width() * 10 h = fir.height() * 10 # FPS clock clock = time.clock() while (True): clock.tick() try: img = fir.snapshot(x_size=w, y_size=h, color_palette=fir.PALETTE_IRONBOW, hint=drawing_hint, copy_to_fb=True) except OSError: continue # Print FPS. print(clock.fps())