Sampling (2D)

Controls the color and pixel sampling of the 2D capture.

For guidance on choosing these settings, see Sampling (2D).

class Sampling

Sampling settings.

Public Functions

Sampling()

Default constructor.

template<typename ...Args>
inline explicit Sampling(Args&&... args)

Constructor taking variadic number of arguments.

One or more descendant types can be provided. All types not provided will be set to their default value. The result is the same as default constructing Sampling then invoking set(args).

The provided arguments must be descendants of Sampling. These types can be provided:

template<typename ...Args>
inline void set(Args&&... args)

Set multiple arguments.

The method invokes set(arg) with each of the provided arguments.

The provided arguments must be descendants of Sampling. These types can be provided:

template<typename ...Args>
inline Sampling copyWith(Args&&... args) const

Returns a copy of this object with the given argument(s) set to the new value(s)

Creates a copy of this Sampling object, then invokes set(args) on the copy, and finally returns the copy. This method does not modify the original object.

The provided arguments must be descendants of Sampling. These types can be provided:

inline const Color &color() const

Get Color.

inline Color &color()

Get Color.

inline Sampling &set(const Color &value)

Set Color.

inline const Interval &interval() const

Get Interval.

inline Interval &interval()

Get Interval.

inline Sampling &set(const Interval &value)

Set Interval.

inline Sampling &set(const Interval::Duration &value)

Set Interval::Duration.

inline Sampling &set(const Interval::Enabled &value)

Set Interval::Enabled.

inline const Pixel &pixel() const

Get Pixel.

inline Pixel &pixel()

Get Pixel.

inline Sampling &set(const Pixel &value)

Set Pixel.

template<typename F>
inline void forEach(const F &f) const

Run the given function on each direct member with the value of the member as parameter.

template<typename F>
inline void forEach(const F &f)

Run the given function on each direct member with the value of the member as parameter.

bool operator==(const Sampling &other) const

Equality operator.

bool operator!=(const Sampling &other) const

Inequality operator.

std::string toString() const

Get the value as string.

Public Static Attributes

static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group

The type of this node.

static constexpr const char *path = {"Sampling"}

The full path for this value.

static constexpr const char *name = {"Sampling"}

The name of this value.

static constexpr const char * description   = { R"description(Samplingsettings.)description" }

The description for this value.

Friends

inline friend std::ostream &operator<<(std::ostream &stream, const Sampling &value)

Operator to send the value as string to a stream.

class Color

Choose how to sample colors for the 2D image.

  • rgb option gives an image with full colors.

  • grayscale option gives a grayscale (r=g=b) image, which can be acquired faster than full colors.

  • rgbStrongAmbientLight option gives an image with full colors and reduced color noise. This option should be chosen only for applications which suffer from high color noise and with high amounts of ambient light in the scene.

  • rgbAmbientSuppression option gives an image with full colors while suppressing the ambient light. The Zivid 2+R and Zivid 3 cameras suppress ambient light by default, and therefore do not need the additional option rgbAmbientSuppression.

The grayscale, rgbStrongAmbientLight and rgbAmbientSuppression options are not available on all camera models.

Public Types

enum class ValueType

The type of the underlying value.

Values:

enumerator rgb
enumerator grayscale
enumerator rgbStrongAmbientLight
enumerator rgbAmbientSuppression

Public Functions

Color() = default

Default constructor.

inline explicit constexpr Color(ValueType value)

Constructor.

ValueType value() const

Get the value.

If this object does not contain a value (see hasValue) then this method throws an exception.

bool hasValue() const

Check if the value is set.

void reset()

Reset the node to unset state.

std::string toString() const

Get the value as string.

inline bool operator==(const Color &other) const

Comparison operator.

inline bool operator!=(const Color &other) const

Comparison operator.

Public Static Functions

static inline std::set<ValueType> validValues()

All valid values of Color.

Public Static Attributes

static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue

The type of this node.

static constexpr const char *path = {"Sampling/Color"}

The full path for this value.

static constexpr const char *name = {"Color"}

The name of this value.

