Data Types

The value types, containers and utility types used throughout the Zivid SDK API. These are the building blocks returned and consumed by the camera, capture and processing APIs.

For the exhaustive per-type reference, see the Zivid API documentation.

Geometry

Per-point geometry types: 3D points, a 2D point, a depth-only point, a vector and a 2D bounding box in image coordinates.

PointXYZstruct

Point with three coordinates as float.

Public Types

ValueType=floatusing

The type of the coordinate values.

Public Functions

PointXYZ()=default

Constructor.

PointXYZ( floatxCoord, floatyCoord, floatzCoord)inlineconstexpr

Constructor.

isNaN()constinlinebool

Check if the point is Not-a-Number (invalid)

A point is defined as NaN if the z-coordinate is NaN

ZIVID_UTILS_EXPORT std::string toString () const

Get string representation.

ZIVID_UTILS_EXPORT bool operator== (const PointXYZ &rhs) const

Check for equality.

ZIVID_UTILS_EXPORT bool operator!= (const PointXYZ &rhs) const

Check for inequality.

Public Members

ValueTypex

The x element of the point.

ValueTypey

The y element of the point.

ValueTypez

The z element of the point.

PointXYZWstruct

Point with four coordinates as float.

Storing the point coordinates in 4D can be useful in some scenarios. For example if the points are to be passed to a different library which expects 4 floats for point coordinates. It is also useful when applying 4x4 transformation matrices.

Public Types

ValueType=floatusing

The type of the coordinate values.

Public Functions

PointXYZW()=default

Constructor.

PointXYZW( floatxCoord, floatyCoord, floatzCoord, floatwCoord)inline

Constructor.

isNaN()constinlinebool

Check if the point is Not-a-Number (invalid)

A point is defined as NaN if the z-coordinate is NaN

ZIVID_UTILS_EXPORT std::string toString () const

Get string representation.

ZIVID_UTILS_EXPORT bool operator== (const PointXYZW &rhs) const

Check for equality.

ZIVID_UTILS_EXPORT bool operator!= (const PointXYZW &rhs) const

Check for inequality.

Public Members

ValueTypex

The x element of the point.

ValueTypey

The y element of the point.

ValueTypez

The z element of the point.

ValueTypew

The w element of the point.

PointXYstruct

Point with two coordinates as float.

Public Types

ValueType=floatusing

The type of the coordinate values.

Public Functions

PointXY()=default

Constructor.

PointXY( floatxCoord, floatyCoord)inlineconstexpr

Constructor.

isNaN()constinlinebool

Check if the point is Not-a-Number (invalid)

A point is defined as NaN if the y-coordinate is NaN

ZIVID_UTILS_EXPORT std::string toString () const

Get string representation.

ZIVID_UTILS_EXPORT bool operator== (const PointXY &rhs) const

Check for equality.

ZIVID_UTILS_EXPORT bool operator!= (const PointXY &rhs) const

Check for inequality.

Public Members

ValueTypex

The x element of the point.

ValueTypey

The y element of the point.

PointZstruct

Point with Z coordinate.

Public Types

ValueType=floatusing

The type of the coordinate values.

Public Functions

PointZ()=default

Constructor.

PointZ( floatzCoord)inline

Constructor.

isNaN()constinlinebool

Check if the point is Not-a-Number (invalid)

ZIVID_UTILS_EXPORT std::string toString () const

Get string representation.

ZIVID_UTILS_EXPORT bool operator== (const PointZ &rhs) const

Check for equality.

ZIVID_UTILS_EXPORT bool operator!= (const PointZ &rhs) const

Check for inequality.

Public Members

ValueTypez

The z element of the point.

VectorXYZstruct

Vector with three coordinates as float.

Subclassed by Zivid::NormalXYZ

Public Types

ValueType=floatusing

The type of the coordinate values.

Public Functions

VectorXYZ()=default

Constructor.

VectorXYZ( floatxCoord, floatyCoord, floatzCoord)inline

Constructor.

isNaN()constinlinebool

Check if the vector is Not-a-Number (invalid)

A vector is defined as NaN if the z-coordinate is NaN

ZIVID_UTILS_EXPORT std::string toString () const

Get string representation.

ZIVID_UTILS_EXPORT bool operator== (const VectorXYZ &rhs) const

Check for equality.

ZIVID_UTILS_EXPORT bool operator!= (const VectorXYZ &rhs) const

Check for inequality.

Public Members

ValueTypex

The x element of the vector.

ValueTypey

The y element of the vector.

ValueTypez

The z element of the vector.

BoundingBoxstruct

Defines a 2D rectangular bounding box in image coordinates.

Public Types

ValueType=intusing

summary>Constructor

Public Functions

BoundingBox( intxCoord, intyCoord, intboxWidth, intboxHeight)inlineconstexpr

Constructor.

ZIVID_UTILS_EXPORT std::string toString () const

