Justin Lutz
Published © MIT

See around corners with a thermal camera!

With thermal imaging, glass acts as a mirror. Therefore, you can use picture frames and other glass objects to see reflections!

IntermediateFull instructions provided2 hours1,173
See around corners with a thermal camera!

Things used in this project

Hardware components

OpenMV Cam M7
OpenMV Cam M7
×1
FLIR Lepton FS
×1
FLIR Lepton adaptor module
×1

Software apps and online services

Edge Impulse Studio
Edge Impulse Studio
OpenMV IDE

Story

Read more

Code

Edge Impulse edited python script

Python
# Edge Impulse - OpenMV Image Classification Example

import sensor, image, time, os, tf

sensor.reset()                         # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE)    # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QVGA)      # Set frame size to QVGA (320x240)
sensor.set_windowing((240, 240))       # Set 240x240 window.
sensor.skip_frames(time=2000)          # Let the camera adjust.

net = "trained.tflite"
labels = [line.rstrip('\n') for line in open("labels.txt")]

clock = time.clock()
found = 0
if not "images" in os.listdir(): os.mkdir("images")
while(True):
    clock.tick()

    img = sensor.snapshot()

    # default settings just do one detection... change them to search the image...
    for obj in tf.classify(net, img, min_scale=1.0, scale_mul=0.8, x_overlap=0.5, y_overlap=0.5):
        print("**********\nPredictions at [x=%d,y=%d,w=%d,h=%d]" % obj.rect())
        img.draw_rectangle(obj.rect())
        # This combines the labels and confidence values into a list of tuples
        predictions_list = list(zip(labels, obj.output()))

        #person found!
        if predictions_list[1][1] > 0.75:
            img.draw_string(10,130,"Person found!")
            print("Person found!!!\n")
            file_name = "images/person_" + str(found) + ".jpeg"
            img = img.save(file_name)
            found = found+1
            print("Saved " + file_name)

    print(clock.fps(), "fps")
    time.sleep(1)

Credits

Justin Lutz
24 projects • 40 followers
Quality manager by day, tinkerer by night. Avid runner. You can tell I'm a dad because of my jokes.
Contact

Comments

Please log in or sign up to comment.