static constexpr const char * description  { R"description(Choose how to sample colors for the 2D image.- `rgb` option gives an image with full colors.- `grayscale` option gives a grayscale(r=g=b) image, whichcan be acquired faster than full colors.- `rgbStrongAmbientLight` option gives an image with full colors and reduced   colornoise. This option should be chosen only for applications whichsuffer from highcolornoise and with high amounts of ambient light in thescene.- `rgbAmbientSuppression` option gives an image with full colors whilesuppressing the ambient light. The Zivid 2+R and Zivid 3 cameras suppress ambientlight by default, and therefore do not need the additional option`rgbAmbientSuppression`.The `grayscale`, `rgbStrongAmbientLight` and `rgbAmbientSuppression` options are not available on all camera models.)description" }

The description for this value.

static const Color rgb

rgb

static const Color grayscale

grayscale

static const Color rgbStrongAmbientLight

rgbStrongAmbientLight

static const Color rgbAmbientSuppression

rgbAmbientSuppression

Friends

inline friend std::ostream &operator<<(std::ostream &stream, const Color::ValueType &value)

Operator to serialize ValueType to a stream.

inline friend std::ostream &operator<<(std::ostream &stream, const Color &value)

Operator to serialize the value to a stream.

class Interval

Sampling interval controls the interval between successive sensor operations (e.g., structured light pattern projection and image exposure), aligned to external frequencies (e.g., 50 Hz, 60 Hz grid) or to other devices (e.g., barcode scanners at 100 Hz).

The requested interval is a target: the sensor operations will happen at this rate if the it can fit the chosen exposure time plus some processing overhead. Otherwise, the sampling interval is rounded up to the nearest suitable integer multiple (e.g., n * 10 ms for 100 Hz and n * 8.33 ms for 120 Hz).

Public Functions

Interval()

Default constructor.

template<typename ...Args>
inline explicit Interval(Args&&... args)

Constructor taking variadic number of arguments.

One or more descendant types can be provided. All types not provided will be set to their default value. The result is the same as default constructing Interval then invoking set(args).

The provided arguments must be descendants of Interval. These types can be provided:

template<typename ...Args>
inline void set(Args&&... args)

Set multiple arguments.

The method invokes set(arg) with each of the provided arguments.

The provided arguments must be descendants of Interval. These types can be provided:

template<typename ...Args>
inline Interval copyWith(Args&&... args) const

Returns a copy of this object with the given argument(s) set to the new value(s)

Creates a copy of this Interval object, then invokes set(args) on the copy, and finally returns the copy. This method does not modify the original object.

The provided arguments must be descendants of Interval. These types can be provided:

inline const Duration &duration() const

Get Duration.

inline Duration &duration()

Get Duration.

inline Interval &set(const Duration &value)

Set Duration.

inline const Enabled &isEnabled() const

Get Enabled.

inline Enabled &isEnabled()

Get Enabled.

inline Interval &set(const Enabled &value)

Set Enabled.

template<typename F>
inline void forEach(const F &f) const

Run the given function on each direct member with the value of the member as parameter.

template<typename F>
inline void forEach(const F &f)

Run the given function on each direct member with the value of the member as parameter.

bool operator==(const Interval &other) const

Equality operator.

bool operator!=(const Interval &other) const

Inequality operator.

std::string toString() const

Get the value as string.

Public Static Attributes

static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group

The type of this node.

static constexpr const char *path = {"Sampling/Interval"}

The full path for this value.

static constexpr const char *name = {"Interval"}

The name of this value.

static constexpr const char * description  {R"description(Sampling interval controls the intervalbetween successive sensor operations (e.g.,structured light pattern projection and image exposure), aligned to externalfrequencies (e.g., 50 Hz, 60 Hz grid) or to other devices (e.g., barcode scannersat 100 Hz). The requestedintervalis a target: the sensor operations will happenat this rate if the it can fit the chosen exposure time plus someprocessingoverhead.Otherwise, thesampling intervalis rounded up to the nearest suitable integer multiple(e.g., n * 10 ms for 100 Hz and n * 8.33 ms for 120 Hz).)description"}

The description for this value.

Friends

inline friend std::ostream &operator<<(std::ostream &stream, const Interval &value)

Operator to send the value as string to a stream.

class Duration

Duration between successive sensor operations, in microseconds.

The effective interval might be rounded up to the nearest suitable integer multiple and will never be shorter than exposure time plus some processing overhead.