Get string representation.

ZIVID_UTILS_EXPORT bool operator== (const BoundingBox &rhs) const

Check for equality.

ZIVID_UTILS_EXPORT bool operator!= (const BoundingBox &rhs) const

Check for inequality.

Public Members

ValueTypex

Top-left corner x coordinate.

ValueTypey

Top-left corner y coordinate.

ValueTypewidth

Width of the bounding box.

ValueTypeheight

Height of the bounding box.

PointXYZstruct

Point with three coordinates as float.

PointXYZWstruct

Point with four coordinates as float (homogeneous coordinates)

PointXYstruct

Point with two coordinates as float.

PointZstruct

Point with only the Z coordinate as float.

Point and vector data is exposed as NumPy arrays.

classBoundingBox(:intx , :inty , :intwidth , :intheight )

Defines a 2D rectangular bounding box in image coordinates.

Initialization

Construct a BoundingBox object.

パラメータ:
  • x -- Top-left corner x coordinate as int

  • y -- Top-left corner y coordinate as int

  • width -- Width of the bounding box as int

  • height -- Height of the bounding box as int

propertyx int:

Get the top-left corner x coordinate.

戻り値:

The x coordinate as int

propertyy int:

Get the top-left corner y coordinate.

戻り値:

The y coordinate as int

propertywidth int:

Get the width of the bounding box.

戻り値:

The width as int

propertyheight int:

Get the height of the bounding box.

戻り値:

The height as int

Color

Per-pixel color types in different channel orders, with and without alpha, in 8-bit and floating-point precision, and in linear and sRGB color spaces.

ColorRGBA:publicZividColorRGBABaseuint8_tstruct ::<>

Color with 8-bit red, green, blue and alpha channels.

The order of the members is r, g, b, a, and each member is represented as an uint8_t. The members have values from 0 to 255. This type differs from ColorBGRA only in the order of the channels (RGBA vs. BGRA).

This format holds linear color values, which are suitable as input to computer vision algorithms. For showing colors on a display for viewing, consider using the ColorRGBA_SRGB format.

Public Functions

ColorRGBABase()=default

Constructor.

ColorRGBABase(Tred , Tgreen , Tblue , Talpha )inline

Constructor.

ColorBGRA:publicZividColorBGRABaseuint8_tstruct ::<>

Color with 8-bit blue, green, red and alpha channels.

The order of the members is b, g, r, a, and each member is represented as an uint8_t. The members have values from 0 to 255. This type differs from ColorRGBA only in the order of the channels (BGRA vs. RGBA).

This format holds linear color values, which are suitable as input to computer vision algorithms. For showing colors on a display for viewing, consider using the ColorRGBA_SRGB format.

Public Functions

ColorBGRABase()=default

Constructor.

ColorBGRABase(Tblue , Tgreen , Tred , Talpha )inline

Constructor.

ColorRGB:publicZividColorRGBBaseuint8_tstruct ::<>

Color with 8-bit red, green and blue channels (no alpha)

The order of the members is r, g, b and each member is represented as an uint8_t. The members have values from 0 to 255. This format is identical to ColorRGBA but skips the alpha channel for ~25% bandwidth savings on the device-side path.

This format holds linear color values, which are suitable as input to computer vision algorithms. For showing colors on a display for viewing, consider using the ColorRGB_SRGB format.

Public Functions

ColorRGBBase()=default

Constructor.

ColorRGBBase(Tred , Tgreen , Tblue )inline

Constructor.

ColorBGR:publicZividColorBGRBaseuint8_tstruct ::<>

Color with 8-bit blue, green and red channels (no alpha)

The order of the members is b, g, r and each member is represented as an uint8_t. The members have values from 0 to 255. This format is identical to ColorBGRA but skips the alpha channel for ~25% bandwidth savings on the device-side path.

This format holds linear color values, which are suitable as input to computer vision algorithms. For showing colors on a display for viewing, consider using the ColorBGR_SRGB format.

Public Functions

ColorBGRBase()=default

Constructor.

ColorBGRBase(Tblue , Tgreen , Tred )inline

Constructor.

ColorRGBAf:publicZividColorRGBABasefloatstruct ::<>

Color with 32-bit red, green, blue and alpha channels.

The order of the members is r, g, b, a, and each member is represented as a 32-bit float. The members have values from 0 to 1.

This format holds linear color values, which are suitable as input to computer vision algorithms. It is the floating-point counterpart of ColorRGBA, covering the same range with 0 to 255 mapped to 0 to 1. It carries more precision than ColorRGBA, which is this value quantized to 8 bits per channel, so ColorRGBAf * 255 and ColorRGBA agree only to within half a quantization step. For showing colors on a display for viewing, consider using the ColorRGBA_SRGB format.

Public Functions

ColorRGBABase()=default

Constructor.

ColorRGBABase(Tred , Tgreen , Tblue , Talpha )inline

