Open Bra1nsen opened 3 weeks ago
Hi,
This isn't exactly a bug. None of the control functions (like flat fielding/AGC request) are currently implemented in Flirpy because the way they're communicated to the PureThermal board is not trivial (in Python, anyway). It's unclear to me where most of your code comes from - none of those methods exist in Flirpy so it's not surprising that they don't work. The only methods available for the Lepton beyond core
are some setup functions and a telemetry decoder. This allows for some basic functionality with PureThermal boards, but you don't get control.
The way that the GroupGets library works, is it provides a custom version of libuvc that sends camera commands via UVC extension. In some respect, this is a logical way to add this sort of control, but just implementing a normal serial interface would have made life a lot easier (i.e. as FLIR does with its other camera cores). Their fork of libuvc is now years old and doesn't seem to be maintained.
GetThermal uses a modified version of libuvc for camera image download and control. Even if you have libuvc on your system already, you will have to build the fork.
We might be able to do workaround via this approach: https://github.com/groupgets/purethermal1-uvc-capture, calling v4l2-ctl
via subprocess. That would be fine I think.
Could you check if those V4L commands work on your Pi via a terminal? If they do then it should be straightforward to add support, assuming the later boards work in the same way.
Otherwise you are correct, AGC has no dependence on radiometry. It's just a flat field correction. For example, the Boson was non-radiometric for a long time.
The other option is to use the OEM breakout board which I think works fine on a full size Pi (but not a Zero) and implement the commands over serial. That's a... "on the list" feature, but I haven't had any time to devote to it.
Best Josh
Version 0.3.0
Describe the bug AGC (Automatic Gain Control) settings cannot be enabled on non-radiometric FLIR Lepton cameras when using flirpy. The camera.set_agc(True) command has no effect, and AGC-related settings are unresponsive. In the GetThermal application, we confirmed that AGC control is dependent on radiometry support, as AGC settings are disabled when supportsRadiometry is false. Commenting out this radiometry dependency line in GetThermal was necessary to enable AGC settings.
To Reproduce 1Set up a non-radiometric FLIR Lepton camera with flirpy. 2Attempt to enable AGC using camera.set_agc(True) and configure AGC parameters like set_agc_mode and set_agc_max_gain. 3Verify that AGC settings do not apply, and the image output remains unaffected. 4Confirm AGC dependency on radiometry in GetThermal by opening ~/GetThermal/qml/lepton/AgcControls.qml and observing that 5AGC settings are disabled when supportsRadiometry is false. Comment out or remove enabled: !acq.cci.supportsRadiometry in AgcControls.qml to manually override the dependency.
Expected behavior AGC should be configurable independently of radiometry support, particularly for non-radiometric Lepton cameras, as AGC primarily affects image contrast and should ideally not require radiometric capabilities.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context expected image:
current image:
script used: