颜色不一致(随机色调)

问题

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

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

原因

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

潜在解决方案

修改捕获设置

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

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

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

Alternatively, use the SDK to measure the ambient light conditions. This method will report whether significant ambient light flicker is detected and if it corresponds to a 50 Hz or 60 Hz power grid.

Go to source

source

std::cout << "Measuring scene conditions" << std::endl;
auto sceneConditions = camera.measureSceneConditions();
auto flickerClassification = sceneConditions.ambientLight().flickerClassification().toString();
std::cout << flickerClassification << std::endl;
auto flickerFrequency = sceneConditions.ambientLight().flickerFrequency();
std::cout << "Measured flickering frequency in the scene: " << flickerFrequency << " Hz." << std::endl;
Go to source

source

Console.WriteLine("Measuring scene conditions");
var sceneConditions = camera.MeasureSceneConditions();
var FlickerClassification = sceneConditions.AmbientLight.FlickerClassification.ToString();
var flickerFrequency = sceneConditions.AmbientLight.FlickerFrequency;
Console.WriteLine($"Measured flickering frequency in the scene: {flickerFrequency} Hz.");
Go to source

source

print("Measuring scene conditions")
scene_conditions = camera.measure_scene_conditions()
flicker_classification = scene_conditions.ambient_light.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

隔绝环境光

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

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

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

改变环境光

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

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