Quick Capture Tutorial
Introduction
This tutorial describes the most basic way to use the Zivid SDK to capture point clouds.
Prerequisites
Install Zivid Software.
For Python: install zivid-python
Initialize
Calling any of the APIs in the Zivid SDK requires initializing the Zivid application and keeping it alive while the program runs.
Zivid::Application zivid;
var zivid = new Zivid.NET.Application();
app = zivid.Application()
Connect
auto camera = zivid.connectCamera();
var camera = zivid.ConnectCamera();
camera = app.connect_camera()
Configure
const auto settings = Zivid::Settings(settingsFile);
var settings = new Zivid.NET.Settings(settingsFile);
settings = zivid.Settings.load(settings_file)
Capture
const auto frame = camera.capture2D3D(settings);
using (var frame = camera.Capture2D3D(settings))
with camera.capture_2d_3d(settings) as frame:
Save
const auto dataFile = "Frame.zdf";
frame.save(dataFile);
var dataFile = "Frame.zdf";
frame.Save(dataFile);
data_file = "Frame.zdf"
frame.save(data_file)
const auto dataFilePLY = "PointCloud.ply";
frame.save(dataFilePLY);
var dataFilePLY = "PointCloud.ply";
frame.Save(dataFilePLY);
data_file_ply = "PointCloud.ply"
frame.save(data_file_ply)
For other exporting options, see Point Cloud for a list of supported formats
Utilize
const auto pointCloud = frame.pointCloud();
const auto data = pointCloud.copyData<Zivid::PointXYZColorRGBA>();
var pointCloud = frame.PointCloud;
var pointCloudData = pointCloud.CopyPointsXYZColorsRGBA();
point_cloud = frame.point_cloud()
xyz = point_cloud.copy_data("xyz")
rgba = point_cloud.copy_data("rgba")
Tip
You can export Preset settings to YML from Zivid Studio
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.