2D + 3D Capture Strategy
참고로, 색상 정보가 중요하지 않다면 바로 다음 섹션 selecting 3D and 2D settings based on capture speed 으로 넘어가세요.
(디)팔레타이징 애플리케이션에서 일반적으로 사용되는 많은 감지 알고리즘은 2D 데이터를 기반으로 어떤 물체를 선택할지 식별합니다. 이 글에서는 2D 정보를 수집하는 다양한 방법, 장단점, 그리고 외부 조명 조건에 대한 통찰력을 제공합니다. 또한 다양한 2D-3D 접근 방식, 데이터 품질, 그리고 사이클 시간에 미치는 영향에 대해서도 다룹니다.
2D 데이터를 얻는 방법에는 두 가지가 있습니다.
camera.capture2D(Zivid::Settings).imageRGBA()를 통해 2D 캡처를 별도로 수행합니다. 2D Image Capture Process 을 참조하세요.3D 캡처의 일부
camera.capture2D3D(Zivid::Settings).pointCloud().copyImageRGBA()를 통해 수행합니다, Point Cloud Capture Process 을 참조하세요.
Which one to use depends on your requirements and the machine vision pipeline. We advocate for a dedicated 2D capture as it can use multi-threading and optimized scheduling. Utilizing 2D data from the 3D capture is simpler, but you may have to compromise speed to get desired 2D quality.
팁
When you capture 2D separately, disable RGB in the 3D capture.
This saves both on acquisition and processing time.
Disable RGB in 3D capture by setting Sampling::Color to disabled.
- 우리의 추천 사항:
전체 해상도와 프로젝터를 켜서 2D를 별도로 캡처합니다.
색상이 비활성화된 Subsampled 샘플링된 3D 캡처.
카메라 해상도 및 1:1 매핑
For accurate 2D segmentation and detection, it is beneficial with a high-resolution color image. Zivid 3 has a 8 MPx imaging sensor, Zivid 2+ a 5 MPx sensor, while Zivid 2 has a 2.3 MPx sensor. The following table shows the resolution outputs of the different cameras for both 2D and 3D captures.
2D capture |
Zivid 3 |
Zivid 2+ |
Zivid 2 |
|---|---|---|---|
Full resolution |
2816 x 2816 |
2448 x 2048 |
1944 x 1200 |
2x2 subsampled |
1408 x 1408 |
1224 x 1024 |
972 x 600 |
4x4 subsampled |
704 x 704 |
612 x 512 |
Not available |
3D capture |
Zivid 3 |
Zivid 2+ |
Zivid 2 |
|---|---|---|---|
Full resolution |
2816 x 2816 |
2448 x 2048 |
1944 x 1200 |
2x2 subsampled |
1408 x 1420 |
1224 x 1024 |
972 x 600 |
4x4 subsampled |
704 x 704 |
612 x 512 |
Not available |
capture2D3D() 캡처를 수행하면 2D와 3D 데이터가 모두 포함된 프레임이 생성됩니다.
2D 데이터는 두 가지 방법으로 추출할 수 있습니다.
frame.frame2D().imageRGBA_SRGB()이는 2D를 독립적으로 캡처한 것과 같습니다.
frame.pointCloud().copyImageRGBA_SRGB()이렇게 하면 2D와 3D의 해상도가 달라야 하는 설정에서도 1:1 매핑이 보장됩니다.
Output resolution of 2D captures is controlled via the Settings2D::Sampling::Pixel setting and the output resolution of 3D captures via the combination of the Settings::Sampling::Pixel and the Settings::Processing::Resampling settings.
See Pixel Sampling (2D), Pixel Sampling (3D) and Resampling.
For accurate 2D segmentation and detection, it is common to require high-resolution 2D data.
For example, our recommended preset for Consumer Goods Z2+ MR130 Quality preset uses Settings::Sampling::Pixel set to by2x2.
In this case, either:
3D 데이터를 업샘플링하여 1대1 대응을 복원하거나
2D 인덱스를 하위 샘플링된 3D 데이터의 인덱스에 매핑하거나
frame.pointCloud().copyImageRGBA_SRGB()통해 포인트 클라우드에서 2D 데이터를 가져옵니다.
Resampling
To match the resolution of the 2D capture, apply an upsampling which undoes the subsampling. This retains the speed advantages of the subsampled capture. For example:
auto settings2D = Zivid::Settings2D{
Zivid::Settings2D::Acquisitions{ Zivid::Settings2D::Acquisition{} },
Zivid::Settings2D::Sampling::Pixel::all,
};
auto settings = Zivid::Settings{
Zivid::Settings::Engine::stripe,
Zivid::Settings::Acquisitions{ Zivid::Settings::Acquisition{} },
Zivid::Settings::Sampling::Pixel::blueSubsample2x2,
Zivid::Settings::Sampling::Color::disabled,
Zivid::Settings::Processing::Resampling::Mode::upsample2x2,
};
settings_2d = zivid.Settings2D()
settings_2d.acquisitions.append(zivid.Settings2D.Acquisition())
settings_2d.sampling.pixel = zivid.Settings2D.Sampling.Pixel.all
settings = zivid.Settings()
settings.engine = "stripe"
settings.acquisitions.append(zivid.Settings.Acquisition())
settings.sampling.pixel = zivid.Settings.Sampling.Pixel.blueSubsample2x2
settings.sampling.color = zivid.Settings.Sampling.Color.disabled
settings.processing.resampling.mode = zivid.Settings.Processing.Resampling.Mode.upsample2x2
자세한 내용은 Resampling 을 참조하세요.
다른 옵션은 2D 인덱스를 하위 샘플링된 3D 데이터의 인덱스에 매핑하는 것입니다. 이 옵션은 조금 더 복잡하지만, 잠재적으로 더 효율적입니다. 포인트 클라우드는 하위 샘플링된 상태로 유지될 수 있으므로 메모리와 처리 능력을 덜 소모합니다.
전체 해상도 2D 데이터와 하위 샘플링된 포인트 클라우드 간의 상관관계를 확립하려면 특정 매핑 기법이 필요합니다. 이 과정은 베이어 그리드의 파란색 또는 빨간색 픽셀에 해당하는 픽셀에서 RGB 값을 추출하는 과정을 포함합니다.
Zivid::Experimental::Calibration::pixelMapping(camera, settings); 을 사용하면 이 매핑을 수행하는 데 필요한 매개변수를 얻을 수 있습니다. 다음은 이 함수를 사용하는 예입니다.
const auto pixelMapping = Zivid::Experimental::Calibration::pixelMapping(camera, settings);
std::cout << "Pixel mapping: " << pixelMapping << std::endl;
cv::Mat mappedBGR(
fullResolutionBGR.rows / pixelMapping.rowStride(),
fullResolutionBGR.cols / pixelMapping.colStride(),
CV_8UC3);
std::cout << "Mapped width: " << mappedBGR.cols << ", height: " << mappedBGR.rows << std::endl;
for(size_t row = 0; row < static_cast<size_t>(fullResolutionBGR.rows - pixelMapping.rowOffset());
row += pixelMapping.rowStride())
{
for(size_t col = 0; col < static_cast<size_t>(fullResolutionBGR.cols - pixelMapping.colOffset());
col += pixelMapping.colStride())
{
mappedBGR.at<cv::Vec3b>(row / pixelMapping.rowStride(), col / pixelMapping.colStride()) =
fullResolutionBGR.at<cv::Vec3b>(row + pixelMapping.rowOffset(), col + pixelMapping.colOffset());
}
}
return mappedBGR;
pixel_mapping = calibration.pixel_mapping(camera, settings)
return rgba[
int(pixel_mapping.row_offset) :: pixel_mapping.row_stride,
int(pixel_mapping.col_offset) :: pixel_mapping.col_stride,
0:3,
]
참고
내장 함수를 사용하고 2D 및 3D 캡처의 해상도가 서로 다른 경우, 해당 함수를 올바르게 사용해야 합니다. 자세한 내용은 Camera Intrinsics 을 참조하세요.
External light considerations
2D 캡처에 이상적인 광원은 강해야 합니다. 이는 변화하는 주변광의 영향을 줄여주기 때문입니다. 또한 확산광이어야 합니다. 이는 blooming effects 를 제한하기 때문입니다. Zivid 카메라의 경우 이 광원은 내장 프로젝터에서 제공됩니다. 따라서 로봇 셀에 추가 조명이 필요하지 않습니다.
You can encounter blooming when using the internal projector as light source. Tilting the camera, changing the background, or tuning the 2D acquisition settings can mitigate the blooming effect.
Exposure variations caused by changes in ambient light, such as transitions from day to night, doors opening and closing, or changes in ceiling lighting, affects 2D and 3D data differently. For 2D data, they can impact segmentation performance, especially when it is trained on specific datasets. For 3D data, exposure variations may affect point cloud completeness due to varying noise levels. Zivid cameras are robust to such exposure variations.
아래 표는 2D 품질과 관련하여 Zivid 카메라를 사용하는 것의 장단점을 요약한 것입니다.
Internal projector |
|
|---|---|
Robot Cell setup |
Simple |
Resilience to ambient light variations |
Strong |
Blooming in 2D images |
Likely |
2D color balance needed |
No |
Capture strategies
먼저 필요한 데이터(2D 또는 3D)에 따라 세 가지 캡처 전략이 있습니다.
3D 데이터 이전의 2D 데이터
3D 데이터의 일부로서의 2D 데이터
3D 데이터 이후의 2D 데이터
Which strategy fits best depends on your machine vision algorithms and pipeline. We recommend 2D data before 3D data (taking a 2D capture first, followed by a 3D capture with color disabled). This approach allows you to process the color image (e.g., segmentation) in parallel with capturing 3D data, thus achieving the best pick rates on the system level.
Below we summarize the performance of the different strategies. For a more in-depth understanding and ZividBenchmarks, please see 2D + 3D Capture Strategy.
다음은 다양한 하드웨어에 대한 실제 측정값을 보여주는 표입니다.
- Zivid 3
- Zivid 2+
- Zivid 2
팁
PC에서 다양한 2D-3D 전략을 테스트하려면 YML 파일에서 설정을 로드하여 ZividBenchmark.cpp 샘플을 실행하세요. Samples 로 이동하여 지침을 보려면 C++를 선택하세요.
다음 섹션에서는 selecting 3D and 2D settings based on capture speed 에 대해 안내합니다.
Version History
SDK |
Changes |
|---|---|
2.12.0 |
Zivid 2+의 경우 2D 캡처의 경우 최대 50%, 3D 캡처의 경우 최대 5%까지 획득 시간이 단축됩니다. Zivid One+는 지원이 종료되어 더 이상 지원되지 않습니다. |
2.11.0 |
|