3

I'm working with a Lepton Thermal Camera Breakout Board and trying to read in pixel values using this simple python program:

import numpy as np
import cv2
from pylepton import Lepton

with Lepton("/dev/spidev0.0") 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

The program calls the capture() method which is located in a file called Lepton.py which I got from GitHub. The program is supposed to take input from the thermal camera store it to an array which it then returns along with a "frame ID". However, it is currently just returning an empty array with nothing that contains nothing but 0.

I can't figure out why this would happen. The capture.py method inside of Lepton.py calls another method called capture_segment() which contains a call to ioctl but at that point I can't understand what the program is doing.

Where are the actual values being read in? Is there a way to cut down on the amount of code so that I can just read in the values and store them directly?

EDIT: The camera is directly plugged into a Raspberry Pi and this python program is the only thing I'm running.

Angel Lockhart
  • 157
  • 1
  • 2
  • 11
  • Do you have any other software talking to the camera? Are you sure it's working and is set up correctly? – 9000 Dec 19 '16 at 16:53
  • Have you tried the debug_print=True option, for some hints? – Benjamin Dec 19 '16 at 16:54
  • The camera is plugged into a Raspberry Pi and this is the only program that I am running. Also, I'm sure my wiring is correct because I used another program that was provided by the manufacturer and it was able to take a picture so I know that values are being sent to the Pi. – Angel Lockhart Dec 19 '16 at 16:55
  • @Benjamin yup it just tells me that everything is 0s basically. Originally I also had `retry_reset = True` and it would get stuck in an loop because all the frames being returned had just 0 in them. I just need to find where the program is actually supposed to reading in values so that I can see if anything is coming in. – Angel Lockhart Dec 19 '16 at 16:57

0 Answers0