Constructor.

ColorSRGB:publicZividColorRGBABaseuint8_tstruct ::<>

Color with 8-bit red, green, blue and alpha channels in the sRGB color space.

The order of the members is r, g, b, a and each member is represented as an uint8_t. The members have values from 0 to 255.

The sRGB color space is suitable for showing an image on a display for human viewing. It is easier to see details in darker areas of an image in sRGB than in linear RGB, as more of the dynamic range is dedicated to darker colors. This format is assumed by default by most monitors and should be used when displaying an image.

The name of this type is deprecated as of SDK 2.15. The type will be replaced in the next SDK major version (SDK 3.0). Prefer to use the new type name ColorRGBA_SRGB.

Public Functions

ColorRGBABase()=default

Constructor.

ColorRGBABase(Tred , Tgreen , Tblue , Talpha )inline

Constructor.

ColorSRGBColorRGBA_SRGBtypedef

Color with 8-bit red, green, blue and alpha channels in the sRGB color space.

The order of the members is r, g, b, a and each member is represented as an uint8_t. The members have values from 0 to 255.

The sRGB color space is suitable for showing an image on a display for human viewing. It is easier to see details in darker areas of an image in sRGB than in linear RGB, as more of the dynamic range is dedicated to darker colors. This format is assumed by default by most monitors and should be used when displaying an image.

ColorBGRA_SRGB:publicZividColorBGRABaseuint8_tstruct ::<>

Color with 8-bit blue, green, red and alpha channels in the sRGB color space.

The order of the members is b, g, r, a and each member is represented as an uint8_t. The members have values from 0 to 255. This type differs from ColorRGBA_SRGB only in the order of the channels (BGRA vs. RGBA).

The sRGB color space is suitable for showing an image on a display for human viewing. It is easier to see details in darker areas of an image in sRGB than in linear RGB, as more of the dynamic range is dedicated to darker colors. This format is assumed by default by most monitors and should be used when displaying an image.

Public Functions

ColorBGRABase()=default

Constructor.

ColorBGRABase(Tblue , Tgreen , Tred , Talpha )inline

Constructor.

ColorRGB_SRGB:publicZividColorRGBBaseuint8_tstruct ::<>

Color with 8-bit red, green and blue channels (no alpha) in the sRGB color space.

The order of the members is r, g, b and each member is represented as an uint8_t. The members have values from 0 to 255. This format is identical to ColorRGBA_SRGB but skips the alpha channel for ~25% bandwidth savings on the device-side path.

The sRGB color space is suitable for showing an image on a display for human viewing.

Public Functions

ColorRGBBase()=default

Constructor.

ColorRGBBase(Tred , Tgreen , Tblue )inline

Constructor.

ColorBGR_SRGB:publicZividColorBGRBaseuint8_tstruct ::<>

Color with 8-bit blue, green and red channels (no alpha) in the sRGB color space.

The order of the members is b, g, r and each member is represented as an uint8_t. The members have values from 0 to 255. This format is identical to ColorBGRA_SRGB but skips the alpha channel for ~25% bandwidth savings on the device-side path.

The sRGB color space is suitable for showing an image on a display for human viewing.

Public Functions

ColorBGRBase()=default

Constructor.

ColorBGRBase(Tblue , Tgreen , Tred )inline

Constructor.

ColorRGBAstruct

Color with 8-bit red, green, blue and alpha channels.

The order of the members is r, g, b, a, and each member is represented as an uint8_t. The members have values from 0 to 255. This type differs from ColorBGRA only in the order of the channels (RGBA vs. BGRA).

This format holds linear color values, which are suitable as input to computer vision algorithms. For showing colors on a display for viewing, consider using the ColorRGBA_SRGB format.

ColorBGRAstruct

Color with 8-bit blue, green, red and alpha channels.

The order of the members is b, g, r, a, and each member is represented as an uint8_t. The members have values from 0 to 255. This type differs from ColorRGBA only in the order of the channels (BGRA vs. RGBA).

This format holds linear color values, which are suitable as input to computer vision algorithms. For showing colors on a display for viewing, consider using the ColorRGBA_SRGB format.

ColorRGBAfstruct

Color with four float channels (red, green, blue, alpha)

Each channel is a 32-bit float in the range [0.0, 1.0]. This format holds linear color values, which are suitable as input to computer vision algorithms and GPU processing.

ColorSRGBstruct

Color with 8-bit red, green, blue and alpha channels in the sRGB color space.

The sRGB color space is suitable for showing an image on a display for human viewing. It is easier to see details in darker areas of an image in sRGB than in linear RGB, as more of the dynamic range is dedicated to darker colors. This format is assumed by default by most monitors and should be used when displaying an image.

The order of the members is r, g, b, a, and each member is represented as an uint8_t. The members have values from 0 to 255. This type differs from ColorRGBA only in that it is intended to use with color values in the sRGB color space.

