Quick Capture Tutorial

This tutorial shows the fastest way to connect to a Zivid camera, capture a point cloud, and save it using the Zivid SDK.

Introduction

This tutorial describes the most basic way to use the Zivid SDK to capture point clouds.

Prerequisites

Initialize

Calling any of the APIs in the Zivid SDK requires initializing the Zivid application and keeping it alive while the program runs.

Go to source

source

Zivid::Application zivid;
Go to source

source

var zivid = new Zivid.NET.Application();
Go to source

source

app = zivid.Application()

Connect

Connect to the camera:

Go to source

source

auto camera = zivid.connectCamera();
Go to source

source

var camera = zivid.ConnectCamera();
Go to source

source

camera = app.connect_camera()

Configure

Load capture settings from a YML file:

Go to source

source

const auto settings = Zivid::Settings(settingsPath);
Go to source

source

var settings = new Zivid.NET.Settings(settingsFile);
Go to source

source

settings = zivid.Settings.load(user_options.settings_path)

Capture

Capture a point cloud:

Go to source

source

const auto frame = camera.capture2D3D(settings);
Go to source

source

using (var frame = camera.Capture2D3D(settings))
Go to source

source


frame = camera.capture_2d_3d(settings)

Save

Save

Save the point cloud to a ZDF file:

Go to source

source

const auto dataFile = "Frame.zdf";
frame.save(dataFile);
Go to source

source

var dataFile = "Frame.zdf";
frame.Save(dataFile);
Go to source

source

data_file = "Frame.zdf"
frame.save(data_file)

Export

Export the point cloud to the .ply format:

Go to source

source

const auto dataFilePLY = "PointCloud.ply";
frame.save(dataFilePLY);
Go to source

source

var dataFilePLY = "PointCloud.ply";
frame.Save(dataFilePLY);
Go to source

source

data_file_ply = "PointCloud.ply"
frame.save(data_file_ply)

For other exporting options, see Point Cloud for a list of supported formats

Utilize

Go to source

source

const auto pointCloud = frame.pointCloud();
const auto data = pointCloud.copyData<Zivid::PointXYZColorRGBA_SRGB>();
Go to source

source

var pointCloud = frame.PointCloud;
var pointCloudData = pointCloud.CopyPointsXYZColorsRGBA_SRGB();
Go to source

source

point_cloud = frame.point_cloud()
xyz = point_cloud.copy_data("xyz")
rgba = point_cloud.copy_data("rgba_srgb")

Tip

  1. You can export Preset settings to YML from Zivid Studio

  2. You can open and view Frame.zdf file in Zivid Studio.

Conclusion

This tutorial shows the most basic way to use the Zivid SDK to connect to, capture, and save from the Zivid camera.

For a more in-depth tutorial check out the complete Capture Tutorial.