FLIR Lepton module usage on APF & OPOS
From ArmadeusWiki
Page under construction... Informations on this page are not guaranteed !!
FLIR Lepton(tm) thermal camera have been tested on APF6 and OPOS6UL platforms. This page detail how to give it a quick try.
Contents
Hardware
- you can use devt kit bought from sparkfun or digikey. Don't forget to buy breakout board AND the sensor ;-).
- only 80x60 models have been tested yet
Connecting Lepton breakout board to your Dev
Software
- Even if initially developped for platforms like RaspberryPi or BeagleBone, the following tools are able to run on APF/OPOS:
https://github.com/groupgets/LeptonModule
- flirpi: it converts and shows Lepton data to framebuffer
- raspberry_capture: it can capture Letpon frames and store it as images or raw file
- v4l2lepton: it takes data from Lepton, converts them to RGB and send them to v4l2loopback device. This way Lepton is directly usable with V4L compatible applications like gstreamer.
All these software are using spidev interface to get data from Lepton, so before using them you have to:
# modprobe spidev
flirpi/fblept
- To display IR image on framebuffer (here magnified by 8x on APF6Dev):
./fblept -m 8 -d /dev/spidev0.0
v4l2lepton
- First you have to load v4l2loopback kernel module:
# modprobe v4l2loopback
- It will create you a virtual video camera input in /dev/video0 (if you don't have another camera on your system). To check it:
# v4l2-ctl -d /dev/video0 --all
- Then launch following the command (in background) to fill virtual camera buffer with IR images:
./v4l2lepton /dev/video0 &
- Then you can use this device as a normal camera. Example to display Lepton image on APF6Dev LCD:
# gst-launch-1.0 v4l2src device=/dev/video0 ! imxg2dvideosink
- If your SOM has no IPU/2D accelerator, you can directly use software renderer in framebuffer:
# gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! videoscale ! video/x-raw,width=320,height=240 ! fbdevsink
- You can also do H.264 encoding and send the stream on the network (here 192.168.0.X is the adress of the Host PC):
# gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! videoscale ! video/x-raw,width=320,height=240,framerate=30/1 ! imxvpuenc_h264 ! rtph264pay ! udpsink host=192.168.0.X port=9001
- If you don't have any VPU (Video Processing Unit), you can use software encoding (slow):
# gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! x264enc ! rtph264pay ! udpsink host=192.168.0.X port=9001