This type has been deprecated as of SDK 2.15. The type will be removed in the next SDK major version (SDK 3.0). Prefer to use the new equivalent type ColorRGBA_SRGB.

ColorRGBA_SRGBstruct

Color with 8-bit red, green, blue and alpha channels in the sRGB color space.

The sRGB color space is suitable for showing an image on a display for human viewing. It is easier to see details in darker areas of an image in sRGB than in linear RGB, as more of the dynamic range is dedicated to darker colors. This format is assumed by default by most monitors and should be used when displaying an image.

The order of the members is r, g, b, a, and each member is represented as an uint8_t. The members have values from 0 to 255. This type differs from ColorRGBA only in that it is intended to use with color values in the sRGB color space.

ColorBGRA_SRGBstruct

Color with 8-bit blue, green, red and alpha channels in the sRGB color space.

The sRGB color space is suitable for showing an image on a display for human viewing. It is easier to see details in darker areas of an image in sRGB than in linear RGB, as more of the dynamic range is dedicated to darker colors. This format is assumed by default by most monitors and should be used when displaying an image.

The order of the members is b, g, r, a, and each member is represented as an uint8_t. The members have values from 0 to 255. This type differs from ColorRGBA_SRGB only in the order of the channels (BGRA vs. RGBA).

Color data is exposed as NumPy arrays. See zivid-python.

Per-point composite

Combined point-and-color types plus per-point normals and signal-to-noise ratio.

PointXYZColorRGBAstruct

Struct which contains XYZ point and RGBA color packed together.

Contains one PointXYZ (3*4 bytes) and one ColorRGBA (4*1 bytes), making this a 16 byte struct. This type differs from PointXYZColorBGRA only in the order of the color channels (RGBA vs. BGRA).

Public Functions

ZIVID_UTILS_EXPORT std::string toString () const

Get string representation.

ZIVID_UTILS_EXPORT bool operator== (const PointXYZColorRGBA &rhs) const

Check for equality.

ZIVID_UTILS_EXPORT bool operator!= (const PointXYZColorRGBA &rhs) const

Check for inequality.

Public Members

PointXYZpoint

Point (contains x, y and z coordinates as floats)

ColorRGBAcolor

Color (RGBA order with 8 bits per channel)

PointXYZColorBGRAstruct

Struct which contains XYZ point and BGRA color packed together.

Contains one PointXYZ (3*4 bytes) and one ColorBGRA (4*1 bytes), making this a 16 byte struct. This type differs from PointXYZColorRGBA only in the order of the color channels (BGRA vs. RGBA).

Public Functions

ZIVID_UTILS_EXPORT std::string toString () const

Get string representation.

ZIVID_UTILS_EXPORT bool operator== (const PointXYZColorBGRA &rhs) const

Check for equality.

ZIVID_UTILS_EXPORT bool operator!= (const PointXYZColorBGRA &rhs) const

Check for inequality.

Public Members

PointXYZpoint

Point (contains x, y and z coordinates as floats)

ColorBGRAcolor

Color (BGRA order with 8 bits per channel)

NormalXYZ:publicZividVectorXYZstruct ::

Normal vector with three coordinates as float.

SNRstruct

Signal-to-Noise ratio (SNR)

Public Types

ValueType=floatusing

The type of the SNR value.

Public Functions

ZIVID_UTILS_EXPORT std::string toString () const

Get the value as string.

ZIVID_UTILS_EXPORT bool operator== (const SNR &rhs) const

Check for equality.

ZIVID_UTILS_EXPORT bool operator!= (const SNR &rhs) const

Check for inequality.

Public Members

ValueTypevalue

SNR value.

PointXYZColorRGBAstruct

Struct which contains XYZ point and RGBA color packed together.

Contains one PointXYZ (3*4 bytes) and one ColorRGBA (4*1 bytes), making this a 16 byte struct. This type differs from PointXYZColorBGRA only in the order of the color channels (RGBA vs. BGRA).

PointXYZColorBGRAstruct

Struct which contains XYZ point and BGRA color packed together.

Contains one PointXYZ (3*4 bytes) and one ColorBGRA (4*1 bytes), making this a 16 byte struct. This type differs from PointXYZColorRGBA only in the order of the color channels (BGRA vs. RGBA).

NormalXYZstruct

Normal vector with three coordinates as float.

SNRstruct

Signal-to-noise ratio value as float.

Composite point data is exposed as structured NumPy arrays. See zivid-python.

Containers

Generic 1D and 2D array containers used by the point cloud and image APIs.

< DataFormattemplatetypename>
Array1Dclass

One-dimensional container of data.

Array1D manages the data using implicit sharing via reference counting. Copy or assignment of an Array1D object is shallow (only a pointer to the data is copied), which makes copy/assignment of Array1D fast. The data stored in the array is deallocated when there are no Array1D instances pointing to it.

