LJMUAstroecology / flirpy

Python library to interact with FLIR camera cores
Other
191 stars 54 forks source link

Use case for raw2temp #33

Open csedwar opened 3 years ago

csedwar commented 3 years ago

I'm wondering if you can provide an example use case of raw2temp...information online is scarce related to converting boson data to temperatures.

jveitchmichaelis commented 3 years ago

The main use case is converting FLIR raw formats (eg SEQ from the Duo Pro R) which provide counts and calibration coefficients. This is not possible for the Boson unless you perform a radiometric calibration yourself and compute those coefficients, unfortunately. FLIR has said for the last two years that a radiometric variant is imminent, but nothing has been released yet.

Some info on the formula here https://flirpy.readthedocs.io/en/latest/getting_started/cameras.html#radiometry

This is something I'm actively working on as a researcher and I hope I can provide some instructions when we have a confirmed procedure. It's not trivial though, you will almost certainly need an environmental or temperature controlled chamber of some kind.

What you will find is that the count rates from the Boson are repeatable for a particular temperature object at a particular stable camera temperature. If the camera is not in thermal equilibrium we've observed a strong hysteresis effect. That is, the count you measure for a stable object will differ depending on whether the camera is heating or cooling, and how rapidly it's doing so.

csedwar commented 3 years ago

Yeah. That's what I was concerned about. I have 2 calibration targets (v-groove, painted) that are instrumented which I can use to derive the calibration on a per-scene basis, which overall is actually fine...its just annoying. I'm pretty confident the cores in a boson have no physical reason why one cant do radiometry. The big problem for me is that drift you were talking about if the camera temp changes dramatically during the scene acquisition. Good news for me is my acquisitions are short and i'd wait until the camera has mostly stabilized.

csedwar commented 3 years ago

Side note (i also have a Duo Pro R), have you had any success dealing with a non-uniformity in temperature across the image. I see a ~1K delta from center to side looking at my cal-targets. It really appears to be a lens based effect, and probably needs a different NUC or other but i've never been able to figure out if this is actually possible to perform with the duo pro r whereas its super obvious how to do this with the Boson (though not that it seems to really mean that much).

jveitchmichaelis commented 3 years ago

Hmm we have seen significant vignetting too. One approach I've used for aerial imagery is to just do a sort of dynamic flat field, using the median of the previous 100 frames. That works reasonably well for images captured with motion.

But I don't think you can do much with the Duo itself, it's frustratingly locked down. You'd have to do it in post.

I think an issue with the Boson is that it runs very hot and has almost no thermal mass. There may also be issues like asymmetric heating between the lens and the camera body. Maybe if you used a large heatsink (if weight allowed) it might work better. I've found even in a chamber, if the temperature variation oscillates by even a fraction of a degree, you still get noticeable hysteresis of a few hundred counts.

csedwar commented 3 years ago

Seems like we're learning the same things! Sigh. I really do not understand why the Duo Pro R has fewer capabilities than the Boson in terms of calibration but the Boson cannot provide a linear output. And yeah. a median is likely to work well.

Do you find the Boson is just a shift (e.g. all the counts move up by the same few hundred counts with the temp of the FPA?). I mean i'm not against picking a reference image and tying everything to that either (when rastering a scene), assuming I have calibration targets of known temperatures. I also expect one could trend the FPA temp and figure out a reasonable-ish relationship.

If you develop a calibration procedure i'd love to see it. I'm also thinking about doing it and if i do something worthwhile before you i'll be sure to share.