示例

直接使用您喜欢的编程语言对Zivid相机进行编程。

备注

一些Zivid示例需要使用到 Sample Data(示例数据)

示例列表

  • Camera

  • Applications

    • Basic

      • Visualization

        • CaptureFromFileCameraVis3D - Capture point clouds, with color, with the Zivid file camera and visualize them.

        • CaptureHDRVisNormals - Capture Zivid point clouds, with color and normals, and visualize it in 3D and as a normal map.

        • CaptureVis3D - Capture point clouds, with color, from the Zivid camera, and visualize it.

        • CaptureWritePCLVis3D - Capture point clouds, with color, from the Zivid camera, save it to PCD file format, and visualize it.

        • ProjectImageStartAndStop - Start the Image Projection and Stop it.

        • ReadAndProjectImage - Read a 2D image from file and project it using the camera projector.

        • ReadPCLVis3D - Read point cloud from PCL file and visualize it.

      • FileFormats

        • ReadIterateZDF - Read point cloud data from a ZDF file, iterate through it, and extract individual points.

    • Advanced

      • CaptureUndistort2D - Use camera intrinsics to undistort a 2D image.

      • CreateDepthMap - Convert point cloud from a ZDF file to OpenCV format, extract depth map and visualize it.

      • Downsample - Downsample point cloud from a ZDF file.

      • GammaCorrection - Capture 2D image with gamma correction.

      • HandEyeCalibration - Perform Hand-Eye calibration.

      • MaskPointCloud - Mask point cloud from a ZDF file and convert to PCL format, extract depth map and visualize it.

      • ProjectAndFindMarker - Show a marker using the projector, capture a set of 2D images to find the marker coordinates (2D and 3D).

      • ReprojectPoints - Illuminate checkerboard (Zivid Calibration Board) corners by getting checkerboard pose

      • ROIBoxViaArucoMarker - Filter the point cloud based on a ROI box given relative to the ArUco marker on a Zivid Calibration Board.

      • ROIBoxViaCheckerboard - Filter the point cloud based on a ROI box given relative to the Zivid Calibration Board.

      • TransformPointCloudFromMillimetersToMeters - Transform point cloud data from millimeters to meters.

      • TransformPointCloudViaArucoMarker - Transform a point cloud from camera to ArUco marker coordinate frame by estimating the marker’s pose from the point cloud.

      • TransformPointCloudViaCheckerboard - Transform a point cloud from camera to checkerboard (Zivid Calibration Board) coordinate frame by getting checkerboard pose from the API.

      • HandEyeCalibration

        • PoseConversions - Convert to/from Transformation Matrix (Rotation Matrix + Translation Vector)

        • UtilizeHandEyeCalibration - Transform single data point or entire point cloud from camera to robot base reference frame using Hand-Eye calibration

      • MultiCamera

        • MultiCameraCalibration - Use captures of a calibration object to generate transformation matrices to a single coordinate frame, from connected cameras.

        • MultiCameraCalibrationFromZDF - Use captures of a calibration object to generate transformation matrices to a single coordinate frame, from a ZDF files.

        • StitchByTransformation - Use transformation matrices from Multi-Camera calibration to transform point clouds into single coordinate frame, from connected cameras.

        • StitchByTransformationFromZDF - Use transformation matrices from Multi-Camera calibration to transform point clouds into single coordinate frame, from a ZDF files.

  • Camera

    • Basic

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

      • Capture2D - Capture 2D images from the Zivid camera.

      • CaptureAssistant - Use Capture Assistant to capture point clouds, with color, from the Zivid camera.

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

      • CaptureHDR - Capture point clouds, with color, from the Zivid camera.

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

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

    • Advanced

      • CaptureHalconViaGenICam - Capture and save a point cloud, with colors, using GenICam interface and Halcon C++ SDK.

      • CaptureHalconViaZivid - Capture a point cloud, with colors, using Zivid SDK, transform it to a Halcon point cloud and save it using Halcon C++ SDK.

      • CaptureHDRLoop - Cover the same dynamic range in a scene with different acquisition settings to optimize for quality, speed, or to find a compromise.

      • CaptureHDRPrintNormals - Capture Zivid point clouds, compute normals and print a subset.

    • InfoUtilOther

      • AutomaticNetworkConfigurationForCameras - Automatically set the IP addresses of any number of cameras to be in the same subnet as the provided IP address of the network interface.

      • 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 point clouds, with color, from the Zivid camera, with settings from YML file and diagnostics enabled.

      • FirmwareUpdater - Update firmware on the Zivid camera.

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

      • NetworkConfiguration - Uses Zivid API to change the IP address of the Zivid camera.

      • Warmup - A basic warm-up method for a Zivid camera with specified time and capture cycle.

    • Maintenance

  • Applications

    • Basic

      • Visualization

      • FileFormats

        • ReadIterateZDF - Read point cloud data from a ZDF file, iterate through it, and extract individual points.

        • ZDF2PLY - Convert point cloud from a ZDF file to a PLY file.

    • Advanced

  • Camera

    • Basic

      • Capture - Capture a 3D color point cloud from the camera and use it to generate a HALCON ObjectModel3D which is then visualized.

      • CaptureHDR - Capture an HDR image from the camera and use it to generate a HALCON ObjectModel3D which is then visualized.

      • CaptureHDRCompleteSettings - Capture an HDR image from the Zivid camera with fully configured settings for each frame.

      • CaptureSavePLY - Capture a 3D color point cloud from the camera and save it to a PLY file format.

      • CaptureWithSettingsFromJSON - Capture a 3D color point cloud from the camera and use it to generate a HALCON ObjectModel3D which is then visualized.

      • ConnectToSerialNumberCamera - Connect to a specific Zivid 3D camera based on its serial number.

    • Advanced

      • CaptureHDRLoop - Capture HDR images from the camera in a loop (while actively changing some HDR settings).

    • InfoUtilOther

      • QuerySettingsAndParameters - Query information about the image acquisition interface and selected specific parameters of Zivid camera.

      • Warmup - A basic warm-up method for a Zivid camera with specified time and capture cycle.

  • Applications

  • Camera

    • Basic

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

      • Capture2D - Capture 2D images from the Zivid camera.

      • CaptureAssistant - Capture Assistant to capture point clouds, with color, from the Zivid camera.

      • CaptureFromFileCamera - Capture point clouds, with color, from the Zivid file camera. Currently supported by Zivid One.

      • CaptureHDR - Capture HDR point clouds, with color, from the Zivid camera.

      • zividApplication - application = zividApplication(folder)

    • InfoUtilOther

  • Applications

    • Basic

      • Visualization

        • CaptureFromFileCameraVis3D - Capture point clouds, with color, from the virtual Zivid camera, and visualize it. Currently supported by Zivid One.

        • CaptureVis3D - Capture point clouds, with color, from the Zivid camera, and visualize it.

      • FileFormats

        • convertZDF - convertZDF(inputFileName,outputFileFormat)

        • ReadIterateZDF - Read point cloud data from a ZDF file, iterate through it, and extract individual points.

        • readZDF - [xyz,rgba,snr] = readZDF(dataFile)

    • Advanced

      • Downsample - Downsample point cloud from ZDF file.

