Sampling

Controls the projected light color and which pixels are sampled for the 3D capture.

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

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 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 point cloud.

  • 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.

This setting is deprecated as of SDK 2.14. This setting will be removed in the next SDK major version (SDK 3.0). The recommended way to do a 2D+3D capture is to set a Settings2D object in the Settings/Color field. Tip: If you want to convert an existing settings.yml file to the recommended API, you can import the .yml file into Zivid Studio and then re-export it to .yml.

Public Types

enum class ValueType

The type of the underlying value.

Values:

enumerator rgb
enumerator disabled
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 point cloud.- `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.This setting is deprecated as of SDK 2.14. This setting will be removed in the next SDK majorversion (SDK 3.0). The recommended way to do a 2D+3D capture is to set a `Settings2D` objectin the `Settings/Color` field. Tip: If you want to convert an existing settings.yml file tothe recommended API, you can import the .yml file into Zivid Studio and then re-export it to.yml.)description" }

The description for this value.

static const Color rgb

rgb

static const Color disabled

disabled

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 Pixel

For Zivid 2 and Zivid 2+, this setting controls whether to read out the full image sensor and use white projector light or to subsample pixels for specific color channels with corresponding projector light.

Picking a specific color channel can help reduce noise and effects of ambient light - projecting blue light is recommended.

For Zivid 2+R and Zivid 3, the user does not have to set the projection color and should only consider whether to scale the resolution by2x2 or by4x4. Both of these modes will boost the signal strength by about 4x compared to all, so the user should consider a corresponding reduction in exposure time.

Sampling at a decreased resolution decreases capture time, as less data will be captured and processed.

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(For Zivid 2 and Zivid 2+, this setting controls whether to read out the full image sensor anduse white projector light or to subsample pixels for specificcolorchannels withcorresponding projector light. Picking a specificcolorchannel can help reduce noiseand effects of ambient light - projecting blue light is recommended.For Zivid 2+R and Zivid 3, the user does not have toset the projection colorand should onlyconsider whether to scale the resolution `by2x2` or `by4x4`. Both of these modeswill boost the signal strength by about 4x compared to `all`, so the user shouldconsider a corresponding reduction in exposure time.Samplingat a decreased resolution decreases capture time, as less data will be captured and processed.)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::Settings::Sampling::Color::ValueType>::type

Choose how to sample colors for the point cloud.

  • 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.

This setting is deprecated as of SDK 2.14. This setting will be removed in the next SDK major version (SDK 3.0). The recommended way to do a 2D+3D capture is to set a Settings2D object in the Settings/Color field. Tip: If you want to convert an existing settings.yml file to the recommended API, you can import the .yml file into Zivid Studio and then re-export it to .yml.

Values:

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

For Zivid 2 and Zivid 2+, this setting controls whether to read out the full image sensor and use white projector light or to subsample pixels for specific color channels with corresponding projector light.

Picking a specific color channel can help reduce noise and effects of ambient light - projecting blue light is recommended.

For Zivid 2+R and Zivid 3, the user does not have to set the projection color and should only consider whether to scale the resolution by2x2 or by4x4. Both of these modes will boost the signal strength by about 4x compared to all, so the user should consider a corresponding reduction in exposure time.

Sampling at a decreased resolution decreases capture time, as less data will be captured and processed.

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 point cloud.

  • 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.

This setting is deprecated as of SDK 2.14. This setting will be removed in the next SDK major version (SDK 3.0). The recommended way to do a 2D+3D capture is to set a Settings2D object in the Settings/Color field. Tip: If you want to convert an existing settings.yml file to the recommended API, you can import the .yml file into Zivid Studio and then re-export it to .yml.

System::Nullable<PixelOption> Pixel

For Zivid 2 and Zivid 2+, this setting controls whether to read out the full image sensor and use white projector light or to subsample pixels for specific color channels with corresponding projector light.

Picking a specific color channel can help reduce noise and effects of ambient light - projecting blue light is recommended.

For Zivid 2+R and Zivid 3, the user does not have to set the projection color and should only consider whether to scale the resolution by2x2 or by4x4. Both of these modes will boost the signal strength by about 4x compared to all, so the user should consider a corresponding reduction in exposure time.

Sampling at a decreased resolution decreases capture time, as less data will be captured and processed.

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

Sampling settings.

class Color

Choose how to sample colors for the point cloud. - 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. This setting is deprecated as of SDK 2.14. This setting will be removed in the next SDK major version (SDK 3.0). The recommended way to do a 2D+3D capture is to set a Settings2D object in the Settings/Color field. Tip: If you want to convert an existing settings.yml file to the recommended API, you can import the .yml file into Zivid Studio and then re-export it to .yml.

class Pixel

For Zivid 2 and Zivid 2+, this setting controls whether to read out the full image sensor and use white projector light or to subsample pixels for specific color channels with corresponding projector light. Picking a specific color channel can help reduce noise and effects of ambient light - projecting blue light is recommended. For Zivid 2+R and Zivid 3, the user does not have to set the projection color and should only consider whether to scale the resolution by2x2 or by4x4. Both of these modes will boost the signal strength by about 4x compared to all, so the user should consider a corresponding reduction in exposure time. Sampling at a decreased resolution decreases capture time, as less data will be captured and processed.

property color

Choose how to sample colors for the point cloud. - 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. This setting is deprecated as of SDK 2.14. This setting will be removed in the next SDK major version (SDK 3.0). The recommended way to do a 2D+3D capture is to set a Settings2D object in the Settings/Color field. Tip: If you want to convert an existing settings.yml file to the recommended API, you can import the .yml file into Zivid Studio and then re-export it to .yml.

property pixel

For Zivid 2 and Zivid 2+, this setting controls whether to read out the full image sensor and use white projector light or to subsample pixels for specific color channels with corresponding projector light. Picking a specific color channel can help reduce noise and effects of ambient light - projecting blue light is recommended. For Zivid 2+R and Zivid 3, the user does not have to set the projection color and should only consider whether to scale the resolution by2x2 or by4x4. Both of these modes will boost the signal strength by about 4x compared to all, so the user should consider a corresponding reduction in exposure time. Sampling at a decreased resolution decreases capture time, as less data will be captured and processed.