Quick Capture Tutorial

Introduction

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

For MATLAB see Zivid Quick Capture Tutorial for MATLAB

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;

Connect

Go to source

source

auto camera = zivid.connectCamera();

Configure

Go to source

source

const auto suggestSettingsParameters = Zivid::CaptureAssistant::SuggestSettingsParameters{
    Zivid::CaptureAssistant::SuggestSettingsParameters::AmbientLightFrequency::none,
    Zivid::CaptureAssistant::SuggestSettingsParameters::MaxCaptureTime{ std::chrono::milliseconds{ 1200 } }
};

std::cout << "Running Capture Assistant with parameters:\n" << suggestSettingsParameters << std::endl;
auto settings = Zivid::CaptureAssistant::suggestSettings(camera, suggestSettingsParameters);

Capture

Go to source

source

const auto frame = camera.capture(settings);

Save

Go to source

source

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

The API detects which format to use. See Point Cloud for a list of supported formats.

Tip

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.