This repository contains Python code samples for Zivid.
Contents: Samples | Instructions | Support | Licence
There are two main categories of samples: camera and applications. The samples in the camera category focus only on how to use the camera. The samples in the applications category demonstrate practical use of the output data from the camera, such as 3D point clouds or 2D images.
-
camera
- basic (quick tutorial / complete tutorial)
- capture - Capture point clouds, with color, from the Zivid camera.
- capture_2d - Capture 2D images from the Zivid camera.
- capture_assistant - Use Capture Assistant to capture point clouds, with color, from the Zivid camera.
- capture_from_file - Capture point clouds, with color, from the Zivid file camera.
- capture_with_settings_from_yml - Capture point clouds, with color, from the Zivid camera, with settings from YML file.
- capture_hdr - Capture HDR point clouds, with color, from the Zivid camera.
- capture_hdr_complete_settings - Capture point clouds, with color, from the Zivid camera with fully configured settings.
- advanced
- capture_hdr_loop - Cover the same dynamic range in a scene with different acquisition settings to optimize for quality, speed, or to find a compromise.
- info_util_other
- print_version_info - Print version info about connected Zivid cameras and the installed Zivid SDK.
- basic (quick tutorial / complete tutorial)
-
applications
- basic
- visualization
- read_zdf_vis_3d - Read point cloud data from a ZDF file and visualize it.
- Dependencies:
- Open3D version 0.12.0 or newer
- numpy version 1.19.2 or newer
- matplotlib version 3.3.2 or newer
- Dependencies:
- read_zdf_vis_3d - Read point cloud data from a ZDF file and visualize it.
- file_formats
- convert_zdf - Convert point cloud data from a ZDF file to your preferred format (.ply, .csv, .txt, .png, .jpg, .bmp, .tiff).
- read_iterate_zdf - Read point cloud data from a ZDF file, iterate through it, and extract individual points.
- visualization
- advanced
- hand_eye_calibration
- calibrate_eye_to_hand - Perform Eye-to-Hand calibration.
- Dependencies:
- numpy version 1.19.2 or newer
- Dependencies:
- utilize_eye_in_hand_calibration - Transform a single data point or entire point cloud from the camera frame to the robot base frame using the Eye-in-Hand calibration matrix.
- pose_conversions - Convert to/from Transformation Matrix (Rotation Matrix + Translation Vector).
- universal_robots_hand_eye_calibration
- universal_robots_perform_hand_eye_calibration - Generate dataset and perform Hand-Eye calibration on the generated dataset.
- calibrate_eye_to_hand - Perform Eye-to-Hand calibration.
- downsample - Downsample point cloud from a ZDF file.
- create_depth_map - Read point cloud data from a ZDF file, convert it to OpenCV format, then extract and visualize depth map.
- mask_point_cloud - Read point cloud data from a ZDF file, apply a binary mask, and visualize it.
- Dependencies:
- numpy version 1.19.2 or newer
- matplotlib version 3.3.2 or newer
- Open3D version 0.12.0 or newer
- Dependencies:
- gamma_correction - Capture 2D image with gamma correction.
- color_balance - Balance color of 2D image.
- Dependencies:
- numpy version 1.19.2 or newer
- matplotlib version 3.3.2 or newer
- Dependencies:
- hand_eye_calibration
- basic
-
Install Zivid Software. Note: The samples require Zivid SDK v2 (minor version 2.2 or newer).
-
Install Zivid Python. Note: The recommended Python version for these samples is 3.7.
-
[Optional] Launch the Python IDE of your choice. Read our instructions on setting up Python.
-
Install the runtime requirements using IDE or command line:
pip install -r requirements.txt
-
Add the directory
source
to PYTHONPATH. Navigate to the root of the repository and run:- PowerShell:
$env:PYTHONPATH=$env:PYTHONPATH + ";$PWD\source"
- cmd:
set PYTHONPATH="$PYTHONPATH;$PWD\source"
- bash:
export PYTHONPATH="$PYTHONPATH:$PWD/source"
- PowerShell:
-
Open and run one of the samples.
If you need assistance with using Zivid cameras, visit our Knowledge Base at https://help.zivid.com/ or contact us at customersuccess@zivid.com.
Zivid Samples are distributed under the BSD license.