The type of the elements stored in the array is given by template parameter DataFormat.

Public Types

ValueType=DataFormatusing

The type of the elements stored in the Array.

ConstIterator=constDataFormatusing *

The iterator type for immutable access.

It iterates over individual Array1D elements.

Public Functions

Array1D()inline

Create an empty Array1D.

size_tsize()constinline

Get the number of elements in the array.

isEmpty()constinlinebool

Check if the array is empty.

DataFormat*data()constinlineconst

Pointer to the first data element of the array.

If the array is empty then this method returns nullptr

DataFormat&()operator(size_tidx )constinlineconst

Constant reference to an element given by an index.

No bounds checking is performed. Calling this operator with an argument that is out of range causes undefined behavior. Calling this operator when the Array1D is empty causes undefined behavior.

パラメータ:

idx -- Index (from 0 to size - 1)

ConstIteratorbegin()constinline

Iterator to the beginning of the array.

ConstIteratorend()constinline

Iterator to the end of the array.

ConstIteratorcbegin()constinline

Iterator to the beginning of the array.

ConstIteratorcend()constinline

Iterator to the end of the array.

stdstringtoString()constinline::

Get array information as string.

< DataFormattemplatetypename>
Array2Dclass

Two-dimensional container of data.

Array2D manages the data using implicit sharing via reference counting. Copy or assignment of an Array2D object is shallow (only a pointer to the data is copied), which makes copy/assignment of Array2D fast. The data stored in the array is deallocated when there are no Array2D instances pointing to it.

The type of the elements stored in the array is given by template parameter DataFormat. Elements are stored sequentially in row-major order. Use data to get a pointer to the first element (row 0, column 0).

Public Types

ValueType=DataFormatusing

The type of the elements stored in the Array2D.

ConstIterator=constDataFormatusing *

The iterator type for immutable access.

It iterates over individual Array2D elements in row major order.

Public Functions

Array2D()inline

Create an empty Array2D.

size_twidth()constinline

Get the width of the array (number of columns)

size_theight()constinline

Get the height of the array (number of rows)

size_tsize()constinline

Get the number of elements in the array.

This is identical to width() * height()

isEmpty()constinlinebool

Check if the array is empty.

DataFormat*data()constinlineconst

Pointer to the first data element of the array.

If the array is empty then this method returns nullptr

DataFormat&()operator(size_tidx )constinlineconst

Constant reference to an element given by a 1D linear index.

Data is stored in row-major order. No bounds checking is performed. Calling this operator with an argument that is out of range causes undefined behavior. Calling this operator when the Array2D is empty causes undefined behavior.

パラメータ:

idx -- Index (from 0 to size - 1)

DataFormat&()operator(size_ti , size_tj )constinlineconst

Constant reference to an element given by row and column.

Data is stored in row-major order. No bounds checking is performed. Calling this operator with an argument that is out of range causes undefined behavior. Calling this operator when the Array2D is empty causes undefined behavior.

パラメータ:
  • i -- Row, from 0 to height - 1

  • j -- Column, from 0 to width - 1

ConstIteratorbegin()constinline

Iterator to the beginning of the array.

ConstIteratorend()constinline

Iterator to the end of the array.

ConstIteratorcbegin()constinline

Iterator to the beginning of the array.

ConstIteratorcend()constinline

Iterator to the end of the array.

stdstringtoString()constinline::

Get array information as string.

The array containers are exposed through the C++ and Python APIs. See the Zivid API documentation for the full reference.

Array data is exposed as NumPy arrays. See zivid-python.

classPixelFormat(args*, kwds**)

Color format of a device array or DeviceArrayView.

The 4-channel formats are 3D (height x width x 4): RGBA / BGRA are 8-bit, RGBA_SRGB / BGRA_SRGB are 8-bit sRGB-encoded, and RGBAF is float32. The 3-channel formats are 3D (height x width x 3, no alpha): RGB / BGR are 8-bit, RGB_SRGB / BGR_SRGB are 8-bit sRGB-encoded.

Not every accessor accepts every format. create_device_array_view accepts all color formats; the Frame2D color accessors (allocate and fill) cover all color formats, while the point-cloud color accessors cover a subset.

Initialization

RGBA='rgba'
BGRA='bgra'
RGBA_SRGB='rgba_srgb'
BGRA_SRGB='bgra_srgb'
RGBAF='rgbaf'
RGB='rgb'
RGB_SRGB='rgb_srgb'
BGR='bgr'
BGR_SRGB='bgr_srgb'

Masking

Binary mask applied to a point cloud or frame after capture, e.g. to keep only a region of interest. Used by the mask() / masked() methods on PointCloud and Frame.

Mask:publicZividArray2Duint8_tclass ::<>

A mask for filtering point cloud data.

