サンプル

お好みのプログラミング言語を使用して、Zivid カメラのプログラミングに直接取り組んでください。

注釈

一部の Zivid サンプルには サンプルデータ が必要です。

サンプル一覧

  • Camera

    • Basic

      • Capture - Capture colored point cloud, save 2D image, save 3D ZDF, and export PLY, using the Zivid camera.

      • CaptureFromFileCamera - Capture point clouds, with color, with the Zivid file camera.

      • CaptureHDRCompleteSettings - Capture point clouds, with color, from the Zivid camera with fully configured settings.

      • CaptureWithSettingsFromYML - Capture images and point clouds, with and without color, from the Zivid camera with settings from YML file.

      • Connect - Connect to a Zivid camera using the different available methods.

      • CreateFileCameraFromZDFWithDiagnostics - Capture a frame with diagnostics enabled and create a file camera from it.

    • Advanced

    • InfoUtilOther

      • CameraInfo - List connected cameras and print camera version and state information for each connected camera.

      • CameraUserData - Store user data on the Zivid camera.

      • CaptureWithDiagnostics - Capture a 2D+3D frame and a 2D frame from the Zivid camera with diagnostics enabled.

      • CheckHealth - Poll the camera health check from a separate thread while capturing, printing statuses and values each second.

      • FirmwareUpdater - Update firmware on the Zivid camera.

      • FrameInfo - Read frame info from the Zivid camera.

      • GetCameraIntrinsics - Read intrinsic parameters from the Zivid camera (OpenCV model) or estimate them from the point cloud.

      • MeasureSceneConditions - Measure ambient light in the scene and report the flickering frequency when flickering is detected.

      • Warmup - Short example of a basic way to warm up the camera with specified time and capture cycle.

      • Network

    • Maintenance

  • Applications

zivid-ros GitHub リポジトリにアクセスしてください。

インストール

  1. Zivid ソフトウェアをインストールします

  2. Zivid サンプル データをダウンロードする

Windows

キーボードの Win + R キーを押してコマンド プロンプトを起動し、次に cmd と入力して Enter を押します。

Navigate to a location where you want to clone the repository, then run the following command:

git clone https://github.com/zivid/zivid-cpp-samples

CMake でサンプル ソリューションを構成し、Visual Studio で開き、ビルドして実行します。詳細については CMake を使用して C++ サンプルを構成し、Windows の Visual Studio でビルドする を参照してください。

Ubuntu

キーボードの Ctrl + Alt + T キーを押してターミナルを開きます。

Navigate to a location where you want to clone the repository, then run the following command:

git clone https://github.com/zivid/zivid-cpp-samples
cd zivid-cpp-samples

プロジェクトをビルドします。

mkdir build
cd build
cmake <options, see below> ../source
cmake --build .

一部のサンプルは、外部ライブラリ、特に Eigen 3、OpenCV、PCL、または HALCON に依存しています。これらのライブラリをインストールしたくない場合は、次のオプションをそれぞれ cmake に渡すことで、それらに依存するサンプルを無効にできます: -DUSE_EIGEN3=OFF 、 -DUSE_OPENCV=OFF 、 -DUSE_PCL=OFF 、 -DUSE_HALCON=OFF 。

オプションの依存関係をインストールし、サンプルがそれらを使用するように構成する方法については オプションの依存関係を使用した C++ サンプルの設定 を参照してください。

たとえば次のように、ビルド ディレクトリからサンプルを実行できるようになりました。

./CaptureFromFileCameraVis3D

詳細については、GitHub zivid-cpp-samples リポジトリにアクセスしてください。

  1. Zivid ソフトウェアをインストールします

  2. Zivid サンプル データをダウンロードする

キーボードの Win + R キーを押してコマンド プロンプトを起動し、次に cmd と入力して Enter を押します。

Navigate to a location where you want to clone the repository, then run the following command:

git clone https://github.com/zivid/zivid-csharp-samples

Visual Studio で ZividNETSamples.sln を開き、ビルドして実行します。これを行うかどうか不明な場合は、 Visual Studio を使用して C# サンプルをビルドする を確認してください。

一部のサンプルは、外部ライブラリ、特に MathNet.Numerics と System.ValueTuple に依存しています。これらのライブラリは、サンプルをビルドする際に NuGet を通じて自動的にインストールされます。

