Giter Club home page Giter Club logo

pylepton's People

Contributors

brandoncurtis avatar kekiefer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pylepton's Issues

"failed to get a buffer from the pool"

Hi,

when I run pylepton_overlay I'm getting error message "PiCameraRuntimeError: failed to get a buffer from the pool"

Pylepton_capture works well, raspistill -o image.jpg is working too.

any advice?

Thanks!

Unable to detect the camera

I am getting the following error after connecting lepton camera with Rasberry Pi 3 B

mmal: mmal_vc_component_create: failed to create component ‘vc.ril.camera’ (1:ENOMEM)

mmal: mmal_component_create_core: could not create component ‘vc.ril.camera’ (1)

Traceback (most recent call last):

File “/usr/local/bin/pylepton_overlay”, line 66, in

main(flip_v = options.flip_v, alpha = options.alpha, device = options.device)

File “/usr/local/bin/pylepton_overlay”, line 17, in main

with picamera.PiCamera() as camera:

File “/usr/lib/python2.7/dist-packages/picamera/camera.py”, line 431, in init

self._init_camera(camera_num, stereo_mode, stereo_decimate)

File “/usr/lib/python2.7/dist-packages/picamera/camera.py”, line 460, in _init_camera

“Camera is not enabled. Try running ‘sudo raspi-config’ “

picamera.exc.PiCameraError: Camera is not enabled. Try running ‘sudo raspi-config’ and ensure that the camera has been enabled.

But I have enabled the camera and checked all the connections as well

pylepton_overlay -a 155 error

When i run "pylepton_overlay -a 155" command i get the following error. However both my cameras (pi camera and flir lepton are working fine if i run them individually)
When i run "pylepton_capture output.png" this command it also works fine and captures a picture.

i am only facing the issue while running "pylepton_overlay -a 155"

Traceback (most recent call last):
File "_ctypes/callbacks.c", line 315, in 'calling callback function'
File "/home/pi/.local/lib/python2.7/site-packages/picamera/mmalobj.py", line 1227, in wrapper
self._pool.send_buffer(block=False)
File "/home/pi/.local/lib/python2.7/site-packages/picamera/mmalobj.py", line 1931, in send_buffer
super(MMALPortPool, self).send_buffer(port, block, timeout)
File "/home/pi/.local/lib/python2.7/site-packages/picamera/mmalobj.py", line 1881, in send_buffer
raise PiCameraMMALError(mmal.MMAL_EAGAIN, 'no buffers available')
picamera.exc.PiCameraMMALError: no buffers available: Resource temporarily unavailable; try again later

Black images

The code gets stuck in the while loop in capture, if i remove it I only get black images. It also seems like some of the code is missing since the while loop has no definition.

Is it possible to Stop Camera from adjusting exposure

I am trying to lock the scale/heat range of the camera so that it doesn't adjust based on the scene it is taking a photo of.

For example, when my hand is in the frame, the resulting image that the camera takes only highlights my hand (as it is the hottest thing in the frame). However, when I remove my hand, it auto compensates and adjusts the heat range to now show the next hottest thing as a bright pixel (so now the whole background is lit up with white pixels.)

Is it possible to lock the auto adjust feature of the camera? Let me know you need any clarification for my explanation. I apologize if it is confusing...

Weird images

I am using a FLIR Lepton Camera and a raspberry pi3 to generate heat maps.
In the beginning, the camera gives me the correct output, however, after some time, it gives me following kind of images:
img_0
img_1
img_4

After I restart the pi, it starts giving me correct images but deteriorates after some time again.
Does anyone have any idea why this can be?
I have an idea that this could be about connections with pi3 as I previously used this with pi1 and it never gave me any such troubles.
Are there any changes in the way lepton camera is connected to pi3 as compared to pi1?

Using 160x120 sensor

I believe these are by definition Lepton 3s? Anyway, the code as-is does work with my sensor. This image is correctly identifiable as a shot of my keyboard:

output

But the resolution of the final image is 80x60. And the obvious scanline effect does suggest a single 160px line is being broken into two 80px lines. I've tried the obvious changes in Lepton.py - changing the values of the row and column constants - but it returns this:

