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
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 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);
var suggestSettingsParameters = new Zivid.NET.CaptureAssistant.SuggestSettingsParameters {
AmbientLightFrequency =
Zivid.NET.CaptureAssistant.SuggestSettingsParameters.AmbientLightFrequencyOption.none,
MaxCaptureTime = Duration.FromMilliseconds(1200)
};
Console.WriteLine("Running Capture Assistant with parameters:\n{0}", suggestSettingsParameters);
var settings = Zivid.NET.CaptureAssistant.Assistant.SuggestSettings(camera, suggestSettingsParameters);
suggest_settings_parameters = zivid.capture_assistant.SuggestSettingsParameters(
max_capture_time=datetime.timedelta(milliseconds=1200),
ambient_light_frequency=zivid.capture_assistant.SuggestSettingsParameters.AmbientLightFrequency.none,
)
print(f"Running Capture Assistant with parameters: {suggest_settings_parameters}")
settings = zivid.capture_assistant.suggest_settings(camera, suggest_settings_parameters)
Capture¶
const auto frame = camera.capture(settings);
using(var frame = camera.Capture(settings))
with camera.capture(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)
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.