Closed alduxvm closed 4 years ago
This application uses libuvc, rather than v4l2, to get data from the camera. That said, the output looks mostly OK, other than all this UVC_GetAttribute failed: -9
. I wonder if this is something with the 2.0 core?
You can try the python uvc-capture.py example from here https://github.com/groupgets/purethermal1-uvc-capture -- this also uses libuvc, but does not use QT, so it will cut out a third of the problem at least.
thanks for the fast reply!
Testing python opencv-capture.py
from the purethermal1-uvc-capture works normally:
Can you check that GetThermal is using the same version of libuvc, like if you have a different version installed that it is picking up instead? LD_DEBUG=libs
might help with this
Where can I check the LD_DEBUG? in the GetThermal.pro or the Makefile thats inside build?
Strangely I tried to do it in a mac, and got the same issue... the white screen...
I dug up a 2.0 camera core and replicated this issue on the master branch. I tried the master+upstream-libuvc branch, and it worked.
There were a few libuvc fixes related to the multiple altsettings that we implemented for the 1.3.0 firmware, and GetThermal uses a higher bandwidth altsetting for RGB than the uvc capture examples, so I'm guessing this is the problem.
You'll want to build and install libuvc from our fork for MacOS, but for linux you can use the upstream libuvc.
Please let me know how the build goes for you, it might be time to merge these changes into master.
I found a strange behaviour when I was doing some tests...
Using the breakout board v1.4 and a raspberry, using the LeptonModule I get this camera behaviour when I turn on a lighter close to the camera:
https://i.imgur.com/UGfiLcV.mp4
And when I tried the breakout board 2.0 via usb to the raspberry pi and using vlc to record, trying the same experiment, the camera behaves different!!:
https://i.imgur.com/j3SgtwE.mp4
Is this common? or my lepton core is damaged? what do you think?
This is working as it should do, and might clear up a comment I made above about GetThermal trying to grab the higher bandwidth RGB channel rather than Y16.
Your first video is grabbing Y16 (the raw thermal data, though it isn't radiometric on your 2.0 core) and applying a linear AGC across the whole image in software, and colorizing with the "ironblack" palette also in software.
Your second video is FLIR's hardware AGC that does a type of adaptive histogram equalization to improve contrast throughout the image, and also applying a different color palette in hardware. The camera returns data in 24-bit RGB format to support, and it is color downsampled for YUV420 or YUV422 that VLC will deal with. This image will look slightly better in GetThermal, because it will grab the original RGB stream, but this is what requires the high bandwidth altsetting.
https://lepton.flir.com/application-notes/basic-agc-for-radiometric-lepton-images
Thanks for the great explanation!
This is the output of GetThermal
using the PT2 on the RPI: https://i.imgur.com/iw3qWuT.mp4
There are some lines on the right side of the screen... but the output does look slightly better as you mention... When trying to deactivate the AGC in the GUI, the frame froze...
Also, I tried again in my ubuntu 18.04 computer, I compiled and installed the libusb version from the github directly and then proceed to compile GetThermal
, but got this error:
g++ -c -pipe -O2 -g -std=gnu++11 -flto -fno-fat-lto-objects -Wall -W -Wall -D_REENTRANT -fPIC -D__STDC_LIMIT_MACROS -DGIT_VERSION="\"v0.1.4\"" -D_TTY_NOWARN_ -DQT_NO_DEBUG -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../../GetThermal -I. -I../lepton_sdk/Inc -I/home/aldux/GetThermal/libuvc/build/include -I/home/aldux/GetThermal/libuvc/include -I../inc -isystem /usr/include/libusb-1.0 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtQuick -isystem /usr/include/x86_64-linux-gnu/qt5/QtMultimedia -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtQml -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -Imoc -isystem /usr/include/libdrm -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o obj/main.o ../src/main.cpp
g++ -c -pipe -O2 -g -std=gnu++11 -flto -fno-fat-lto-objects -Wall -W -Wall -D_REENTRANT -fPIC -D__STDC_LIMIT_MACROS -DGIT_VERSION="\"v0.1.4\"" -D_TTY_NOWARN_ -DQT_NO_DEBUG -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../../GetThermal -I. -I../lepton_sdk/Inc -I/home/aldux/GetThermal/libuvc/build/include -I/home/aldux/GetThermal/libuvc/include -I../inc -isystem /usr/include/libusb-1.0 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtQuick -isystem /usr/include/x86_64-linux-gnu/qt5/QtMultimedia -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtQml -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -Imoc -isystem /usr/include/libdrm -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o obj/uvcvideoproducer.o ../src/uvcvideoproducer.cpp
g++ -c -pipe -O2 -g -std=gnu++11 -flto -fno-fat-lto-objects -Wall -W -Wall -D_REENTRANT -fPIC -D__STDC_LIMIT_MACROS -DGIT_VERSION="\"v0.1.4\"" -D_TTY_NOWARN_ -DQT_NO_DEBUG -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../../GetThermal -I. -I../lepton_sdk/Inc -I/home/aldux/GetThermal/libuvc/build/include -I/home/aldux/GetThermal/libuvc/include -I../inc -isystem /usr/include/libusb-1.0 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtQuick -isystem /usr/include/x86_64-linux-gnu/qt5/QtMultimedia -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtQml -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -Imoc -isystem /usr/include/libdrm -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o obj/uvcacquisition.o ../src/uvcacquisition.cpp
../src/uvcacquisition.cpp: In member function ‘void UvcAcquisition::setVideoFormat(const QVideoSurfaceFormat&)’:
../src/uvcacquisition.cpp:153:21: error: ‘UVC_FRAME_FORMAT_I420’ was not declared in this scope
uvcFormat = UVC_FRAME_FORMAT_I420;
^~~~~~~~~~~~~~~~~~~~~
../src/uvcacquisition.cpp:153:21: note: suggested alternative: ‘UVC_FRAME_FORMAT_NV12’
uvcFormat = UVC_FRAME_FORMAT_I420;
^~~~~~~~~~~~~~~~~~~~~
UVC_FRAME_FORMAT_NV12
../src/uvcacquisition.cpp:159:21: error: ‘UVC_FRAME_FORMAT_Y16’ was not declared in this scope
uvcFormat = UVC_FRAME_FORMAT_Y16;
^~~~~~~~~~~~~~~~~~~~
../src/uvcacquisition.cpp:159:21: note: suggested alternative: ‘UVC_FRAME_FORMAT_NV12’
uvcFormat = UVC_FRAME_FORMAT_Y16;
^~~~~~~~~~~~~~~~~~~~
UVC_FRAME_FORMAT_NV12
Makefile:721: recipe for target 'obj/uvcacquisition.o' failed
make: *** [obj/uvcacquisition.o] Error 1
I'm not really sure what's up with that output on raspberry pi, I haven't seen anything like this before, and I'm not seeing it on my 2.0 core with the same setup as you. Does it persist after power cycling the camera?
It looks like your ubuntu build isn't building code from the master+upstream-libuvc branch, the UVC_FRAME_FORMAT_Y16
would be replaced with UVC_FRAME_FORMAT_GRAY16
in this branch.
Is this issue resolved?
yes we can close it, thanks!!
What was the actual resolution? I'm still getting this error on a RPi4 after following the instruction on the wiki. It seems those haven't been updated in 3 years though so probably don't include the modifications needed for the RPi4.
Hi all,
I'm using a lepton 2.0, the pt2 and an ubuntu laptop.
I successfully compiled
GetThermal
after a lot of issues and missing dependencies with qt. When I open the device using VLC it does work and I can see the thermal image from/dev/video1
, but when I execute:sudo ./GetThermal
I see the next screen:
The output in the terminal is:
I'm not sure if its a problem of a missing qt dependency or a problem with the compilation or with my camera...