Corrupted images

716 views
Skip to first unread message

Simon Allen

unread,
Nov 29, 2017, 8:45:34 AM11/29/17
to Flir Lepton

I am using a lepton camera (2.5 or 2) with RPi to in a temperature control routine, capturing images, reading the highest temperature and inputting to a PD control loop. I am using python and the pylepton code for image capture. Works fine generally, but recently have starting having issues with the image capture. After a random length of time the image ‘locks’ for a couple of frames and then subsequent frames show what appears to be an overlay of the locked image and a weaker updating image together – see two images below. Sometimes this can be reset by shutting the RPi terminal window and restarting, sometimes it needs a reboot.

 

This now occurs on two different cameras on two different Pi boards, so doesn’t appear to be a specific hardware problem.


 '"clean" image 


 "ghosted"  image a few minutes later - dark area is a 'fixed' copy of the previous clean image. Light area is 'active' , i.e. refreshed as I move


Any pointers gratefully received!


Walter Lucetti

unread,
Nov 29, 2017, 9:01:23 AM11/29/17
to Simon Allen, Flir Lepton
The "ghost" is a feature of thermal images. To avoid it you must perform an FFC (Flat Field Correction) about each 5 minutes. 
The problem is more visible if the image is really static

--
You received this message because you are subscribed to the Google Groups "Flir Lepton" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flir-lepton+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/flir-lepton.
To view this discussion on the web visit https://groups.google.com/d/msgid/flir-lepton/f1c09c49-ef63-4912-bfb6-430cfe7d5ee1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Ben Kluwe

unread,
Nov 29, 2017, 10:22:22 AM11/29/17
to Flir Lepton
Myzhar is close, but it doesn't have to do with whether or not a Flat Field Correction has been done. He is however right that you should do one every couple of minutes to avoid other effects such as camera drift.

Whats happening is an effect known as (fittingly) ghosting. It happens when you do a FFC without a known temperature reference infront of the camera i.e. the shutter. To test whether or not the shutter is working, you can fire a FFC manually and hear/see if the shutter comes down infront of the camera for a brief moment. If it doesnt, you will see ghosting, if it does, it should go back to what you refer as a clean image.

If it doesnt work it might be the contacts just below the shutter aren't touching the pinout where it is supposed to be making contact. Beware though that once you take the shutter assembly off, you might not be able to put it back on again because the clamping mechanism is made of quite thin plastic and might break off. This happened to me and was the reason why the shutter wasn't always coming down.

Best Regards,
Ben


On Wednesday, November 29, 2017 at 2:01:23 PM UTC, Myzhar wrote:
The "ghost" is a feature of thermal images. To avoid it you must perform an FFC (Flat Field Correction) about each 5 minutes. 
The problem is more visible if the image is really static
2017-11-29 14:45 GMT+01:00 Simon Allen <si...@sandlallen.co.uk>:

I am using a lepton camera (2.5 or 2) with RPi to in a temperature control routine, capturing images, reading the highest temperature and inputting to a PD control loop. I am using python and the pylepton code for image capture. Works fine generally, but recently have starting having issues with the image capture. After a random length of time the image ‘locks’ for a couple of frames and then subsequent frames show what appears to be an overlay of the locked image and a weaker updating image together – see two images below. Sometimes this can be reset by shutting the RPi terminal window and restarting, sometimes it needs a reboot.

 

This now occurs on two different cameras on two different Pi boards, so doesn’t appear to be a specific hardware problem.


 '"clean" image 


 "ghosted"  image a few minutes later - dark area is a 'fixed' copy of the previous clean image. Light area is 'active' , i.e. refreshed as I move


Any pointers gratefully received!


--
You received this message because you are subscribed to the Google Groups "Flir Lepton" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flir-lepton...@googlegroups.com.

Simon Allen

unread,
Nov 29, 2017, 10:40:08 AM11/29/17
to Flir Lepton
Many thanks for quick responses. I will need to look into the FFC issue then. Using the pylepton code, there isn't an obvious way to fire  a FFC - I haven't coded anything in so I guess there is a default setting. As you can see I am just feeling my way into this!

On the Lepton 2 there isn't (I think!) a shutter, so any FFC would give the erroneous result you describe. The 2.5 does have one but I have to say I have never heard it operate. I'm away from the lab for a couple of days now but will report back when I have had a chance to investigate further.

Myzhar

unread,
Nov 30, 2017, 3:36:43 AM11/30/17
to Flir Lepton
You are right... if you perform FFC not using a "flat panel" you will continue to have a static "ghost" because the camera will continue to compensate something that thinks it is "flat".
I took for granted the execution of the FFC with the use of the shutter...

Simon Allen

unread,
Nov 30, 2017, 4:12:17 AM11/30/17
to Flir Lepton
Thanks Myzhar

It is lack of knowledge rather than anything deliberate! I didn't set out to carry out any FFC, but I guess the default settings are for an automatic action. The behaviour seems consistent with this in that the image greys out for a few seconds before the ghost appears.

I can't find reference to any way to control the operation of the FFC through python code. Is anyone able to help with this?

Many thanks

Simon


Myzhar

unread,
Nov 30, 2017, 4:21:37 AM11/30/17
to Flir Lepton
You must send commands to Lepton using I2C bus. 
According to "Engineer Datasheet" (I suggest to search for it and read) you have two communication channels:
- VoSPI on SPI to retrieve images
- CCI on I2C to get status, control the parameters and perform calibrations

For CCI communication Flir provides an SDK, but it is written in C. You can search for Python porting

Ben Kluwe

unread,
Nov 30, 2017, 4:28:32 AM11/30/17
to Flir Lepton
Hi Simon, Hi Myzhar,

You beat me to it again :)

I knew that I had seen python binding for C in the forum somewhere and found it here: https://groups.google.com/forum/#!searchin/flir-lepton/python$20C%7Csort:date/flir-lepton/i8rq6g7wZuQ/vJYoTqSgBwAJ

You can use the 'tutorial' in the last comment to interface with the LeptonModule C code.

Ben

Simon Allen

unread,
Dec 5, 2017, 6:06:26 AM12/5/17
to Flir Lepton
Myzhar, Ben

Thanks for the useful pointers. I have now tried out our system using a new Lepton 2.5, which doesn't show the problem: we do get occasional 'grey' images as the shutter closes, presumably to carry out an FFC, but no ghosting. I'm pretty sure then, given your input, that the older camera must have developed a shutter problem so that it was carrying out the FFC against an open image.

I'll now follow your leads to implementing the SDK within the python framework so that we can take control of the FFC process!

Regards

Simon
Reply all
Reply to author
Forward
0 new messages