This repository provides step-by-step instructions to set up and use a thermal camera (e.g., FLIR Lepton) with the PureThermal 2 interface board. It also includes preliminary exercises to validate that the hardware and software are correctly configured before running the final project.
- Real-time thermal video visualization.
- Highlights the hottest and coldest points in the frame, displaying their temperatures.
- A side color bar shows the temperature range (red = hottest, blue = coldest).
- PureThermal 2 interface board.
- FLIR Lepton camera module.
- A computer running Linux (tested on Ubuntu).
- Python 3.x.
- Required libraries:
libuvc.OpenCV.numpy.
Clone this repository to your local machine:
git clone https://github.com/Clarrainl/thermal-camera.git
cd thermal-cameraInstall the required libraries and dependencies:
sudo apt update
sudo apt install -y build-essential cmake libusb-1.0-0-dev libjpeg-dev python3-pip libgtk2.0-dev libgtk-3-dev python3-opencvClone the libuvc repository and build it on your machine:
git clone https://github.com/groupgets/libuvc.git
cd libuvc
mkdir build && cd build
cmake ..
make
sudo make install
sudo ldconfigExpected result: The make command should complete without errors, showing output like:
[100%] Built target uvc
A virtual environment has already been created in the file directory of this repository. To activate it, run:
cd file
source thermcam/bin/activateThis ensures all dependencies are properly installed and isolated for this project.
The main script for the project is uvc-radiometry-celsius.py. Navigate to the directory and activate the environment before running:
cd file
source thermcam/bin/activate
sudo python3 uvc-radiometry-celsius.pyExpected result:
- The thermal image will be displayed in real-time.
- The hottest and coldest points will be highlighted in red and blue, respectively.
- Their temperatures will be displayed in white.
- A color bar on the right will indicate the temperature range.
Press q to exit the program.
- Ensure the camera is properly connected.
- Verify detection with:
ls /dev/video*
If no device appears, check the USB connection.
If you encounter errors like:
- The function is not implemented.
- Cannot query video position.
Ensure OpenCV is installed via:
sudo apt update
sudo apt install python3-opencvthermal-camera-project/
├── README.md # Documentation
├── LICENSE # License information
├── file/ # Main directory for scripts and virtual environment
│ ├── thermcam/ # Virtual environment for the project
│ ├── uvc-deviceinfo.py # Camera info script
│ ├── uvc-radiometry.py # Basic thermal data stream
│ └── uvc-radiometry-celsius.py # Final project script
The final thermal video includes:
- Real-time thermal visualization.
- Hottest (red) and coldest (blue) points highlighted.
- A color bar on the right showing the temperature range:
- Creation of GitHub template: Marita Georganta - Robotic Sensing Expert
- Creation of MRAC-IAAC GitHub Structure: Huanyu Li - Robotic Researcher
