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.3b6.tar.gz (3.0 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.3b6-py3-none-any.whl (3.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lepton_pt-0.3b6.tar.gz
  • Upload date:
  • Size: 3.0 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.3b6.tar.gz
Algorithm Hash digest
SHA256 1d70dc0e3ee789d5d7ef7e9ee82229419d2c7880f1b3e0d8dfed15fb77fac5df
MD5 f73bdd6a4bd9a5e9cabbb39958c905a9
BLAKE2b-256 9b38ebfc85737e21f63b5dd4d12f66cbe6263a255bfcfeda3ee6c3cbb9ee58dc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lepton_pt-0.3b6-py3-none-any.whl
  • Upload date:
  • Size: 3.0 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.3b6-py3-none-any.whl
Algorithm Hash digest
SHA256 e52b7e2b5f58e055c4da9f2adb1c51ba6d1ee7daf6343969a0ef4bbbe42e6601
MD5 39a5fb99567b07e1de619d759726a5f5
BLAKE2b-256 d54ab1136e81500a46536c9232bfdd72420823f47f445cdab482de18e1c14118

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