Sampling(采样)- 2D

Color

Setting Settings2D::Sampling::Color to rgb or grayscale specifies the type of information that can be captured from the scene. Depending on camera model the setting will have different options.

Available Settings2D::Sampling::Color values

Zivid 2/2+

Zivid 2+ R

Zivid 3

rgb

rgbStrongAmbientLight

grayscale

The behavior of different capture functions in relation to Settings2D::Sampling::Color is as follows:

Capture2D3D()Capture2D()

  • Acquire full color information when Settings2D::Sampling::Color is set to rgb.

  • Acquire texture or intensity information when Settings2D::Sampling::Color is set to grayscale.

Capture3D()

  • Does not acquire color or texture information, regardless of the Settings2D::Sampling::Color setting.

  • 为所有像素分配统一的 RGB 值( \(R=200\)\(G=50\)\(B=200\) ),从而产生粉红色的图像和点云。

可用捕获函数和 Settings2D::Sampling::Color 选项组合的结果

捕获功能

Settings2D::Sampling::Color

2D 图像

点云

Capture2D3D()

rgb

RGB图像

RGB图像

rgbStrongAmbientLight

RGB图像

RGB图像

grayscale

灰度图像

灰度图像

__not_set__

RGB图像

RGB图像

Capture2D()

rgb

RGB图像

/

rgbStrongAmbientLight

RGB图像

/

grayscale

灰度图像

/

__not_set__

RGB图像

/

Capture3D()

rgb

粉色图像

粉色图像

rgbStrongAmbientLight

粉色图像

粉色图像

grayscale

粉色图像

粉色图像

__not_set__

粉色图像

粉色图像

当使用 Capture2D3D() 并将 Settings2D::Sampling::Color 设置为 rgb 时,将得到彩色点云 当使用 Capture2D3D() 并将 Settings2D::Sampling::Color 设置为 rgb 时,将得到彩色点云
当使用 Capture2D3D() 并将 Settings2D::Sampling::Color 设置为 grayscale(灰度)时,将得到不带颜色数据的点云 当使用 Capture2D3D() 并将 Settings2D::Sampling::Color 设置为 grayscale(灰度)时,将得到不带颜色数据的点云
当使用 Capture3D() 时,无论 Settings2D::Sampling::Color 如何,将得到粉红色的点云 当使用 Capture3D() 时,无论 Settings2D::Sampling::Color 如何,将得到粉红色的点云
当使用 Capture2D3D() 或 Capture2D() 并将 Settings2D::Sampling::Color 设置为 rgb 时,输出的 2D 图像是彩色的 当使用 Capture2D3D() 或 Capture2D() 并将 Settings2D::Sampling::Color 设置为 rgb 时,输出的 2D 图像是彩色的
当使用 Capture2D3D() 或 Capture2D() 并将 Settings2D::Sampling::Color 设置为灰度时,输出的 2D 图像是灰度图像 当使用 Capture2D3D() 或 Capture2D() 并将 Settings2D::Sampling::Color 设置为灰度时,输出的 2D 图像是灰度图像
当使用 Capture3D() 时,无论 Settings2D::Sampling::Color 如何设置,2D 图像显示为一副粉红色图像 当使用 Capture3D() 时,无论 Settings2D::Sampling::Color 如何设置,2D 图像显示为一副粉红色图像

Pixel

The Settings2D::Sampling::Pixel parameter is used to choose the sampled pixels to generate 2D image. Depending on camera model the setting will have different options.

Available Settings::Sampling::Pixel values

Zivid 2/2+

Zivid 2+R/3

all

by2x2

by4x4

blueSubsample2x2

redSubsample2x2

blueSubsample4x4

redSubsample4x4

给定相机的相应分辨率如下:

3D 捕获分辨率

3D 捕获

Zivid 3

Zivid 2+/2+R

Zivid 2

全分辨率 [1]

2816 x 2816

2448 x 2048

