Sampling(采样)- 2D
Color
将 Settings2D::Sampling::Color 设置为 rgb 或 grayscale 可指定可从场景中捕获的信息类型。根据相机型号,设置将有不同的选项。
Zivid 2/2+ |
Zivid 2+ R |
Zivid 3 |
|
|---|---|---|---|
|
✓ |
✓ |
✓ |
|
✓ |
||
|
✓ |
✓ |
与 Settings2D::Sampling::Color 相关的不同捕获函数的行为如下:
Capture2D3D() 和 Capture2D()
当
Settings2D::Sampling::Color设置为rgb时获取全彩信息。当
Settings2D::Sampling::Color设置为grayscale时获取纹理或强度信息。
Capture3D()
无论
Settings2D::Sampling::Color设置如何,都不会获取颜色或纹理信息。为所有像素分配统一的 RGB 值( \(R=200\) 、 \(G=50\) 和 \(B=200\) ),从而产生粉红色的图像和点云。
捕获功能 |
|
2D 图像 |
点云 |
|---|---|---|---|
|
|
RGB图像 |
RGB图像 |
|
RGB图像 |
RGB图像 |
|
|
灰度图像 |
灰度图像 |
|
|
RGB图像 |
RGB图像 |
|
|
|
RGB图像 |
/ |
|
RGB图像 |
/ |
|
|
灰度图像 |
/ |
|
|
RGB图像 |
/ |
|
|
|
粉色图像 |
粉色图像 |
|
粉色图像 |
粉色图像 |
|
|
粉色图像 |
粉色图像 |
|
|
粉色图像 |
粉色图像 |
Pixel
Settings2D::Sampling::Pixel 参数用于选择采样像素以生成 2D 图像。根据相机型号,设置将有不同的选项。
Zivid 2/2+ |
Zivid 2+R/3 |
|
|---|---|---|
|
✓ |
✓ |
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
✓ |
给定相机的相应分辨率如下:
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。
可在示例中查看同一场景的三张图像的放大部分,每张图像都是使用不同的 Settings2D::Sampling::Pixel 设置捕获的。
子采样缩短了采集和捕获时间,因为需要捕获和处理的数据量减少了。此外,它消除了将数据下采样以转换为更易管理大小的需求,从而减少了存储和后处理的要求。数据量减少到四分之一后,用户的后处理(例如,基于AI的分割算法)速度会更快。
Interval
The Sampling Interval setting controls the timing of 2D image acquisitions to avoid interference with external light sources.
备注
2D Sampling Interval is only available for 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.
Example
If the exposure time is 3 000 µs and the sampling interval duration is 10 000 µs, the acquisition will occur at 10 000 µs (1 x 10 000 µs).
If the exposure time is 15 000 µs and the sampling interval duration is 10 000 µs, the acquisition will occur at 20 000 µs (2 x 10 000 µs).
If the exposure time is 9 000 µs and the duration is 10 000 µs, the acquisition may still occur at 20 000 µs due to system overhead. This behavior is determined at runtime and cannot be predicted in advance.
When the exposure time is close to the sampling interval duration, capture timing may fluctuate due to internal processing overhead.
Adapting to Flickering Ambient Light
The sampling interval is especially useful in environments with flickering ambient light, such as:
Fluorescent lighting powered by alternating current (AC)
Barcode scanners with intense LED illumination
Flickering light can cause color inconsistencies in captured images (e.g., random green or pink tints) if the exposure times are not synchronized with the grid frequency.
Flickering AC-Powered Light
To mitigate this:
Enable
Settings2D::Sampling::IntervalSet
Settings2D::Sampling::Interval::Durationbased on the grid frequency:10 000 µs for 50 Hz
8 333 µs for 60 Hz
This synchronization helps avoid interference from flickering light and ensures consistent color reproduction.
备注
Matching the Exposure Time(曝光时间) to the grid frequency is a better solution than using the sampling interval. Use the sampling interval only as a fallback, e.g., when avoiding overexposure in 2D images by adjusting exposure time is not feasible. Another example is when compensating with the longer exposure time requires lowering the projector brightness too much, causing more noise in the color image. This is the case when using rgb mode, and not when using the rgbStrongAmbientLight mode.
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.
Active Light Sources
The sampling interval can also be used to synchronize with actively pulsing light sources (e.g., barcode scanners, LED strobes), helping to minimize interference and enhance image quality. Learn more about how to avoid interference from active light sources.
Version History
SDK |
Changes |
|---|---|
2.17.0 |
Added support for Sampling Interval setting for Zivid 3 camera. |