颜色不一致(随机色调)

问题

使用相同设置捕获的彩色图像中偶尔可能会出现随机色调(例如绿色、黄色、粉色、紫色)。

../_images/green-pink-tint-in-the-color-image.png

原因

场景中的环境光很强,当使用交流电 (AC) 电源时,它会闪烁。2D 设置中的曝光时间没有针对电网频率进行补偿。因此,电网会造成 环境光 干扰,从而导致彩色图像出现随机色调。

潜在解决方案

修改捕获设置

首先,确定您所在地区的环境光(电网)频率。

打开 Zivid Studio 并连接到您的相机。单击 Capture 部分中的三个点。然后单击 Measure scene lighting conditions 。软件将显示检测到的环境光闪烁频率。

../_images/studio-measure-ambient-light.png

或者,使用 SDK 测量环境光条件。此方法将报告是否检测到明显的环境光闪烁,以及它对应的电网频率是 50 Hz 还是 60 Hz。

转至源代码

源码

std::cout << "Measuring scene conditions" << std::endl;
auto sceneConditions = camera.measureSceneConditions();
auto flickerClassification = sceneConditions.ambientLight().flickerClassification().toString();
std::cout << "Flicker classification: " << flickerClassification << std::endl;
    auto flickerFrequency = sceneConditions.ambientLight().flickerFrequency();
    std::cout << "Measured flickering frequency in the scene: " << flickerFrequency << " Hz." << std::endl;
转至源代码

源码

Console.WriteLine("Measuring scene conditions");
var sceneConditions = camera.MeasureSceneConditions();
var flickerClassification = sceneConditions.AmbientLight.FlickerClassification.ToString();
Console.WriteLine("Flicker classification: " + flickerClassification);
    var flickerFrequency = sceneConditions.AmbientLight.FlickerFrequency;
    Console.WriteLine($"Measured flickering frequency in the scene: {flickerFrequency} Hz.");
转至源代码

源码

print("Measuring scene conditions")
scene_conditions = camera.measure_scene_conditions()
flicker_classification = scene_conditions.ambient_light.flicker_classification
print(f"Flicker classification: {flicker_classification}")
    flicker_frequency = scene_conditions.ambient_light.flicker_frequency
    print(f"The measured flickering frequency in the scene: {flicker_frequency} Hz.")

使用适当的预设值

如果您使用预设值,请选择针对 50 Hz 或 60 Hz 定制的预设值。这些预设值可在 Zivid Studio 或 Presets(预设值) 页面找到。

手动调整设置

如果您已手动配置设置,请确保您的曝光时间与您所在地区的电网频率适配。

在存在强烈闪烁的环境光源的情况下,使用电网频率倍数的采样率(曝光时间):

  • 在 50 Hz 电网频率下为 10 000 µs 的倍数。

  • 在 60 Hz 电网频率下为 8 333 µs 的倍数。

此方法将消除随机色调,如下面校正后的图像所示。请记住,使用补偿电网频率的曝光时间设置可能会增加捕获时间。

../_images/no-tint-in-the-color-image.png

如果由于 2D 图像过度曝光而无法调整曝光时间以匹配电网频率,则可使用 2D 采样间隔 (仅限 Zivid 3)并将其与您所在区域的电网频率同步。

  • 10 000 µs in the presence of 50 Hz grid frequency.

  • 8 333 µs in the presence of 60 Hz grid frequency.

此方法还能消除随机色偏。捕获时间会增加,增幅大致相当于为匹配电网频率而调整的曝光时间,甚至略多。如果曝光时间接近采样间隔,捕获时间可能会出现一些波动。例如,如果曝光时间为 9000 微秒,采样间隔为 10000 微秒,则实际采样可能发生在 20000 微秒(因为曝光时间加上图像处理耗时可能超过 10000 微秒)。此外,连续的 2D 捕获之间可能会出现轻微的亮度变化(当使用单次采集且禁用色调映射,并且曝光时间远小于采样间隔时)。

隔绝环境光

处理环境光的最好方法是消除它。

关闭 Zivid 相机附近不必要的光源。

如果无法移除光源,可在场景周围使用光障来阻挡光源。这些光障不需要是实心的;深色窗帘或类似材料就足够了。

改变环境光

如果无法消除环境光,请考虑使用不会因使用了交流电源而产生闪烁的光源。

请选择直流电供电的灯光,例如频率≥1 kHz的聚光灯或LED灯。这将减少闪烁并防止图像中的颜色不一致。

版本历史记录

SDK

变更

2.17.0

增加了对采样间隔设置(Sampling Interval)的支持。