Python
Sample 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_assistant - Use Capture Assistant to capture point clouds, with color, from the Zivid camera.
capture_from_file_camera - Capture point clouds, with color, from 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_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
capture_with_diagnostics - Capture point clouds, with color, from the Zivid camera, with settings from YML file and diagnostics enabled.
print_version_info - Print version information for Python, zivid-python and Zivid SDK, then list cameras and print camera info for each connected camera.
warmup - A basic warm-up method for a Zivid camera with specified time and capture cycle.
applications
basic
visualization
capture_hdr_vis_normals - Capture Zivid point clouds, compute normals and convert to color map and display.
capture_vis_3d - Capture point clouds, with color, from the Zivid camera, and visualize it.
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.
advanced
color_balance - Balance color of 2D image.
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.
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.
hand_eye_calibration
pose_conversions - Convert to/from Transformation Matrix (Rotation Matrix + Translation Vector).
utilize_hand_eye_calibration - Transform single data point or entire point cloud from camera frame to robot base frame using Hand-Eye calibration
ur_hand_eye_calibration
universal_robots_perform_hand_eye_calibration - Script to generate a dataset and perform hand-eye calibration using a Universal Robot UR5e robot.
sample_utils
Instructions
Install Zivid Python. Note: The recommended Python version for these samples is 3.8.
[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"
Open and run one of the samples.