Coder Social home page Coder Social logo

lookup's Introduction

Look Up

Thermal imaging, also known as infrared imaging, allows us to visualize and capture thermal energy emitted by objects in the form of heat. By detecting these temperature variations, thermal cameras provide a unique perspective that extends beyond what our naked eyes can perceive. This ability to see the invisible heat signatures makes thermal imaging invaluable across a multitude of industries and applications.

The Lepton FLIR camera is a compact and versatile thermal imaging solution that brings professional-grade thermal imaging capabilities to a broad range of consumer applications. The Lepton camera integrates an advanced microbolometer sensor that captures infrared radiation with remarkable precision and allows us to visualise the invisible.

LookUp demonstrates the capabilities of the FLIR Lepton when connected to a low cost Raspberry PI single board computer utilising the pylepton library to control the camera via Python

How is the image generated?

The microbolometer sensor consists of an array of 80x60 tiny thermal detectors. These detectors can sense the infrared radiation emitted by objects in the form of heat which translates to a "pixel" value. Each "pixel" measures the temperature of the corresponding portion of the scene being captured. The temperature readings are converted into electrical signals proportional to the detected heat energy. After some internal signal processing to amplifying, filter, and digitize the signal, algorithms reconstruct the "pixels" into a thermal image.

Since thermal imaging captures temperature differences rather than colors, a color mapping scheme is applied to the thermal image to enhance its interpretability. This involves assigning different colors or color gradients to different temperature ranges, creating a pseudo-color representation of the thermal data. The color mapping allows users to easily distinguish and analyze temperature variations within the scene. In this example we use the "White Hot" colour palette.

sample image

What does the code do?

The simplest example to get started is example_lepton_capture.py. This opens the camera, takes a reading and then saves it as a file. The overview below describes what is happening.

We utlise the pylepton library so need to import it at the start.

from pylepton import Lepton

capture() calls a read of the sensor which returns a tuple that includes an array of sensor values from and a unique frame ID. Lepton frames can update at ~27 Hz, but only unique ones are returned at ~9 Hz.

with Lepton() as l:
  a,_ = l.capture()

We us a function from the computer vision library cv2 to normalise the range of values between the maximum and minumum values in the sensor array. This improves the contrast of the image since the coldest sensor value is set to black and the warmest set to white. This is also why the image looks more "grainy" when there is no one in the scene since the temperature variation in small.

cv2.normalize(a, a, 0, 65535, cv2.NORM_MINMAX) 

Image data from capture() is 12-bit, in this next step we convert it to 8 bits and then write it to a file to save as an image.

np.right_shift(a, 8, a) # fit data into 8 bits
cv2.imwrite("output.jpg", np.uint8(a)) # write it!

In this repository

  • exhibition_lepton.py - code used in Testing Ground exhibtion at UCL East
  • example_xxx.py - example code to test cameras
  • testing folder - random examples

lookup's People

Contributors

djdunc avatar

Stargazers

August Weinbren avatar

Watchers

 avatar August Weinbren avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.