Capturing...
Traceback (most recent call last):
File "./pylepton_capture", line 38, in
image = capture(flip_v = options.flip_v, device = options.device)
File "./pylepton_capture", line 10, in capture
a,_ = l.capture()
File "/home/pi/pylepton/pylepton/Lepton.py", line 153, in capture
Lepton.capture_segment(self.__handle, self.__xmit_buf, self.__msg_size, self.__capture_buf[0])
File "/home/pi/pylepton/pylepton/Lepton.py", line 125, in capture_segment
ret = ioctl(handle, iow, xs_buf[xs_size * (120 - messages):], True)
IOError: [Errno 90] Message too long

Attribute Error: Lepton3 object has no attribute '_msg_size'

when running pylepton_capture getting above error. I'm also not sure but wondering in which folder I should be running the pylepton_capture command since I see it in a few places. Any assistance is much appreciated, it's been 10yrs since I coded and I'm very rusty and new to linux/python.

Lepton capture

Hi,

I have tried to use pylepton_capture but the output is just a blank image. Also the Lepton is functioning via raspberrypi_video (PureEngineering/LeptonModule) which means camera should be OK. Do you have any idea why this is happening?

Regards
Amin

Update: solved, the device name was different from the pylepton default. By setting that to spidev01.1, the problem is solved.

Lepton Modes

Hi,

I have a question about Lepton modes. Is it possible to enable/disable the Radiometry and AGC modes via pylepton?

Thanks
Amin

Lepton 2.5 and 3.5 are not working with New Raspbian release: Buster

Hi,

Earlier I used these two FLIR cameras on Raspberry pi 3 with Raspbian Stretch, its working absolutely fine. But I want to try them with Raspberry 4 with the Raspbian current release: Buster. It's not working though. Are these cameras and their libraries compatible with new Raspbian release on Pi 4?

Thanks!

Getting split images with Lepton 3 and FLIR Lepton Breakout Board V2.0

Hi,

I've been trying to get the program running using Lepton 3 with the new release of the breakout board, but images I am getting are either corrupted or split like the picture below. I tried to adjust the SPEED in Lepton.py and haven't gotten the issues fixed completely, but it does make a difference. So I suspect it is a sync issue with SPI. According to the datasheet, the new version of breakout added a vsync output signal, yet the pylepton library doesn't reflect the changes. So I wonder could this be the cause of the problem. BTW I am using Raspberry Pi 4.
op

Reliable vospi sync via the breakout board

Hi everyone,
I came across this while browsing github. Basically on the back of the breakout board is a GPIO port labelled GPIO3. This provides a sync signal that can be connected to a PI gpio port to provide bullet proof sync between the camera and the break out board. Dan Julio produced this project (see below)

Dan Julio's project

leptonic with breakout board vsync

My question is, would it be possible to include a wired vsync as an option to pylepton ? Has anyone looked at this before?

Gus

SPI speed

Is there any way to set the speed of the SPI bus?

I am using lepton3-dev with an RPI 3B+ and a 4B with a Lepton 3.5 via a Breakout Board v2. I set the CPU governor to run at fixed 100%. Video is fine, but there are sporadic lost frames ("Garbage..." message). Also, when I start picamera, the pylepton almost stops. As soon as I stop picamera, Lepton capture gets smooth again. (OK, that may be because the two I/O operations are blocking each other so threading should be used.)

I suspect the SPI bus speed is slow by default because when I used flirpy with my PureThermal, I could get stable video without any errors at 30MHz only. Anything below that caused split frames or garbage.

I am aware that pylepton does not use I2C, but I hope basic SPI settings, like bus speed can be configured. As I see, it is done via ioctl, but could someone help me where exactly?

Inappropriate ioctl for device

I've tried running a basic capture per the README.MD instructions under both Python v2.7.9 (with Numpy v1.8.2 & OpenCV v2.4.9.1) and Python 3.4.2 (with Numpy v1.8.2 & OpenCV v3.4.0) and always receive the following errors:
Python v2.7.9

Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pylepton import Lepton
>>> with Lepton() as l:
...   a,_ = l.capture()
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pylepton/Lepton.py", line 84, in __enter__
    ioctl(self.__handle, SPI_IOC_RD_MODE, struct.pack("=B", Lepton.MODE))
IOError: [Errno 25] Inappropriate ioctl for device

Python v3.4.2

Python 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pylepton import Lepton
>>> with Lepton() as l:
...   a,_ = l.capture()
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/dist-packages/pylepton/Lepton.py", line 84, in __enter__
    ioctl(self.__handle, SPI_IOC_RD_MODE, struct.pack("=B", Lepton.MODE))