The Mask class represents a 2D binary mask that can be used to filter point cloud data. Zero values in the mask indicate that the corresponding point should be preserved, while non-zero values indicate that the point should be masked out (set to NaN).

Public Functions

ZIVID_UTILS_EXPORTMask()

Create an empty mask.

ZIVID_UTILS_EXPORTMask( Resolution&const resolution)explicit

Create a nonzero-filled mask with the specified resolution.

パラメータ:

resolution -- The resolution (width x height) of the mask

ZIVID_UTILS_EXPORTMask( Resolution&const resolution, uint8_t*const beginIt, uint8_t*const endIt)

Create a mask from third-party mask data (e.g., OpenCV Mat)

The data is copied, so the original data can be safely freed after construction.

パラメータ:
  • resolution -- The resolution (width x height) of the mask

  • beginIt -- Pointer to the beginning of mask data (uint8_t array)

  • endIt -- Pointer to the end of mask data (uint8_t array)

< Iterator stdenable_if_tstdis_convertible_vtypenamestditerator_traitsIterator::value_type uint8_t,stdnullptr_t >templatetypename,typename::<::< ::<>,> ::>=nullptr
Mask( Resolution&const resolution, IteratorbeginIt , IteratorendIt )inline

Create a mask from iterator range.

パラメータ:
  • resolution -- The resolution (width x height) of the mask

  • beginIt -- Iterator to the beginning of mask data

  • endIt -- Iterator to the end of mask data

ZIVID_UTILS_EXPORT Resolution resolution () const

Get the resolution of the mask.

戻り値:

Resolution object containing width and height of the mask

ZIVID_UTILS_EXPORT std::string toString () const

Get string representation of the mask.

inline ZIVID_UTILS_EXPORT uint8_t * data ()

Mutable pointer to the first data element of the mask.

If the mask is empty then this method returns nullptr

inline ZIVID_UTILS_EXPORT const uint8_t * data () const

Const pointer to the first data element of the mask.

If the mask is empty then this method returns nullptr

inline ZIVID_UTILS_EXPORT uint8_t * begin ()

Mutable iterator to the beginning of the mask.

Returns an iterator to the first element of the mask

inline ZIVID_UTILS_EXPORT uint8_t * end ()

Mutable iterator to the end of the mask.

Returns an iterator to one past the last element of the mask

inline ZIVID_UTILS_EXPORT uint8_t & operator() (size_t idx)

Mutable reference to an element given by a 1D linear index.

Data is stored in row-major order. No bounds checking is performed. Calling this operator with an argument that is out of range causes undefined behavior. Calling this operator when the mask is empty causes undefined behavior.

パラメータ:

idx -- Index (from 0 to size - 1)

inline ZIVID_UTILS_EXPORT uint8_t & operator() (size_t i, size_t j)

Mutable reference to an element given by row and column.

Data is stored in row-major order. No bounds checking is performed. Calling this operator with an argument that is out of range causes undefined behavior. Calling this operator when the mask is empty causes undefined behavior.

パラメータ:
  • i -- Row, from 0 to height - 1

  • j -- Column, from 0 to width - 1

inline ZIVID_UTILS_EXPORT const uint8_t & operator() (size_t idx) const

Const reference to an element given by a 1D linear index.

Data is stored in row-major order. No bounds checking is performed. Calling this operator with an argument that is out of range causes undefined behavior. Calling this operator when the mask is empty causes undefined behavior.

パラメータ:

idx -- Index (from 0 to size - 1)

inline ZIVID_UTILS_EXPORT const uint8_t & operator() (size_t i, size_t j) const

Const reference to an element given by row and column.

Data is stored in row-major order. No bounds checking is performed. Calling this operator with an argument that is out of range causes undefined behavior. Calling this operator when the mask is empty causes undefined behavior.

パラメータ:
  • i -- Row, from 0 to height - 1

  • j -- Column, from 0 to width - 1

Maskclass

Binary mask for filtering point cloud data.

The Mask class represents a 2D binary mask that can be used to filter point cloud data. Zero values in the mask indicate that the corresponding point should be preserved, while non-zero values indicate that the point should be masked out (set to NaN).

Public Functions

Mask (Resolution ^ resolution)

Create a nonzero-filled mask with specified resolution.

パラメータ:

resolution -- The resolution (width and height) of the mask

Mask (Resolution ^ resolution, cli::array< System::Byte > ^ data)

Create a mask from raw data.

パラメータ:
  • resolution -- The resolution (width and height) of the mask

  • data -- Raw mask data as byte array

Resolution ^ GetResolution ()

Get the resolution of the mask.

System::String ^ ToString () override

Get a string representation of the mask.

Properties

size_tWidth

Get the width of the mask.

size_tHeight

Get the height of the mask.

System::Byte default [int, int]

Access mask element at given coordinates.

Param x:

X coordinate (column)

Param y:

Y coordinate (row)

classMask(mask_data)