Public Types

using ValueType = std::chrono::microseconds

The type of the underlying value.

Public Functions

Duration() = default

Default constructor.

inline explicit constexpr Duration(std::chrono::microseconds value)

Constructor.

std::chrono::microseconds value() const

Get the value.

If this object does not contain a value (see hasValue) then this method throws an exception.

bool hasValue() const

Check if the value is set.

void reset()

Reset the node to unset state.

std::string toString() const

Get the value as string.

inline bool operator==(const Duration &other) const

Comparison operator.

inline bool operator!=(const Duration &other) const

Comparison operator.

inline bool operator<(const Duration &other) const

Comparison operator.

inline bool operator>(const Duration &other) const

Comparison operator.

inline bool operator<=(const Duration &other) const

Comparison operator.

inline bool operator>=(const Duration &other) const

Comparison operator.

Public Static Functions

static inline constexpr Range<std::chrono::microseconds> validRange()

The range of valid values for Duration.

Public Static Attributes

static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue

The type of this node.

static constexpr const char *path = {"Sampling/Interval/Duration"}

The full path for this value.

static constexpr const char *name = {"Duration"}

The name of this value.

static constexpr const char * description  {R"description(Duration between successive sensor operations, in microseconds. The effective intervalmight be rounded up to the nearest suitable integer multiple and will never be shorterthan exposure time plus someprocessingoverhead.)description"}

The description for this value.

Friends

inline friend std::ostream &operator<<(std::ostream &stream, const Duration &value)

Operator to serialize the value to a stream.

class Enabled

Enable or disable sampling interval.

Public Types

using ValueType = bool

The type of the underlying value.

Public Functions

Enabled() = default

Default constructor.

inline explicit constexpr Enabled(bool value)

Constructor.

bool value() const

Get the value.

If this object does not contain a value (see hasValue) then this method throws an exception.

bool hasValue() const

Check if the value is set.

void reset()

Reset the node to unset state.

std::string toString() const

Get the value as string.

inline bool operator==(const Enabled &other) const

Comparison operator.

inline bool operator!=(const Enabled &other) const

Comparison operator.

Public Static Functions

static inline std::set<bool> validValues()

All valid values of Enabled.

Public Static Attributes

static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue

The type of this node.

static constexpr const char *path = {"Sampling/Interval/Enabled"}

The full path for this value.

static constexpr const char *name = {"Enabled"}

The name of this value.

static constexpr const char * description  {R"description(Enable or disablesamplinginterval.)description"}

The description for this value.

static const Enabled yes

On/enabled.

static const Enabled no

Off/disabled.

Friends

inline friend std::ostream &operator<<(std::ostream &stream, const Enabled &value)

Operator to serialize the value to a stream.

class Pixel

Set the pixel sampling to use for the 2D capture.

This setting defines how the camera sensor is sampled. When doing 2D+3D capture, picking the same value that is used for 3D is generally recommended.

Public Types

enum class ValueType

The type of the underlying value.

Values:

enumerator all
enumerator blueSubsample2x2
enumerator redSubsample2x2
enumerator blueSubsample4x4
enumerator redSubsample4x4
enumerator by2x2
enumerator by4x4

Public Functions

Pixel() = default

Default constructor.

inline explicit constexpr Pixel(ValueType value)

Constructor.

ValueType value() const

Get the value.

If this object does not contain a value (see hasValue) then this method throws an exception.

bool hasValue() const

Check if the value is set.

void reset()

Reset the node to unset state.

std::string toString() const

Get the value as string.

inline bool operator==(const Pixel &other) const

Comparison operator.

inline bool operator!=(const Pixel &other) const

Comparison operator.

Public Static Functions

static inline std::set<ValueType> validValues()

All valid values of Pixel.

Public Static Attributes

static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue

The type of this node.

static constexpr const char *path = {"Sampling/Pixel"}

The full path for this value.

static constexpr const char *name = {"Pixel"}

The name of this value.

static constexpr const char * description  {R"description(Set thepixel samplingto use for the 2D capture. This setting defines how the camera sensor is sampled.When doing 2D+3D capture, picking the samevaluethat is used for 3D is generally recommended.)description"}

