示例

直接使用您喜欢的编程语言对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) centers by getting the checkerboard feature points

      • 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 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.

    • 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 configure the IP addresses of connected cameras to match the network of the user's PC.

      • 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.

      • 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 conditions in the scene and output the measured flickering frequency of the ambient light if flickering is detected.

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

      • Warmup - Short example of a basic way to warm up the 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.

      • CaptureWithSettingsFromYML - Capture a 2D color image, a 3D point cloud without colour and 2D color image + 3D color point cloud from the camera and use them to generate 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.

访问 zivid-ros Github 存储库。

安装

  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

Some of the samples depend on external libraries, in particular Eigen 3, OpenCV, PCL, Open3D or HALCON. If you don't want to install those, you can disable the samples depending on them by passing the following options, respectively, to cmake: -DUSE_EIGEN3=OFF, -DUSE_OPENCV=OFF, -DUSE_PCL=OFF, -DUSE_HALCON=OFF.

See Configure C++ Samples With Optional Dependencies for instructions on how to install the optional dependencies and configure the samples to use them.

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

./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#示例

一些示例依赖于外部库,特别是 MathNet.NumericsSystem.ValueTuple 。在构建示例时,将通过NuGet自动安装这些库。

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

备注

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

  1. 安装Zivid软件

  2. 下载Zivid Sample Data

  3. 查看 Zivid Python 示例存储库:

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

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

    备注

    在 Windows 上运行 GUI 示例应该通过 pythonw 完成。

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

Zivid offers two ways of interfacing with HALCON:

  1. Through the Zivid SDK, utilizing the C++/C# libraries available for HALCON. We provide samples for both C++ and C#. (Recommended)

  2. Directly through a GenICam GenTL producer that comes with the 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, 24.05 Progress, 24.11 Progress-Steady

我们建议使用我们测试过的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 存储库。

查看 zivid-ros GitHub 存储库以获取安装说明、代码示例以及如何开始使用 Zivid ROS 2 驱动程序。如果您使用的是 ROS 1,请参阅 zivid-ros-1 分支。

等同示例

相机

Sample

C++

C#

Python

HDevelop

MATLAB

Basic

Capture

Capture2D

CaptureAssistant

CaptureFromFileCamera

CaptureHdr

CaptureHdrCompleteSettings

CaptureSavePly

CaptureWithSettingsFromYml

ConnectToSerialNumberCamera

ZividApplication

Advanced

AllocateMemoryForPointCloudData

Capture2DAnd3D

CaptureHalconViaGenICam

CaptureHalconViaZivid

CaptureHdrLoop

CaptureHdrPrintNormals

CaptureViaGenICam

MultiCameraCaptureInParallel

MultiCameraCaptureSequentially

MultiCameraCaptureSequentiallyWithInterleavedProcessing

InfoUtilOther

AutomaticNetworkConfigurationForCameras

CameraInfo

CameraUserData

CaptureWithDiagnostics

context_manager_with_zivid

FirmwareUpdater

FrameInfo

GetCameraIntrinsics

MeasureSceneConditions

NetworkConfiguration

QuerySettingsAndParameters

SettingsInfo

Warmup

ZividBenchmark

Maintenance

CorrectCameraInField

ResetCameraInField

VerifyCameraInField

VerifyCameraInFieldFromZdf

应用

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/HandEyeCalibration/RobodkHandEyeCalibration

robodk_verify_hand_eye_calibration

Advanced/MultiCamera

MultiCameraCalibration

MultiCameraCalibrationFromZdf

StitchByTransformation

StitchByTransformationFromZdf

Advanced/ObjectMatching

SurfaceMatchingCreateModel

SurfaceMatchingCreateModelFromFile

SurfaceMatchingFindModel

SurfaceMatchingFindModelFromFile

Advanced/RobotGuidance

robodk_robot_guidance

模块

Sample

C++

C#

Python

HDevelop

MATLAB

Zividsamples

calibration_board_utils

camera_verification

color_to_grayscale

display

paths

robodk_tools

save_load_matrix

settings_utils

transformation_matrix

white_balance_calibration