从灰度图像获取温度值

问题描述 投票:0回答:1

我使用的是带有热像仪的 Anafi Parrot Thermal 无人机。由于对 Olympe 库的支持很差,使用这架无人机做事相当困难,但是,我终于能够获得用热像仪拍摄的略有不同的图像。问题是我不知道如何从该图像中获取温度值,因为它本身只是一个灰度图像,我已经看到有一些公式可以做到这一点,但此时我很迷失。我使用 Python 和 Olympe 库完成所有这些工作。

First photo with no hot objects

在第二张图片上,我很想比较这些图像:

Photo with some fire

我将包含一些代码,但我已经尝试为所有内容设置不同的参数,并且使用此设置可以获得最好的结果:

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()

我在 Python 程序本身中尝试了不同的照片模式,还进行了一些 Gray16 转换,但到目前为止我什么也没得到。

python temperature
1个回答
0
投票

我会先说:我不熟悉 Olympe 或你们的系统。该文档确实看起来相当混乱。
因此,在没有任何关于无人机上热像仪类型的指示的情况下,我只能假设比例是线性的。

如果您知道照片中允许的最低和最高温度(您应该能够通过自己设置来获得这些温度,就像在代码片段中所做的那样;或者通过在拍摄照片时查看

palette_settings
消息事件来获得)照片),您应该能够线性缩放像素值以获得它们的温度,如下所示:

pixel_temp = (pixel_value / 255.) * (highest_temp - lowest_temp) + lowest_temp
© www.soinside.com 2019 - 2024. All rights reserved.