The description for this value.

static const Pixel all

all

static const Pixel blueSubsample2x2

blueSubsample2x2

static const Pixel redSubsample2x2

redSubsample2x2

static const Pixel blueSubsample4x4

blueSubsample4x4

static const Pixel redSubsample4x4

redSubsample4x4

static const Pixel by2x2

by2x2

static const Pixel by4x4

by4x4

Friends

inline friend std::ostream &operator<<(std::ostream &stream, const Pixel::ValueType &value)

Operator to serialize ValueType to a stream.

inline friend std::ostream &operator<<(std::ostream &stream, const Pixel &value)

Operator to serialize the value to a stream.

struct SamplingGroup

Sampling settings.

Public Types

enum class ColorOption : std::underlying_type<Zivid::Settings2D::Sampling::Color::ValueType>::type

Choose how to sample colors for the 2D image.

  • rgb option gives an image with full colors.

  • grayscale option gives a grayscale (r=g=b) image, which can be acquired faster than full colors.

  • rgbStrongAmbientLight option gives an image with full colors and reduced color noise. This option should be chosen only for applications which suffer from high color noise and with high amounts of ambient light in the scene.

  • rgbAmbientSuppression option gives an image with full colors while suppressing the ambient light. The Zivid 2+R and Zivid 3 cameras suppress ambient light by default, and therefore do not need the additional option rgbAmbientSuppression.

The grayscale, rgbStrongAmbientLight and rgbAmbientSuppression options are not available on all camera models.

Values:

enumerator Rgb
enumerator Grayscale
enumerator RgbStrongAmbientLight
enumerator RgbAmbientSuppression
enum class PixelOption : std::underlying_type<Zivid::Settings2D::Sampling::Pixel::ValueType>::type

Set the pixel sampling to use for the 2D capture.

This setting defines how the camera sensor is sampled. When doing 2D+3D capture, picking the same value that is used for 3D is generally recommended.

Values:

enumerator All
enumerator BlueSubsample2x2
enumerator RedSubsample2x2
enumerator BlueSubsample4x4
enumerator RedSubsample4x4
enumerator By2x2
enumerator By4x4

Public Functions

inline SamplingGroup()

Constructor.

SamplingGroup ^ CopyWith (CopyWithDelegate ^ delegate)

Create a clone (deep copy) of the current instance and invoke delegate on the clone.

Creates a clone (deep copy) of this object, then invokes the delegate function on the clone, and finally returns the clone. This method can be used to create a clone of an instance and then change one or more properties on the clone in one method call. The current instance is unchanged.

SamplingGroup ^ Clone ()

Create a clone (deep copy) of the current instance.

System::String ^ ToString () override

Get string representation of the object.

Properties

System::Nullable<ColorOption> Color

Choose how to sample colors for the 2D image.

  • rgb option gives an image with full colors.

  • grayscale option gives a grayscale (r=g=b) image, which can be acquired faster than full colors.

  • rgbStrongAmbientLight option gives an image with full colors and reduced color noise. This option should be chosen only for applications which suffer from high color noise and with high amounts of ambient light in the scene.

  • rgbAmbientSuppression option gives an image with full colors while suppressing the ambient light. The Zivid 2+R and Zivid 3 cameras suppress ambient light by default, and therefore do not need the additional option rgbAmbientSuppression.

The grayscale, rgbStrongAmbientLight and rgbAmbientSuppression options are not available on all camera models.

System::Nullable<PixelOption> Pixel

Set the pixel sampling to use for the 2D capture.

This setting defines how the camera sensor is sampled. When doing 2D+3D capture, picking the same value that is used for 3D is generally recommended.

struct IntervalGroup

Sampling interval controls the interval between successive sensor operations (e.g., structured light pattern projection and image exposure), aligned to external frequencies (e.g., 50 Hz, 60 Hz grid) or to other devices (e.g., barcode scanners at 100 Hz).

The requested interval is a target: the sensor operations will happen at this rate if the it can fit the chosen exposure time plus some processing overhead. Otherwise, the sampling interval is rounded up to the nearest suitable integer multiple (e.g., n * 10 ms for 100 Hz and n * 8.33 ms for 120 Hz).

Public Functions