Binary mask for filtering point cloud data.

The Mask class represents a 2D binary mask that can be used to filter point cloud data. Non-zero values in the mask indicate that the corresponding point should be masked out (set to NaN), while zero values indicate that the point should be preserved.

Initialization

Initialize Mask wrapper.

パラメータ:

mask_data -- Can be one of: - A 2D numpy array of booleans or uint8 values - A zivid.Resolution object to create a mask that masks out every point

例外:
  • TypeError -- If argument type is not supported

  • ValueError -- If numpy array dimensions are incorrect

propertywidth int:

Get the width of the mask.

戻り値:

Width as an integer

propertyheight int:

Get the height of the mask.

戻り値:

Height as an integer

propertyresolution Resolution:

Get the resolution of the mask.

戻り値:

Resolution object with width and height

to_array() → ndarray

Convert mask to numpy array.

戻り値:

2D numpy array of uint8 values

release() → None

Release the underlying resources.

Math and utility

A matrix type (used for transforms), a numeric range and a 2D resolution.

< T size_trowCount size_tcolCounttemplatetypename, , >
Matrixclass

A fixed size matrix in row major order.

Public Types

ValueType=Tusing

The type stored in the matrix.

Iterator=typenameStorageiteratorusing ::

The matrix iterator type for mutable access.

It iterates over individual matrix elements in row major order.

ConstIterator=typenameStorageconst_iteratorusing ::

The matrix iterator type for immutable access.

It iterates over individual matrix elements in row major order.

Public Functions

Matrix()=default

Constructor.

Matrix( stdstring&const:: fileName)inline

Load the matrix from a file.

Matrix( stdarrayT colCount*rowCount arrArrconst::<, >&)inlineexplicit

Constructor.

< Utemplatetypename>
Matrix( MatrixU rowCount colCount sourceMatrixconst<,,>&)inlineexplicit

Constructor.

< Iteratortemplatetypename>
Matrix(IteratorbeginIt , IteratorendIt )inline

Constructor.

Matrix(stdinitializer_listT ::<>values)inlineexplicit

Constructor.

Matrix(stdinitializer_liststdinitializer_listT>values::<::<> )inlineexplicit

Constructor.

Iteratorbegin()inline

Iterator to the beginning of the matrix.

Iteratorend()inline

Iterator to the end of the matrix.

ConstIteratorbegin()constinline

Iterator to the beginning of the matrix.

ConstIteratorend()constinline

Iterator to the end of the matrix.

ConstIteratorcbegin()constinline

Iterator to the beginning of the matrix.

ConstIteratorcend()constinline

Iterator to the end of the matrix.

T&at(size_trow , size_tcol )inline

Access specified element with bounds checking.

T&at(size_trow , size_tcol )constinlineconst

Access specified element with bounds checking.

T&()operator(size_trow , size_tcol )inline

Access specified element without bounds checking.

T&()operator(size_trow , size_tcol )constinlineconst

Access specified element without bounds checking.

T*data()inline

Pointer to the underlying data.

T*data()constinlineconst

Pointer to the underlying data.

save( stdstring&const:: fileName)constvoid

Save the matrix to the given file.

The matrix is saved in YAML format.

load( stdstring&const:: fileName)void

Load the matrix from the given file.

Loads the matrix into the object it was invoked on, does not return a value.

template<typename Q = T, typename = typename std::enable_if_t<invertSupported, Q>> ZIVID_UTILS_EXPORT Matrix inverse () const

Get the inverse of this matrix.

An exception is thrown if the matrix is not invertible.

戻り値:

A new matrix, holding the inverse

stdstringtoString()constinline::

Get string representation of the Matrix.

戻り値:

Matrix as string

Public Static Functions

< Q=T stdenable_if_tidentitySupported Q>templatetypename ,typename=typename::<,>
Matrixidentity()staticinline

Get the identity matrix of given type and size.

戻り値:

An identity matrix of the given type and size

Public Static Attributes

size_trows={rowCountstaticconstexpr }

The number of rows in the matrix.

size_tcols={colCountstaticconstexpr }

The number of columns in the matrix.

< Ttemplatetypename>
Rangeclass

Class describing a range of values for a given type T.

The range is inclusive, in other words both the minimum and maximum values are included in the range.

Public Types

Type=Tusing

Underlying type.

Public Functions

Range()=defaultconstexpr

Default constructor.

Range(Tmin , Tmax )inlineconstexpr

Constructor.

T&min()constinlineconstexprconst

Get the minimum value of the range.

T&max()constinlineconstexprconst

Get the maximum value of the range.

isInRange( T&const value)constinlineconstexprbool

Check if the value is in range.

The range is inclusive, in other words both the minimum and maximum values are included in the range.

==operator( RangeT otherconst<>&)constinlinebool

Comparison operator.

!=operator( RangeT otherconst<>&)constinlinebool

Comparison operator.

