Lepton Maker Community / Forum / Installation and getting started / Topics / Recording and Viewing Raw Data

Recording and Viewing Raw Data

This topic contains 29 replies, has 16 voices, and was last updated by Profile photo of KaSaBiS KaSaBiS 1 month, 3 weeks ago.

Viewing 20 posts - 1 through 20 (of 30 total)

  • Author

    Posts

  • #11746

    Profile photo of Karl
    Karl

    Participant

    Hello All!

    Sharing this not as a question but as a way to help some people using the awesome flir lepton 3.5 and purethermal 2 board!

    I wanted an infared camera that could be easily controlled remotely and could record raw data. The Lepton 3.5 along with the purethermal 2 board provided a lot of options integrated with a raspberry pi. Looking through Groupgets software GetThermal and purethermal1-uvc-capture, I was able to piece together two user interfaces combining opencv and matplotlib with pyqt4.

    The folder IR Data has the python script irdatavXX.X.py and a .ui file. IR Data is configured to run on a raspberry pi 3b+ at a 45% CPU usage (cv2.resize takes up too much resources on the pi).

    IR Data Abilities:
    -View IR Camera Stream
    -Display Max and Min Temperatures
    -Record Raw Data as HDF5 without overloading CPU
    -Save Specific Filenames to Directories

    The folder IR Data Viewer has the python script irDataViewervXX.py and another .ui file. IR Data Viewer is a post processing script designed to take in the binary .HDF5 files and process them into a matplotlib figure.

    IR Data Viewer Abilities:
    -View .HDF5 Recorded Raw Data in matplotlib format
    -Save .AVI Files of specific length
    -Save PNG Images
    -Generate TIFF Files for further processing in Matlab or GNU Octave
    -View Temperatures at any pixel on the frame
    -Zoom in and analyze your data in depth
    -Executable files are included for Linux and Windows Machines!

    Special thanks to the developers of GetThermal and the Flir Community Forum.

    #11747

    Profile photo of Karl
    Karl

    Participant

    #11754

    Profile photo of Allison
    Allison

    Moderator

    Hi Karl,

    Thank you for being so active on the forums and sharing your progress with other users along the way. It looks like you’ve been able to implement a lot of new and exciting features with the Lepton.

    Thank you,
    Allison Torchia

    #11755

    Profile photo of Karl
    Karl

    Participant

    No problem,

    I had a lot of help along the way from others and don’t mind sharing at all.

    Karl

    #11762

    Profile photo of Shuangjun
    Shuangjun

    Participant

    Is this also working on Windows?
    Thanks.

    #11763

    Profile photo of Karl
    Karl

    Participant

    Short answer, No.

    The IR Data Viewer works after recording the raw file using IR Data on a linux machine.

    However Flir released a very good program for windows linked here: https://lepton.flir.com/wp-content/uploads/2015/06/PureThermal-2-Basic-Lepton-Features.pdf

    #11765

    Profile photo of Shuangjun
    Shuangjun

    Participant

    I tried the app mentioned in the lecture
    https://lepton.flir.com/wp-content/uploads/2015/06/PureThermal-2-Basic-Lepton-Features.pdf

    So the problem is that the windows demo app facilitates key functions on windows which means the pure thermal driver is well available. So does the basic SDK on which the app depends.

    If flir can release this SDK, it will be great help.

    #11769

    Profile photo of Allison
    Allison

    Moderator

    Hi Shuangjun,

    The FLIR Lepton SDK can be found here: https://lepton.flir.com/sdk/

    It can be used on windows and has the capability to get raw IR data from the lepton. Karl’s code https://github.com/Kheirlb/purethermal1-uvc-capture isn’t written for windows which is why it won’t run easily on windows. The SDK available for download will work on windows.

    Thank you,
    Allison Torchia

    #11770

    Profile photo of Shuangjun
    Shuangjun

    Participant

    Is there a demo of how to use this SDK.
    If I want to communicate with purethermal and get a frame of raw data.
    What will the code be like.

    The definition of device doesn’t even list a USB device option.

        typedef enum LEP_PROTOCOL_DEVICE_E_TAG
        {
            /* I2C Devices */
            AARDVARK_I2C = 0,
            DEV_BOARD_FTDI_V2,
            //C232HM_DDHSL_0,
    		TCP_IP,
    
            /* SPI Devices */
    
            LEP_END_PROTOCOL_DEVICE,
        }
    

    Thank you.

    #11771

    Profile photo of Allison
    Allison

    Moderator

    Hi Shuangjun,

    I apologize for the confusion. I would check out this example code: https://github.com/groupgets/purethermal1-uvc-capture. The PureThermal Boards output UVC video from the Lepton, so libuvc is used to interface with the Purethermal board in this example. The lepton SDK deals with a lot of the communication and functions of the Lepton while Libuvc is used to communicate with the purethermal board.

    Thank you,
    Allison Torchia

    #12565

    Profile photo of Hardik
    Hardik

    Participant

    Hi,</p><br />
    <p>I am working with Flir Lepton 2.5 Radiometric development kit-14654 interfaced with Rpi, I got the raw.bin values using LEP_GetSysFpaTemperatureKelvin. I read in the flir software IDD that this are the values between 0 to 65535 with units kelvin and scale factor 100. how can I convert those values into corresponding temperature values. Is there some relationship to extract the temperature data from this values.</p><br />
    <p>Any help would be appreciated</p><br />
    <p>Thank you

    • This reply was modified 1 year, 9 months ago by Profile photo of Hardik Hardik.

    #14868

    Profile photo of Irene
    Irene

    Participant

    Hello everyone,

    First, thank you Karl for your app, it is exactly what I needed! I was successful on the installation and I can see the camera and so on.

    However, the Lepton loses connection after few seconds. The image freezes. I tried to change the SPI time on the cmdline.txt by adding: spidev.bufsiz=131072 but it didn’t solve the problem.

    Have anyone encountered this problem? How did you solve it?

    I’m a new user of Raspberry Pi and Lepton and it’s getting harder for me to know what to change in which files and so on.

    Thank you in advance for your help! 🙂

    #14887

    Profile photo of Marv
    Marv

    Participant

    HI
    I saw the project in the GITHUB and I have succesfully run the RecordIR_v18.3.py. However, when I run the file PostProcessI_v11.py I got an error “_init_()” missing 1 required positional argument: ‘figure’

    Please, can somebody help me how can I save how can I solve this problem ? . I want to use it to save the as tiff file the raw data. Moreover, I do not how to open the IR data VIewer.

    Thank you.

    #14891

    Profile photo of Jesica Leticia
    Jesica Leticia

    Participant

    Hi Marv
    I tried the GITHUB project two weeks ago and I had the same problem as you. I solved it changing the backend of matplotlib. You can do that by changing:
    matplotlib.backends.backend_qt4agg
    to:
    matplotlib.backends.backend_qt5agg
    in lines 27 and 28 of the PostProcessIR_v11.py archive and run it again.

    Now everything is running but I have the same problem as Irene, I lost connection with the Lepton module after a few seconds of recording and the image freezes. It is a huge problem because for my application I need it to be connected during at least a couple of hours.
    If someone nows how to solve it I’d be really thankful!

    #14892

    Profile photo of Karl
    Karl

    Participant

    Hello everyone,

    First off, really awesome to see you all using this software. Wanted to address two things.

    1 – I recently was requested to update from PyQt4 to PyQt5 and I’m still facing some issues from that update such as the matplotlib library change. Thanks you Jesica for figuring that out. Overall the speed and abilities of the program have improved.

    2. Regarding the sync dropout, I’ve been able to record for a couple minutes without issues but have not attempted hours of recording yet. I use a raspberry pi 3b+ and was wondering if you are using a different version of the pi? This question is to Irene and Jesica. Also which folder are you saving the recording to on your pi? Make sure it is saving to a user directory such as Documents or Desktop.

    Best of luck everyone,

    Karl

    #14893

    Profile photo of Irene
    Irene

    Participant

    Hello,

    Thanks Karl for your message. I have the same raspberry pi as you, 3b+, and the directory I use is Documents.

    I’d appreciate if you or someone else can let me know if you manage to solve the sync dropout problem, please.

    Cheers,

    Irene

    #14895

    Profile photo of Karl
    Karl

    Participant

    Hello everyone,

    I had some time this weekend and I was able to update the repository a bit. There is now a build script and a couple more libraries which may help solve your sync problems if the issue is related to a library/package install. https://github.com/Kheirlb/purethermal1-uvc-capture

    On my end, I started the lepton feed and recorded for 17 minutes without errors (no loss of connection) and probably let it stream well over an hour on a Raspberry Pi 3 Model B v1.2 today. Unfortunately I haven’t been able to recreate your sync dropout issue. :/

    The only issue I can think of is that it might be the power supply to your raspberry pi? This was a problem I faced early on in development for me because the lepton would cause the pi to dip below 5 volts. As you would imagine, I tried using a “worse” power supply today but I couldn’t replicate the issue. I’d still recommend investing in a 5.25V power supply such as this one (its what I use and the adafruit explains the issue really well). https://www.adafruit.com/product/1995

    Let me know if you have make any progress! I did a complete reinstall today using the April 2019 Raspbian Stretch with desktop and the new build script. If anything, maybe a complete reinstall will fix some of these issues?

    Best regards,

    Karl

    #14965

    Profile photo of Ting
    Ting

    Participant

    Hello
    I use Lepton 2.5 on the Pure Thermal 2 not Lepton 3.5.
    Can I use the following the code?
    repository: https://github.com/Kheirlb/purethermal1-uvc-capture.

    Thank you,
    Ting

    #15030

    Profile photo of Karl
    Karl

    Participant

    Ting,

    If you haven’t already tried, I believe it will work just fine. When viewing the visuals, instead of scaling resolution from 160×120 to 640×480 it will have to do that from 80×60. I believe the resolution is the only main difference between the lepton 2.5 and 3.5.

    Karl

    #16069

    Profile photo of Cheou Sheng
    Cheou Sheng

    Participant

    Hi, currently I am using PureThermal board 2 with Lepton 2.5 radiometry, I would like to know how can I get the raw data if I am using OpenCV with c++ language. Is there any c++ SDK that I can use to get raw data from the USB connected to Purthermal board 2? I want c++ source code that actually can get the raw data from the IR image.

Viewing 20 posts - 1 through 20 (of 30 total)

You must be logged in to reply to this topic.