Get the max temperature output using PT2 with lepton 3.5

800 views
Skip to first unread message

Mortox

unread,
Mar 7, 2019, 4:57:09 AM3/7/19
to Flir Lepton
Hi everyone,

I'm looking for a way to use the PureThermal 2 with the Flir Radiometric Lepton 3.5 for getting the temperature from each pixels on her video stream's frames. The final goal would be to get the greatest temperature of an electronic device monitored by this camera to shutdown the device if the temperature exceeds a certain value.

I'm working on Linux Ubuntu 18.04

I'm totally new to image processing, any help would be appreciated ! Thanks in advance !

Best regards,

Mortox.

Andrew V. Jones

unread,
Mar 7, 2019, 5:11:40 AM3/7/19
to Mortox, Flir Lepton
Hello Mortox,

Have you looked at `uvc-radiometry.py`? For example, the following:

https://github.com/groupgets/purethermal1-uvc-capture/blob/master/python/uvc-radiometry.py#L106

which calculates the max and minimum value from a frame.

Cheers,

Andrew
> --
> 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.
> 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/bdf7a0a3-deb1-4fad-964c-09f939632ef6%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Mortox

unread,
Mar 7, 2019, 5:40:47 AM3/7/19
to Flir Lepton
 Hi Andrew, 

It seems to be a very nice first solution ! I'll have to find a way to catch the output values and convert them into celsius degrees before using them into my software.

Thank you for your help !

Best regards,

Mortox.

Andrew V. Jones

unread,
Mar 7, 2019, 5:46:50 AM3/7/19
to Mortox, Flir Lepton
Hi,

My branch of this code does something like that (see: `ctok`):

https://github.com/andrewvaughanj/purethermal1-uvc-capture/blob/master/python/uvc-radiometry.py#L350

https://github.com/andrewvaughanj/purethermal1-uvc-capture/blob/master/python/uvc-radiometry.py#L366

Note: I think my code is out of date with what’s on GroupGet’s
`master`, so “buyer beware”.

Cheers,

Andrew
> --
> 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.
> 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/d7e3e7f6-2e05-43ce-b104-5701d1d0f5f6%40googlegroups.com.

Andrew V. Jones

unread,
Mar 7, 2019, 6:05:07 AM3/7/19
to Mortox, Flir Lepton
I gave some bad info here, you actually want the `ktoc` part of the
code:

https://github.com/andrewvaughanj/purethermal1-uvc-capture/blob/master/python/uvc-radiometry.py#L376
Message has been deleted

Mortox

unread,
Mar 7, 2019, 8:27:56 AM3/7/19
to Flir Lepton
I tried using your code (i'm using OpenCV3)

I got this error : 

device opened!
Version gpp: 3.3.26 dsp: 3.3.26
FLIR part #: 500-0771-01
FLIR serial #: "!`'\x00\x00\x00\x00\x00"
Estimated / selected altsetting bandwith : 18 / 962. 
28771.0 29720.0
Traceback (most recent call last):
  File "./uvc-radiometry.py", line 396, in <module>
    main()
  File "./uvc-radiometry.py", line 379, in main
    font, 0.70, (40, 60, 215), 1, cv2.CV_AA)
AttributeError: 'module' object has no attribute 'CV_AA'

So I changed the line 379 from  font, 0.70, (40, 60, 215), 1, cv2.CV_AA) to font, 0.70, (40, 60, 215), 1, cv2.LINE_AA)

And when i try to launch the .py, here what happens :

Version gpp: 3.3.26 dsp: 3.3.26
FLIR part #: 500-0771-01
FLIR serial #: "!`'\x00\x00\x00\x00\x00"
Estimated / selected altsetting bandwith : 18 / 962. 
28875.0 29829.0

And ... nothing else happens ... Not even a video display or something :(


Best regards,

Mortox.

Andrew V. Jones

unread,
Mar 7, 2019, 8:29:21 AM3/7/19
to Mortox, Flir Lepton
Which code are using, the official GroupGets one, or “my” version?

Either way, the fact you’re getting an “empty” serial number for
your Lepton suggests something is unhappy.

Does GetThermal:

https://github.com/groupgets/GetThermal

work for you?

Cheers,

Andrew
> --
> 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.
> 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/85b9f6be-10dc-4421-8313-07020a35466c%40googlegroups.com.

Mortox

unread,
Mar 7, 2019, 8:33:03 AM3/7/19
to Flir Lepton
I tried both,

the GroupGet one's works great and then i wanted to try your's to see the differences. GetThermal is working fine too.

How could i fix this lepton's serial number problem ? 

Best regards,

Mortox.

Andrew V. Jones

unread,
Mar 7, 2019, 8:34:46 AM3/7/19
to Mortox, Flir Lepton
Well, the short answer is “don’t use mine”.

Mine was a fork made a while ago for a specialist reason. I am not
updating it with master. It is very much “works for me”.

Literally, all mine does (differently) is have those conversion routines
and print it to a file (oh, and the pinning of a max/min).

I can’t tell you why my version doesn’t get the serial number.

Cheers,

Andrew
> --
> 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.
> 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/4029dea2-a10f-4a25-bc8c-75e18fe56f4e%40googlegroups.com.

Mortox

unread,
Mar 7, 2019, 8:38:45 AM3/7/19
to Flir Lepton
It's ok, i'll try to do some change on the GroupGets one for my needs.

Thank you for everything, you're the real MVP !

Best regards,

Mortox.

Andrew V. Jones

unread,
Mar 7, 2019, 8:39:32 AM3/7/19
to Mortox, Flir Lepton
Sure, no worries … it should be pretty simple (you probably just want
to call the `ktoc` function in the right place and print it out).
> --
> 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.
> 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/85c93532-51c2-4533-8724-fd1f238354e0%40googlegroups.com.

Andrew V. Jones

unread,
Mar 7, 2019, 8:42:31 AM3/7/19
to Mortox, Flir Lepton
I was curious … my script has been capturing thermal imagery every 10
seconds _for the last 70 days_ without issue!

Not sure why it doesn’t work everywhere, but it certainly works for me
:)

Cheers,

Andrew
> --
> 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.
> 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/85c93532-51c2-4533-8724-fd1f238354e0%40googlegroups.com.

윤여경

unread,
May 20, 2024, 10:37:58 PMMay 20
to Flir Lepton
Hi Andrew, i know it is too late but i want to ask one thing about your example code `uvc-radiometry.py`. There is a code to set list's first and last item values as min and max value at L364-365. It seems you are trying to set the minimum and maximum temperature range that you want to care about but is it working? I mean if the array is not linear then this can't be worked can it?
Reply all
Reply to author
Forward
0 new messages