stdstringtoString()constinline::

Get the range as string.

Resolutionclass

Class describing a resolution with a width and a height.

Public Functions

ZIVID_UTILS_EXPORTResolution(size_twidth , size_theight )

Construct a Resolution from width and height.

ZIVID_UTILS_EXPORT size_t width () const

Get the width value of the resolution.

ZIVID_UTILS_EXPORT size_t height () const

Get the height value of the resolution.

ZIVID_UTILS_EXPORT size_t size () const

Get the size (area) that is the product of the width and height.

ZIVID_UTILS_EXPORT bool operator== (const Resolution &other) const

Comparison operator.

ZIVID_UTILS_EXPORT bool operator!= (const Resolution &other) const

Comparison operator.

ZIVID_UTILS_EXPORT std::string toString () const

Get a string representation of the resolution.

< Ttemplatetypename>
Rangestruct

Class describing a range of values for a given type T.

Public Functions

Range(Tmin , Tmax )

Constructor.

System::String ^ ToString () override

Get string representation of the object.

Properties

TMin

The minimum value.

TMax

The maximum value.

Resolutionclass

Class describing a resolution with a width and a height.

Public Functions

Resolution(size_twidth , size_theight )

Construct a Resolution from width and height.

System::String ^ ToString () override

Get a string representation of the resolution.

Properties

size_tSize

Get the size (area) that is the product of the width and height.

size_tWidth

Get the width value of the resolution.

size_tHeight

Get the height value of the resolution.

classMatrix4x4(=argNone)

Matrix of size 4x4 containing 32-bit floats.

Initialization

Overloaded constructor.

Does different kinds of initializations depending on the argument:

  • None or no arguments -> Zero initializes all values.

  • 1 dimensional List or numpy.ndarray of 16 floats -> Map 1D array of 16 values into this 2D array of 4x4.

  • 2 dimensional List or numpy.ndarray of 4x4 floats -> Copy 2D array of size 4x4.

  • str or pathlib.Path -> Load the matrix from a file.

パラメータ:

arg -- Any of the above-mentioned.

inverse() → Matrix4x4

Return the inverse of this matrix.

An exception is thrown if the matrix is not invertible.

戻り値:

A new matrix, holding the inverse

load(:strfile_path ) → None

Load the matrix from the given file.

パラメータ:

file_path -- path for the file to load the matrix from.

save(:strfile_path ) → None

Save the matrix to the given file.

パラメータ:

file_path -- path for the new file to save the matrix in.

staticidentity() → Matrix4x4

Return the identity matrix.

戻り値:

A new matrix, holding the identity matrix.

classResolution(:intwidth , :intheight )

Class describing a resolution with a width and a height.

A Resolution represents the dimensions (width x height) of 2D data structures such as images, point clouds, or masks.

Initialization

Construct a Resolution from width and height.

パラメータ:
  • width -- Width as a positive integer

  • height -- Height as a positive integer

例外:
  • TypeError -- If width or height are not integers

  • ValueError -- If width or height are not positive

propertywidth int:

Get the width value of the resolution.

戻り値:

Width as an integer

propertyheight int:

Get the height value of the resolution.

戻り値:

Height as an integer

propertysize int:

Get the size (area) that is the product of the width and height.

戻り値:

Area as an integer (width * height)

Capture output and buffers

  • Image — the 2D image container (Applications Basic).

  • DeviceArray, DeviceArrayView, StreamOrQueue, ComputeDevice and the CUDA/OpenCL backend pointer types — GPU device buffers for zero-copy interop (Advanced: Data Access).

Camera intrinsics

  • CameraIntrinsics and Experimental::PixelMapping — camera matrix, distortion coefficients and sensor-to-projector pixel mapping (Camera Intrinsics).

Calibration results

  • Calibration::Pose, Calibration::DetectionResult, Calibration::DetectionResultFiducialMarkers, Calibration::MarkerShape and Calibration::MarkerDictionary — robot pose, calibration-board and marker detection (Hand-Eye Calibration).

  • Calibration::HandEyeInput, Calibration::HandEyeOutput and Calibration::HandEyeResidual — hand-eye calibration (Hand-Eye Calibration).

  • Calibration::MultiCameraOutput and Calibration::MultiCameraResidual — multi-camera calibration (Multi-Camera Calibration).

Detection results

  • Experimental::Toolbox::LinearBarcodeDetectionResult, Experimental::Toolbox::LinearBarcodeDecodingResult and Experimental::Toolbox::MatrixBarcodeDecodingResult — barcode detection (Barcode Detection).

  • Experimental::Toolbox::LocalPointCloudRegistrationResult — point cloud registration (Point Cloud Registration).

Info and maintenance

  • CameraInfo, CameraState, CameraHealth, SceneConditions and FrameInfo — camera metadata, telemetry, health and per-frame information (Camera Info and Maintenance).