Myzhar / Lepton3_Jetson

Library and examples to connect the FLIR Lepton3 thermal camera to Nvidia Jetson embedded boards
MIT License
52 stars 15 forks source link

Lepton3_Jetson

Library and examples to connect the FLIR Lepton3 thermal camera to Nvidia Jetson embedded boards

More info on Myzhar website blog post

Prerequisites

Note: as pointed out by @ma-ludw in this issue, it is highly recommended to run the jetson_clocks.sh script in order to obtain the maximum performances from the Jetson Nano and hence reduce the amount of missed frames.

Software Installation

Install build requirements

$ sudo apt install build-essential g++ libopencv-dev

Install latest CMake

At least CMake 3.15 is required. Check your current version:

cmake --version

Download CMake 3.18 sources:

version=3.18
build=1
mkdir ~/temp
cd ~/temp
wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz
tar -xzvf cmake-$version.$build.tar.gz
cd cmake-$version.$build/

Build and install:

./bootstrap
make -j$(nproc)
sudo make install

Note: in case you get an error about OpenSSL not found, you can install it using the command: sudo apt-get install libssl-dev

Verify:

cmake --version

Build the project

Clone this repository

$ git clone https://github.com/Myzhar/Lepton3_Jetson.git

Compile

$ mkdir build
$ cd build
$ cmake ..
$ make
$ cd ..

Camera connection

Detailed instruction about how to connect the Lepton3 module to a Nvidia Jetson Nano are available on Myzhar's website.

SPI buffer size change

The default buffer size use for SPI communication is set to 4096 bytes by the spidev module. Lepton3 requires 20KB of buffer to retrieve a full segment of data that composes the thermal image.

You can get the procedure to change the size of the SPI buffer for the Jetson Nano on the Myzhar's blog.

Run the Demos

Two examples are provided to illustrate how to use the lepton3_grabber static library available in the folder build/grabber_lib.

OpenCV Demo

With this sample you can see how to use OpenCV to display the thermal stream and control the camera behaviors

$ cd build/opencv_demo
$ ./opencv_demo

Keyboard commands:

Fever control demo

With this demo you can see how to estimate temperatures from 16 bit gray images to evaluate the temperature of a person and get alarms in case of fever. I created this demo as a security sample application to be used in the COVID19 period.

$ cd build/check_fever_app
$ ./check_fever_app

Using keyboard u/d you can increase/decrease the estimated temperature su simulate person fever.

See the demo on YouTube

| |