Quick Capture Tutorial

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

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

Go to source

source

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

source

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

source

settings = zivid.Settings.load(settings_file)

Capture

Go to source

source

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

source

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

source

with camera.capture_2d_3d(settings) as frame:

Save

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)

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>();
Go to source

source

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

source

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

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.