zivid / zivid-python

Official Python package for Zivid 3D cameras
BSD 3-Clause "New" or "Revised" License
40 stars 14 forks source link

Add python support for presets API #236

Closed johningve closed 1 year ago

johningve commented 1 year ago

The presets API added in Zivid SDK 2.9 allows the user to obtain settings presets that are fine tuned for each camera model for a number of different use-cases.

See samples/sample_presets.py for an example of how to use it.

apartridge commented 1 year ago

We also need to double-check that we are able to add 2D settings presets in the future when we want to without breaking any existing stuff. In the C++ API it is covered since CategoryBase and PresetBase are templated types, and I think it would also work quite well here since Python is very dynamic :)

johningve commented 1 year ago

We also need to double-check that we are able to add 2D settings presets in the future when we want to without breaking any existing stuff. In the C++ API it is covered since CategoryBase and PresetBase are templated types, and I think it would also work quite well here since Python is very dynamic :)

Yeah I don't think there will be any problem. It looks to me like adding 2D settings presets would add new C++ types for 2D presets and categories, and would also require a new function to get the categories. So that could all be added without any conflict to the python wrapper. We will probably be able to reuse code for the preset and category classes.

johningve commented 1 year ago

So, there are two things to fix in a follow-up PR:

  1. Remove the type(_zivid....) in the error thrown by initializers for certain classes
  2. Scope the camera in the samples
johningve commented 1 year ago

Ready for next round