詳細については、GitHub zivid-csharp-samples リポジトリにアクセスしてください。

注釈

これらのサンプルに推奨される Python バージョンは 3.7 - 3.9 です。

なお、Open3D は Python 3.13 以降では利用できません。

  1. Zivid ソフトウェアをインストールします 。

  2. Zivid サンプル データをダウンロードします 。

  3. Zivid の Python サンプルリポジトリをチェックしてみてください。

    git clone http://github.com/zivid/zivid-python-samples.git
    
  4. IDE またはコマンド ラインを使用して、ランタイム要件をインストールします。

cd zivid-python-samples
pip install -r requirements.txt

注釈

Open3D のインストールに失敗した場合は、Open3D でサポートされている Python バージョンを使用していることを確認してください。または、以下のコマンドを実行して、Open3D 以外のサンプルに必要な依存関係のみをインストールすることもできます。

pip install ./modules
  1. いずれかのサンプルを開いて実行します。

    注釈

    Windows 上で GUI サンプルを実行するには pythonw を使用する必要があります。

詳細については、GitHub zivid-python-samples リポジトリにアクセスしてください。

Zivid は HALCON と連携するための 2 つの方法を提供しています。

  1. Zivid SDK を通じて、HALCON で利用可能な C++/C# ライブラリを活用します。 C++ と C# の両方のサンプルを提供しています。(推奨)

  2. Zivid Software に付属する GenICam GenTL プロデューサーを介して直接行います。

Zivid and HALCON are compatible with Windows 10 and 11, and Ubuntu 20.04, 22.04, 24.04, 26.04.

注釈

Ubuntu 18.04 のサポートは SDK 2.10 以降削除されました。

これらのオペレーティングシステムのいずれかで Zivid をセットアップして使用するには、次のページに記載されているそれぞれの手順に従ってください。

詳細については、GitHub zivid-halcon-samples リポジトリにアクセスしてください。

MATLAB のサポートは終了しました。サポートが必要な場合は、旧バージョン(2.15 以前)をご利用ください。

詳細については、GitHub zivid-matlab-samples リポジトリにアクセスしてください。

インストール手順、コードサンプル、Zivid ROS 2 ドライバの入門方法については、GitHub リポジトリの zivid-ros を参照してください。ROS 1 を使用している場合は、 zivid-ros-1 ブランチを参照してください。

サンプルパリティ

カメラ

Sample

C++

C#

Python

HDevelop

Basic

Capture

✓

✓

✓

✓

CaptureFromFileCamera

✓

✓

✓

CaptureHdrCompleteSettings

✓

✓

✓

✓

CaptureSavePly

✓

CaptureWithSettingsFromYml

✓

✓

✓

✓

Connect

✓

✓

✓

ConnectToSerialNumberCamera

✓

CreateFileCameraFromZdfWithDiagnostics

✓

✓

✓

Advanced

AllocateMemoryForPointCloudData

✓

Capture2DAnd3D

✓

✓

CaptureAndPrintNormals

✓

✓

✓

CaptureHalconViaGenICam

✓

✓

CaptureHalconViaZivid

✓

✓

CaptureViaGenICam

✓

Advanced/MultiCamera

MultiCameraCaptureInParallel

✓

MultiCameraCaptureSequentially

✓

MultiCameraCaptureSequentiallyWithInterleavedProcessing

✓

InfoUtilOther

adapt_settings_for_flickering_ambient_light

✓

CameraInfo

✓

✓

✓

CameraUserData

✓

✓

✓

CaptureWithDiagnostics

✓

✓

✓

CheckHealth

✓

✓

✓

context_manager_with_zivid

✓

ExploreSettingsMetaData

✓

FirmwareUpdater

✓

✓

✓

FrameInfo

✓

✓

✓

GetCameraIntrinsics

✓

✓

✓

MeasureSceneConditions

✓

✓

✓

QuerySettingsAndParameters

✓

SettingsInfo

✓

Warmup

✓

✓

✓

✓

ZividBenchmark

✓

InfoUtilOther/Network

AutomaticNetworkConfigurationForCameras

✓

✓

✓

NetworkConfiguration

✓

✓

✓

Maintenance

CorrectCameraInField

✓

✓

✓

ResetCameraInField

✓

✓

✓

VerifyCameraInField

✓

✓

✓

VerifyCameraInFieldFromZdf

