LJMUAstroecology / flirpy

Python library to interact with FLIR camera cores
Other
193 stars 54 forks source link

Radiometric data on Lepton 3.5 #86

Open Hrishikesh-Kalyanaraman opened 1 year ago

Hrishikesh-Kalyanaraman commented 1 year ago

I am trying to get radiometric data from my lepton. I have successfully connected to my device and received a numpy array. However, I'm unsure what exactly this array means. It does not seem like it represents temperature data in micro kelvin like this issue mentions: https://github.com/LJMUAstroecology/flirpy/issues/53 as when I try to get the largest value from my array, it is always 58744 regardless of other data.

How do i get radiometric data from the lepton?

to recreate error condition, get an image from the lepton 3.5 and print(np.max(image, 0)). 58744 is always in the same place in the array generated irrespective of temperature [ (1,7) where the first object is at (0,0)]

I have tried using the groupgets software, and the camera seems fine. I have also used opencv directly, and this is the output i get when i do it

jveitchmichaelis commented 1 year ago

Hi,

Please provide a sample image. I would guess 58744 is some telemetry value but it's impossible to say without seeing any data. If you have TLinear mode on, the results should be in Kelvin / 100.

Thanks!

Hrishikesh-Kalyanaraman commented 1 year ago

How would I turn tlinear mode on? Is it automatically turned on with flirpy?

My numpy array of the image is a 160×120 array, so im not sure how I can share it

jveitchmichaelis commented 1 year ago

If you're using the Pure Thermal board then you should use their configuration tools. Flirpy doesn't offer any config for the Lepton at the moment.

You could save it with np.save for example?

Hrishikesh-Kalyanaraman commented 1 year ago

It seems like you were right. I checked data by row, and the last 2 rows are radiometric data, which was screwing with my results. Thank you!

On the other hand, I seem to have an issue on Linux where the camera disconnects after I access it 10-12 times on Linux. I did not have this issue on Windows. I suspect it might be because Linux reads multiple video devices for some reason. My issue is the same as this one: https://github.com/LJMUAstroecology/flirpy/issues/75

jveitchmichaelis commented 1 year ago

Unfortunately my answer would be the same - speak to PureThermal or OpenCV because the opening/closing of the camera is done via those libraries, not Flirpy. It's possible that we're not closing/releasing the camera properly so what you could try is writing your own code where you open and close the camera repeatedly and see if you can trigger this fault. You could also try playing with GroupGets' software and seeing if that has the same problem or not.

Flirpy should call camera.release() when you close the context (e.g. if using with Lepton() as camera or delete the object. That calls cv2.VideoCapture.release() underneath.