Skip to main content

Runs a FLIR Lepton 3.5 on a Purethermal3 in Windows 10.

Project description

Shield: CC BY-SA 4.0

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

CC BY-SA 4.0

Lepton3.5_Purethermal3

Software to run a FLIR Lepton 3.5 mounted on a Groupgets Purethermal3 board running on Windows 10.

Installation

From PyPi (Reccomended)

It is reccomended that you use either Anaconda or Miniconda.

Run the commands below to create a fresh conda environment named lepton.

conda create -n lepton -y
conda activate lepton

Install pip in the environment.

conda install pip -y

Install lepton-pt

pip install lepton-pt

From Source

It is reccomended that you use either Anaconda or Miniconda.

Run the commands below to create a fresh conda environment named lepton.

conda create -n lepton -y
conda activate lepton

Install pip and git in the environment.

conda install pip git -y

Clone the Lepton3.5_Purethermal3 repository.

git clone https://github.com/GrayKS3248/Lepton3.5_Purethermal3.git

Navigate to the repository directory and install the package.

cd Lepton3.5_Purethermal3
pip install .

Usage

Streaming

After the Lepton is seated in the Purethermal board and connected to a device via a USB-C, activate the Conda environment in which this package is installed and start streaming the camera using the leprun command.

conda activate lepton
leprun

When you are finshed streaming, press the esc while the viewing window is active to terminate the streaming.

Recording

After the Lepton is seated in the Purethermal board and connected to a device via a USB-C, activate the Conda environment in which this package is installed and start streaming the camera using the leprun command and the -r flag.

conda activate lepton
leprun -r

The -r flag indicates that you want to record what is being streamed. All generated data is saved in a folder named rec_data in the current directory and after the recording is terminated, will be rendered into a .avi video also in the current directory.

When you are finshed recording, press the esc while the viewing window is active to terminate recording. Note that it will take some time after the recording is terminated to render the captured video.

Other

You can use the -h flag to explore addtional flags and functionality.

leprun -h

Homography Transform

This software supports post-processing image warping to focus on a quadrilateral region of interest (qROI). To begin, press f while the viewer window is active to open the focus window, shown in cyan. The aspect ratio and size of the focus window are adjusted using the mouse scroll wheel (the middle mouse button can be used to toggle between fast edit and slow edit). You can switch between which parameter you are adjusting using the right mouse click.

Once the focus window is set, use the left mouse button to define the four corners of the qROI, shown in magenta. The corner of the focus box to which the selected qROI corner will be transformed is shown as a magenta dot on one of the focus box corners. Once all four corners are defined, a homography transformation will be applied so the qROI occupies the focus box.

To reset the qROI, press r.

To toggle the homography transform, press f.

homography

Common Errors

Port and Socket

ImageShapeException
In function: _stream()
Captured image shape (358, 640) does not equal expected image shape
(160, 120). Are you sure the selected port is correct? NOTE: If captured
image shape is (61,80) the Lepton may be seated incorrectly and you 
should reseat its socket.
  1. The incorrect port is selected.

    To fix, try instead running:

    leprun -p A_PORT_NUMBER_THAT_IS_NOT_0
    

    Where A_PORT_NUMBER_THAT_IS_NOT_0 is any integer that is not 0. Each camera device has its own unique port identifier. This code defaults to using port 0 but if you have multiple cameras, the Lepton might be at a higher port number. The -p flag allows a users to change the selected port.

  2. The lepton is not seated properly in the Purethermal socket.

    To fix, disconnect the Purethermal from power, completely remove the Lepton from the Purethermal socket, and reinsert it. After power is restored, you can try leprun again.

Failed Recording

In some cases, a video may fail to gen generated after the recording is finished. This occurs most commonly when the recording frame rate was too low for the renderer to handle. To correct this issue avoid setting target frame rates below 5 fps.

Lost Frames Every 3 Minutes

The FLIR Lepton camera uses automatic flat field correction (FFC) during operation to ensure image fidelity and prevent pixel drift. These automatic FFCs occur every 3 minutes and are predicated by a box reading "FFC" in the top left corner of the viewing window. They last approximately 3 seconds during which no thermal or telemetry data are transmitted by the camera resulting in dropped frames. This is unavoidable for proper Lepton function. Note the renderer automatically detects the dropped frames and locally adjusts the frame rate to maintain true playback speed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lepton_pt-0.3b1.tar.gz (3.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lepton_pt-0.3b1-py3-none-any.whl (3.9 MB view details)

Uploaded Python 3

File details

Details for the file lepton_pt-0.3b1.tar.gz.

File metadata

  • Download URL: lepton_pt-0.3b1.tar.gz
  • Upload date:
  • Size: 3.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for lepton_pt-0.3b1.tar.gz
Algorithm Hash digest
SHA256 531034d47e60c66a4ef6447fb250c5284d08fdf637b1d90fcf1714e8ea03ff2c
MD5 4853348350f588b6e75ee2c9f06749c3
BLAKE2b-256 1b0066a50a8d9bc032f2bc81ceee203327913cb0cde951b8bfc1c1cc2d3d7e00

See more details on using hashes here.

File details

Details for the file lepton_pt-0.3b1-py3-none-any.whl.

File metadata

  • Download URL: lepton_pt-0.3b1-py3-none-any.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for lepton_pt-0.3b1-py3-none-any.whl
Algorithm Hash digest
SHA256 b8851398e93ff1b60375bc3bfcda44069d9e61c7913b9e0292835b17caafe447
MD5 dbbd1961d27bf9fe6fc2b897ff3efa0c
BLAKE2b-256 9ed046bf96b7946394035b2ec316c1d9668f9afea7db9d5eb9445871964dc7a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page