Samples

Dive straight into programming the Zivid camera with your preferred programming language.

Note

Some Zivid Samples require Sample Data.

List of samples

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

      • 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

    • InfoUtilOther

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

      • PrintVersionInfo - List connected cameras and print version information.

      • SettingsInfo - Read settings info from the Zivid camera.

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

      • ZividBenchmark - Zividbenchmarks is a sample that will test the average speed of different operations on your computer. It will provide

    • Maintenance

  • Applications

    • Basic

      • Visualization

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

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

        • 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

      • CaptureUndistortRGB - Use camera intrinsics to undistort an RGB 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.

      • HandEyeCalibration - Perform Hand-Eye calibration.

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

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

      • 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

      • HandEyeCalibration

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

        • UtilizeHandEyeCalibration - Transform single data point or entire point cloud from camera frame to robot base 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.

Installation

  1. Install Zivid Software

  2. Download Zivid Sample Data

Windows

Launch the Command Prompt by pressing Win + R keys on the keyboard, then type cmd and press Enter.

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

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

Configure the sample solution with CMake, open it in Visual Studio, build it, run it. For more information see Configure C++ Samples With CMake and Build Them in Visual Studio in Windows.

Ubuntu

Open the Terminal by pressing Ctrl + Alt + T keys on the keyboard.

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

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

Build the project:

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

If you do want to use them:

  • Eigen 3: Set -DEIGEN3_INCLUDE_DIR=<path> where <path> is the root directory of your Eigen3 installation (the folder containing Eigen/Core, Eigen/Dense etc.)

  • PCL and OpenCV: If a recent enough version is installed on your system, these should just work. If not, set -DPCL_DIR=<path> / -DOpenCV_DIR=<path> where <path> is the directory containing PCLConfig.cmake and OpenCVConfig.cmake, respectively.

  • HALCON: If a recent enough version is installed on your system, these should just work.

The samples can now be run from the build directory, for instance like this:

./CaptureFromFileCameraVis3D

For more information visit the GitHub zivid-cpp-samples repository.