1944 x 1200

2x2 [1]

1408 x 1408

1224 x 1024

972 x 600

4x4 [1]

704 x 704

612 x 512

不适用

当设置为 all 时,所有像素都会被采样,并且二维图像具有全分辨率。

下图展示了传感器网格和相关索引。

传感器网格

当我们进行子采样/下采样(2x2)时,我们得到原始像素数量的 1/4 的像素。

子采样后的像素

这意味着,在进行 2x2 子采样或下采样之后,x 和 y 轴上的像素数量将除以 2。对于 4x4 进行子采样,x 和 y 轴上的点数量将除以 4。

As an example see the zoomed-in sections of three images of the same scene, each captured with different Settings2D::Sampling::Pixel setting.

all all
by2x2 by2x2
by4x4 by4x4

子采样缩短了采集和捕获时间,因为需要捕获和处理的数据量减少了。此外,它消除了将数据下采样以转换为更易管理大小的需求,从而减少了存储和后处理的要求。数据量减少到四分之一后,用户的后处理(例如,基于AI的分割算法)速度会更快。

Interval(间隔)

Sampling Interval(采样间隔)设置控制 2D 图像采集的时间,以避免受到外部光源的干扰。

备注

2D Sampling Interval (2D 采样间隔)功能仅适用于 Zivid 3。

When Settings2D::Sampling::Interval is disabled, the camera captures images as quickly as possible, based solely on the specified exposure times.

When Settings2D::Sampling::Interval is enabled, the base time interval for 2D image acquisition is defined by the Settings2D::Sampling::Interval::Duration parameter. Actual acquisitions will align with the nearest multiple of this duration, depending on the exposure times.

例子

  • 如果曝光时间为 3000 微秒,采样间隔持续时间为 10000 微秒,则采集将在 10000 微秒 (1 x 10000 微秒) 时发生。

  • 如果曝光时间为 15000 微秒,采样间隔持续时间为 10000 微秒,则采集将在 20000 微秒 (2 x 10000 微秒) 时发生。

  • 如果曝光时间为 9000 微秒,持续时间为 10000 微秒,由于系统开销,采集可能仍会在 20000 微秒时发生。这种行为在运行时确定,无法预先预测。

当曝光时间接近采样间隔持续时间时,由于内部处理开销,捕获时间可能会波动。

适应闪烁的环境光

采样间隔在存在闪烁的环境光的环境中尤其有用,例如:

  • 交流电(AC)供电的荧光灯

  • 带强光LED照明的条形码扫描器

如果曝光时间未与电网频率同步,闪烁的光源可能导致所捕获图像出现颜色不一致的问题,例如 随机出现绿色或粉色色偏

交流电灯闪烁

为了缓解这种情况:

  1. Enable Settings2D::Sampling::Interval

  2. Set Settings2D::Sampling::Interval::Duration based on the grid frequency:

    • 10 000 µs for 50 Hz

    • 8 333 µs for 60 Hz

这种同步有助于避免闪烁光线的干扰,并确保色彩还原的一致性。

备注

Exposure Time(曝光时间) 与电网频率匹配比使用采样间隔更好。采样间隔仅作为备选方案,例如,当无法通过调整曝光时间来避免 2D 图像过曝时。另一个例子是,当使用更长的曝光时间来补偿时,需要将投影仪亮度降低过多,从而导致彩色图像噪点增加。这种情况在使用 rgb 模式时会出现,而使用 rgbStrongAmbientLight 时则不会。

If your exposure times already compensate for flicker (e.g., 10 000 µs for 50 Hz), it is recommended to keep Settings2D::Sampling::Interval disabled.

主动光源

采样间隔还可以用于与主动脉冲光源(例如条形码扫描器、LED频闪灯)同步,从而有助于最大限度地减少干扰并提高图像质量。了解更多关于 如何避免来自自动光源的干扰

版本历史记录

SDK

变更

2.17.0

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