✓

✓

✓

visualize_benchmark_results

✓

アプリケーション

Sample

C++

C#

Python

HDevelop

Basic/Visualization

CaptureAndVisualizeNormals

✓

✓

CaptureFromFileCameraVis3D

✓

✓

✓

CaptureVis3D

✓

✓

✓

CaptureWritePclVis3D

✓

ProjectImageStartAndStop

✓

✓

✓

ReadPclVis3D

✓

read_zdf_vis_3d

✓

Basic/FileFormats

ConvertZdf

✓

✓

ReadIterateZdf

✓

✓

✓

ReadPly

✓

Zdf2Ply

✓

Advanced

auto_2d_settings

✓

CaptureUndistort2D

✓

✓

color_balance

✓

CreateDepthMap

✓

✓

Downsample

✓

✓

✓

GammaCorrection

✓

✓

MaskPointCloud

✓

✓

✓

Advanced/Visualization

CaptureVis3DInLoop

✓

✓

✓

CaptureVis3DInLoopWithKeypressExit

✓

✓

✓

Advanced/Cuda

CaptureAndConvertImageWithOpenCvOnCuda

✓

CaptureAndConvertToDlpackTensorOnCuda

✓

✓

capture_and_process_image_with_cupy_on_cuda

✓

capture_and_render_point_cloud_with_opengl_on_cuda

✓

capture_and_segment_image_with_pytorch_on_cuda

✓

Advanced/Transform

get_checkerboard_pose_from_zdf

✓

TransformPointCloudFromMillimetersToMeters

✓

✓

✓

TransformPointCloudViaArucoMarker

✓

✓

✓

TransformPointCloudViaCheckerboard

✓

✓

✓

Advanced/Roi

RoiBoxViaArucoMarker

✓

✓

✓

RoiBoxViaCheckerboard

✓

✓

✓

Advanced/Stitching

StitchContinuouslyRotatingObject

✓

✓

✓

StitchUsingRobotMountedCamera

✓

✓

✓

StitchViaLocalPointCloudRegistration

✓

✓

✓

Advanced/Barcode

BarcodeDetector

✓

✓

Advanced/HandEyeCalibration

EyeInHandCalibration3DObject

✓

EyeInHandCalibrationMvTecPlate

✓

HandEyeCalibration

✓

✓

✓

hand_eye_gui

✓

JsonHomogeneousMatrixToHalconPose

✓

pose_conversion_gui

✓

PoseConversions

✓

✓

✓

UtilizeHandEyeCalibration

✓

✓

✓

verify_hand_eye_with_visualization

✓

Advanced/HandEyeCalibration/UrHandEyeCalibration

universal_robots_perform_hand_eye_calibration

✓

Advanced/HandEyeCalibration/RobodkHandEyeCalibration

robodk_hand_eye_calibration

✓

robodk_verify_hand_eye_calibration

✓

Advanced/MultiCamera

MultiCameraCalibration

✓

✓

✓

MultiCameraCalibrationFromZdf

✓

✓

StitchByTransformation

✓

✓

StitchByTransformationFromZdf

✓

✓

Advanced/Projector

ProjectAndFindMarker

✓

✓

ReadProjectAndCaptureImage

✓

✓

✓

ReprojectPoints

✓

✓

Advanced/RobotGuidance

robodk_robot_guidance

✓

Advanced/ObjectMatching

SurfaceMatchingCreateModel

✓

SurfaceMatchingCreateModelFromFile

✓

SurfaceMatchingFindModel

✓

SurfaceMatchingFindModelFromFile

✓

手順

Sample

C++

C#

Python

HDevelop

CalcCalplatePoseEyeInHand

✓

CalcCalplatePoseEyeToHand

✓

GenerateRGBAndRgbImages

✓

GetFirstAvailableZividDevice

✓

GetSettingsForZividCameraModel

✓

GetZividCameraWidth

✓

GetZividPresetFile

✓

GetZividSampleDataDir

✓

モジュール

Sample

C++

C#

Python

HDevelop

Zividsamples

calibration_board_utils

✓

camera_verification

✓

color_to_grayscale

✓

display

✓

paths

✓

robodk_tools

✓

save_load_matrix

✓

save_load_transformation_matrix

✓

save_residuals

✓

settings_utils

✓

transformation_matrix

✓

white_balance_calibration

✓