2D + 3D Capture Strategy

색상 정보가 중요하지 않은 경우 바로 다음 섹션인 selecting 3D and 2D settings based on capture speed 으로 이동하세요.

피킹(piece-picking) 애플리케이션에서 일반적으로 사용되는 많은 감지 알고리즘은 2D 데이터를 기반으로 피킹할 객체를 식별합니다. 이 글에서는 2D 정보를 수집하는 다양한 방법, 장단점, 그리고 외부 조명 조건에 대한 통찰력을 제공합니다. 또한 다양한 2D-3D 접근 방식, 데이터 품질, 그리고 사이클 시간에 미치는 영향에 대해서도 다룹니다.

2D 데이터를 얻는 방법에는 두 가지가 있습니다.

  1. camera.capture2D(Zivid::Settings).imageRGBA() 통해 2D 캡처를 별도로 수행합니다. 2D Image Capture Process 를 참조하세요.

  2. 3D 캡처의 일부인 camera.capture2D3D(Zivid::Settings).pointCloud().copyImageRGBA() 대한 자세한 내용은 Point Cloud Capture Process 를 참조하세요.

어떤 방식을 사용할지는 요구 사항과 머신 비전 파이프라인에 따라 달라집니다. 멀티스레딩과 최적화된 스케줄링을 활용할 수 있는 전용 2D 캡처를 권장합니다. 3D 캡처에서 2D 데이터를 활용하는 것이 더 간단하지만, 원하는 2D 품질을 얻으려면 속도를 희생해야 할 수도 있습니다.

2D를 개별적으로 캡처할 때는 3D 캡처에서 RGB를 비활성화해야 합니다. 이렇게 하면 수집 시간과 처리 시간을 모두 절약할 수 있습니다. 3D 캡처에서 Sampling::Colordisabled 로 설정하여 RGB를 비활성화하세요.

Our recommendation:
  • 전체 해상도와 프로젝터를 켜서 2D를 별도로 캡처합니다.

  • 색상이 비활성화된 하위 샘플링된 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 sensors. The following table shows the resolution outputs of the different cameras for both 2D and 3D captures.

2D capture resolutions

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 resolutions

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 매핑이 보장됩니다.

2D 캡처의 출력 해상도는 Settings2D::Sampling::Pixel 설정을 통해 제어되고, 3D 캡처의 출력 해상도는 Settings::Sampling::PixelSettings::Processing::Resampling 설정을 조합하여 제어합니다. Pixel Sampling (2D) , Pixel Sampling (3D) , 그리고 Resampling 을 참조하세요.

앞서 언급했듯이, 분할 및 감지에는 고해상도 2D 데이터가 필요한 것이 일반적입니다. 예를 들어, Consumer Goods Z2+ MR130 Quality 프리셋에 권장하는 프리셋은 Sampling::Pixelby2x2 로 설정합니다. 이 경우 다음 중 하나를 수행해야 합니다.

  • 3D 데이터를 업샘플링하여 1대1 대응을 복원하거나

  • 2D 인덱스를 하위 샘플링된 3D 데이터의 인덱스에 매핑하거나

  • frame.pointCloud().copyImageRGBA_SRGB() 통해 포인트 클라우드에서 2D 데이터를 가져옵니다.

Resampling

2D 캡처의 해상도를 맞추려면 서브샘플링을 취소하는 업샘플링을 적용하기만 하면 됩니다. 이렇게 하면 서브샘플링된 캡처의 속도 이점이 유지됩니다. 예를 들어 다음과 같습니다.

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,
]

참고

Intrinsics 함수를 사용하고 2D 및 3D 캡처의 해상도가 서로 다른 경우, 해당 함수를 올바르게 사용해야 합니다. 자세한 내용은 Camera Intrinsics 참조하세요.

External light considerations

2D 촬영에 이상적인 광원은 강합니다. 주변광의 영향을 줄여주기 때문입니다. 또한, 확산광은 blooming effects 를 제한하기 때문입니다. Zivid 카메라의 경우, 이 광원은 내부 프로젝터에서 나옵니다. 따라서 로봇 셀에 추가 조명이 필요하지 않습니다.

내장 프로젝터를 광원으로 사용할 경우 블루밍 현상이 발생할 수 있습니다. 카메라를 기울이거나, 배경을 변경하거나, 2D 촬영 설정을 조정하면 블루밍 현상을 완화할 수 있습니다.

주변광 변화(낮에서 밤으로의 변화, 문이 열리고 닫히는 시간, 천장 조명의 변화 등)로 인한 노출 변화는 2D 데이터와 3D 데이터에 서로 다른 영향을 미칩니다. 2D 데이터의 경우, 특히 특정 데이터셋을 학습할 때 이러한 노출 변화가 분할 성능에 영향을 미칠 수 있습니다. 3D 데이터의 경우, 노출 변화는 노이즈 수준 변화로 인해 포인트 클라우드 완성도에 영향을 미칠 수 있습니다. Zivid 카메라는 이러한 노출 변화에 매우 강합니다.

아래 표는 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)가 필요한지에 따라 세 가지 캡처 전략이 있습니다.

  • 2D data before 3D data

  • 2D data as part of 3D data

  • 2D data after 3D data

어떤 전략을 선택해야 할지는 머신 비전 알고리즘과 파이프라인에 따라 달라집니다. 3D 데이터보다 2D 데이터를 먼저 캡처하는 것을 권장합니다(먼저 2D 데이터를 캡처한 후, 색상을 비활성화한 3D 데이터를 캡처하는 방식). 이 방식을 사용하면 3D 데이터 캡처와 동시에 컬러 이미지(예: 분할)를 처리할 수 있어 시스템 수준에서 최상의 피킹률을 달성할 수 있습니다.

아래에서 다양한 전략의 성능을 요약해 보겠습니다. 더 자세한 내용과 ZividBenchmarks에 대한 종합적인 내용은 2D + 3D Capture Strategy 를 참조하세요.

다음은 다양한 하드웨어에 대한 실제 측정값을 보여주는 표입니다.

Zivid 3

(Z3 XL250 Fast)

Zivid 2+

(Z2+ LR110 Fast)

(Z2+ L110 Fast)

Zivid 2

(Z2 M70 Matte)

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

redSubsample4x4blueSubsample4x4 에 대한 지원이 추가되었습니다.