OSError: [Errno 25] Inappropriate ioctl for device

Doing a ls /dev reports that my SPI device is spidev0.0.

I'm a complete newbie to Linux and Python and I just have no idea where to even start troubleshooting this, frankly I don't even know what the error means!

Any help very much appreciated :)

Using Lepton3

Hello, I was using pylepton to power my Lepton but have since bought he new Lepton3 sensor and put it on my current raspberry pi 3 setup. I am trying to understand how to update pylepton for it to work with the Lepton3. I pulled the branch with Lepton3 changes and when I run the pylepton_overlay example it seems to be using Lepton.py and not Lepton3.py to execute. This causes jitter and a weird flashing in the overlay which I assume is from the lack of buffer size for the new Lepton3. I am new to python so this is why I am feeling lost, I have been reading different sources but still can't figure it out.

Can someone point me in the right direction so I can get the Lepton3 working correctly using pylepton?

Thank you!

Shutter closes and opens w/ Pi 4

Hi,

I've been successful with Lepton 2.5 w/ Breakout board v2.0 and Pi 3 B+ using these libraries. However, when I run the same thing w/ Pi4, I get frequent shutter closes and opens on power on. Its about every 3-5 seconds. Additionally, data coming out of my other sensors connected on I2C protocol freeze and come back alive and then repeat. Although, lepton 2.5 never worked properly.

  1. Earlier I thought it could be a power issue but that didn't seem like it. I have tried giving supply from both adapter and portable battery. But that didn't fix anything.
  2. It seems like its doing FCC over and over again. In other words, Lepton gets faulty signal to perform an FFC. I double checked all wiring, its correct only.

I don't know what's this behavior when I switched to Pi 4. Has anyone gone through this situation or have any clues about the root cause and potential methods to fix the problem? Will appreciate all the info. I could get here.

Thanks,
Akshay

RE: pylepton and error issues w/ Python3, BeagleBone Green, and LCD Display

Hello,

I tried the sudo python3 setup.py install command after sudo apt install python3-numpy python3-opencv.

It seems the script built the installs but I am still receiving issues/errors.

...

Anyway, as I make some headway on this nice SDK on Python(3) w/ changing up some source, is /var/mail/pylepton a real dir. to have my pylepton SDK located in?

Seth

P.S. It seems this is one of the many errors so far.