inline IntervalGroup()

Constructor.

IntervalGroup ^ CopyWith (CopyWithDelegate ^ delegate)

Create a clone (deep copy) of the current instance and invoke delegate on the clone.

Creates a clone (deep copy) of this object, then invokes the delegate function on the clone, and finally returns the clone. This method can be used to create a clone of an instance and then change one or more properties on the clone in one method call. The current instance is unchanged.

IntervalGroup ^ Clone ()

Create a clone (deep copy) of the current instance.

System::String ^ ToString () override

Get string representation of the object.

Properties

System::Nullable<::Zivid::NET::Duration> Duration

Duration between successive sensor operations, in microseconds.

The effective interval might be rounded up to the nearest suitable integer multiple and will never be shorter than exposure time plus some processing overhead.

System::Nullable<bool> Enabled

Enable or disable sampling interval.

class Sampling(
color: str | None = _zivid.Settings2D.Sampling.Color().value,
pixel: str | None = _zivid.Settings2D.Sampling.Pixel().value,
interval: Interval | None = None,
)

Sampling settings.

class Color

Choose how to sample colors for the 2D image. - rgb option gives an image with full colors. - grayscale option gives a grayscale (r=g=b) image, which can be acquired faster than full colors. - rgbStrongAmbientLight option gives an image with full colors and reduced color noise. This option should be chosen only for applications which suffer from high color noise and with high amounts of ambient light in the scene. - rgbAmbientSuppression option gives an image with full colors while suppressing the ambient light. The Zivid 2+R and Zivid 3 cameras suppress ambient light by default, and therefore do not need the additional option rgbAmbientSuppression. The grayscale, rgbStrongAmbientLight and rgbAmbientSuppression options are not available on all camera models.

class Interval(
duration: timedelta | None = _zivid.Settings2D.Sampling.Interval.Duration().value,
enabled: bool | None = _zivid.Settings2D.Sampling.Interval.Enabled().value,
)

Sampling interval controls the interval between successive sensor operations (e.g., structured light pattern projection and image exposure), aligned to external frequencies (e.g., 50 Hz, 60 Hz grid) or to other devices (e.g., barcode scanners at 100 Hz). The requested interval is a target: the sensor operations will happen at this rate if the it can fit the chosen exposure time plus some processing overhead. Otherwise, the sampling interval is rounded up to the nearest suitable integer multiple (e.g., n * 10 ms for 100 Hz and n * 8.33 ms for 120 Hz).

property duration

Duration between successive sensor operations, in microseconds. The effective interval might be rounded up to the nearest suitable integer multiple and will never be shorter than exposure time plus some processing overhead.

property enabled

Enable or disable sampling interval.

class Pixel

Set the pixel sampling to use for the 2D capture. This setting defines how the camera sensor is sampled. When doing 2D+3D capture, picking the same value that is used for 3D is generally recommended.

property color

Choose how to sample colors for the 2D image. - rgb option gives an image with full colors. - grayscale option gives a grayscale (r=g=b) image, which can be acquired faster than full colors. - rgbStrongAmbientLight option gives an image with full colors and reduced color noise. This option should be chosen only for applications which suffer from high color noise and with high amounts of ambient light in the scene. - rgbAmbientSuppression option gives an image with full colors while suppressing the ambient light. The Zivid 2+R and Zivid 3 cameras suppress ambient light by default, and therefore do not need the additional option rgbAmbientSuppression. The grayscale, rgbStrongAmbientLight and rgbAmbientSuppression options are not available on all camera models.

property interval

Sampling interval controls the interval between successive sensor operations (e.g., structured light pattern projection and image exposure), aligned to external frequencies (e.g., 50 Hz, 60 Hz grid) or to other devices (e.g., barcode scanners at 100 Hz). The requested interval is a target: the sensor operations will happen at this rate if the it can fit the chosen exposure time plus some processing overhead. Otherwise, the sampling interval is rounded up to the nearest suitable integer multiple (e.g., n * 10 ms for 100 Hz and n * 8.33 ms for 120 Hz).

property pixel

Set the pixel sampling to use for the 2D capture. This setting defines how the camera sensor is sampled. When doing 2D+3D capture, picking the same value that is used for 3D is generally recommended.