数据类型

Zivid SDK API 中使用的值类型、容器和实用工具类型。它们是相机、捕获和处理 API 所返回和使用的基本构建模块。

有关每种类型的详尽参考,请参阅 Zivid API 文档。

几何

逐点几何类型:3D 点、2D 点、仅深度点、向量以及图像坐标系中的 2D 边界框。

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.

点和向量数据以 NumPy 数组形式提供。

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

颜色

不同通道顺序的逐像素颜色类型,包含或不包含 alpha 通道,具有 8 位和浮点精度,并支持线性和 sRGB 色彩空间。

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

颜色数据以 NumPy 数组形式提供。请参阅 zivid-python。

逐点复合类型

结合了点和颜色的类型,以及逐点法线和信噪比。

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.

复合点数据以结构化 NumPy 数组形式提供。请参阅 zivid-python。

容器

点云和图像 API 所使用的通用 1D 和 2D 数组容器。

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

数组容器通过 C++ 和 Python API 提供。完整参考请参阅 Zivid API 文档。

数组数据以 NumPy 数组形式提供。请参阅 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'

掩膜

捕获后应用于点云或帧的二值掩膜,例如用于仅保留某一感兴趣区域。由 PointCloud 和 Frame 上的 mask() / masked() 方法使用。

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.

数学与实用工具

一种矩阵类型(用于变换)、一个数值范围以及一个 2D 分辨率。

< 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)

捕获输出与缓冲区

  • Image — 2D 图像容器(基础应用)。

  • DeviceArray、DeviceArrayView、StreamOrQueue、ComputeDevice 以及 CUDA/OpenCL 后端指针类型 — 用于零拷贝互操作的 GPU 设备缓冲区(进阶:数据访问)。

相机内参

  • CameraIntrinsics 和 Experimental::PixelMapping — 相机矩阵、畸变系数以及传感器到投影仪的像素映射(相机内参)。

标定结果

  • Calibration::Pose、Calibration::DetectionResult、Calibration::DetectionResultFiducialMarkers、Calibration::MarkerShape 和 Calibration::MarkerDictionary — 机器人位姿、标定板与标记检测(手眼标定)。

  • Calibration::HandEyeInput、Calibration::HandEyeOutput 和 Calibration::HandEyeResidual — 手眼标定(手眼标定)。

  • Calibration::MultiCameraOutput 和 Calibration::MultiCameraResidual — 多相机标定(多相机标定)。

检测结果

  • Experimental::Toolbox::LinearBarcodeDetectionResult、Experimental::Toolbox::LinearBarcodeDecodingResult 和 Experimental::Toolbox::MatrixBarcodeDecodingResult — 条码检测(条码检测)。

  • Experimental::Toolbox::LocalPointCloudRegistrationResult — 点云配准(点云配准)。

信息与维护

  • CameraInfo、CameraState、CameraHealth、SceneConditions 和 FrameInfo — 相机元数据、遥测信息、健康状态以及逐帧信息(相机信息与维护)。