FLIR Thermal Camera Person Detection

Discussion related to "under the hood" OpenMV topics.
User avatar
kwagyeman
Posts: 3406
Joined: Sun May 24, 2015 2:10 pm

FLIR Thermal Camera Person Detection

Postby kwagyeman » Fri May 17, 2019 2:18 am

Ibrahim made this example script showing off person detection using the FLIR Thermal camera. Works with any FLIR Lepton.

Code: Select all

import sensor, image, time, os, nn

sensor.reset()                         # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE)    # Set pixel format to RGB565
sensor.set_framesize(sensor.QQVGA)      # Set frame size to QVGA (320x240)
sensor.set_windowing((32, 64))       # Set 128x128 window.
sensor.skip_frames(time=1000)

net = nn.load('/person.network')

clock = time.clock()                # Create a clock object to track the FPS.
while(True):
    clock.tick()                    # Update the FPS clock.
    img = sensor.snapshot()         # Take a picture and return the image.
    out = net.forward(img, softmax=True)
    if out.index(max(out)) == 0:
        print("person detected")
Save the person.network to your SD card.
Attachments
person.zip
(64.08 KiB) Downloaded 293 times
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests