Why does my program not populate the array with pixel values?

113 views Asked by At

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.

0

There are 0 answers