Go to the zivid-ros Github repository.

安装

  1. 安装Zivid软件

  2. 下载Zivid Sample Data

Windows

点击键盘上的Win+R键启动命令提示符,然后键入 cmd ,接着按下 Enter

导航到要克隆的存储库的位置,然后运行以下命令:

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

使用CMake配置示例解决方案,在Visual Studio中打开示例,生成并运行。更多相关信息,请参阅 使用 CMake 配置 C++ 示例并在 Windows 的 Visual Studio 中构建它们

Ubuntu

点击键盘上的 Ctrl + Alt + T 键打开终端。

导航到要克隆的存储库的位置,然后运行以下命令:

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

生成项目:

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

一些示例依赖于第三方库,比如Eigen 3、OpenCV、PCL或HALCON。如果您不想安装这些库,您可以通过关闭以下选项来禁用相关的示例 : cmake-DUSE_EIGEN3=OFF, -DUSE_OPENCV=OFF, -DUSE_PCL=OFF, -DUSE_HALCON=OFF.

如果您确实想使用它们:

  • Eigen 3:设置 -DEIGEN3_INCLUDE_DIR=<path><path> 是Eigen3安装的根目录(包含 Eigen/Core、Eigen/Dense等的文件夹)

  • PCLOpenCV:如果您的系统上安装了较新的版本,这些示例应该可以正常工作。如果没有,设置 -DPCL_DIR=<path> / -DOpenCV_DIR=<path><path> 分别是包含了 PCLConfig.cmakeOpenCVConfig.cmake 的目录 。

  • HALCON:如果您的系统上安装了较新的版本,这些示例应该可以正常工作。

现在可以从生成的目录运行示例,例如:

./CaptureFromFileCameraVis3D

如需获取更多相关信息,请访问GitHub zivid-cpp-samples 存储库。

  1. 安装Zivid软件

  2. 下载Zivid Sample Data

点击键盘上的Win+R键启动命令提示符,然后键入 cmd ,接着按下 Enter

导航到要克隆的存储库的位置,然后运行以下命令:

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

在Visual Studio中打开ZividNETSamples.sln,生成并运行它。如果您不确定如何操作,请查看 使用Visual Studio构建C#示例

Some of the samples depend on external libraries, in particular MathNet.Numerics and System.ValueTuple. These libraries will be installed automatically through NuGet when building the sample.

如需获取更多相关信息,请访问GitHub zivid-csharp-samples 存储库。

备注

