Python samples
This repository contains python code samples for Zivid SDK v2.13.1. For
tested compatibility with earlier SDK versions, please check out
accompanying
releases.
Contents:
Tutorials |
Samples |
Installation |
Support |
License
Tutorials list
Samples list
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 use
the output generated by the camera, such as the 3D point cloud, a 2D
image or other data from the camera. These samples shows how the data
from the camera can be used.
- camera
- basic
- capture - Capture point clouds, with color, from the Zivid camera.
- capture_2d - Capture 2D images from the Zivid camera.
- capture_2d_with_settings_from_yml - Capture 2D images from the Zivid camera, with settings
from YML file.
- capture_assistant - Use Capture Assistant to capture point clouds, with color,
from the Zivid camera.
- capture_from_file_camera - Capture point clouds, with color, with the Zivid file
camera.
- capture_hdr - Capture 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.
- capture_with_settings_from_yml - Capture point clouds, with color, from the Zivid camera,
with settings from YML file.
- advanced
- capture_2d_and_3d - Capture 2D and 3D separately with the Zivid camera.
- 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.
- capture_hdr_print_normals - Capture Zivid point clouds, compute normals and print a
subset.
- info_util_other
- automatic_network_configuration_for_cameras - 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.
- camera_info - Print version information for Python, zivid-python and
Zivid SDK, then list cameras and print camera info and state
for each connected camera.
- camera_user_data - Store user data on the Zivid camera.
- capture_with_diagnostics - Capture point clouds, with color, from the Zivid camera,
with settings from YML file and diagnostics enabled.
- firmware_updater - Update firmware on the Zivid camera.
- get_camera_intrinsics - Read intrinsic parameters from the Zivid camera (OpenCV
model) or estimate them from the point cloud.
- network_configuration - 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
- 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.
- advanced
- auto_2d_settings - Automatically find 2D settings for a 2D capture by using a
Zivid calibration board.
- color_balance - Balance color of a 2D image by using a Zivid calibration
board.
- create_depth_map - Read point cloud data from a ZDF file, convert it to
OpenCV format, then extract and visualize depth map.
- downsample - Downsample point cloud from a ZDF file.
- gamma_correction - Capture 2D image with gamma correction.
- get_checkerboard_pose_from_zdf - Read point cloud data of a Zivid calibration board from a
ZDF file, estimate the
- hand_eye_calibration - Perform Hand-Eye calibration.
- mask_point_cloud - Read point cloud data from a ZDF file, apply a binary
mask, and visualize it.
- project_and_find_marker - Show a marker using the projector, capture a set of 2D
images to find the marker coordinates (2D and 3D).
- reproject_points - Illuminate checkerboard (Zivid Calibration Board) corners
by getting checkerboard pose
- roi_box_via_aruco_marker - Filter the point cloud based on a ROI box given relative
to the ArUco marker on a Zivid Calibration Board.
- roi_box_via_checkerboard - Filter the point cloud based on a ROI box given relative
to the Zivid Calibration Board.
- transform_point_cloud_via_aruco_marker - Transform a point cloud from camera to ArUco marker
coordinate frame by estimating the marker's pose from the
point cloud.
- transform_point_cloud_via_checkerboard - Transform a point cloud from camera to checkerboard (Zivid
Calibration Board) coordinate frame by getting checkerboard
pose from the API.
- hand_eye_calibration
- sample_utils
- applications
- advanced
- robot_guidance
- verify_hand_eye_calibration
Installation
Note:
The recommended Python version for these samples is 3.7 - 3.9.
-
Install Zivid
Software.
-
Download Zivid Sample
Data.
-
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"
-
Open and run one of the samples.
Support
For more information about the Zivid cameras, please visit our
Knowledge Base. If you run into any
issues please check out
Troubleshooting.
License
Zivid Samples are distributed under the BSD
license.