0

I'm using a Anafi Parrot Thermal drone which has a thermal camera. It's been quite a struggle to do things with this drone as the support for the Olympe library is quite bad, however, I'm finally able to get a somewhat different image taken with a thermal camera. The thing is that I don't know how to get the temperature values from this image, since it's just a Grayscale image itself, I've seen there are some formulas to do this but I'm quite lost at this point. I'm doing all of this using Python and the Olympe library.

First photo with no hot objects

On this second image I had some fire to compare the images:

Photo with some fire

I'll include a bit of my code, but I already tried setting different parameters for everything and the best results I can get are with this settings:

def setup_photo_burst_mode(drone):
    drone(set_mode(mode="standard")) # command message olympe.messages.thermal.set_mode(mode, _timeout=10, _no_expect=False, _float_tol=(1e-07, 1e-09))
    # Thermal modes standard, disabled, blended. Should disable camera? cam_id 1 apparently is for video only.
    # No Thermal support for streaming video.
    drone(set_rendering(mode="thermal", blending_rate=0))
    drone(set_palette_part(red=0, green=0, blue=0, index=0, list_flags=""))
    drone(set_palette_settings(mode="relative", lowest_temp=273, highest_temp=314, outside_colorization="limited", 
                               relative_range="unlocked", spot_type="hot", spot_threshold=290))
    drone(set_sensitivity(range="low")) 
    drone(set_emissivity(emissivity=1))
    drone(set_camera_mode(cam_id=1, value="photo")).wait()
    drone(
        set_photo_mode(
            cam_id=1,
            mode="single",
            format="rectilinear",
            file_format="dng_jpeg",
            burst="burst_14_over_1s",
            bracketing="preset_1ev",
            capture_interval=0.0,
        )
    ).wait().success()

I've tried different photo modes in the Python program itself, and also doing some Gray16 conversions but so far I've got nothing.

6
  • so there's an auto adjustment on the field of view of the images? then whatever calculations you do will still be relative temperature not actual temperature. Commented Aug 15, 2023 at 19:39
  • Not sure what you mean by auto adjustement on the field of view. I guess you refer to the fact that the color intensity is actually not constant but changes according to the min and max temperature values? If that's the case then yes, it's something that I haven't been able to figure out. The camera should be able to tell me the max and min temperature values, but as of now I haven't been able to find a way to get those values. Even so, for now I'm assuming I have those 2 values, since I need to figure out the temperature conversion. Commented Aug 15, 2023 at 19:48
  • Actually, I've been able to set a min and max temperature for the image to prevent this dynamic behaviour, so that now the image will go from 0C to 40C. I'll update with some photo examples, but this might be helpful in order to get a response. Commented Aug 15, 2023 at 19:51
  • Yes that's what I was getting at. So if you can get the temperature values from the camera it sounds like your situation would be mostly solved. If you're trying to infer the temp just from the image AND you know the range of temp the camera will output then you can convert the scale from pixel or (0.0, 1.0) to temp range or (0.0, 40.0) and that's what you're asking about how to do? But what happens if the temp is below or above the camera's set temp range? Is that involved in the auto adjustment shown in your second example image? Commented Aug 15, 2023 at 20:36
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Aug 15, 2023 at 21:01

1 Answer 1

0

I'll preface this by saying: I'm not familiar with Olympe or your system. The documentation certainly seem quite confusing.
So, in the absence of any indication on the type of thermal camera you have on your drone, I can only assume that the scale is linear.

If you know the minimum and maximum temperatures admissible in your photo (which you should be able to get either by setting them yourself, as you do in your code snippet; or by looking at the palette_settings message event thing when you take your photo), you should be able to just linearly scale the pixel values to get their temperature as follows :

pixel_temp = (pixel_value / 255.) * (highest_temp - lowest_temp) + lowest_temp
Sign up to request clarification or add additional context in comments.

1 Comment

Yep! I got it now, the thing is that the documentation is quite messy and I had to test each photo mode to sort things out. The absolute mode will always stick to a min and a max temperature set by the user, so I can just map those temperature values to the [255 255 255] values of the gray image. In short, I finally got it, thanks for the help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.