这些示例的推荐 Python 版本是 3.7 - 3.9 。

  1. 安装Zivid软件

  2. 下载Zivid Sample Data

  3. Check out the Zivid Python samples repository:

    git clone http://github.com/zivid/zivid-python-samples.git
    
  4. 使用IDE或命令行安装runtime requirements:

cd zivid-python-samples
pip install -r requirements.txt
  1. 打开并运行其中一个示例。

    备注

    Running GUI samples on Windows should be done via pythonw.

如需获取更多相关信息,请访问GitHub zivid-python-samples 存储库。

如果你想在HALCON中使用 Zivid,我们提供了一个GenICam GenTL producer( 从 Zivid Software 安装)。

Zivid 和 HALCON 与 Windows 10 和 11 以及 Ubuntu 20.04、22.04、24.04 兼容。

备注

自 SDK 2.10 起,移除了对 Ubuntu 18.04 的支持。

要在这些操作系统之一中设置和使用Zivid,请按照以下页面中各自的说明进行操作:

以下HALCON版本已经过测试并确认可与Zivid相机配合使用:

  • 19.05 Progress, 20.05 Progress, 21.11 Progress

我们建议使用我们测试过的HALCON版本。

如需获取更多相关信息,请访问GitHub zivid-halcon-samples 存储库。

  1. 安装Zivid软件

  2. 下载Zivid Sample Data

  3. 安装MATLAB软件。注意:使用Zivid相机测试的版本是 2019a。

查看 使用Zivid .NET SDK创建一个MATLAB”Hello World”应用程序

如需获取更多相关信息,请访问GitHub zivid-matlab-samples 存储库。

Check out the zivid-ros GitHub repository for installation instructions, code samples and how to get started with the Zivid ROS 2 driver. If you are using ROS 1, see the zivid-ros-1 branch.

等同示例

相机

Sample

C++

C#

Python

HDevelop

MATLAB

Basic

Capture

Capture2D

capture_2d_with_settings_from_yml

CaptureAssistant

CaptureFromFileCamera

CaptureHdr

CaptureHdrCompleteSettings

CaptureSavePly

CaptureWithSettingsFromJson

CaptureWithSettingsFromYml

ConnectToSerialNumberCamera

ZividApplication

Advanced

AllocateMemoryForPointCloudData

Capture2DAnd3D

CaptureHalconViaGenICam

CaptureHalconViaZivid

CaptureHdrLoop

CaptureHdrPrintNormals

MultiCameraCaptureInParallel

MultiCameraCaptureSequentially

MultiCameraCaptureSequentiallyWithInterleavedProcessing

InfoUtilOther

AutomaticNetworkConfigurationForCameras

CameraInfo

CameraUserData

CaptureWithDiagnostics

FirmwareUpdater

FrameInfo

GetCameraIntrinsics

NetworkConfiguration

QuerySettingsAndParameters

SettingsInfo

Warmup

ZividBenchmark

Maintenance

CorrectCameraInField

ResetCameraInField

VerifyCameraInField

VerifyCameraInFieldFromZdf

Applications

Sample

C++

C#

Python

HDevelop

MATLAB

Basic/Visualization

CaptureFromFileCameraVis3D

CaptureHdrVisNormals

CaptureVis3D

CaptureWritePclVis3D

ProjectImageStartAndStop

ReadAndProjectImage

ReadPclVis3D

read_zdf_vis_3d

Basic/FileFormats

convert_zdf

ReadIterateZdf

ReadPly

ReadZdf

Zdf2Ply

Advanced

auto_2d_settings

CaptureUndistort2D

color_balance

CreateDepthMap

Downsample

GammaCorrection

get_checkerboard_pose_from_zdf

HandEyeCalibration

MaskPointCloud

MultiCameraCalibration

ProjectAndFindMarker

ReprojectPoints

RoiBoxViaArucoMarker

RoiBoxViaCheckerboard

TransformPointCloudFromMillimetersToMeters

TransformPointCloudViaArucoMarker

TransformPointCloudViaCheckerboard

Advanced/HandEyeCalibration

hand_eye_gui

pose_conversion_gui

PoseConversions

robodk_hand_eye_calibration

UtilizeHandEyeCalibration

verify_hand_eye_with_visualization

Advanced/HandEyeCalibration/UrHandEyeCalibration

universal_robots_perform_hand_eye_calibration

Advanced/MultiCamera

MultiCameraCalibration

MultiCameraCalibrationFromZdf

StitchByTransformation

StitchByTransformationFromZdf

Advanced/ObjectMatching

SurfaceMatchingCreateModel

SurfaceMatchingCreateModelFromFile

SurfaceMatchingFindModel

SurfaceMatchingFindModelFromFile

Advanced/RobotGuidance

robodk_robot_guidance

Advanced/VerifyHandEyeCalibration

robodk_verify_hand_eye_calibration

Modules

Sample

C++

C#

Python

HDevelop

MATLAB

Zividsamples

calibration_board_utils

display

paths

robodk_tools

save_load_matrix

transformation_matrix

white_balance_calibration