./LeptonOne.py
./LeptonOne.py: line 1: import: command not found
./LeptonOne.py: line 2: import: command not found
from: can't read /var/mail/pylepton
./LeptonOne.py: line 5: syntax error near unexpected token `('

Where the source is:

import numpy as np
import cv2
from pylepton import Lepton

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

cv2.normalize(a, a, 0, 65535, cv2.NORM_MINMAX) # extend contrast
np.right_shift(a, 8, a) # fit data into 8 bits
cv2.imwrite("FirstPhoto.jpg", np.uint8(a)) # write it!

If you are understanding my issue before I find it, please let me know.

Inappropriate ioctl for device

I'm trying to capture the feed from a lepton 3.5, I can get image feed from the getThermal app, so I thought I'd be able to use this library to easily get snapshots from the camera. Im currently using fedora 30 on a lenovo notebook(not a rasp).

The error Im getting relates to the ioctl for the device:

Traceback (most recent call last):
File "/usr/local/bin/pylepton_capture", line 37, in
image = capture(flip_v = options.flip_v, device = options.device)
File "/usr/local/bin/pylepton_capture", line 9, in capture
with Lepton(device) as l:
File "/usr/local/lib/python3.7/site-packages/pylepton/Lepton.py", line 86, in enter
ioctl(self.__handle, SPI_IOC_RD_MODE, struct.pack("=B", Lepton.MODE))
OSError: [Errno 25] Inappropriate ioctl for device

Ive gotten the values for SPI_IOC_RD_MODE, SPI_IOC_WR_MODE, SPI_IOC_MAGIC, which are:
SPI_IOC_RD_MODE: 2147576577
SPI_IOC_WR_MODE: 1073834753
SPI_IOC_MAGIC: 107

Are maaybe the values wrong? or is it failing cause of a certain permission issue?
Really hoping to be able to use this library, Ill try using ubuntu (or another debian based OS) and come back with results. Hoping for a way to get pushed into the right direction to solve this. Thanks in advance.

Lepton 2.5 and its VSYNC pin

Hi everyone,

Months back I was using Lepton 2.0 with breakout board v1.0(which is totally obsolete now). New Lepton 2.5 is coming along with a breakout board v2.0 and this board has introduced a new pin called VSYNC (which was not in the earlier version of breakout board v1.0).
So I wanted to ask if anybody here got the smooth output from Lepton 2.5 with breakout board v2.0 with its VSYNC pin connected to the Raspberry pi 3 B+. Did you notice anything wrong with the thermal output in case you don't connect the breakout board's VSYNC pin to the Pi and later may be resolved with VSYNC pin?

Thanks,
Akshay

Not working with Pi 3b+ and Lepton3.5

I tried using master, lepton3 branch and lepton3-dev branch. I can get an output image by using master branch, but the image looks distorted.
output
With lepton3 and lepton3-dev branch, I kept getting Lepton3 object has no attribute '_msg_size' error.
Traceback (most recent call last):
File "/usr/local/bin/pylepton_capture", line 37, in
image = capture(flip_v = options.flip_v, device = options.device)
File "/usr/local/bin/pylepton_capture", line 9, in capture
with Lepton3(device) as l:
File "/usr/local/lib/python2.7/dist-packages/pylepton/Lepton3.py", line 32, in init
self._xmit_buf = np.zeros((self._msg_size * Lepton.ROWS * 4), dtype=np.uint8)
AttributeError: 'Lepton3' object has no attribute '_msg_size'

Any thoughts will be appreciated. Thanks

Program gets stuck on garbage frame detection.

When I tried running the program it gets stuck on line 156 of Lepton.py and I'm not sure why. It was working a minute ago, but now it just keeps detecting all readings as garbage frames.

Weird image capture

Hello,

I am discovering this library which seems to be very helpful to acquire data from a Lepton camera.
However, when I try to acquire an image, first the time to execute the capture function of Lepton.py file is very random (between 0.01 and 30s), and second the image display is weird. I can see my "shape" but with a lot of noise or like if pixels are dead.
But, using an old software of my colleague (using C++/Python and Perl), the camera is ok and works correctly.
So it deals with my code but I can see where.

Can you help me please ? I thank you in advance.

import sys
import numpy as np
from pylepton import Lepton
import matplotlib.pyplot as plt

with Lepton() as l:
	image = np.zeros((60, 80, 1), 'float')  # to perform operation after
	
	# Capture image
	_, new_sum = l.capture(image)

	# Normalize between 0 and 1
	data = np.reshape(np.rot90(image,1),60*80,1)
	data2=data-min(data)
	data2=data2/max(data2)
	data2=np.reshape(data2, (60,80))
	data = 255.*data2
	data = np.squeeze(image)

# Plotting image acquired
fig = plt.figure()
im = plt.imshow(data)
pos = fig.add_axes([0.93,0.05,0.05,0.8])
fig.colorbar(im, cax=pos) 
plt.show()

Hanging terminal - pylepton_capture output.png

I am working with a raspberry pi 3 (and have also tried on a raspi zero w) and the FLIR radiometric dev kit from SparkFun (Lepton 2.5).

When I run
pylepton_capture output.png

I get an unresponsive terminal, after hitting Ctrl-C I get the following output

File "pylepton_capture", line 37, in image = capture(flip_v = options.flip_v, device = options.device) File "pylepton_capture", line 10, in capture a, _ = l.capture() File "pylepton/Lepton.py", line 158, in capture time.sleep(0.185)

I have tested the Lepton on a digital analyzer and the CS and MISO channels of the SPI seem to be communicating OK. SCK is identical to the CS channel though and I am unsure of the cause or fix to this.

Digging into the code, it seems to get stuck in the def capture function (in Lepton.py) in the while True loop. It seems that the capture_buf array is never populated with data from the pixels collected by the Lepton.

I'm not 100% sure this is the root of the issue, or what this affects either. Any advice on this issue in general is appreciated in advance.

Flir Lepton constantly showing the same temperatures !

Where do I go wrong, temperatures change very little ?


import cv2

from flirpy.camera.lepton import Lepton
import numpy as np

cv2.namedWindow("output", cv2.WINDOW_NORMAL)
font = cv2.FONT_HERSHEY_SIMPLEX
fontScale = 0.4
fontColor = (255,255,255)
lineType = 1

with Lepton() as camera:

 scale_percent = 4 # percent of original size
 while True: 
    img = camera.grab().astype(np.float32)
    # Rescale to 8 bit
    img = 255*(img - img.min())/(img.max()-img.min())
    img=img.astype(np.uint8)
    #img=plt.imshow(img, cmap=cm.plasma)
    img= cv2.applyColorMap(img, cv2.COLORMAP_JET)
    ffc_temp_c=camera.ffc_temp_k# -273.15
    ffc_temp_c=round(ffc_temp_c,2)
    fpa_temp_c=camera.fpa_temp_k#-273.15
    fpa_temp_c=round(fpa_temp_c,2)   
   
 
    cv2.putText(img,"temp_k:"+str(ffc_temp_c),  (5,10) ,  font, fontScale, fontColor, lineType)
    cv2.putText(img,"temp_c:"+str(fpa_temp_c), (5,20),  font, fontScale, fontColor, lineType)
    
 
    cv2.imshow('output', img)
    if cv2.waitKey(1) == 27:
        break  # esc to quit

camera.close()
cv2.destroyAllWindows()


temp1

temp2

OSError: [Errno 90] Message too long on Raspberry Pi4

Hi @kekiefer @brandoncurtis and team members,

Thank you very much for your helpful work. I'm implementing a project using Lepton 2.5 with breakout board v2.0 on Raspberry Pi4. About a few months ago, it was working well. But now it isn't working, and an error below occurs.

Traceback (most recent call last):
File "/home/pi/Desktop/lepton test.py", line 7, in
a,_ = l.capture()
File "/usr/local/lib/python3.7/dist-packages/pylepton/Lepton.py", line 153, in capture
Lepton.capture_segment(self.__handle, self.__xmit_buf, self.__msg_size, self.__capture_buf[0])
File "/usr/local/lib/python3.7/dist-packages/pylepton/Lepton.py", line 125, in capture_segment
ret = ioctl(handle, iow, xs_buf[xs_size * (60 - messages):], True)
OSError: [Errno 90] Message too long

However, raspberrypi_video from LaptonModule is working. Do you know what is wrong with it?

Thank you very much.
Batbayar

Couldn't run pylepton on a PC

Hi, i have a Mini PC with Linux Mint and i was trying to run this module but it doesn't seem to work because i need something called spidev and after some research it appears that it's something related to Raspberry Pi.

My goal is to get the temperature from the images. Is it possible to achieve this with my configuration?

installing help?

I know this might be a silly question, but I am new to python and the Lepton..
Can anyone help with installing the Pylepton library? Not really sure what files I need to download and how to get it working in Python.
Any help will be much appreciated

Running pylepton_capture using the Matlab raspberry pi support package

I am trying run the pylepton_capture program that is installed in a raspberry pi board, using Matlab (that is installed on my laptop). When I try to run the program, I use the following command (in Matlab):

       system(r,'python /home/pi/Downloads/pylepton-master/pylepton_capture output.png')

I get the following:

     ans =

               0×0 empty char array

Do you have any suggestions moving forward?

Thanks in advance for any help that you can provide.

Jetson TK1 Lepton 2.5

I was following http://me.knnect.com/blog/how-to-connect-flir-lepton-module-to-nvidia-jetson-tk1/ to work on getting my Lepton working with my Jetson. Whenever I run the pylepton_capture, the program seems to get get caught somewhere. Whenever I stop the program with a keyboard interupt I get the following traceback

File "pylepton_capture", line 37, in
image = capture(flip_v = options.flip_v, device = options.device)
File "pylepton_capture", line 10, in capture
a, _ = l.capture()
File "pylepton/Lepton.py", line 158, in capture
time.sleep(0.185)

Any help would be appreciated.

Radiometric capture

Can anyone tell me if pylepton can capture radiometric 14 bit arrays from the camera SPI interface that contains temperature*1000 values for 160x120 pixels?

Also, does it support 160x120 resolution?

Thx,
Zoltán

How to find the device name like '/dev/..' when connected directly in mac?

Hi,

I was testing in mac the example python code and there was a line that says device name: device = '/dev/spidev0.0/'
with Lepton(device) as l:
a,_ = l.capture()

In this code, how to find the USB device name as /dev/...?
I can see the device in the USB section of mac.
PureThermal (fw:v1.3.0)@14420000  <class AppleUSBDevice, id 0x100002d64, registered, matched, active, busy 0 (5 ms), retain 16>
  |         "PortNum" = 2
  |         "USB Serial Number" = "00180033-5119-3138-3931-383900000000"

I can use the GUI in mac to see the thermal images, but I want to save the raw data. Can someone please help me to find this device name in the mac?

Do we need any other Arduino/beagle/Raspberry PI board to connect this pure thermal?
Thanks.

Lepton 2.5 radiometry

I would like to know how to get per pixel temperature. From what capture() function is returning, all the elements in the array are almost 30.000 all the time, irrespective of the temperature. Please tell me a way to get per pixel temperature. Thank you

Connect Three Lepton on Raspberry Pi 3

Good morning,
I would like use three lepton to the raspberry, with your library.
Is this possible?

Running this example

import numpy as np
import cv2
from pylepton import Lepton

with Lepton("/dev/spidev1.0") as l:
a,_ = l.capture(None,True,True,True)
cv2.normalize(a, a, 0, 65535, cv2.NORM_MINMAX) # extend contrast
np.right_shift(a, 8, a) # fit data into 8 bits
cv2.imwrite("python3.jpg", np.uint8(a)) # write it!

it works with
with Lepton("/dev/spidev0.0") as l:
with Lepton("/dev/spidev0.1") as l:

after running the program on one port it does not work on the next one until the raspberry is restarted

not work with
with Lepton("/dev/spidev1.0") as l:
The error is:

From the following error
Traceback (most recent call last):
File "3Capture.py", line 7, in
with Lepton ("/ dev / spidev1.0") as l:
File "/usr/local/lib/python2.7/dist-packages/pylepton/Lepton.py", line 85, in enter
ioctl (self .__ handle, SPI_IOC_WR_MODE, struct.pack ("= B", Lepton.MODE))
IOError: [Errno 22] Invalid argument

but the ports exist

pi @ raspberrypi: ~ / Bm / ConveyorApp / Sender $ ls / dev / spidev *
/dev/spidev0.0 /dev/spidev0.1 /dev/spidev1.0 /dev/spidev1.1 /dev/spidev1.2

Thanks for your help

Lepton3/3.5 using pylepton

Hi,

Does anybody try to get lepton 3 or 3.5 successfully working with these libraries. What changes in the libraries could be required to get lepton 3 working?

We are trying to switch from lepton 2.5 to 3/3.5 for better thermal imaging.

Please let me know.

PyLepton Not working on raspberry pi

I have downloaded and installed the pylepton from github and wired it up to my raspberry pi, but when the pylepton capture code is run, it runs indefinitely without outputting the image, and when I force it to quit it says it was at a time.sleep() command. Any ideas?

Error while executing

pi@raspberrypi:~/pylepton $ sudo pylepton_overlay -a 255
Traceback (most recent call last): File "/usr/local/bin/pylepton_overlay", line 29, in main with Lepton(device) as l: File "/usr/local/lib/python2.7/dist-packages/pylepton/Lepton.py", line 84, in __enter__ ioctl(self.__handle, SPI_IOC_RD_MODE, struct.pack("=B", Lepton.MODE)) IOError: [Errno 25] Inappropriate ioctl for device

Jetson TX2 lepton3

Hello! I want to use jetson TX2 and lepton 3. I follow https://devtalk.nvidia.com/default/topic/1024806/jetson-tx2/how-to-enable-spi-spidev-on-28-1-on-target-/ and set the maximum speed as http://me.knnect.com/blog/how-to-connect-flir-lepton-module-to-nvidia-jetson-tk1/. And I also change the default spi device to "/dev/spidev3.0".
However, when I tried to capture image using "pylepton_capture output.png", I got following error,
"
Traceback (most recent call last):
File "/usr/local/bin/pylepton_capture", line 37, in
image = capture(flip_v = options.flip_v, device = options.device)
File "/usr/local/bin/pylepton_capture", line 9, in capture
with Lepton(device) as l:
File "/usr/local/lib/python2.7/dist-packages/pylepton/Lepton.py", line 84, in enter
ioctl(self.__handle, SPI_IOC_RD_MODE, struct.pack("=B", Lepton.MODE))
IOError: [Errno 25] Inappropriate ioctl for device

"

Could anyone help me solve this problem? Thank you!

what does capture() returns?

it says

Image data from capture() is 12-bit, non-normalized (raw sensor data).

I have a lepton 2.5 dev kit
I would assume it should be the temperature value for each pixel
but when I put a melting ice cube (arround 0 degree C) and a cup of coffee (tested with probe, arround 55 degree C) in front of the sensor, the minimum in the array is 27415 and maximum value is 32709 with doesn't really make sense to me

Breakout board v2.0 vs Purethermal 1

Hi all,

I have two hardware development boards with me, FLIR lepton breakout board 2.0 and Purethermal 1. Both have different communication techniques if I am correct? Also, both are capable of giving 9hz frame rate. So my question is whats the difference in their performance other than their communication style? Do one of them give slightly better performance in some aspects?

Thanks,
Akshay

FFC control

Hi!

Is it possible to control the FFC (shutter) with this framework?

Cheers,
Jens

How to change settings ?

I have raspberry pi 3, Flir Lepton 3.0 and Lepton thermal camera Breakout board v1.4.

Before capture thermal images, I need to enable Radiometry Mode, need to enable FFC as automatic, need to enable Telemetry Mode as header using Python.
Can anybody help me to do this?

IOError: [Errno 25] Inappropriate ioctl for device

I am experiencing the issue running the example code from the README.md with a Lepton3.5 on Ubuntu 18

$ uname --all
Linux ubuntu 4.18.0-25-generic #26~18.04.1-Ubuntu SMP Thu Jun 27 07:28:31 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ ls /dev/
$ ...
$ -rw-r--r--  1 root  root             0 Jul 18 17:42 spidev0.0
$ -rw-r--r--  1 root  root             0 Jul 18 17:41 spidev0.1
$ ...

Code:

import numpy as np
import cv2
from pylepton import Lepton

with Lepton() as l:
  a,_ = l.capture()
cv2.normalize(a, a, 0, 65535, cv2.NORM_MINMAX) # extend contrast
np.right_shift(a, 8, a) # fit data into 8 bits
cv2.imwrite("output.jpg", np.uint8(a)) # write it!

Output:

cbusa@ubuntu:~/pylepton$ sudo python main.py 
Traceback (most recent call last):
  File "main.py", line 5, in <module>
    with Lepton() as l:
  File "/home/cbusa/pylepton/pylepton/Lepton.py", line 84, in __enter__
    ioctl(self._handle, SPI_IOC_RD_MODE, struct.pack("=B", Lepton.MODE))
IOError: [Errno 25] Inappropriate ioctl for device

What I have already tried:

  • Change from Lepton() to Lepton("/dev/spidev-0.1")
  • Use different branches of the project
  • Tested with the pylepton_capture application
    All of them produce the same error.

Interesting fact is: when I use the GetThermal-v0.1.4-x86_64-Linux.AppImage, I have no issues.

Do you have any idea how should I proceed with the analysis?

Wrong image values / strange rollover

Hi,

I'm trying to read the complete 14 bit values, yet it seems there's a strange bug which somewhat corrupts the pixel values. While the 'usual' pixel value is supposed to be 8192 when the scene is at the same temperature as the Lepton (according to https://cdn.sparkfun.com/datasheets/Sensors/Infrared/FLIR_Lepton_Data_Brief.pdf, sec. 8.4.1), I'm getting about half of that.
Yet, it's not just a simple bit shift. Something weirder is going on - there seem to be value rollovers, which means that the acquired image value are non-continuous. Here is an example, showing the decimal & binary values of a certain pixel, for a steadily & monotonically increasing temperature:
(specifically, look at the rollovers of 3903->4032, and 4099->4348)

...
3901 00001111,00111101
3902 00001111,00111110
3903 00001111,00111111
4032 00001111,11000000
4033 00001111,11000001
4034 00001111,11000010
...
4093 00001111,11111101
4094 00001111,11111110
4095 00001111,11111111
4096 00010000,00000000
4097 00010000,00000001
4098 00010000,00000010
4099 00010000,00000011
4348 00010000,11111100
4349 00010000,11111101
4350 00010000,11111110
4351 00010000,11111111
...

The temperature itself ranged from a bit under room temperature (and that of the sensor), to a bit above it. That is - the values were supposed to be continuous, around 8192.

The problem is (mostly?) apparent in the low byte, which seems to act somewhat like 2's complement. That's weird, because looking at your code I found only use of uint16.

I know the camera is operating correctly as I've used the 'official' program from PureEngineering and it behaves exactly as expected.

Thanks. Your module is very useful!
Itay

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.