2D + 3D キャプチャ戦略

色情報が不要な場合は、次のセクション キャプチャ速度に基づく 3D および 2D 設定の選択 に直接進んでください。

パレット化・脱パレット化アプリケーションで一般的に使用される多くの検出アルゴリズムは、ピックアップする対象物を識別するために 2D データに依存しています。本稿では、2D 情報を取得するさまざまな方法、それぞれの長所と短所、および外部照明条件について解説します。また、さまざまな 2D-3D アプローチ、それらのデータ品質、およびサイクルタイムへの影響についても触れます。

2D データを取得するには、2つの方法があります。

  1. camera.capture2D(Zivid::Settings).imageRGBA() を使用した個別の 2D キャプチャについては、 2D 画像キャプチャプロセス を参照してください。

  2. 3D キャプチャの一部として camera.capture2D3D(Zivid::Settings).pointCloud().copyImageRGBA() を使用する方法については、 点群キャプチャプロセス を参照してください。

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.

Tip

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 画像を個別にキャプチャします。

  • カラーを無効にした状態でサブサンプリングされた 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 キャプチャ解像度

2D キャプチャ

Zivid 3

Zivid 2+

Zivid 2

フル解像度

2816 x 2816

2448 x 2048

1944 x 1200

2x2 サブサンプリング

1408 x 1408

1224 x 1024

972 x 600

4x4 サブサンプリング

704 x 704

612 x 512

利用不可

3D キャプチャ解像度

3D キャプチャ

Zivid 3

Zivid 2+

Zivid 2

フル解像度

2816 x 2816

2448 x 2048

1944 x 1200

2x2 サブサンプリング

1408 x 1420

1224 x 1024

972 x 600

4x4 サブサンプリング

704 x 704

612 x 512

利用不可

capture2D3D() キャプチャを実行すると、結果として 2D データと 3D データの両方を含むフレームが生成されます。

2D データは 2 つの方法で抽出できます。

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 リサンプリング.

For accurate 2D segmentation and detection, it is common to require high-resolution 2D data. For example, our recommended preset for 消費財 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 データを取得します。

リサンプリング

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

詳細については リサンプリング を参照してください。

もう一つの方法は、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 キャプチャで解像度が異なる場合は、正しく使用していることを確認してください。詳細については カメラ内部パラメータ を参照してください。

外部照明に関する考慮事項

2D キャプチャに最適な光源は、周囲光の変動の影響を軽減するために強力であること、また ブルーミング効果 を抑えるために拡散光であることが求められます。 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 カメラを使用する際の長所と短所をまとめたものです。

内蔵プロジェクター

ロボットセルのセットアップ

シンプル

周囲の光の変化に対する耐性

強い

2D 画像でのブルーミング

発生の可能性あり

2D カラーバランスの調整が必要

不要

キャプチャ戦略

最初にどのデータ(2D データか 3D データか)が必要かによって、3 つのキャプチャ戦略があります。

  • 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 キャプチャ戦略.

以下は、異なるハードウェアにおける実際の測定値を示す表です。

Zivid 3

( Z3 XL250 Fast )

Zivid 2+

( Z2+ LR110 Fast )

( Z2+ L110 Fast )

Zivid 2

( Z2 M70 Matte )

Tip

PC 上でさまざまな 2D-3D 戦略をテストするには、 YML ファイルから読み込んだ設定を使用して ZividBenchmark.cpp サンプルを実行できます。手順については サンプル にアクセスし、 C++ を選択してください。

次のセクションでは、 キャプチャ速度に基づく 3D および 2D 設定の選択 について説明します。

Version History

SDK

変更点

2.12.0

Zivid 2+ では、2D キャプチャで最大 50%、3D キャプチャで最大 5% の取得時間が短縮されます。 Zivid One+ はサポート終了となり、販売は終了しました。

2.11.0

redSubsample4x4blueSubsample4x4 のサポートを追加しました。