此页面由 AI 自动翻译。查看英文原版
最后更新
Claude CodeCodexCursor
Luxonis 智能体工具包为你常用的编程智能体加载 Luxonis 上下文与技能,更快地基于 OAK 开发应用。
安装工具包

DepthAI C++ API

最后更新
DepthAI C++ API 可以在 Github luxonis/depthai-core 上找到。 以下是 C++ API 的参考文档。
namespace

dai

using
DepthUnit = LengthUnit
using
Edge = std::array< uint32_t, 2 >
using
NNArchiveConfig = std::variant< dai::nn_archive::v1::Config >
using
VisualizeType = std::variant< std::shared_ptr< ImgAnnotations >, std::shared_ptr< ImgFrame >, std::monostate >
using
RotationChangePerAxis = std::vector< float >
using
MedianFilterParams = dai::filters::params::MedianFilter
using
using
using
using
FilterParams = std::variant< MedianFilterParams, SpatialFilterParams, SpeckleFilterParams, TemporalFilterParams >
using
Clock = std::chrono::steady_clock
static constant
constexpr static uint32_t BOARD_CONFIG_MAGIC1
static constant
constexpr static uint32_t BOARD_CONFIG_MAGIC2
static constant
constexpr const char * LOG_DEFAULT_PATTERN
constant
constexpr int MAX_UPPER_THRESHOLD
constant
constexpr int MIN_LOWER_THRESHOLD
static constant
constexpr static auto DEFAULT_SERIALIZATION_TYPE
inline function
std::string toString(CameraBoardSocket socket)
function
DEPTHAI_SERIALIZE_EXT(CameraSensorConfig, width, height, minFps, maxFps, fov, type, hdr, hfr)
constant function
constexpr std::string_view toString(CameraModel model)
inline function
std::string toString(CameraSensorType type)
function
DEPTHAI_SERIALIZE_EXT(ChipTemperature, css, mss, upa, dss, average)
function
DEPTHAI_SERIALIZE_EXT(ChipTemperatureRVC4, cpuss, gpuss, mdmss, video, ddr, camera, average)
function
DEPTHAI_SERIALIZE_EXT(Color, r, g, b, a)
function
DEPTHAI_SERIALIZE_EXT(CpuUsage, average, msTime)
constant function
constexpr float getSIPrefixMultiplier(SIPrefix unit)
constant function
constexpr float getAngleUnitToRadianMultiplier(AngleUnit unit)
constant function
constexpr float getLengthUnitMultiplier(LengthUnit unit)
constant function
constexpr float getDistanceUnitScale(LengthUnit targetUnit, LengthUnit sourceUnit)
constant function
constexpr bool isConvertibleLengthUnit(LengthUnit unit)
True for units with a known metric scale, i.e. everything except CUSTOM.
function
DEPTHAI_SERIALIZE_EXT(DetectionParserOptions, nnFamily, subtype, confidenceThreshold, decodingFamily, decodeKeypoints, decodeSegmentation, classes, classNames, coordinates, nKeypoints, strides, anchors, anchorMasks, outputNamesToUse, anchorsV2, iouThreshold, keypointEdges, keypointLabelNames)
function
DEPTHAI_SERIALIZE_OPTIONAL_EXT(EepromData, version, boardCustom, boardName, boardRev, boardConf, hardwareConf, productName, deviceName, batchName, batchTime, boardOptions, cameraData, stereoRectificationData, imuExtrinsics, housingExtrinsics, miscellaneousData, stereoUseSpecTranslation, stereoEnableDistortionCorrection, verticalCameraSocket, imuCalibrationParams)
inline function
std::string toString(ExternalFrameSyncRole role)
function
DEPTHAI_SERIALIZE_EXT(MultiDeviceExtrinsics, fromDeviceId, fromSocket, extrinsics)
inline function
std::string toString(HousingCoordinateSystem housing)
static inline function
const std::unordered_map< std::string, std::unordered_map< dai::HousingCoordinateSystem, std::array< float, 3 > > > & getHousingCoordinates()
function
DEPTHAI_SERIALIZE_EXT(MemoryInfo, remaining, used, total)
function
DEPTHAI_SERIALIZE_EXT(Point2f, x, y, normalized, hasNormalized)
function
DEPTHAI_SERIALIZE_EXT(Point3d, x, y, z)
function
DEPTHAI_SERIALIZE_EXT(Point3f, x, y, z)
function
DEPTHAI_SERIALIZE_EXT(Point3fRGBA, x, y, z, r, g, b, a)
function
DEPTHAI_SERIALIZE_EXT(Quaterniond, qx, qy, qz, qw)
function
DEPTHAI_SERIALIZE_EXT(Rect, x, y, width, height, normalized, hasNormalized)
function
DEPTHAI_SERIALIZE_EXT(RotatedRect, center, size, angle)
function
DEPTHAI_SERIALIZE_EXT(Size2f, width, height, normalized, hasNormalized)
function
DEPTHAI_SERIALIZE_EXT(StereoRectification, rectifiedRotationLeft, rectifiedRotationRight, leftCameraSocket, rightCameraSocket)
function
DEPTHAI_SERIALIZE_EXT(TensorInfo, order, dataType, numDimensions, dims, strides, name, offset, quantization, qpScale, qpZp)
inline function
std::ostream & operator<<(std::ostream & os, const TensorInfo::StorageOrder & so)
inline function
std::ostream & operator<<(std::ostream & os, const TensorInfo::DataType & dt)
function
DEPTHAI_SERIALIZE_EXT(Timestamp, sec, nsec)
function
DEPTHAI_SERIALIZE_EXT(BoardConfig::USB, vid, pid, flashBootedVid, flashBootedPid, maxSpeed, productName, manufacturer)
function
DEPTHAI_SERIALIZE_EXT(BoardConfig::Network, mtu, xlinkTcpNoDelay)
function
DEPTHAI_SERIALIZE_EXT(BoardConfig::GPIO, mode, direction, level, pull, drive, schmitt, slewFast)
function
DEPTHAI_SERIALIZE_EXT(BoardConfig::UART, tmp)
function
DEPTHAI_SERIALIZE_EXT(BoardConfig::Camera, name, sensorType, orientation)
function
DEPTHAI_SERIALIZE_EXT(BoardConfig::IMU, bus, interrupt, wake, csGpio, boot, reset)
function
DEPTHAI_SERIALIZE_EXT(BoardConfig::UVC, cameraName, width, height, frameType, enable)
function
DEPTHAI_SERIALIZE_EXT(BoardConfig, usb, network, sysctl, watchdogTimeoutMs, watchdogInitialDelayMs, gpio, uart, pcieInternalClock, usb3PhyInternalClock, emmc, logPath, logSizeMax, logVerbosity, logDevicePrints, nonExclusiveMode, camera, imu, uvc, defaultImuExtr)
function
std::string platform2string(Platform platform)
Convert Platform enum to string.
Parameters
  • platform: Platform enum
Returns
std::string String representation of Platform
function
Platform string2platform(const std::string & platform)
Convert string to Platform enum.
Parameters
  • platform: String representation of Platform
Returns
Platform Platform enum
function
DEPTHAI_SERIALIZE_EXT(LogMessage, nodeIdName, level, time, colorRangeStart, colorRangeEnd, payload)
function
fs::path getModelFromZoo(const NNModelDescription & modelDescription, bool useCached, const fs::path & cacheDirectory, const std::string & apiKey, const std::string & progressFormat)
Get model from model zoo.
Parameters
  • modelDescription: Model description
  • useCached: Use cached model if present, default is true
  • cacheDirectory: Cache directory where the cached models are stored, default is "". If cacheDirectory is set to "", this function checks the DEPTHAI_ZOO_CACHE_PATH environment variable and uses that if set, otherwise the default value is used (see getDefaultCachePath).
  • apiKey: API key for the model zoo, default is "". If apiKey is set to "", this function checks the DEPTHAI_ZOO_API_KEY environment variable and uses that if set. Otherwise, no API key is used.
  • progressFormat: Format to use for progress output (possible values: pretty, json, none), default is "pretty"
Returns
std::filesystem::path: Path to the model in cache
function
bool downloadModelsFromZoo(const fs::path & path, const fs::path & cacheDirectory, const std::string & apiKey, const std::string & progressFormat)
Helper function allowing one to download all models specified in yaml files in the given path and store them in the cache directory.
Parameters
  • path: Path to the directory containing yaml files
  • cacheDirectory: Cache directory where the cached models are stored, default is "". If cacheDirectory is set to "", this function checks the DEPTHAI_ZOO_CACHE_PATH environment variable and uses that if set, otherwise the default is used (see getDefaultCachePath).
  • apiKey: API key for the model zoo, default is "". If apiKey is set to "", this function checks the DEPTHAI_ZOO_API_KEY environment variable and uses that if set. Otherwise, no API key is used.
  • progressFormat: Format to use for progress output (possible values: pretty, json, none), default is "pretty"
Returns
bool: True if all models were downloaded successfully, false otherwise
function
std::ostream & operator<<(std::ostream & os, const NNModelDescription & modelDescription)
inline function
NNArchiveConfigVersion getNNArchiveConfigVersion(const NNArchiveConfig & config)
function
DEPTHAI_SERIALIZE_EXT(NodeConnectionSchema, node1Id, node1OutputGroup, node1Output, node2Id, node2InputGroup, node2Input)
function
DEPTHAI_SERIALIZE_EXT(NodeIoInfo, group, name, type, blocking, queueSize, waitForMessage, id)
function
DEPTHAI_SERIALIZE_EXT(NodeObjInfo, id, parentId, name, alias, deviceId, deviceNode, builtInNode, properties, logLevel, ioInfo)
function
DEPTHAI_SERIALIZE_EXT(PipelineSchema, connections, globalProperties, nodes, bridges)
function
DEPTHAI_SERIALIZE_EXT(AprilTag, id, hamming, decisionMargin, topLeft, topRight, bottomRight, bottomLeft)
function
bool isDatatypeSubclassOf(DatatypeEnum parent, DatatypeEnum children)
inline function
function
DEPTHAI_SERIALIZE_EXT(IMUReport, sequence, accuracy, timestamp, tsDevice, tsSystem)
function
DEPTHAI_SERIALIZE_EXT(IMUReportAccelerometer, x, y, z, sequence, accuracy, timestamp, tsDevice, tsSystem)
function
DEPTHAI_SERIALIZE_EXT(IMUReportGyroscope, x, y, z, sequence, accuracy, timestamp, tsDevice, tsSystem)
function
DEPTHAI_SERIALIZE_EXT(IMUReportMagneticField, x, y, z, sequence, accuracy, timestamp, tsDevice, tsSystem)
function
DEPTHAI_SERIALIZE_EXT(IMUReportRotationVectorWAcc, i, j, k, real, rotationVectorAccuracy, sequence, accuracy, timestamp, tsDevice, tsSystem)
function
DEPTHAI_SERIALIZE_EXT(IMUPacket, acceleroMeter, gyroscope, magneticField, rotationVector)
function
DEPTHAI_SERIALIZE_EXT(CircleAnnotation, position, diameter, thickness, fillColor, outlineColor)
function
DEPTHAI_SERIALIZE_EXT(PointsAnnotation, type, points, outlineColor, outlineColors, fillColor, thickness)
function
DEPTHAI_SERIALIZE_EXT(TextAnnotation, position, text, fontSize, textColor, backgroundColor)
function
DEPTHAI_SERIALIZE_EXT(ImgAnnotation, circles, points, texts)
function
DEPTHAI_SERIALIZE_EXT(SpatialLocationCalculatorConfigThresholds, lowerThreshold, upperThreshold)
function
DEPTHAI_SERIALIZE_EXT(SpatialLocationCalculatorConfigData, roi, depthThresholds, calculationAlgorithm, stepSize)
function
DEPTHAI_SERIALIZE_EXT(SpatialLocations, config, depthAverage, depthMode, depthMedian, depthMin, depthMax, depthAveragePixelCount, spatialCoordinates)
function
DEPTHAI_SERIALIZE_EXT(TrackedFeature, position, id, age, harrisScore, trackingError, descriptor)
function
DEPTHAI_SERIALIZE_EXT(Transform, matrix)
function
DEPTHAI_SERIALIZE_EXT(AlignProperties, initialConfig, numFramesPool)
function
DEPTHAI_SERIALIZE_EXT(AprilTagProperties, initialConfig, inputConfigSync)
function
DEPTHAI_SERIALIZE_EXT(AutoCalibrationProperties, initialConfig)
function
DEPTHAI_SERIALIZE_EXT(BenchmarkInProperties, reportEveryNMessages, attachLatencies, logReportsAsWarnings)
function
DEPTHAI_SERIALIZE_EXT(BenchmarkOutProperties, numMessages, fps)
function
DEPTHAI_SERIALIZE_EXT(CameraProperties, initialControl, boardSocket, sensorType, cameraName, imageOrientation, resolutionWidth, resolutionHeight, mockIspWidth, mockIspHeight, mockIspFps, fps, isp3aFps, numFramesPoolRaw, maxSizePoolRaw, numFramesPoolIsp, maxSizePoolIsp, numFramesPoolVideo, numFramesPoolPreview, numFramesPoolStill, numFramesPoolOutputs, maxSizePoolOutputs, outputRequests)
function
DEPTHAI_SERIALIZE_EXT(CastProperties, numFramesPool, outputType, scale, offset)
function
DEPTHAI_SERIALIZE_EXT(ColorCameraProperties, initialControl, boardSocket, cameraName, imageOrientation, previewType, previewHeight, previewWidth, videoWidth, videoHeight, stillWidth, stillHeight, mockIspWidth, mockIspHeight, resolution, fps, isp3aFps, sensorCropX, sensorCropY, previewKeepAspectRatio, ispScale, numFramesPoolRaw, numFramesPoolIsp, numFramesPoolVideo, numFramesPoolPreview, numFramesPoolStill, warpMeshSource, warpMeshUri, warpMeshWidth, warpMeshHeight, calibAlpha, warpMeshStepWidth, warpMeshStepHeight, eventFilter, rawPacked)
function
DEPTHAI_SERIALIZE_EXT(DetectionParserProperties, numFramesPool, networkInputs, parser)
function
DEPTHAI_SERIALIZE_EXT(DeviceNodeGroupProperties, dummy)
function
DEPTHAI_SERIALIZE_EXT(DynamicCalibrationProperties, emptyBool)
function
DEPTHAI_SERIALIZE_EXT(EdgeDetectorProperties, initialConfig, outputFrameSize, numFramesPool)
function
DEPTHAI_SERIALIZE_EXT(FeatureTrackerProperties, initialConfig, numShaves, numMemorySlices)
function
DEPTHAI_SERIALIZE_EXT(GPUStereoProperties, initialConfig)
function
DEPTHAI_SERIALIZE_EXT(GateProperties, initialConfig)
function
DEPTHAI_BEGIN_SUPPRESS_DEPRECATION_WARNING DEPTHAI_SERIALIZE_EXT(GlobalProperties, pipelineName, pipelineVersion, multiDeviceCalibration)
function
DEPTHAI_END_SUPPRESS_DEPRECATION_WARNING DEPTHAI_SERIALIZE_EXT(DeviceProperties, leonCssFrequencyHz, leonMssFrequencyHz, cameraTuningBlobSize, cameraTuningBlobUri, cameraSocketTuningBlobSize, cameraSocketTuningBlobUri, calibData, eepromId, xlinkChunkSize, sippBufferSize, sippDmaBufferSize)
function
DEPTHAI_SERIALIZE_EXT(IMUSensorConfig, sensitivityEnabled, sensitivityRelative, changeSensitivity, reportRate, sensorId)
function
DEPTHAI_SERIALIZE_EXT(IMUProperties, imuSensors, batchReportThreshold, maxBatchReports, enableFirmwareUpdate)
function
DEPTHAI_SERIALIZE_EXT(ImageAlignProperties, initialConfig, numFramesPool, alignWidth, alignHeight, warpHwIds, interpolation, outKeepAspectRatio, numShaves)
function
DEPTHAI_SERIALIZE_EXT(ImageFiltersProperties, initialConfig)
function
DEPTHAI_SERIALIZE_EXT(ToFDepthConfidenceFilterProperties, initialConfig)
function
DEPTHAI_SERIALIZE_EXT(ImageManipProperties, initialConfig, outputFrameSize, numFramesPool, maxPoolSize, backend, performanceMode)
function
DEPTHAI_SERIALIZE_EXT(MessageDemuxProperties, processor)
function
DEPTHAI_SERIALIZE_EXT(MonoCameraProperties, initialControl, boardSocket, cameraName, imageOrientation, mockIspWidth, mockIspHeight, resolution, fps, isp3aFps, numFramesPool, numFramesPoolRaw, rawPacked)
function
DEPTHAI_SERIALIZE_EXT(NeuralDepthProperties, initialConfig)
function
DEPTHAI_SERIALIZE_EXT(NeuralNetworkProperties, modelSource, blobSize, blobUri, modelUri, numFrames, numThreads, numNCEPerThread, numShavesPerThread, backend, backendProperties, deviceModel)
function
DEPTHAI_SERIALIZE_EXT(ObjectTrackerProperties, trackerThreshold, maxObjectsToTrack, detectionLabelsToTrack, trackerType, trackerIdAssignmentPolicy, trackingPerClass, occlusionRatioThreshold, trackletMaxLifespan, trackletBirthThreshold, spatialAssociation, spatialAssociationWeight, spatialDistanceThreshold, spatialDepthAwareScale)
function
DEPTHAI_SERIALIZE_EXT(PointCloudProperties, initialConfig, numFramesPool)
function
DEPTHAI_SERIALIZE_EXT(PoolProperties, numMessages, maxMessageSize, datatype, processor)
function
DEPTHAI_SERIALIZE_EXT(RectificationProperties, outputWidth, outputHeight, enableRectification)
function
DEPTHAI_SERIALIZE_EXT(SPIInProperties, streamName, busId, maxDataSize, numFrames)
function
DEPTHAI_SERIALIZE_EXT(SPIOutProperties, streamName, busId)
function
DEPTHAI_SERIALIZE_EXT(ScriptProperties, scriptUri, scriptName, processor)
function
DEPTHAI_SERIALIZE_EXT(SegmentationParserProperties, labels, networkOutputName, classesInOneLayer, backgroundClass)
function
DEPTHAI_SERIALIZE_EXT(SpatialDetectionNetworkProperties, detectedBBScaleFactor, depthThresholds, calculationAlgorithm, stepSize)
function
DEPTHAI_SERIALIZE_EXT(SpatialLocationCalculatorProperties, roiConfig)
function
DEPTHAI_SERIALIZE_EXT(StereoDepthProperties, initialConfig, depthAlignCamera, enableRectification, rectifyEdgeFillColor, width, height, outWidth, outHeight, outKeepAspectRatio, mesh, enableRuntimeStereoModeSwitch, numFramesPool, numPostProcessingShaves, numPostProcessingMemorySlices, focalLengthFromCalibration, useHomographyRectification, enableFrameSync, baseline, focalLength, disparityToDepthUseSpecTranslation, rectificationUseSpecTranslation, depthAlignmentUseSpecTranslation, alphaScaling)
function
DEPTHAI_SERIALIZE_EXT(SyncProperties, syncThresholdNs, syncAttempts, processor, timestampSource)
function
DEPTHAI_SERIALIZE_EXT(SystemLoggerProperties, rateHz)
function
DEPTHAI_SERIALIZE_EXT(ThermalProperties, initialConfig, numFramesPool, boardSocket, fps)
function
DEPTHAI_SERIALIZE_EXT(ToFProperties, initialConfig, numFramesPool, numShaves, warpHwIds, enableUndistortion, boardSocket, cameraName, imageOrientation, fps, numFramesPoolRaw)
function
DEPTHAI_SERIALIZE_EXT(UVCProperties, gpioInit, gpioStreamOn, gpioStreamOff)
function
DEPTHAI_SERIALIZE_EXT(VideoEncoderProperties, bitrate, keyframeFrequency, maxBitrate, numBFrames, numFramesPool, outputFrameSize, profile, quality, lossless, rateCtrlMode, frameRate)
function
DEPTHAI_SERIALIZE_EXT(VppProperties, initialConfig, numFramesPool)
function
DEPTHAI_SERIALIZE_EXT(WarpProperties, outputWidth, outputHeight, outputFrameSize, numFramesPool, meshWidth, meshHeight, meshUri, warpHwIds, interpolation)
function
DEPTHAI_SERIALIZE_EXT(PipelineEventAggregationProperties, aggregationWindowSize, statsUpdateIntervalMs, eventWaitWindow, traceOutput)
function
bool initialize()
function
bool initialize(const std::string & additionalInfo, bool installSignalHandler, void * javavm)
function
bool initialize(const char * additionalInfo, bool installSignalHandler, void * javavm)
function
bool initialize(void * javavm)
inline function
void swap(JoiningThread & x, JoiningThread & y)
enum

ImgResizeMode

enumerator
CROP
Keeps aspect ratio. Crops the image to get the correct output aspect ratio. Crops some FOV to match the required FOV, then scale. No potential NN accuracy decrease.
enumerator
STRETCH
Doesn't keep aspect ratio. Squishes or streches the image to fill the required pixel area. Preserves full FOV, but frames are stretched to match the FOV, which might decrease NN accuracy.
enumerator
LETTERBOX
Keeps aspect ratio. Envelop the image with a background color to get the corect output aspect ratio. Preserves full FOV by padding/letterboxing, but smaller frame means less features which might decrease NN accuracy.
enum

int32_t CameraBoardSocket

Which Camera socket to use.AUTO denotes that the decision will be made by device
enumerator
AUTO
enumerator
CAM_A
enumerator
CAM_B
enumerator
CAM_C
enumerator
CAM_D
enumerator
VERTICAL
enumerator
CAM_E
enumerator
CAM_F
enumerator
CAM_G
enumerator
CAM_H
enumerator
CAM_I
enumerator
CAM_J
enumerator
CBA
Warning
Experimental feature. This API might change or be removed in a future release.
enumerator
RGB
enumerator
CENTER
enumerator
LEFT
enumerator
RIGHT
enum

int32_t CameraExposureOffset

Describe possible exposure offsets
enumerator
START
enumerator
MIDDLE
enumerator
END
enum

int32_t CameraImageOrientation

Camera sensor image orientation / pixel readout. This exposes direct sensor settings. 90 or 270 degrees rotation is not available.AUTO denotes that the decision will be made by device (e.g. on OAK-1/megaAI: ROTATE_180_DEG).
enumerator
AUTO
enumerator
NORMAL
enumerator
HORIZONTAL_MIRROR
enumerator
VERTICAL_FLIP
enumerator
ROTATE_180_DEG
enum

int8_t CameraModel

Projection model of a camera.Perspective, Fisheye and RadialDivision are pinhole cameras whose distortion is applied on the normalized image plane. Equirectangular and Cylindrical are the surfaces panoramas are rendered onto; they carry no distortion coefficients, and their intrinsic matrix (fx, fy, cx, cy) maps the angular coordinates of a direction (x, y, z) in the camera frame to a pixel instead of the normalized image plane:
  • Equirectangular: u = fx * atan2(x, z) + cx, v = fy * asin(y / sqrt(x^2 + y^2 + z^2)) + cy
  • Cylindrical: u = fx * atan2(x, z) + cx, v = fy * y / sqrt(x^2 + z^2) + cy
so fx and fy are the radius of the sphere or cylinder in pixels, and (cx, cy) is the pixel the camera Z axis projects to.
enumerator
Perspective
enumerator
Fisheye
enumerator
Equirectangular
enumerator
RadialDivision
enumerator
Cylindrical
enum

int32_t CameraSensorType

Camera sensor type.
enumerator
AUTO
enumerator
COLOR
enumerator
MONO
enumerator
TOF
enumerator
THERMAL
enum

int32_t Colormap

Camera sensor type.
enumerator
NONE
enumerator
TURBO
enumerator
JET
enumerator
STEREO_TURBO
enumerator
STEREO_JET
enum

int32_t ConnectionInterface

enumerator
USB
enumerator
ETHERNET
enumerator
WIFI
enum

int32_t SIPrefix

enumerator
GIGA
enumerator
MEGA
enumerator
KILO
enumerator
DEKA
enumerator
DEFAULT
enumerator
CENTI
enumerator
MILLI
enum

int32_t LengthUnit

Measurement unit for depth and calibration data.
enumerator
METER
enumerator
CENTIMETER
enumerator
MILLIMETER
enumerator
INCH
enumerator
FOOT
enumerator
CUSTOM
enum

int32_t AngleUnit

Measurement unit for angular quantities stored in radians.
enumerator
RADIAN
enumerator
DEGREE
enum

DeviceModelZoo

On device models, relevant for RVC4 platform
enumerator
NEURAL_DEPTH_1248X780
enumerator
NEURAL_DEPTH_768X480
enumerator
NEURAL_DEPTH_576X360
enumerator
NEURAL_DEPTH_480X300
enumerator
NEURAL_DEPTH_384X240
enumerator
NEURAL_DEPTH_1056X660
enumerator
NEURAL_DEPTH_960X600
enumerator
NEURAL_DEPTH_864X540
enumerator
NEURAL_DEPTH_288X180
enumerator
NEURAL_DEPTH_192X120
enumerator
TOF_NEURAL_FUSION_672X804
enumerator
NEURAL_DEPTH_EXTRA_LARGE
enumerator
NEURAL_DEPTH_LARGE
enumerator
NEURAL_DEPTH_MEDIUM
enumerator
NEURAL_DEPTH_SMALL
enumerator
NEURAL_DEPTH_NANO
enum

int32_t ExternalFrameSyncRole

Which external frame sync role the device should have.AUTO_DETECT denotes that the decision will be made by device. It will choose between MASTER and SLAVE.
enumerator
AUTO_DETECT
enumerator
MASTER
enumerator
SLAVE
enum

int32_t FrameEvent

enumerator
NONE
enumerator
READOUT_START
enumerator
READOUT_END
enum

int32_t HousingCoordinateSystem

Which Housing to use.AUTO denotes that the decision will be made by device
enumerator
AUTO
enumerator
CAM_A
enumerator
CAM_B
enumerator
CAM_C
enumerator
CAM_D
enumerator
CAM_E
enumerator
CAM_F
enumerator
CAM_G
enumerator
CAM_H
enumerator
CAM_I
enumerator
CAM_J
enumerator
FRONT_CAM_A
enumerator
FRONT_CAM_B
enumerator
FRONT_CAM_C
enumerator
FRONT_CAM_D
enumerator
FRONT_CAM_E
enumerator
FRONT_CAM_F
enumerator
FRONT_CAM_G
enumerator
FRONT_CAM_H
enumerator
FRONT_CAM_I
enumerator
FRONT_CAM_J
enumerator
VESA_A
enumerator
VESA_B
enumerator
VESA_C
enumerator
VESA_D
enumerator
VESA_E
enumerator
VESA_F
enumerator
VESA_G
enumerator
VESA_H
enumerator
VESA_I
enumerator
VESA_J
enumerator
IMU
enum

std::int32_t Interpolation

Interpolation type
enumerator
AUTO
enumerator
BILINEAR
enumerator
BICUBIC
enumerator
NEAREST_NEIGHBOR
enumerator
BYPASS
enumerator
DEFAULT
enumerator
DEFAULT_DISPARITY_DEPTH
enum

int32_t ProcessorType

On which processor the node will be placedEnum specifying processor
enumerator
LEON_CSS
enumerator
LEON_MSS
enumerator
CPU
enumerator
DSP
enum

int32_t UsbSpeed

Get USB Speed
enumerator
UNKNOWN
enumerator
LOW
enumerator
FULL
enumerator
HIGH
enumerator
SUPER
enumerator
SUPER_PLUS
enum

int DeviceState

State of a device that is part of a running pipeline.
enumerator
RUNNING
Device is connected and streaming.
enumerator
DISCONNECTED
Device connection was lost; reconnection not started yet.
enumerator
RECONNECTING
Device is being reconnected.
enumerator
FAILED
Device is gone for good (closed, or reconnection exhausted)
enum

std::uint8_t UsbGeneration

USB generation reported by the device health check.
enumerator
UNKNOWN
enumerator
USB_1_0
enumerator
USB_1_1
enumerator
USB_2_0
enumerator
USB_3_0
enumerator
USB_3_1
enum

std::uint8_t HealthCheckResult

Health check result reported by the device health check.
enumerator
NOT_RUN
enumerator
PASS
enumerator
FAIL
enum

std::uint8_t HealthCheckIssueType

Health check issue type
enumerator
Warning
enumerator
Error
enum

std::uint8_t HealthCheckIssueStage

Health check issue stage
enumerator
Connection
enumerator
DeviceAvailability
enumerator
UsbGeneration
enumerator
Bandwidth
enumerator
CameraFunctionality
enumerator
CameraCalibration
enumerator
ImuFunctionality
enumerator
ImuCalibration
enumerator
PowerSupply
enum

Platform

Hardware platform type.
enumerator
RVC2
enumerator
RVC3
enumerator
RVC4
enum

std::int32_t LogLevel

enumerator
TRACE
enumerator
DEBUG
enumerator
INFO
enumerator
WARN
enumerator
ERR
enumerator
CRITICAL
enumerator
OFF
enum

NNArchiveConfigVersion

enumerator
V1
enum

int PipelineAutoCalibrationMode

enumerator
OFF
enumerator
ON_START
enumerator
CONTINUOUS
enum

std::int32_t DatatypeEnum

enumerator
ADatatype
enumerator
Buffer
enumerator
ImgFrame
enumerator
EncodedFrame
enumerator
SegmentationMask
enumerator
GateControl
enumerator
NNData
enumerator
ImageManipConfig
enumerator
CameraControl
enumerator
ImgDetections
enumerator
SpatialImgDetections
enumerator
SystemInformation
enumerator
SystemInformationRVC4
enumerator
SpatialLocationCalculatorConfig
enumerator
SpatialLocationCalculatorData
enumerator
EdgeDetectorConfig
enumerator
AprilTagConfig
enumerator
AprilTags
enumerator
Tracklets
enumerator
IMUData
enumerator
StereoDepthConfig
enumerator
NeuralDepthConfig
enumerator
GPUStereoConfig
enumerator
FeatureTrackerConfig
enumerator
ThermalConfig
enumerator
ToFConfig
enumerator
TrackedFeatures
enumerator
BenchmarkReport
enumerator
MessageGroup
enumerator
MapData
enumerator
TransformData
enumerator
PointCloudConfig
enumerator
PointCloudData
enumerator
RGBDData
enumerator
ImageAlignConfig
enumerator
ImgAnnotations
enumerator
ImageFiltersConfig
enumerator
ToFDepthConfidenceFilterConfig
enumerator
ObjectTrackerConfig
enumerator
DynamicCalibrationControl
enumerator
DynamicCalibrationResult
enumerator
AutoCalibrationConfig
enumerator
AutoCalibrationResult
enumerator
CalibrationQuality
enumerator
CalibrationMetrics
enumerator
CoverageData
enumerator
SegmentationParserConfig
enumerator
PipelineEvent
enumerator
PipelineState
enumerator
PipelineEventAggregationConfig
enumerator
VppConfig
enumerator
PacketizedData
enumerator
Transformable
enumerator
AlignConfig
enumerator
ImgDetectionsFilterConfig
enumerator
Classifications
enumerator
Keypoints
enumerator
Clusters
enumerator
Map2D
enumerator
Lines
enumerator
Predictions
enumerator
FastSAMParserConfig
enumerator
HRNetParserConfig
enumerator
MLSDParserConfig
enumerator
MPPalmDetectionParserConfig
enumerator
PPTextDetectionParserConfig
enumerator
RFDETRParserConfig
enumerator
SCRFDParserConfig
enumerator
SuperAnimalParserConfig
enumerator
YuNetParserConfig
enumerator
ClassificationSequenceParserConfig
enumerator
MapOutputParserConfig
enumerator
XFeatMonoParserConfig
enumerator
XFeatStereoParserConfig
enumerator
DetectionParserConfig
enumerator
Odometry
enumerator
MultiDeviceCalibrationControl
enumerator
MultiDeviceCalibrationResult
enumerator
COUNT
enum

std::uint32_t ImageFiltersPresetMode

Preset modes for ImageFiltersConfig.
enumerator
TOF_LOW_RANGE
Optimized for low range ToF measurements (0.2m–2m).
enumerator
TOF_MID_RANGE
Optimized for mid range ToF measurements (e.g., 0.2m–5m).
enumerator
TOF_HIGH_RANGE
Optimized for high range ToF measurements (e.g., 1m–6m).
enum

std::uint8_t PointsAnnotationType

enumerator
UNKNOWN
enumerator
POINTS
enumerator
LINE_LOOP
enumerator
LINE_STRIP
enumerator
LINE_LIST
enum

uint32_t SpatialLocationCalculatorAlgorithm

SpatialLocationCalculatorAlgorithm configuration modesContains calculation method used to obtain spatial locations.
enumerator
AVERAGE
enumerator
MEAN
enumerator
MIN
enumerator
MAX
enumerator
MODE
enumerator
MEDIAN
enum

std::int32_t IMUSensor

Available IMU sensors. More details about each sensor can be found in the datasheet:https://www.ceva-dsp.com/wp-content/uploads/2019/10/BNO080_085-Datasheet.pdf
enumerator
ACCELEROMETER_RAW
Section 2.1.1Raw accelerometer measurement in the sensor-native frame. No IMU extrinsics or affine calibration are applied. Units are [m/s^2]
Note
Prior firmware versions incorrectly delivered frame-aligned data on this stream (equivalent to what is now ACCELEROMETER_UNCALIBRATED). This stream now correctly provides the unprocessed sensor output.
enumerator
ACCELEROMETER_UNCALIBRATED
DepthAI synthetic accelerometer stream.Acceleration of the device including gravity, aligned to the DepthAI IMU frame without the stored affine calibration applied. Units are [m/s^2]
enumerator
ACCELEROMETER_CALIBRATED
Section 2.1.1Acceleration of the device including gravity, aligned to the DepthAI IMU frame and corrected with the stored affine calibration. Units are [m/s^2]
enumerator
ACCELEROMETER
DeprecatedUse ACCELEROMETER_CALIBRATED
enumerator
LINEAR_ACCELERATION
Section 2.1.1Acceleration of the device with gravity removed. Units are [m/s^2]DeprecatedThe affine calibration (bias) stored for the accelerometer is calibrated against the full gravity-included signal and is therefore incorrect when applied to this gravity-stripped output. This sensor is not correctly calibrated and may be removed in a future release.
enumerator
GRAVITY
Section 2.1.1Gravity. Units are [m/s^2]DeprecatedThe affine calibration (bias) stored for the accelerometer is calibrated against the full gravity-included signal and is therefore incorrect when applied to this gravity-only output. This sensor is not correctly calibrated and may be removed in a future release.
enumerator
GYROSCOPE_RAW
Section 2.1.2Raw gyroscope measurement in the sensor-native frame. DepthAI does not apply IMU extrinsics or affine calibration on this stream. Units are [rad/s]
enumerator
GYROSCOPE_CALIBRATED
Section 2.1.2Angular velocity aligned to the DepthAI IMU frame and corrected with the stored affine calibration. Units are [rad/s]
enumerator
GYROSCOPE_UNCALIBRATED
Section 2.1.2Angular velocity aligned to the DepthAI IMU frame without the stored affine calibration applied. Units are [rad/s]
enumerator
MAGNETOMETER_RAW
Section 2.1.3Raw magnetometer measurement in the sensor-native frame. DepthAI does not apply IMU extrinsics on this stream. Units are [uTesla]
enumerator
MAGNETOMETER_CALIBRATED
Section 2.1.3Magnetic field measurement aligned to the DepthAI IMU frame. Units are [uTesla]
enumerator
MAGNETOMETER_UNCALIBRATED
Section 2.1.3Magnetic field measurement aligned to the DepthAI IMU frame without hard-iron offset applied. Units are [uTesla]
enumerator
ROTATION_VECTOR
Section 2.2The rotation vector provides an orientation output that is expressed as a quaternion referenced to magnetic north and gravity. It is produced by fusing the outputs of the accelerometer, gyroscope and magnetometer. The rotation vector is the most accurate orientation estimate available. The magnetometer provides correction in yaw to reduce drift and the gyroscope enables the most responsive performance.
enumerator
GAME_ROTATION_VECTOR
Section 2.2The game rotation vector is an orientation output that is expressed as a quaternion with no specific reference for heading, while roll and pitch are referenced against gravity. It is produced by fusing the outputs of the accelerometer and the gyroscope (i.e. no magnetometer). The game rotation vector does not use the magnetometer to correct the gyroscopes drift in yaw. This is a deliberate omission (as specified by Google) to allow gaming applications to use a smoother representation of the orientation without the jumps that an instantaneous correction provided by a magnetic field update could provide. Long term the output will likely drift in yaw due to the characteristics of gyroscopes, but this is seen as preferable for this output versus a corrected output.
enumerator
GEOMAGNETIC_ROTATION_VECTOR
Section 2.2The geomagnetic rotation vector is an orientation output that is expressed as a quaternion referenced to magnetic north and gravity. It is produced by fusing the outputs of the accelerometer and magnetometer. The gyroscope is specifically excluded in order to produce a rotation vector output using less power than is required to produce the rotation vector of section 2.2.4. The consequences of removing the gyroscope are: Less responsive output since the highly dynamic outputs of the gyroscope are not used More errors in the presence of varying magnetic fields.
enumerator
ARVR_STABILIZED_ROTATION_VECTOR
Section 2.2Estimates of the magnetic field and the roll/pitch of the device can create a potential correction in the rotation vector produced. For applications (typically augmented or virtual reality applications) where a sudden jump can be disturbing, the output is adjusted to prevent these jumps in a manner that takes account of the velocity of the sensor system.
enumerator
ARVR_STABILIZED_GAME_ROTATION_VECTOR
Section 2.2While the magnetometer is removed from the calculation of the game rotation vector, the accelerometer itself can create a potential correction in the rotation vector produced (i.e. the estimate of gravity changes). For applications (typically augmented or virtual reality applications) where a sudden jump can be disturbing, the output is adjusted to prevent these jumps in a manner that takes account of the velocity of the sensor system. This process is called AR/VR stabilization.
enum

std::int32_t TrackerType

enumerator
SHORT_TERM_KCF
Kernelized Correlation Filter tracking.
enumerator
SHORT_TERM_IMAGELESS
Short term tracking without using image data.
enumerator
ZERO_TERM_IMAGELESS
Ability to track the objects without accessing image data.
enumerator
ZERO_TERM_COLOR_HISTOGRAM
Tracking using image data too.
enum

std::int32_t TrackerIdAssignmentPolicy

enumerator
UNIQUE_ID
Always take a new, unique ID.
enumerator
SMALLEST_ID
Take the smallest available ID.
enum

LockingQueueState

enumerator
SUCCESS
enumerator
BLOCKED
enumerator
CANCELLED
enum

SerializationType

enumerator
LIBNOP
enumerator
JSON
enumerator
JSON_MSGPACK
class

dai::Capability

Derived by dai::CapabilityCRTP< Capability, ImgFrameCapability >
function
const char * getName()
function
~Capability()
class

dai::CapabilityCRTP

variable
friend Derived
variable
friend Base
function
~CapabilityCRTP()
inline function
const char * getName()
class

dai::CapabilityRange

variable
std::optional< std::variant< T, std::pair< T, T >, std::vector< T > > > value
inline function
void minMax(const std::pair< T, T > & minMax)
inline function
void minMax(const std::tuple< T, T > & minMax)
inline function
void minMax(const T & min, const T & max)
inline function
void fixed(const T & fixed)
inline function
void discrete(const std::vector< T > & discreteValues)
function
DEPTHAI_SERIALIZE(CapabilityRange, value)
class

dai::ImgFrameCapability

variable
CapabilityRange< std::pair< uint32_t, uint32_t > > size
variable
CapabilityRange< float > fps
variable
std::optional< ImgFrame::Type > type
variable
ImgResizeMode resizeMode
variable
std::optional< bool > enableUndistortion
variable
std::optional< float > alphaScaling
variable
bool ispOutput
function
~ImgFrameCapability()
function
DEPTHAI_SERIALIZE(ImgFrameCapability, size, fps, type, resizeMode, enableUndistortion, alphaScaling, ispOutput)
struct

dai::CameraSensorConfig

#include CameraFeatures.hpp
variable
std::int32_t width
variable
std::int32_t height
variable
float minFps
variable
float maxFps
variable
Rect fov
Sensor active view area in physical area [pixels].
variable
CameraSensorType type
variable
bool hdr
variable
bool hfr
struct

dai::CameraFeatures

#include CameraFeatures.hpp
variable
CameraBoardSocket socket
Board socket where the camera was detected
variable
std::string sensorName
Camera sensor name, e.g: "IMX378", "OV9282"
variable
std::int32_t width
Maximum sensor resolution
variable
std::int32_t height
variable
CameraImageOrientation orientation
Default camera orientation, board dependent
variable
std::vector< CameraSensorType > supportedTypes
List of supported types of processing for the given camera.For some sensors it's not possible to determine if they are color or mono (e.g. OV9782 and OV9282), so this could return more than one entry
variable
bool hasAutofocusIC
Whether an autofocus VCM IC was detected
variable
bool hasAutofocus
Whether camera has auto focus capabilities, or is a fixed focus lens
variable
std::string name
Camera name or alias
variable
std::vector< std::string > additionalNames
Additional camera names or aliases
variable
std::vector< CameraSensorConfig > configs
Available sensor configs
variable
std::optional< CameraSensorConfig > calibrationResolution
function
struct

dai::CameraInfo

#include CameraInfo.hpp
variable
uint16_t width
variable
uint16_t height
variable
uint8_t lensPosition
variable
std::vector< std::vector< float > > intrinsicMatrix
variable
std::vector< float > distortionCoeff
variable
Extrinsics extrinsics
variable
float specHfovDeg
variable
CameraModel cameraType
function
DEPTHAI_SERIALIZE(CameraInfo, cameraType, width, height, specHfovDeg, lensPosition, intrinsicMatrix, distortionCoeff, extrinsics)
struct

dai::ChipTemperature

#include ChipTemperature.hpp
variable
float css
CPU Subsystem
variable
float mss
Media Subsystem
variable
float upa
Shave Array
variable
float dss
DRAM Subsystem
variable
float average
Average of measurements
struct

dai::ChipTemperatureRVC4

#include ChipTemperatureRVC4.hpp
variable
float cpuss
CPU Subsystem
variable
float gpuss
GPU Subsystem
variable
float mdmss
Modem Subsystem
variable
float video
Video
variable
float ddr
DDR Memory
variable
float camera
Camera
variable
float average
Average of measurements
struct

dai::Color

#include Color.hpp
variable
float r
variable
float g
variable
float b
variable
float a
function
Color()
inline function
Color(float r, float g, float b, float a)
Parameters
  • r: Red value
  • g: Green value
  • b: Blue value
  • a: Alpha value
Parameters
  • std::invalid_argument: if r,g,b,a values are not in range [0.0, 1.0]
struct

dai::CpuUsage

#include CpuUsage.hpp
variable
float average
Average CPU usage, expressed with a normalized value (0-1)
variable
int32_t msTime
Time span in which the average was calculated in milliseconds
struct

dai::DetectionParserOptions

#include DetectionParserOptions.hpp
variable
DetectionNetworkType nnFamily
Generic Neural Network properties.
variable
std::string subtype
variable
float confidenceThreshold
variable
YoloDecodingFamily decodingFamily
YOLO specific network properties.
variable
bool decodeKeypoints
variable
bool decodeSegmentation
variable
int classes
variable
std::optional< std::vector< std::string > > classNames
variable
int coordinates
variable
std::optional< int > nKeypoints
variable
std::vector< int > strides
variable
std::vector< float > anchors
variable
std::map< std::string, std::vector< int > > anchorMasks
variable
std::vector< std::string > outputNamesToUse
variable
std::vector< std::vector< std::vector< float > > > anchorsV2
see YoloDetectionNetwork::setAnchors() for format
variable
float iouThreshold
variable
std::vector< dai::Edge > keypointEdges
variable
std::vector< std::string > keypointLabelNames
struct

dai::EepromData

#include EepromData.hpp
variable
uint32_t version
variable
std::string productName
variable
std::string boardCustom
variable
std::string boardName
variable
std::string boardRev
variable
std::string boardConf
variable
std::string hardwareConf
variable
std::string deviceName
variable
std::string batchName
variable
uint64_t batchTime
Deprecated, not used or stored.
variable
uint32_t boardOptions
variable
std::unordered_map< CameraBoardSocket, CameraInfo > cameraData
variable
StereoRectification stereoRectificationData
variable
Extrinsics imuExtrinsics
variable
Extrinsics housingExtrinsics
variable
std::vector< uint8_t > miscellaneousData
variable
bool stereoUseSpecTranslation
variable
bool stereoEnableDistortionCorrection
variable
CameraBoardSocket verticalCameraSocket
variable
ImuCalibrationParams imuCalibrationParams
struct

dai::Extrinsics

#include Extrinsics.hpp
variable
std::vector< std::vector< float > > rotationMatrix
variable
Point3f translation
(x, y, z) pose of destCameraSocket w.r.t currentCameraSocket obtained through calibration
variable
Point3f specTranslation
(x, y, z) pose of destCameraSocket w.r.t currentCameraSocket measured through CAD design
variable
CameraBoardSocket toCameraSocket
The destination camera socket for which these extrinsics are defined.
variable
std::string toDeviceId
The device containing the destination camera socket for which these extrinsics are defined. An empty value means that the device is unknown.
variable
LengthUnit lengthUnit
The distance unit for the translation vector.
function
Extrinsics()
function
Extrinsics(std::vector< std::vector< float >> rotationMatrix, Point3f translation, CameraBoardSocket toCameraSocket, LengthUnit lengthUnit)
function
Extrinsics(const std::vector< std::vector< float >> & extrinsicsMatrix, CameraBoardSocket toCameraSocket, LengthUnit lengthUnit)
function
Extrinsics(const std::array< std::array< float, 4 >, 4 > & extrinsicsMatrix, CameraBoardSocket toCameraSocket, LengthUnit lengthUnit)
function
std::vector< std::vector< float > > getRotationMatrix()
Get the extrinsic rotation matrix in array format.
Returns
3x3 rotation matrix as a 2D array
function
std::vector< std::vector< float > > getInverseRotationMatrix()
Get the inverse extrinsic rotation matrix in array format.
Returns
3x3 inverse rotation matrix as a 2D array
function
std::array< std::array< float, 4 >, 4 > getTransformationMatrix(bool useSpecTranslation, LengthUnit unit)
Get the Camera Extrinsics object to the toCameraSocket.
Parameters
  • useSpecTranslation: Set to true to force using spec translation
  • unit: Units of the returned translation vector
Returns
4x4 homogeneous transformation matrix
[ r00 r01 r02 Tx ] [ r10 r11 r12 Ty ] [ r20 r21 r22 Tz ] [ 0 0 0 1 ]
Note
The full transformation matrix can only be obtained if both the rotation matrix and the translation vector are set.
function
std::array< std::array< float, 4 >, 4 > getInverseTransformationMatrix(bool useSpecTranslation, LengthUnit unit)
Get the inverse of the extrinsic transformation matrix which is equal to the transformation from the toCameraSocket to the current camera socket.
Parameters
  • useSpecTranslation: Set to true to force using spec translation
  • unit: Units of the returned translation vector
Returns
a transformationMatrix which is 4x4 in homogeneous coordinate system
function
void setTransformationMatrix(const std::vector< std::vector< float >> & matrix, LengthUnit unit)
Set the extrinsic transformation matrix.
Parameters
  • matrix: 4x4 homogeneous transformation matrix
  • unit: Units of the translation components Tx, Ty, and Tz
[ r00 r01 r02 Tx ] [ r10 r11 r12 Ty ] [ r20 r21 r22 Tz ] [ 0 0 0 1 ]
function
void setTransformationMatrix(const std::array< std::array< float, 4 >, 4 > & matrix, LengthUnit unit)
Set the extrinsic transformation matrix.
Parameters
  • matrix: 4x4 homogeneous transformation matrix
  • unit: Units of the translation components Tx, Ty, and Tz
[ r00 r01 r02 Tx ] [ r10 r11 r12 Ty ] [ r20 r21 r22 Tz ] [ 0 0 0 1 ]
function
void setTranslationVector(const dai::Point3f & translationVector, LengthUnit unit, bool useSpecTranslation)
Set the translation vector
Parameters
  • translationVector: The translation vector to set
  • unit: Units of the provided translation vector
  • useSpecTranslation: Set to true to force setting spec translation
function
std::vector< float > getTranslationVector(bool useSpecTranslation, LengthUnit unit)
Get the translation vector
Parameters
  • unit: Units of the returned translation vector
Returns
translation vector in specified units
function
Extrinsics withLengthUnit(LengthUnit unit)
Get a copy of these extrinsics with the translation and specification translation expressed in another unit.
Parameters
  • unit: Length unit of the returned copy
Returns
Copy of these extrinsics in the given unit
function
bool isEqualExtrinsics(const Extrinsics & other, float epsilon)
Two Extrinsics objects are equal if their rotation matrices and translation vectors are equal (within a small epsilon).
Parameters
  • other: The other Extrinsics object to compare with
  • epsilon: The tolerance for comparing floating-point values
Returns
true if the Extrinsics objects are equal, false otherwise
function
bool hasValidRotationMatrix()
Check whether the rotation matrix is a finite, proper 3x3 rotation matrix.
Returns
true if the rotation matrix is valid, false otherwise
function
bool hasCompatibleCoordinateSystem(const Extrinsics & to)
Check whether these extrinsics can be expressed relative to the same target coordinate system as another Extrinsics object. Unknown device IDs and AUTO camera sockets are treated as compatible for backwards compatibility.
Parameters
Returns
true if no known part of the target coordinate system differs, false otherwise
function
std::array< std::array< float, 4 >, 4 > getExtrinsicsTransformationTo(const Extrinsics & to, bool useSpecTranslation, LengthUnit sourceUnit)
Get the extrinsic transformation matrix from this Extrinsics to the target Extrinsics.
Parameters
  • to: The target Extrinsics to get the transformation matrix to
  • useSpecTranslation: Set to true to force using spec translation
  • sourceUnit: Units of the translation vector in the source Extrinsics (this). Only relevant if useSpecTranslation is false.
Returns
a transformationMatrix which is 4x4 in homogeneous coordinate system
function
DEPTHAI_SERIALIZE_OPTIONAL(Extrinsics, rotationMatrix, translation, specTranslation, toCameraSocket, lengthUnit, toDeviceId)
struct

dai::MultiDeviceExtrinsics

#include Extrinsics.hpp
variable
std::string fromDeviceId
variable
CameraBoardSocket fromSocket
variable
Extrinsics extrinsics
struct

dai::ImgTransformation

#include ImgTransformations.hpp
function
ImgTransformation()
inline function
ImgTransformation(size_t width, size_t height)
inline function
ImgTransformation(size_t srcWidth, size_t srcHeight, size_t width, size_t height)
inline function
ImgTransformation(size_t width, size_t height, std::array< std::array< float, 3 >, 3 > sourceIntrinsicMatrix)
inline function
ImgTransformation(size_t width, size_t height, std::array< std::array< float, 3 >, 3 > sourceIntrinsicMatrix, CameraModel distortionModel, std::vector< float > distortionCoefficients)
inline function
ImgTransformation(size_t width, size_t height, std::array< std::array< float, 3 >, 3 > sourceIntrinsicMatrix, CameraModel distortionModel, std::vector< float > distortionCoefficients, Extrinsics extrinsics)
function
dai::Point2f transformPoint(dai::Point2f point)
Transform a point from the source frame to the current frame.
Parameters
  • point: Point to transform
Returns
Transformed point
function
dai::RotatedRect transformRect(const dai::RotatedRect & rect)
Transform a rotated rect from the source frame to the current frame.
Parameters
  • rect: Rectangle to transform
Returns
Transformed rectangle
function
dai::Point2f invTransformPoint(dai::Point2f point)
Transform a point from the current frame to the source frame.
Parameters
  • point: Point to transform
Returns
Transformed point
function
dai::RotatedRect invTransformRect(const dai::RotatedRect & rect)
Transform a rotated rect from the current frame to the source frame.
Parameters
  • rect: Rectangle to transform
Returns
Transformed rectangle
function
std::pair< size_t, size_t > getSize()
Retrieve the size of the frame. Should be equal to the size of the corresponding ImgFrame message.
Returns
Size of the frame
function
std::pair< size_t, size_t > getSourceSize()
Retrieve the size of the source frame from which this frame was derived.
Returns
Size of the frame
function
std::array< std::array< float, 3 >, 3 > getMatrix()
Retrieve the transformation matrix from the source frame to the current frame.
Returns
Transformation matrix
function
std::array< std::array< float, 3 >, 3 > getMatrixInv()
Retrieve the inverse transformation matrix from the current frame to the source frame.
Returns
Inverse transformation matrix
function
std::array< std::array< float, 3 >, 3 > getSourceIntrinsicMatrix()
Retrieve the intrinsic matrix of the source sensor.
Returns
Intrinsic matrix
function
std::array< std::array< float, 3 >, 3 > getSourceIntrinsicMatrixInv()
Retrieve the inverse intrinsic matrix of the source sensor.
Returns
Inverse intrinsic matrix
function
CameraModel getDistortionModel()
Retrieve the distortion model of the source sensor
Returns
Distortion model
function
std::vector< float > getDistortionCoefficients()
Retrieve the distortion coefficients of the source sensor
Returns
vector of distortion coefficients
function
Extrinsics getExtrinsics()
Retrieve the pose of the source sensor or virtual camera relative to its target coordinate system. The target coordinate system is identified by Extrinsics::toDeviceId and Extrinsics::toCameraSocket.
Returns
function
bool isEqualTransformation(const ImgTransformation & other)
Two transformations are equal if the transformation matrices, intrinsic matrices, distortion models, distortion coefficients, extrinsics, and sizes are all equal.
Parameters
  • other: Transformation to compare with
Returns
True if the transformations are equal, false otherwise
inline function
std::array< std::array< float, 3 >, 3 > getTransformationMatrix()
inline function
std::array< std::array< float, 3 >, 3 > getTransformationMatrixInv()
function
std::array< std::array< float, 3 >, 3 > getIntrinsicMatrix()
Retrieve the total intrinsic matrix calculated from transform * intrinsic.
Returns
total intrinsic matrix
function
std::array< std::array< float, 3 >, 3 > getIntrinsicMatrixInv()
Retrieve the inverse of the total intrinsic matrix.
Returns
inverse total intrinsic matrix
function
float getDFov(bool source)
Retrieve the diagonal field of view of the image.
Parameters
  • source: If true, the source field of view will be returned. Otherwise, the current field of view will be returned.
Returns
Diagonal field of view in degrees
function
float getHFov(bool source)
Retrieve the horizontal field of view of the image.
Parameters
  • source: If true, the source field of view will be returned. Otherwise, the current field of view will be returned.
Returns
Horizontal field of view in degrees
function
float getVFov(bool source)
Retrieve the vertical field of view of the image.
Parameters
  • source: If true, the source field of view will be returned. Otherwise, the current field of view will be returned.
Returns
Vertical field of view in degrees
function
std::vector< dai::RotatedRect > getSrcCrops()
function
ImgTransformation & rebaseExtrinsics(const Extrinsics & localOriginToTarget)
Re-express the source extrinsics relative to a new target coordinate system.The supplied transform must map the current local calibration origin to the new target. Only the extrinsics are changed; all image-space transformation data is preserved. The rebased extrinsics translation is stored in centimeters.
Parameters
  • localOriginToTarget: Transform from the current local calibration origin to the new target coordinate system.
Returns
This transformation.
function
bool getSrcMaskPt(size_t x, size_t y)
Returns true if the point is inside the transformed region of interest (determined by crops used).
function
bool getDstMaskPt(size_t x, size_t y)
Returns true if the point is inside the image region (not in the background region).
function
ImgTransformation & addTransformation(const std::array< std::array< float, 3 >, 3 > & matrix)
Add a new transformation.
Parameters
  • matrix: Transformation matrix
function
ImgTransformation & addCrop(int x, int y, int width, int height)
Add a crop transformation.
Parameters
  • x: X coordinate of the top-left corner of the crop
  • y: Y coordinate of the top-left corner of the crop
  • width: Width of the crop
  • height: Height of the crop
function
ImgTransformation & addPadding(int top, int bottom, int left, int right)
Add a pad transformation. Works like crop, but in reverse.
Parameters
  • top: Padding on the top
  • bottom: Padding on the bottom
  • left: Padding on the left
  • right: Padding on the right
function
ImgTransformation & addFlipVertical()
Add a vertical flip transformation.
function
ImgTransformation & addFlipHorizontal()
Add a horizontal flip transformation.
function
ImgTransformation & addRotation(float angle, dai::Point2f rotationPoint)
Add a rotation transformation.
Parameters
  • angle: Angle in degrees
  • rotationPoint: Point around which to rotate
function
ImgTransformation & addScale(float scaleX, float scaleY)
Add a scale transformation.
Parameters
  • scaleX: Scale factor in the horizontal direction
  • scaleY: Scale factor in the vertical direction
function
ImgTransformation & addSrcCrops(const std::vector< dai::RotatedRect > & crops)
function
ImgTransformation & setSize(size_t width, size_t height)
function
ImgTransformation & setSourceSize(size_t width, size_t height)
function
ImgTransformation & setExtrinsics(const Extrinsics & extrinsics)
function
ImgTransformation & setIntrinsicMatrix(const std::array< std::array< float, 3 >, 3 > & intrinsicMatrix)
function
ImgTransformation & setDistortionModel(CameraModel model)
function
ImgTransformation & setDistortionCoefficients(const std::vector< float > & coefficients)
function
dai::Point2f remapPointTo(const ImgTransformation & to, dai::Point2f point)
Remap a point from this transformation to another. If the intrinsics are different (e.g. different camera), the function will also use the intrinsics to remap the point.
Parameters
  • to: Transformation to remap to
  • point: Point to remap
Note
This function assumes both transformations have the same source (eg. same source camera socket). If they don't, remapping will be inaccurate.
function
dai::Point2f remapPointFrom(const ImgTransformation & from, dai::Point2f point)
Remap a point to this transformation from another. If the intrinsics are different (e.g. different camera), the function will also use the intrinsics to remap the point.
Parameters
  • from: Transformation to remap from
  • point: Point to remap
function
dai::RotatedRect remapRectTo(const ImgTransformation & to, dai::RotatedRect rect)
Remap a rotated rect from this transformation to another. If the intrinsics are different (e.g. different camera), the function will also use the intrinsics to remap the rect.
Parameters
  • to: Transformation to remap to
  • rect: RotatedRect to remap
function
dai::RotatedRect remapRectFrom(const ImgTransformation & from, const dai::RotatedRect & rect)
Remap a rotated rect to this transformation from another. If the intrinsics are different (e.g. different camera), the function will also use the intrinsics to remap the rect.
Parameters
  • from: Transformation to remap from
  • rect: RotatedRect to remap
function
dai::Point2f project3DPoint(const dai::Point3f & point)
Project a 3D spatial point into 2D point in the current frame defined by this transformation.
Parameters
  • point: 3D point to project
Returns
Projected 2D point in the current frame
Note
This function assumes that the point is in the coordinate system of the current frame.
function
dai::Point2f projectPointTo(const ImgTransformation & to, dai::Point2f & point, float depth)
Project a 2D point from the source frame defined by this transformation into a 2D point in the target frame defined by the to transformation. This function will use the depth of the point to project it into 3D space and then reproject it back to 2D in the target frame.
Parameters
  • to: Target transformation to project to
  • point2f: Source 2D point in the current frame
  • depth: (mm) Depth of the point to project
Returns
Projected 2D point in the target frame (to transformation)
function
dai::RotatedRect projectRectTo(const ImgTransformation & to, RotatedRect & rect, float depth)
Project a rotated rectangle from the source frame defined by this transformation into the target frame defined by the to transformation. This function assumes the rectangle is parallel to the image plane (i.e. the entire rectangle is at the same depth away). The function fits the smallest possible rectangle on to the projected corners of the original rectangle.
Parameters
  • to: Target transformation to project to
  • rect: Source rotated rectangle in the current frame
  • depth: (mm) Depth of the rectangle to project
function
dai::Point2f project3DPointTo(const ImgTransformation & to, const dai::Point3f & point)
Project a 3D spatial point from the source coordinate system (this transformation) into a 2D point in the target frame (to transformation).
Parameters
  • to: Target transformation to project to
  • point3f: 3D point to project
Returns
Projected 2D point in the target frame (to transformation)
Note
This function assumes that the point3f is in the coordinate system of the current frame.
function
dai::Point2f project3DPointFrom(const ImgTransformation & from, const dai::Point3f & point)
Project a 3D point from the source frame (from transformation) into a 2D point in the current frame (this transformation).
Parameters
  • from: Transformation to project from
  • point3f: 3D point to project
Returns
Projected 2D point in the current frame
Note
This function assumes that the point3f is in the coordinate system of the source frame.
function
dai::Point3f remap3DPointTo(const ImgTransformation & to, const dai::Point3f & point)
Remap a 3D point from the source coordinate system of this transformation to the coordinate system of the target transformation (to transformation).
Parameters
  • to: Target transformation to remap to
  • point: 3D point to remap
Returns
Remapped 3D point in the target coordinate system
Note
This function assumes that the point is in the coordinate system of the current frame.
function
dai::Point3f remap3DPointFrom(const ImgTransformation & from, const dai::Point3f & point)
Remap a 3D point to the coordinate system of this transformation from the source coordinate system of the from transformation.
Parameters
  • from: Transformation to remap from
  • point: 3D point to remap
Returns
Remapped 3D point in the current coordinate system
Note
This function assumes that the point is in the coordinate system of the source frame.
function
std::array< std::array< float, 4 >, 4 > getExtrinsicsTransformationMatrixTo(const ImgTransformation & to, bool useSpecTranslation, LengthUnit sourceUnit)
Get the extrinsic transformation matrix from the source coordinate system of this transformation to the target coordinate system of the to transformation.
Parameters
  • to: Target transformation to get extrinsics to
  • useSpecTranslation: If true, the translation vector w.r.t. the CAD design will be used instead of the translation vector obtained through calibration.
  • sourceUnit: The desired measurement unit in which to return the transformation matrix in.
Returns
4x4 homogeneous transformation matrix representing the extrinsics from this transformation to the target transformation
Note
Both transformations must have a compatible target device ID and a common target camera socket. Otherwise extrinsics cannot be calculated.
function
std::array< std::array< float, 3 >, 3 > getRotationMatrixTo(const ImgTransformation & to)
Get the extrinsic rotation matrix from the source coordinate system of this transformation to the target coordinate system of the to transformation.
Parameters
  • to: Transformation to get extrinsics to
Returns
3x3 rotation matrix representing the extrinsic rotation from this transformation to the target transformation
function
std::array< float, 3 > getTranslationVectorTo(const ImgTransformation & to, bool useSpecTranslation, LengthUnit sourceUnit)
Get the extrinsic translation vector from the source coordinate system of this transformation to the target coordinate system of the to transformation.
Parameters
  • to: Transformation to get extrinsics to
Returns
3x1 translation vector representing the extrinsic translation from this transformation to the target transformation
function
bool isAlignedTo(const ImgTransformation & to)
Check if the transformations are aligned
Parameters
  • to: Transformation to compare with
function
bool isValid()
Check if the transformations are valid. The transformations are valid if the source frame size and the current frame size are set.
function
DEPTHAI_SERIALIZE(ImgTransformation, extrinsics, transformationMatrix, transformationMatrixInv, sourceIntrinsicMatrix, sourceIntrinsicMatrixInv, distortionModel, distortionCoefficients, srcWidth, srcHeight, width, height, srcCrops)
struct

dai::AccelAxisNoiseParams

variable
float noiseDensity
variable
float randomWalk
variable
float biasStability
function
DEPTHAI_SERIALIZE(AccelAxisNoiseParams, noiseDensity, randomWalk, biasStability)
struct

dai::GyroAxisNoiseParams

variable
float noiseDensity
variable
float randomWalk
variable
float biasStability
function
DEPTHAI_SERIALIZE(GyroAxisNoiseParams, noiseDensity, randomWalk, biasStability)
struct

dai::AccelerometerNoiseParams

variable
variable
variable
function
DEPTHAI_SERIALIZE(AccelerometerNoiseParams, x, y, z)
struct

dai::GyroscopeNoiseParams

variable
variable
variable
function
DEPTHAI_SERIALIZE(GyroscopeNoiseParams, x, y, z)
struct

dai::ImuNoiseParameters

#include ImuParameters.hpp
variable
std::string name
variable
variable
function
DEPTHAI_SERIALIZE(ImuNoiseParameters, name, accelerometer, gyroscope)
struct

dai::ImuCalibrationParams

#include ImuParameters.hpp
variable
variable
std::vector< std::vector< float > > accelerometer
variable
std::vector< std::vector< float > > gyroscope
function
DEPTHAI_SERIALIZE(ImuCalibrationParams, noise, accelerometer, gyroscope)
struct

dai::Keypoint

variable
Point3f imageCoordinates
variable
float confidence
variable
uint32_t label
variable
std::string labelName
function
Keypoint()
inline explicit function
Keypoint(Point3f imageCoordinates, float conf, uint32_t label, std::string labelName)
inline explicit function
Keypoint(Point2f imageCoordinates, float confidence, uint32_t label, std::string labelName)
inline explicit function
Keypoint(float x, float y, float z, float confidence, uint32_t label, std::string labelName)
inline function
void transform(const ImgTransformation & source, const ImgTransformation & target)
function
DEPTHAI_SERIALIZE(dai::Keypoint, imageCoordinates, confidence, label, labelName)
struct

dai::KeypointsList

using
inline function
void setKeypoints(const std::vector< Point3f > & kps3)
Sets the keypoints list.
Parameters
  • keypoints: list of Point3f objects to set.
Note
This will clear any existing keypoints and edges.
inline function
void setKeypoints(const std::vector< Point2f > & kps2)
Sets the keypoints list.
Parameters
  • keypoints: list of Point2f objects to set.
Note
This will clear any existing keypoints and edges.
inline function
KeypointsList transformTo(const ImgTransformation & source, const ImgTransformation & target)
Returns a new KeypointsList with the keypoints transformed into the target image transformation under the assumption that the keypoints are defined in the source image transformation.If the target transformation has a different source coordinate system (eg. different camera socket) than the one the keypoints were originally generated in, the remapping will be inaccurate due to the lack of depth information.
Parameters
  • source: Source image transformation.
  • target: Target image transformation.
function
DEPTHAI_SERIALIZE(KeypointsList, keypoints, edges)
struct

dai::KeypointsListT

using
value_type = KeypointT
using
iterator = typename std::vector< KeypointT >::iterator
using
const_iterator = typename std::vector< KeypointT >::const_iterator
function
KeypointsListT()
inline explicit function
KeypointsListT(std::vector< KeypointT > keypoints, std::vector< Edge > edges)
inline explicit function
KeypointsListT(std::vector< KeypointT > keypoints)
function
~KeypointsListT()
inline function
iterator begin()
inline function
iterator end()
inline function
const_iterator begin()
inline function
const_iterator end()
inline function
const_iterator cbegin()
inline function
const_iterator cend()
inline function
bool empty()
inline function
size_t size()
inline function
value_type & operator[](size_t i)
inline function
const value_type & operator[](size_t i)
inline function
void setKeypoints(const std::vector< KeypointT > kps)
Sets the keypoints list.
Parameters
  • keypoints: list of Keypoint objects to set.
Note
This will clear any existing keypoints and edges.
inline function
void setKeypoints(std::vector< KeypointT > keypoints, std::vector< Edge > edges)
Sets the keypoints list.
Parameters
  • keypoints: list of Keypoint objects and edges to set.
Note
This will clear any existing keypoints and edges.
inline function
void setEdges(std::vector< Edge > edges)
Set the indices of the edges.
Parameters
  • edges: Vector of edge indices.
inline function
std::vector< KeypointT > getKeypoints()
Get keypoints.
Returns
Vector of Keypoint objects.
inline function
std::vector< Edge > getEdges()
Get the indices of the edges.
Returns
Vector of edge indices.
inline function
std::vector< Point3f > getPoints3f()
Get only image coordinates of the keypoints.
Returns
Vector of Point3f coordinates.
inline function
std::vector< Point2f > getPoints2f()
Get only image 2D coordinates of the keypoints and drop the z axis values.
Returns
Vector of Point2f coordinates.
struct

dai::MemoryInfo

#include MemoryInfo.hpp
variable
int64_t remaining
variable
int64_t used
variable
int64_t total
struct

dai::Point2f

#include Point2f.hpp
variable
float x
variable
float y
variable
bool normalized
variable
bool hasNormalized
function
Point2f()
inline function
Point2f(float x, float y)
inline function
Point2f(float x, float y, bool normalized)
inline function
bool isNormalized()
struct

dai::Point3d

#include Point3d.hpp
variable
double x
variable
double y
variable
double z
function
Point3d()
inline function
Point3d(double x, double y, double z)
struct

dai::Point3f

#include Point3f.hpp
variable
float x
variable
float y
variable
float z
function
Point3f()
inline function
Point3f(float x, float y, float z)
struct

dai::Point3fRGBA

#include Point3fRGBA.hpp
variable
float x
variable
float y
variable
float z
variable
uint8_t r
variable
uint8_t g
variable
uint8_t b
variable
uint8_t a
function
Point3fRGBA()
inline function
Point3fRGBA(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b, uint8_t a)
struct

dai::Quaterniond

#include Quaterniond.hpp
variable
double qx
variable
double qy
variable
double qz
variable
double qw
function
Quaterniond()
inline function
Quaterniond(double qx, double qy, double qz, double qw)
struct

dai::Rect

#include Rect.hpp
variable
float x
variable
float y
variable
float width
variable
float height
variable
bool normalized
variable
bool hasNormalized
function
Rect()
inline function
Rect(float x, float y, float width, float height)
Construct Rectangle from (x, y) coordinates of the top-left corner, width and height.
inline function
Rect(float x, float y, float width, float height, bool normalized)
Construct Rectangle from (x, y) coordinates of the top-left corner, width, height and normalization flag.
Parameters
  • x: Top-left x coordinate
  • y: Top-left y coordinate
  • width: Width of the rectangle
  • height: Height of the rectangle
  • normalized: Whether the rectangle is normalized (coordinates in [0,1] range) or not
inline function
Rect(const Rect & r)
Copy constructor
inline function
Rect(const Point2f & org, const Size2f & sz)
Construct Rectangle from top left point and size
inline function
Rect(const Point2f & org, const Size2f & sz, bool normalized)
Construct Rectangle from top left point, size and normalization flag.
Note
: if normalized is true, the coordinates are in [0,1] range
inline function
Rect(const Point2f & pt1, const Point2f & pt2)
Construct Rectangle between any two given points. Constructor will determine top-left and bottom-right points.
Parameters
  • pt1: First point
  • pt2: Second point
inline function
Rect(const Point2f & pt1, const Point2f & pt2, bool normalized)
Construct Rectangle between any two given points with normalization flag. Constructor will determine top-left and bottom-right points.
Parameters
  • pt1: First point
  • pt2: Second point
  • normalized: Whether the rectangle is normalized (coordinates in [0,1] range) or not
function
Rect & operator=(const Rect & r)
function
Rect & operator=(Rect && r)
inline function
Point2f topLeft()
The top-left corner.
inline function
Point2f bottomRight()
The bottom-right corner
inline function
Size2f size()
Size (width, height) of the rectangle
inline function
float area()
Area (width*height) of the rectangle
inline function
bool empty()
True if rectangle is empty.
inline function
bool contains(const Point2f & pt)
Checks whether the rectangle contains the point.
inline function
bool isNormalized()
Whether rectangle is normalized (coordinates in [0,1] range) or not.
inline function
Rect denormalize(int destWidth, int destHeight)
Denormalize rectangle.
Parameters
  • destWidth: Destination frame width.
  • destHeight: Destination frame height.
inline function
Rect normalize(int srcWidth, int srcHeight)
Normalize rectangle.
Parameters
  • srcWidth: Source frame width.
  • srcHeight: Source frame height.
struct

dai::RotatedRect

#include RotatedRect.hpp
variable
Point2f center
variable
Size2f size
variable
float angle
degrees, increasing clockwise
function
RotatedRect()
inline function
RotatedRect(const Point2f & center, const Size2f & size, float angle)
A rotated rectangle is specified by the center point, size, and rotation angle in degrees.
inline function
RotatedRect(const Rect & rect, float angle)
Construct RotatedRect from provided dai::Rect rect and angle
Parameters
  • rect: dai::Rect rectangle
  • angle: Rotation angle in degrees
inline function
operator Rect()
inline function
bool isNormalized()
inline function
RotatedRect normalize(unsigned int width, unsigned int height)
Normalize the rotated rectangle. The normalized rectangle will have center and size coordinates in range [0,1]
Returns
Normalized rotated rectangle
inline function
RotatedRect denormalize(unsigned int width, unsigned int height, bool force)
Denormalize the rotated rectangle. The denormalized rectangle will have center and size coordinates in range [0, width] and [0, height]
Returns
Denormalized rotated rectangle
inline function
std::array< dai::Point2f, 4 > getPoints()
Get the 4 corner points of the rotated rectangle
Returns
4 corner points
inline function
std::array< float, 4 > getOuterRect()
Returns the outer non-rotated rectangle
Returns
[minx, miny, maxx, maxy]
inline function
std::tuple< dai::Point2f, dai::Size2f > getOuterXYWH()
Returns the outer non-rotated rectangle in the COCO (xmin, ymin, width, height) format.
Returns
(top-left point, size)
inline function
std::tuple< dai::Point2f, dai::Size2f > getOuterCXCYWH()
Returns the outer non-rotated rectangle in the YOLO (xcenter, ycenter, width, height) format.
Returns
(center point, size)
struct

dai::Size2f

#include Size2f.hpp
variable
float width
variable
float height
variable
bool normalized
variable
bool hasNormalized
function
Size2f()
inline function
Size2f(float width, float height)
inline function
Size2f(float width, float height, bool normalized)
inline function
bool isNormalized()
struct

dai::SpatialKeypoint

variable
Point3f imageCoordinates
variable
float confidence
variable
uint32_t label
variable
std::string labelName
variable
Point3f spatialCoordinates
function
SpatialKeypoint()
inline explicit function
SpatialKeypoint(Point3f imageCoordinates, Point3f spatialCoordinates, float conf, uint32_t label, std::string labelName)
inline explicit function
SpatialKeypoint(Point2f imageCoordinates, Point3f spatialCoordinates, float conf, uint32_t label, std::string labelName)
inline explicit function
SpatialKeypoint(float x, float y, float z, float sx, float sy, float sz, float conf, uint32_t label, std::string labelName)
function
DEPTHAI_SERIALIZE(dai::SpatialKeypoint, imageCoordinates, confidence, label, labelName, spatialCoordinates)
struct

dai::SpatialKeypointsList

#include SpatialKeypoint.hpp
using
variable
LengthUnit unit
Length unit used by all keypoints' spatialCoordinates in this list.
inline explicit function
SpatialKeypointsList(std::vector< SpatialKeypoint > keypoints, std::vector< Edge > edges, LengthUnit unit)
inline explicit function
SpatialKeypointsList(std::vector< SpatialKeypoint > keypoints, LengthUnit unit)
inline function
void setKeypoints(const std::vector< Point3f > & kps3)
Sets the keypoints list.
Parameters
  • keypoints: list of Point3f objects to set.
Note
This will clear any existing keypoints and edges.
inline function
void setSpatialCoordinates(const std::vector< Point3f > & spatialCoordinates, LengthUnit spatialUnit)
Sets the keypoints from a vector of 3D spatial points.The size of spatialCoordinates must match the number of keypoints.
Parameters
  • spatialCoordinates: vector of Point3f objects to set as spatial coordinates.
  • spatialUnit: The unit of the spatial coordinates. By default, spatial coordinates are in millimeters.
inline function
std::vector< Point3f > getSpatialCoordinates()
Get spatial coordinates of the keypoints.
Returns
Vector of Point3f spatial coordinates.
inline function
SpatialKeypointsList transformTo(const ImgTransformation & source, const ImgTransformation & target)
Transforms the list of keypoints to the target image transformation under the assumption that the keypoints are defined in the source image transformation.If a keypoint does not have valid spatial coordinates (spatialCoordinates.z <= 0), the depth-based 3D projection is skipped and only a 2D remapping is applied to its imageCoordinates.
Parameters
  • source: Source image transformation.
  • target: Target image transformation.
function
DEPTHAI_SERIALIZE(SpatialKeypointsList, keypoints, edges, unit)
struct

dai::StereoPair

#include StereoPair.hpp
variable
CameraBoardSocket left
variable
CameraBoardSocket right
variable
float baseline
Baseline in centimeters.
variable
bool isVertical
function
DEPTHAI_SERIALIZE(StereoPair, left, right, baseline, isVertical)
struct

dai::StereoRectification

#include StereoRectification.hpp
variable
std::vector< std::vector< float > > rectifiedRotationLeft
variable
std::vector< std::vector< float > > rectifiedRotationRight
variable
CameraBoardSocket leftCameraSocket
variable
CameraBoardSocket rightCameraSocket
struct

dai::TensorInfo

#include TensorInfo.hpp
variable
StorageOrder order
variable
DataType dataType
variable
unsigned int numDimensions
variable
std::vector< unsigned > dims
variable
std::vector< unsigned > strides
variable
std::string name
variable
unsigned int offset
variable
bool quantization
variable
float qpScale
variable
float qpZp
inline function
void validateStorageOrder()
inline function
int getDataTypeSize()
inline function
int getWidth()
inline function
int getHeight()
inline function
std::size_t getTensorSize()
inline function
int getChannels()
inline function
size_t getChannelStride()
inline function
size_t getWidthStride()
inline function
size_t getHeightStride()
enum

int StorageOrder

enumerator
NHWC
enumerator
NHCW
enumerator
NCHW
enumerator
HWC
enumerator
CHW
enumerator
WHC
enumerator
HCW
enumerator
WCH
enumerator
CWH
enumerator
NC
enumerator
CN
enumerator
C
enumerator
H
enumerator
W
enum

int DataType

enumerator
FP16
enumerator
U8F
enumerator
INT
enumerator
FP32
enumerator
I8
enumerator
FP64
enumerator
U16F
struct

dai::Timestamp

#include Timestamp.hpp
variable
int64_t sec
variable
int64_t nsec
inline function
std::chrono::time_point< Clock, typename Clock::duration > get()
struct

dai::BoardConfig

variable
USB usb
variable
Network network
variable
std::vector< std::string > sysctl
Optional list of FreeBSD sysctl parameters to be set (system, network, etc.). For example: "net.inet.tcp.delayed_ack=0" (this one is also set by default)
variable
std::optional< uint32_t > watchdogTimeoutMs
Watchdog config.
variable
std::optional< uint32_t > watchdogInitialDelayMs
variable
std::unordered_map< std::int8_t, GPIO > gpio
variable
std::unordered_map< std::int8_t, UART > uart
UART instance map.
variable
std::optional< bool > pcieInternalClock
PCIe config.
variable
std::optional< bool > usb3PhyInternalClock
USB3 phy config.
variable
std::optional< bool > mipi4LaneRgb
MIPI 4Lane RGB config.
variable
std::optional< bool > emmc
eMMC config
variable
std::optional< std::string > logPath
log path
variable
std::optional< size_t > logSizeMax
Max log size.
variable
std::optional< LogLevel > logVerbosity
log verbosity
variable
std::optional< bool > logDevicePrints
log device prints
variable
bool nonExclusiveMode
variable
std::unordered_map< CameraBoardSocket, Camera > camera
variable
std::optional< IMU > imu
variable
std::optional< UVC > uvc
variable
std::unordered_map< std::string, Extrinsics > defaultImuExtr
struct

dai::BoardConfig::Camera

#include BoardConfig.hpp
variable
std::string name
variable
std::optional< CameraSensorType > sensorType
variable
std::optional< CameraImageOrientation > orientation
struct

dai::BoardConfig::GPIO

#include BoardConfig.hpp
variable
Mode mode
variable
Direction direction
variable
Level level
variable
Pull pull
variable
Drive drive
variable
bool schmitt
variable
bool slewFast
function
GPIO()
inline function
GPIO(Direction direction)
inline function
GPIO(Direction direction, Level level)
inline function
GPIO(Direction direction, Level level, Pull pull)
inline function
GPIO(Direction direction, Mode mode)
inline function
GPIO(Direction direction, Mode mode, Pull pull)
enum

std::int8_t Mode

enumerator
ALT_MODE_0
enumerator
ALT_MODE_1
enumerator
ALT_MODE_2
enumerator
ALT_MODE_3
enumerator
ALT_MODE_4
enumerator
ALT_MODE_5
enumerator
ALT_MODE_6
enumerator
DIRECT
enum

std::int8_t Direction

enumerator
INPUT
enumerator
OUTPUT
enum

std::int8_t Level

enumerator
LOW
enumerator
HIGH
enum

std::int8_t Pull

enumerator
NO_PULL
enumerator
PULL_UP
enumerator
PULL_DOWN
enumerator
BUS_KEEPER
enum

std::int8_t Drive

Drive strength in mA (2, 4, 8 and 12mA)
enumerator
MA_2
enumerator
MA_4
enumerator
MA_8
enumerator
MA_12
struct

dai::BoardConfig::IMU

variable
int8_t bus
variable
int8_t interrupt
variable
int8_t wake
variable
int8_t csGpio
variable
int8_t boot
variable
int8_t reset
inline function
IMU()
struct

dai::BoardConfig::Network

#include BoardConfig.hpp
variable
uint16_t mtu
Network MTU, 0 is auto (usually 1500 for Ethernet) or forwarded from bootloader (not yet implemented there). Note: not advised to increase past 1500 for now
variable
bool xlinkTcpNoDelay
Sets the TCP_NODELAY option for XLink TCP sockets (disable Nagle's algorithm), reducing latency at the expense of a small hit for max throughput. Default is true
struct

dai::BoardConfig::UART

#include BoardConfig.hpp
variable
std::int8_t tmp
struct

dai::BoardConfig::USB

#include BoardConfig.hpp
variable
uint16_t vid
variable
uint16_t pid
variable
uint16_t flashBootedVid
variable
uint16_t flashBootedPid
variable
UsbSpeed maxSpeed
variable
std::string productName
variable
std::string manufacturer
struct

dai::BoardConfig::UVC

#include BoardConfig.hpp
variable
std::string cameraName
variable
uint16_t width
variable
uint16_t height
variable
ImgFrame::Type frameType
variable
bool enable
inline function
UVC(uint16_t width, uint16_t height)
inline function
UVC()
class

dai::CalibrationHandler

Derived by dai::CBACalibrationHandler
function
CalibrationHandler()
explicit function
CalibrationHandler(std::filesystem::path eepromDataPath, std::optional< bool > validateCalibration)
Construct a new Calibration Handler object using the eeprom json file created from calibration procedure.
Parameters
  • eepromDataPath: takes the full path to the json file containing the calibration and device info.
  • validateCalibration: Enable internal check for extrinsics cycling links or dangling references.
function
CalibrationHandler(std::filesystem::path calibrationDataPath, std::filesystem::path boardConfigPath, std::optional< bool > validateCalibration)
Construct a new Calibration Handler object using the board config json file and .calib binary files created using gen1 calibration.
Parameters
  • calibrationDataPath: Full Path to the .calib binary file from the gen1 calibration. (Supports only Version 5)
  • boardConfigPath: Full Path to the board config json file containing device information.
  • validateCalibration: Enable internal check for extrinsics cycling links or dangling references.
explicit function
CalibrationHandler(const EepromData & eepromData, std::optional< bool > validateCalibration)
Construct a new Calibration Handler object from EepromData object.
Parameters
  • eepromData: EepromData data structure containing the calibration data.
  • validateCalibration: Enable internal check for extrinsics cycling links or dangling references.
function
dai::EepromData getEepromData()
Get the Eeprom Data object
Returns
EepromData object which contains the raw calibration data
function
bool hasCalibrationData()
Returns true when calibration payload is supported and contains camera calibration entries. This check is not presence-only: it returns true only when eepromData.version >= 4 (supported by intrinsics-dependent APIs) and cameraData is non-empty.
function
bool hasCameraCalibration(CameraBoardSocket cameraId)
Returns true when calibration is supported and contains data for a specific camera socket. This is a presence-plus-version-compatibility check. It requires hasCalibrationData() to be true (currently eepromData.version >= 4) and a matching entry for cameraId in cameraData.
function
std::vector< std::vector< float > > getCameraIntrinsics(CameraBoardSocket cameraId, int resizeWidth, int resizeHeight, Point2f topLeftPixelId, Point2f bottomRightPixelId, bool keepAspectRatio)
Get the Camera Intrinsics object
Parameters
  • cameraId: Uses the cameraId to identify which camera intrinsics to return
  • resizewidth: resized width of the image for which intrinsics is requested. resizewidth = -1 represents width is same as default intrinsics
  • resizeHeight: resized height of the image for which intrinsics is requested. resizeHeight = -1 represents height is same as default intrinsics
  • topLeftPixelId: (x, y) point represents the top left corner coordinates of the cropped image which is used to modify the intrinsics for the respective cropped image
  • bottomRightPixelId: (x, y) point represents the bottom right corner coordinates of the cropped image which is used to modify the intrinsics for the respective cropped image
  • keepAspectRatio: Enabling this will scale on width or height depending on which provides the max resolution and crops the remaining part of the other side
Returns
Represents the 3x3 intrinsics matrix of the respective camera at the requested size and crop dimensions.
\[ \text{Intrinsic Matrix} = \left [ \begin{matrix} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \end{matrix} \right ] \]
function
std::vector< std::vector< float > > getCameraIntrinsics(CameraBoardSocket cameraId, Size2f destShape, Point2f topLeftPixelId, Point2f bottomRightPixelId, bool keepAspectRatio)
Get the Camera Intrinsics object
Parameters
  • cameraId: Uses the cameraId to identify which camera intrinsics to return
  • destShape: resized width and height of the image for which intrinsics is requested.
  • topLeftPixelId: (x, y) point represents the top left corner coordinates of the cropped image which is used to modify the intrinsics for the respective cropped image
  • bottomRightPixelId: (x, y) point represents the bottom right corner coordinates of the cropped image which is used to modify the intrinsics for the respective cropped image
  • keepAspectRatio: Enabling this will scale on width or height depending on which provides the max resolution and crops the remaining part of the other side
Returns
Represents the 3x3 intrinsics matrix of the respective camera at the requested size and crop dimensions.
\[ \text{Intrinsic Matrix} = \left [ \begin{matrix} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \end{matrix} \right ] \]
function
std::vector< std::vector< float > > getCameraIntrinsics(CameraBoardSocket cameraId, const std::tuple< int, int > & destShape, Point2f topLeftPixelId, Point2f bottomRightPixelId, bool keepAspectRatio)
Get the Camera Intrinsics object
Parameters
  • cameraId: Uses the cameraId to identify which camera intrinsics to return
  • destShape: resized width and height of the image for which intrinsics is requested.
  • topLeftPixelId: (x, y) point represents the top left corner coordinates of the cropped image which is used to modify the intrinsics for the respective cropped image
  • bottomRightPixelId: (x, y) point represents the bottom right corner coordinates of the cropped image which is used to modify the intrinsics for the respective cropped image
  • keepAspectRatio: Enabling this will scale on width or height depending on which provides the max resolution and crops the remaining part of the other side
Returns
Represents the 3x3 intrinsics matrix of the respective camera at the requested size and crop dimensions.
\[ \text{Intrinsic Matrix} = \left [ \begin{matrix} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \end{matrix} \right ] \]
function
std::tuple< std::vector< std::vector< float > >, int, int > getDefaultIntrinsics(CameraBoardSocket cameraId)
Get the Default Intrinsics object
Parameters
  • cameraId: Uses the cameraId to identify which camera intrinsics to return
Returns
Represents the 3x3 intrinsics matrix of the respective camera along with width and height at which it was calibrated.
\[ \text{Intrinsic Matrix} = \left [ \begin{matrix} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \end{matrix} \right ] \]
function
uint32_t getSourceHeight(CameraBoardSocket cameraId)
Get the source height of the camera from the calibration data.
Parameters
  • cameraId: Uses the cameraId to identify which camera source height to return
Returns
the source height of the camera from the calibration data.
function
uint32_t getSourceWidth(CameraBoardSocket cameraId)
Get the source width of the camera from the calibration data.
Parameters
  • cameraId: Uses the cameraId to identify which camera source width to return
Returns
the source width of the camera from the calibration data.
function
std::vector< float > getDistortionCoefficients(CameraBoardSocket cameraId)
Get the Distortion Coefficients object
Parameters
  • cameraId: Uses the cameraId to identify which distortion Coefficients to return.
Returns
the distortion coefficients of the requested camera in this order: [k1,k2,p1,p2,k3,k4,k5,k6,s1,s2,s3,s4,τx,τy] for CameraModel::Perspective or [k1, k2, k3, k4] for CameraModel::Fisheye see https://docs.opencv.org/4.5.4/d9/d0c/group__calib3d.html for Perspective model (Rational Polynomial Model) see https://docs.opencv.org/4.5.4/db/d58/group__calib3d__fisheye.html for Fisheye model
function
float getFov(CameraBoardSocket cameraId, bool useSpec)
Get the Fov of the camera
Parameters
  • cameraId: of the camera of which we are fetching fov.
  • useSpec: Disabling this bool will calculate the fov based on intrinsics (focal length, image width), instead of getting it from the camera specs
Returns
field of view of the camera with given cameraId.
function
uint8_t getLensPosition(CameraBoardSocket cameraId)
Get the lens position of the given camera
Parameters
  • cameraId: of the camera with lens position is requested.
Returns
lens position of the camera with given cameraId at which it was calibrated.
function
CameraModel getDistortionModel(CameraBoardSocket cameraId)
Get the distortion model of the given camera
Parameters
  • cameraId: of the camera with lens position is requested.
Returns
lens position of the camera with given cameraId at which it was calibrated.
function
std::vector< std::vector< float > > getCameraExtrinsics(CameraBoardSocket srcCamera, CameraBoardSocket dstCamera, bool useSpecTranslation, LengthUnit unit)
Get the Camera Extrinsics object between two cameras from the calibration data if there is a linked connection between any two cameras then the relative rotation and translation is returned by this function.
Parameters
  • srcCamera: Camera Id of the camera which will be considered as origin.
  • dstCamera: Camera Id of the destination camera to which we are fetching the rotation and translation from the SrcCamera
  • useSpecTranslation: Enabling this bool uses the translation information from the board design data
  • unit: Units of the returned translation (default: centimeters)
Returns
a transformationMatrix which is 4x4 in homogeneous coordinate system
\[ \text{Transformation Matrix} = \left [ \begin{matrix} r_{00} & r_{01} & r_{02} & T_x \\ r_{10} & r_{11} & r_{12} & T_y \\ r_{20} & r_{21} & r_{22} & T_z \\ 0 & 0 & 0 & 1 \end{matrix} \right ] \]
function
std::vector< std::vector< float > > getHousingCalibration(CameraBoardSocket srcCamera, const HousingCoordinateSystem housingCS, bool useSpecTranslation, LengthUnit unit)
Get the transformation matrix between a camera and a chosen housing coordinate system. The returned 4x4 homogeneous transformation matrix maps points from the camera's coordinate system into the specified housing coordinate system.The transformation consists of a rotation matrix and translation vector extracted either from the calibration data or from the board design (specification) data, depending on the useSpecTranslation flag.
Parameters
  • srcCamera: Camera whose coordinate frame will be treated as the origin.
  • housingCS: The housing coordinate system to which the camera transformation is requested (e.g. VESA_RIGHT, FRONT_COVER_LEFT, etc.).
  • useSpecTranslation: If true, uses board-design (spec) translation values. If false, uses calibrated translation values.
  • unit: Units of the returned translation (default: centimeters)
Returns
A 4x4 homogeneous transformation matrix.
\[ \text{Transformation Matrix} = \left[ \begin{matrix} r_{00} & r_{01} & r_{02} & T_x \\ r_{10} & r_{11} & r_{12} & T_y \\ r_{20} & r_{21} & r_{22} & T_z \\ 0 & 0 & 0 & 1 \end{matrix} \right] \]
function
std::vector< float > getCameraTranslationVector(CameraBoardSocket srcCamera, CameraBoardSocket dstCamera, bool useSpecTranslation, LengthUnit unit)
Get the Camera translation vector between two cameras from the calibration data.
Parameters
  • srcCamera: Camera Id of the camera which will be considered as origin.
  • dstCamera: Camera Id of the destination camera to which we are fetching the translation vector from the SrcCamera
  • useSpecTranslation: Disabling this bool uses the translation information from the calibration data (not the board design data)
  • unit: Units of the returned translation (default: centimeters)
Returns
a translation vector like [x, y, z]
function
std::vector< std::vector< float > > getCameraRotationMatrix(CameraBoardSocket srcCamera, CameraBoardSocket dstCamera)
Get the Camera rotation matrix between two cameras from the calibration data.
Parameters
  • srcCamera: Camera Id of the camera which will be considered as origin.
  • dstCamera: Camera Id of the destination camera to which we are fetching the rotation vector from the SrcCamera
Returns
a 3x3 rotation matrix Matrix representation of rotation matrix \[ \text{Rotation Matrix} = \left [ \begin{matrix} r_{00} & r_{01} & r_{02}\\ r_{10} & r_{11} & r_{12}\\ r_{20} & r_{21} & r_{22}\\ \end{matrix} \right ] \]
function
float getBaselineDistance(CameraBoardSocket cam1, CameraBoardSocket cam2, bool useSpecTranslation, LengthUnit unit)
Get the baseline distance between two specified cameras. By default it will get the baseline between CameraBoardSocket.RIGHT and CameraBoardSocket.LEFT.
Parameters
  • cam1: First camera
  • cam2: Second camera
  • useSpecTranslation: Enabling this bool uses the translation information from the board design data (not the calibration data)
  • unit: Units of the returned baseline distance (default: centimeters)
Returns
baseline distance
function
std::vector< std::vector< float > > getCameraToImuExtrinsics(CameraBoardSocket cameraId, bool useSpecTranslation, LengthUnit unit)
Get the Camera To Imu Extrinsics object From the data loaded if there is a linked connection between IMU and the given camera then there relative rotation and translation from the camera to IMU is returned.
Parameters
  • cameraId: Camera Id of the camera which will be considered as origin. from which Transformation matrix to the IMU will be found
  • useSpecTranslation: Enabling this bool uses the translation information from the board design data
  • unit: Units of the returned translation (default: centimeters)
Returns
Returns a transformationMatrix which is 4x4 in homogeneous coordinate system
\[ \text{Transformation Matrix} = \left [ \begin{matrix} r_{00} & r_{01} & r_{02} & T_x \\ r_{10} & r_{11} & r_{12} & T_y \\ r_{20} & r_{21} & r_{22} & T_z \\ 0 & 0 & 0 & 1 \end{matrix} \right ] \]
function
std::vector< std::vector< float > > getImuToCameraExtrinsics(CameraBoardSocket cameraId, bool useSpecTranslation, LengthUnit unit)
Get the Imu To Camera Extrinsics object from the data loaded if there is a linked connection between IMU and the given camera then there relative rotation and translation from the IMU to Camera is returned.
Parameters
  • cameraId: Camera Id of the camera which will be considered as destination. To which Transformation matrix from the IMU will be found.
  • useSpecTranslation: Enabling this bool uses the translation information from the board design data
  • unit: Units of the returned translation (default: centimeters)
Returns
Returns a transformationMatrix which is 4x4 in homogeneous coordinate system
\[ \text{Transformation Matrix} = \left [ \begin{matrix} r_{00} & r_{01} & r_{02} & T_x \\ r_{10} & r_{11} & r_{12} & T_y \\ r_{20} & r_{21} & r_{22} & T_z \\ 0 & 0 & 0 & 1 \end{matrix} \right ] \]
function
std::vector< std::vector< float > > getStereoRightRectificationRotation()
Get the Stereo Right Rectification Rotation object
Returns
returns a 3x3 rectification rotation matrix
function
std::vector< std::vector< float > > getStereoLeftRectificationRotation()
Get the Stereo Left Rectification Rotation object
Returns
returns a 3x3 rectification rotation matrix
function
dai::CameraBoardSocket getStereoLeftCameraId()
Get the camera id of the camera which is used as left camera of the stereo setup
Returns
cameraID of the camera used as left camera
function
dai::CameraBoardSocket getStereoRightCameraId()
Get the camera id of the camera which is used as right camera of the stereo setup
Returns
cameraID of the camera used as right camera
function
std::vector< std::vector< float > > getAccelerometerCalibration()
Get canonical accelerometer calibration matrix [Q|b].The linear transform Q is dimensionless. The bias column b is stored in SI units of [m/s^2].
Returns
returns 3x4 matrix in the form [[q00, q01, q02, b0], [q10, q11, q12, b1], [q20, q21, q22, b2]]
function
std::vector< std::vector< float > > getGyroscopeCalibration()
Get canonical gyroscope calibration matrix [Q|b].The linear transform Q is dimensionless. The bias column b is stored in SI units of [rad/s].
Returns
returns 3x4 matrix in the form [[q00, q01, q02, b0], [q10, q11, q12, b1], [q20, q21, q22, b2]]
function
dai::ImuNoiseParameters getImuNoiseParameters()
Get complete IMU noise parameters.Accelerometer noise terms are stored in [m/s^2]-based units. Gyroscope noise terms are stored in [rad/s]-based units.
Returns
returns IMU noise parameters
function
dai::ImuCalibrationParams getImuParameters()
Get full IMU parameter payload.Accelerometer calibration bias terms are stored in [m/s^2]. Gyroscope calibration bias terms are stored in [rad/s].
Returns
returns IMU parameters containing noise + calibration matrices
function
bool eepromToJsonFile(std::filesystem::path destPath)
Write raw calibration/board data to json file.
Parameters
  • destPath: Full path to the json file in which raw calibration data will be stored
Returns
True on success, false otherwise
function
nlohmann::json eepromToJson()
Get JSON representation of calibration data
Returns
JSON structure
function
void setBoardInfo(const std::string & boardName, const std::string & boardRev)
Set the Board Info object
Parameters
  • version: Sets the version of the Calibration data(Current version is 6)
  • boardName: Sets your board name.
  • boardRev: set your board revision id.
function
void setBoardInfo(const std::string & productName, const std::string & boardName, const std::string & boardRev, const std::string & boardConf, const std::string & hardwareConf, const std::string & batchName, uint64_t batchTime, uint32_t boardOptions, const std::string & boardCustom)
Set the Board Info object. Creates version 7 EEPROM data
Parameters
  • productName: Sets product name (alias).
  • boardName: Sets board name.
  • boardRev: Sets board revision id.
  • boardConf: Sets board configuration id.
  • hardwareConf: Sets hardware configuration id.
  • batchName: Sets batch name.
  • batchTime: Sets batch time (unix timestamp).
  • boardCustom: Sets a custom board (Default empty string).
function
void setBoardInfo(const std::string & deviceName, const std::string & productName, const std::string & boardName, const std::string & boardRev, const std::string & boardConf, const std::string & hardwareConf, const std::string & batchName, uint64_t batchTime, uint32_t boardOptions, const std::string & boardCustom)
Set the Board Info object. Creates version 7 EEPROM data
Parameters
  • deviceName: Sets device name.
  • productName: Sets product name (alias).
  • boardName: Sets board name.
  • boardRev: Sets board revision id.
  • boardConf: Sets board configuration id.
  • hardwareConf: Sets hardware configuration id.
  • batchName: Sets batch name. Not supported anymore
  • batchTime: Sets batch time (unix timestamp).
  • boardCustom: Sets a custom board (Default empty string).
function
void setDeviceName(const std::string & deviceName)
Set the deviceName which responses to getDeviceName of Device
Parameters
  • deviceName: Sets device name.
function
void setProductName(const std::string & productName)
Set the productName which acts as alisas for users to identify the device
Parameters
  • productName: Sets product name (alias).
function
void setCameraIntrinsics(CameraBoardSocket cameraId, const std::vector< std::vector< float >> & intrinsics, Size2f frameSize)
Set the Camera Intrinsics object
Parameters
  • cameraId: CameraId of the camera for which Camera intrinsics are being loaded
  • intrinsics: 3x3 intrinsics matrix
  • frameSize: Represents the width and height of the image at which intrinsics are calculated.
\[ \text{Intrinsic Matrix} = \left [ \begin{matrix} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \end{matrix} \right ] \]
function
void setCameraIntrinsics(CameraBoardSocket cameraId, const std::vector< std::vector< float >> & intrinsics, int width, int height)
Set the Camera Intrinsics object
Parameters
  • cameraId: CameraId of the camera for which Camera intrinsics are being loaded
  • intrinsics: 3x3 intrinsics matrix
  • width: Represents the width of the image at which intrinsics are calculated.
  • height: Represents the height of the image at which intrinsics are calculated.
\[ \text{Intrinsic Matrix} = \left [ \begin{matrix} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \end{matrix} \right ] \]
function
void setCameraIntrinsics(CameraBoardSocket cameraId, const std::vector< std::vector< float >> & intrinsics, const std::tuple< int, int > & frameSize)
Set the Camera Intrinsics object
Parameters
  • cameraId: CameraId of the camera for which Camera intrinsics are being loaded
  • intrinsics: 3x3 intrinsics matrix
  • frameSize: Represents the width and height of the image at which intrinsics are calculated.
\[ \text{Intrinsic Matrix} = \left [ \begin{matrix} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \end{matrix} \right ] \]
function
void setDistortionCoefficients(CameraBoardSocket cameraId, std::vector< float > distortionCoefficients)
Sets the distortion Coefficients obtained from camera calibration
Parameters
  • cameraId: Camera Id of the camera for which distortion coefficients are computed
  • distortionCoefficients: Distortion Coefficients of the respective Camera.
function
void setFov(CameraBoardSocket cameraId, float hfov)
Set the Fov of the Camera
Parameters
  • cameraId: Camera Id of the camera
  • hfov: Horizontal fov of the camera from Camera Datasheet
function
void setLensPosition(CameraBoardSocket cameraId, uint8_t lensPosition)
Sets the distortion Coefficients obtained from camera calibration
Parameters
  • cameraId: Camera Id of the camera
  • lensPosition: lens posiotion value of the camera at the time of calibration
function
void setCameraType(CameraBoardSocket cameraId, CameraModel cameraModel)
Set the Camera Type object
Parameters
  • cameraId: CameraId of the camera for which cameraModel Type is being updated.
  • cameraModel: Type of the model the camera represents
function
void setCameraExtrinsics(CameraBoardSocket srcCameraId, CameraBoardSocket destCameraId, const std::vector< std::vector< float >> & rotationMatrix, const std::vector< float > & translation, const std::vector< float > & specTranslation)
Set the Camera Extrinsics objectTranslation values are stored in the default CalibrationHandler length unit: centimeters (cm).
Parameters
  • srcCameraId: Camera Id of the camera which will be considered as relative origin.
  • destCameraId: Camera Id of the camera which will be considered as destination from srcCameraId.
  • rotationMatrix: Rotation between srcCameraId and destCameraId origins.
  • translation: Translation between srcCameraId and destCameraId origins, in centimeters (cm).
  • specTranslation: Translation between srcCameraId and destCameraId origins from the design, in centimeters (cm).
function
void updateCameraExtrinsics(CameraBoardSocket srcCameraId, CameraBoardSocket destCameraId, const std::vector< std::vector< float >> & rotationMatrix, const std::vector< float > & translation)
Overwrite the Camera Extrinsics object where the link already existsTranslation values are stored in the default CalibrationHandler length unit: centimeters (cm).
Parameters
  • srcCameraId: Camera Id of the camera which will be considered as relative origin.
  • destCameraId: Camera Id of the camera which will be considered as destination from srcCameraId.
  • rotationMatrix: Rotation between srcCameraId and destCameraId origins.
  • translation: Translation between srcCameraId and destCameraId origins, in centimeters (cm).
function
void setImuExtrinsics(CameraBoardSocket destCameraId, const std::vector< std::vector< float >> & rotationMatrix, const std::vector< float > & translation, const std::vector< float > & specTranslation)
Set the Imu to Camera Extrinsics objectTranslation values are stored in the default CalibrationHandler length unit: centimeters (cm).
Parameters
  • destCameraId: Camera Id of the camera which will be considered as destination from IMU.
  • rotationMatrix: Rotation between srcCameraId and destCameraId origins.
  • translation: Translation between IMU and destCameraId origins, in centimeters (cm).
  • specTranslation: Translation between IMU and destCameraId origins from the design, in centimeters (cm).
function
void setStereoLeft(CameraBoardSocket cameraId, const std::vector< std::vector< float >> & rectifiedRotation)
Set the Stereo Left Rectification object
Parameters
  • cameraId: CameraId of the camera which will be used as left Camera of stereo Setup
  • rectifiedRotation: Rectification rotation of the left camera required for feature matching
function
void setStereoRight(CameraBoardSocket cameraId, const std::vector< std::vector< float >> & rectifiedRotation)
Set the Stereo Right Rectification object
Parameters
  • cameraId: CameraId of the camera which will be used as left Camera of stereo Setup
  • rectifiedRotation: Rectification rotation of the left camera required for feature matching
function
bool validateCameraArray()
Using left camera as the head it iterates over the camera extrinsics connection to check if all the camera extrinsics are connected and no loop exists.
Returns
true on proper connection with no loops.
function
void setAccelerometerCalibration(const std::vector< std::vector< float >> & calibration)
Set canonical accelerometer calibration [Q|b].
Parameters
  • calibration: 3x4 matrix in the form [[q00, q01, q02, b0], [q10, q11, q12, b1], [q20, q21, q22, b2]]
function
void setGyroscopeCalibration(const std::vector< std::vector< float >> & calibration)
Set canonical gyroscope calibration [Q|b].
Parameters
  • calibration: 3x4 matrix in the form [[q00, q01, q02, b0], [q10, q11, q12, b1], [q20, q21, q22, b2]]
function
void setImuParameters(const ImuCalibrationParams & params)
Set full IMU parameter payload.
Parameters
  • params: noise + accelerometer + gyroscope calibration parameters
function
void validateCalibrationHandler(bool throwOnError)
Validate Calibration handler properties and how they are set, so there is no:
  • Cycling links
  • Missing links
  • Dangling connections
Parameters
  • throwOnError: Throw runtime error on failture.
function
dai::CameraBoardSocket getCameraWithLowestId()
Get the lowest camera socket
Returns
the lowest camera socket
function
std::vector< std::vector< float > > getExtrinsicsToOrigin(CameraBoardSocket cameraId, bool useSpecTranslation, CameraBoardSocket & originSocket)
Get the Transformation matrix from the given camera to the coordinate system origin (one without extrinsics and linked to CameraBoardSocket.AUTO).
Parameters
  • cameraId: Camera Id of the camera for which the origin matrix is being calculated.
  • useSpecTranslation: Enabling this bool uses the translation information from the board design data.
  • originSocket: Output socket of the local calibration origin.
Returns
A transformation matrix which is 4x4 in homogeneous coordinate system.
class

dai::CBACalibrationHandler

#include CalibrationHandler.hpp
function
CBACalibrationHandler()
explicit function
CBACalibrationHandler(const EepromData & eepromData, std::optional< bool > validateCalibration)
function
bool hasCameraCalibration()
function
std::vector< std::vector< float > > getCameraIntrinsics(int resizeWidth, int resizeHeight, Point2f topLeftPixelId, Point2f bottomRightPixelId, bool keepAspectRatio)
function
std::vector< std::vector< float > > getCameraIntrinsics(Size2f destShape, Point2f topLeftPixelId, Point2f bottomRightPixelId, bool keepAspectRatio)
function
std::vector< std::vector< float > > getCameraIntrinsics(const std::tuple< int, int > & destShape, Point2f topLeftPixelId, Point2f bottomRightPixelId, bool keepAspectRatio)
function
std::tuple< std::vector< std::vector< float > >, int, int > getDefaultIntrinsics()
function
uint32_t getSourceHeight()
function
uint32_t getSourceWidth()
function
std::vector< float > getDistortionCoefficients()
function
float getFov(bool useSpec)
function
uint8_t getLensPosition()
function
CameraModel getDistortionModel()
function
void setCameraIntrinsics(const std::vector< std::vector< float >> & intrinsics, Size2f frameSize)
function
void setCameraIntrinsics(const std::vector< std::vector< float >> & intrinsics, int width, int height)
function
void setCameraIntrinsics(const std::vector< std::vector< float >> & intrinsics, const std::tuple< int, int > & frameSize)
function
void setDistortionCoefficients(const std::vector< float > & distortionCoefficients)
function
void setFov(float hfov)
function
void setLensPosition(uint8_t lensPosition)
function
void setCameraType(CameraModel cameraModel)
function
nlohmann::json eepromToJson()
Get JSON representation of calibration data
Returns
JSON structure
function
bool eepromToJsonFile(std::filesystem::path destPath)
Write raw calibration/board data to json file.
Parameters
  • destPath: Full path to the json file in which raw calibration data will be stored
Returns
True on success, false otherwise
function
dai::EepromData getEepromData()
Get the Eeprom Data object
Returns
EepromData object which contains the raw calibration data
function
bool hasCalibrationData()
Returns true when calibration payload is supported and contains camera calibration entries. This check is not presence-only: it returns true only when eepromData.version >= 4 (supported by intrinsics-dependent APIs) and cameraData is non-empty.
function
void validateCalibrationHandler(bool throwOnError)
Validate Calibration handler properties and how they are set, so there is no:
  • Cycling links
  • Missing links
  • Dangling connections
Parameters
  • throwOnError: Throw runtime error on failture.
class

dai::CallbackHandler

function
void setCallback(std::function< std::shared_ptr< ADatatype >(std::shared_ptr< ADatatype >)> cb)
function
CallbackHandler(std::shared_ptr< XLinkConnection > conn, const std::string & streamName, std::function< std::shared_ptr< ADatatype >(std::shared_ptr< ADatatype >)> cb)
function
~CallbackHandler()
class

dai::CrashDump

#include CrashDump.hppDerived by dai::CrashDumpRVC2, dai::CrashDumpRVC4
variable
std::string depthaiVersion
variable
std::string depthaiVersionMajor
variable
std::string depthaiVersionMinor
variable
std::string depthaiVersionPatch
variable
std::string depthaiVersionPreReleaseType
variable
std::string depthaiVersionPreReleaseVersion
variable
std::string depthaiVersionBuildInfo
variable
std::string depthaiCommitHash
variable
std::string depthaiCommitDatetime
variable
std::string depthaiBuildDatetime
variable
std::string depthaiDeviceVersion
variable
std::string depthaiBootloaderVersion
variable
std::string depthaiDeviceRVC3Version
variable
std::string depthaiDeviceRVC4Version
variable
std::string osPlatform
variable
std::string crashdumpTimestamp
variable
std::string deviceId
variable
nlohmann::json extra
function
~CrashDump()
function
Platform getPlatform()
Identify the platform that this crashdump corresponds to.
Returns
Platform enum value
function
std::string getCrashDumpVersion()
Get the version of the crash dump format.
Returns
Version string
function
nlohmann::json & operator[](const std::string & key)
Mutable access to extra data by key.
Parameters
  • key: The key to access
Returns
Reference to the JSON value
function
const nlohmann::json & operator[](const std::string & key)
Constant access to extra data by key, throws if key doesn't exist.
Parameters
  • key: The key to access
Returns
Const reference to the JSON value
function
void toTar(const std::filesystem::path & tarPath)
Serialize the crash dump to a tar file.
Parameters
  • tarPath: Path to the output tar file
function
void fromTar(const std::filesystem::path & tarPath)
Deserialize the crash dump from a tar file.
Parameters
  • tarPath: Path to the input tar file
function
std::vector< uint8_t > toBytes()
Serialize the crash dump to a byte array (bytes in filesystem after calling toTar)
Returns
Byte array
class

dai::CrashDumpRVC2

variable
function
CrashDumpRVC2()
explicit function
CrashDumpRVC2(const std::filesystem::path & tarFile)
Construct crashdump from a tar file.
Parameters
  • tarFile: Path to the tar file
inline function
Platform getPlatform()
Identify the platform that this crashdump corresponds to.
Returns
Platform enum value
inline function
std::string getCrashDumpVersion()
Get the version of the crash dump format.
Returns
Version string
function
void toTar(const std::filesystem::path & tarPath)
Serialize the crash dump to a tar file.
Parameters
  • tarPath: Path to the output tar file
function
void fromTar(const std::filesystem::path & tarPath)
Deserialize the crash dump from a tar file.
Parameters
  • tarPath: Path to the input tar file
struct

dai::CrashDumpRVC2::CrashReport

variable
ProcessorType processor
variable
std::string errorSource
variable
uint32_t crashedThreadId
variable
ErrorSourceInfo errorSourceInfo
variable
std::vector< ThreadCallstack > threadCallstack
variable
std::vector< std::string > prints
Device print/log lines captured around the crash.
variable
uint64_t uptimeNs
Device uptime in nanoseconds at crash-report capture time.
variable
uint64_t timerRaw
Raw device timer value captured in the crash report.
variable
uint64_t statusFlags
Platform-specific crash/status flags captured with the report.
function
DEPTHAI_SERIALIZE(CrashReport, processor, errorSource, crashedThreadId, errorSourceInfo, threadCallstack, prints, uptimeNs, timerRaw, statusFlags)
struct

dai::CrashDumpRVC2::CrashReport::ErrorSourceInfo

variable
AssertContext assertContext
variable
TrapContext trapContext
variable
uint32_t errorId
function
DEPTHAI_SERIALIZE(ErrorSourceInfo, assertContext, trapContext, errorId)
struct

dai::CrashDumpRVC2::CrashReport::ErrorSourceInfo::AssertContext

variable
std::string fileName
variable
std::string functionName
variable
uint32_t line
function
DEPTHAI_SERIALIZE(AssertContext, fileName, functionName, line)
struct

dai::CrashDumpRVC2::CrashReport::ErrorSourceInfo::TrapContext

variable
uint32_t trapNumber
variable
uint32_t trapAddress
variable
std::string trapName
function
DEPTHAI_SERIALIZE(TrapContext, trapNumber, trapAddress, trapName)
struct

dai::CrashDumpRVC2::CrashReport::ThreadCallstack

variable
uint32_t threadId
variable
std::string threadName
variable
std::string threadStatus
variable
uint32_t stackBottom
variable
uint32_t stackTop
variable
uint32_t stackPointer
variable
uint32_t instructionPointer
variable
std::vector< CallstackContext > callStack
function
DEPTHAI_SERIALIZE(ThreadCallstack, threadId, threadName, threadStatus, stackBottom, stackTop, stackPointer, instructionPointer, callStack)
struct

dai::CrashDumpRVC2::CrashReport::ThreadCallstack::CallstackContext

variable
uint32_t callSite
variable
uint32_t calledTarget
variable
uint32_t framePointer
variable
std::string context
function
DEPTHAI_SERIALIZE(CallstackContext, callSite, calledTarget, framePointer, context)
struct

dai::CrashDumpRVC2::CrashReportCollection

variable
std::vector< CrashReport > crashReports
variable
std::string depthaiCommitHash
variable
std::string deviceId
function
DEPTHAI_SERIALIZE(CrashReportCollection, crashReports, depthaiCommitHash, deviceId)
class

dai::CrashDumpRVC4

variable
std::vector< uint8_t > data
variable
std::string filename
function
CrashDumpRVC4()
explicit function
CrashDumpRVC4(const std::filesystem::path & tarFile)
Construct from a tar file.
Parameters
  • tarFile: Path to the tar file
inline function
Platform getPlatform()
Identify the platform that this crashdump corresponds to.
Returns
Platform enum value
inline function
std::string getCrashDumpVersion()
Get the version of the crash dump format.
Returns
Version string
function
void toTar(const std::filesystem::path & tarPath)
Serialize the crash dump to a tar file.
Parameters
  • tarPath: Path to the output tar file
function
void fromTar(const std::filesystem::path & tarPath)
Deserialize the crash dump from a tar file.
Parameters
  • tarPath: Path to the input tar file
class

dai::Device

#include Device.hpp
function
Device()
Connects to any available device with a DEFAULT_SEARCH_TIME timeout. Uses OpenVINO version OpenVINO::VERSION_UNIVERSAL
function
~Device()
dtor to close the device
function
DeviceBase()
Connects to any available device with a DEFAULT_SEARCH_TIME timeout. Uses OpenVINO version OpenVINO::VERSION_UNIVERSAL
function
DeviceBase(UsbSpeed maxUsbSpeed)
Connects to device
Parameters
  • maxUsbSpeed: Maximum allowed USB speed
function
DeviceBase(const DeviceInfo & devInfo, UsbSpeed maxUsbSpeed)
Connects to device specified by devInfo.
Parameters
  • devInfo: DeviceInfo which specifies which device to connect to
  • maxUsbSpeed: Maximum allowed USB speed
function
DeviceBase(const DeviceInfo & devInfo, const std::filesystem::path & pathToCmd)
Connects to device specified by devInfo.
Parameters
  • devInfo: DeviceInfo which specifies which device to connect to
  • pathToCmd: Path to custom device firmware
explicit function
DeviceBase(const Config & config)
Connects to any available device with custom config.
Parameters
  • config: Device custom configuration to boot with
function
DeviceBase(const Config & config, const DeviceInfo & devInfo)
Connects to device 'devInfo' with custom config.
Parameters
  • config: Device custom configuration to boot with
  • devInfo: DeviceInfo which specifies which device to connect to
explicit function
DeviceBase(const DeviceInfo & devInfo)
Connects to any available device with a DEFAULT_SEARCH_TIME timeout. Uses OpenVINO version OpenVINO::VERSION_UNIVERSAL
Parameters
  • devInfo: DeviceInfo which specifies which device to connect to
function
DeviceBase(std::string nameOrDeviceId)
Connects to any available device with a DEFAULT_SEARCH_TIME timeout. Uses OpenVINO version OpenVINO::VERSION_UNIVERSAL
Parameters
  • nameOrDeviceId: Creates DeviceInfo with nameOrDeviceId to connect to
function
DeviceBase(std::string nameOrDeviceId, UsbSpeed maxUsbSpeed)
Connects to any available device with a DEFAULT_SEARCH_TIME timeout. Uses OpenVINO version OpenVINO::VERSION_UNIVERSAL
Parameters
  • nameOrDeviceId: Creates DeviceInfo with nameOrDeviceId to connect to
  • maxUsbSpeed: Maximum allowed USB speed
function
DeviceBase(const Config & config, UsbSpeed maxUsbSpeed)
Connects to device specified by devInfo.
Parameters
  • config: Config with which the device will be booted with
  • maxUsbSpeed: Maximum allowed USB speed
function
DeviceBase(const Config & config, const std::filesystem::path & pathToCmd)
Connects to any available device with a DEFAULT_SEARCH_TIME timeout.
Parameters
  • config: Config with which the device will be booted with
  • pathToCmd: Path to custom device firmware
function
DeviceBase(const Config & config, const DeviceInfo & devInfo, UsbSpeed maxUsbSpeed)
Connects to device specified by devInfo.
Parameters
  • config: Config with which the device will be booted with
  • devInfo: DeviceInfo which specifies which device to connect to
  • maxUsbSpeed: Maximum allowed USB speed
function
DeviceBase(const Config & config, const DeviceInfo & devInfo, const std::filesystem::path & pathToCmd, bool dumpOnly)
Connects to device specified by devInfo.
Parameters
  • config: Config with which the device will be booted with
  • devInfo: DeviceInfo which specifies which device to connect to
  • pathToCmd: Path to custom device firmware
  • dumpOnly: If true only the minimal connection is established to retrieve the crash dump
enum

ReconnectionStatus

class

dai::DeviceBase

#include DeviceBase.hppDerived by dai::Device
function
DeviceBase()
Connects to any available device with a DEFAULT_SEARCH_TIME timeout. Uses OpenVINO version OpenVINO::VERSION_UNIVERSAL
function
DeviceBase(UsbSpeed maxUsbSpeed)
Connects to device
Parameters
  • maxUsbSpeed: Maximum allowed USB speed
function
DeviceBase(const DeviceInfo & devInfo, UsbSpeed maxUsbSpeed)
Connects to device specified by devInfo.
Parameters
  • devInfo: DeviceInfo which specifies which device to connect to
  • maxUsbSpeed: Maximum allowed USB speed
function
DeviceBase(const DeviceInfo & devInfo, const std::filesystem::path & pathToCmd)
Connects to device specified by devInfo.
Parameters
  • devInfo: DeviceInfo which specifies which device to connect to
  • pathToCmd: Path to custom device firmware
explicit function
DeviceBase(const Config & config)
Connects to any available device with custom config.
Parameters
  • config: Device custom configuration to boot with
function
DeviceBase(const Config & config, const DeviceInfo & devInfo)
Connects to device 'devInfo' with custom config.
Parameters
  • config: Device custom configuration to boot with
  • devInfo: DeviceInfo which specifies which device to connect to
explicit function
DeviceBase(const DeviceInfo & devInfo)
Connects to any available device with a DEFAULT_SEARCH_TIME timeout. Uses OpenVINO version OpenVINO::VERSION_UNIVERSAL
Parameters
  • devInfo: DeviceInfo which specifies which device to connect to
function
DeviceBase(std::string nameOrDeviceId)
Connects to any available device with a DEFAULT_SEARCH_TIME timeout. Uses OpenVINO version OpenVINO::VERSION_UNIVERSAL
Parameters
  • nameOrDeviceId: Creates DeviceInfo with nameOrDeviceId to connect to
function
DeviceBase(std::string nameOrDeviceId, UsbSpeed maxUsbSpeed)
Connects to any available device with a DEFAULT_SEARCH_TIME timeout. Uses OpenVINO version OpenVINO::VERSION_UNIVERSAL
Parameters
  • nameOrDeviceId: Creates DeviceInfo with nameOrDeviceId to connect to
  • maxUsbSpeed: Maximum allowed USB speed
function
DeviceBase(const Config & config, UsbSpeed maxUsbSpeed)
Connects to device specified by devInfo.
Parameters
  • config: Config with which the device will be booted with
  • maxUsbSpeed: Maximum allowed USB speed
function
DeviceBase(const Config & config, const std::filesystem::path & pathToCmd)
Connects to any available device with a DEFAULT_SEARCH_TIME timeout.
Parameters
  • config: Config with which the device will be booted with
  • pathToCmd: Path to custom device firmware
function
DeviceBase(const Config & config, const DeviceInfo & devInfo, UsbSpeed maxUsbSpeed)
Connects to device specified by devInfo.
Parameters
  • config: Config with which the device will be booted with
  • devInfo: DeviceInfo which specifies which device to connect to
  • maxUsbSpeed: Maximum allowed USB speed
function
DeviceBase(const Config & config, const DeviceInfo & devInfo, const std::filesystem::path & pathToCmd, bool dumpOnly)
Connects to device specified by devInfo.
Parameters
  • config: Config with which the device will be booted with
  • devInfo: DeviceInfo which specifies which device to connect to
  • pathToCmd: Path to custom device firmware
  • dumpOnly: If true only the minimal connection is established to retrieve the crash dump
function
~DeviceBase()
Device destructor
Note
In the destructor of the derived class, remember to call close()
function
Platform getPlatform()
Get the platform of the connected device.
Returns
Platform Platform enum
function
std::string getPlatformAsString()
Get the platform of the connected device as string.
Returns
std::string String representation of Platform
function
std::optional< Version > getBootloaderVersion()
Gets Bootloader version if it was booted through Bootloader
Returns
DeviceBootloader::Version if booted through Bootloader or none otherwise
function
std::string getOSVersion()
Gets device OS version if supported by the connected device.
Returns
OS version string, for example "1.32.0"
function
bool isPipelineRunning()
Checks if devices pipeline is already running
Returns
True if running, false otherwise
function
bool startPipeline(const Pipeline & pipeline)
Starts the execution of a given pipeline
Parameters
  • pipeline: OpenVINO version of the pipeline must match the one which the device was booted with.
Returns
True if pipeline started, false otherwise
function
void setLogLevel(LogLevel level)
Sets the devices logging severity level. This level affects which logs are transferred from device to host.
Parameters
  • level: Logging severity
function
void setNodeLogLevel(int64_t id, LogLevel level)
Sets the logging severity level for a specific node with a given ID.
Parameters
  • id: Node ID
  • level: Logging severity
function
LogLevel getLogLevel()
Gets current logging severity level of the device.
Returns
Logging severity level
function
LogLevel getNodeLogLevel(int64_t id)
Gets the logging severity level for a specific node with a given ID.
Parameters
Returns
Logging severity level
function
void setProperties(const DeviceProperties & properties)
Sets properties for the device.
Parameters
  • properties: DeviceProperties struct with properties to set. Only properties which are supported by the device and have different values than current ones will be applied. Some properties are only applied before starting the pipeline.
function
DeviceProperties getProperties()
Gets current properties set on the device. Some properties might be not supported by the device, in that case they will have default values.
Returns
DeviceProperties struct with current device properties
function
void setCameraTuningBlob(const std::string & uri, uint32_t size)
Sets the camera tuning blob for the device.
Parameters
  • uri: URI of the tuning blob retrieved using the asset manager
  • size: size of the tuning blob in bytes
function
void setCameraSocketTuningBlobs(const std::unordered_map< CameraBoardSocket, std::pair< std::string, uint32_t >> & blobs)
Sets the camera socket specific tuning blobs for the device.
Parameters
  • blobs: Unordered map of CameraBoardSocket to pair of URI and size of the tuning blob in bytes. The URI should be retrieved using the asset manager
function
void setCameraSocketTuningBlob(CameraBoardSocket socket, const std::string & uri, uint32_t size)
Sets the camera socket specific tuning blob for the device.
Parameters
  • socket: CameraBoardSocket for which the tuning blob will be set
  • uri: URI of the tuning blob retrieved using the asset manager
  • size: size of the tuning blob in bytes
function
void setXLinkChunkSize(int sizeBytes)
Sets the chunk size for splitting device-sent XLink packets. A larger value could increase performance, and 0 disables chunking. A negative value is ignored. Device defaults are configured per protocol, currently 64*1024 for both USB and Ethernet.
Parameters
  • sizeBytes: XLink chunk size in bytes
function
int getXLinkChunkSize()
Gets current XLink chunk size.
Returns
XLink chunk size in bytes
function
void setSippBufferSize(int sizeBytes)
Sets the size of the SIPP buffer on the device.
Parameters
  • sizeBytes: SIPP buffer size in bytes. Device default is 18 * 1024 bytes
function
void setSippDmaBufferSize(int sizeBytes)
Sets the size of the SIPP DMA buffer on the device.
Parameters
  • sizeBytes: SIPP DMA buffer size in bytes. Device default is 16 * 1024 bytes
function
void setXLinkRateLimit(int maxRateBytesPerSecond, int burstSize, int waitUs)
Sets the maximum transmission rate for the XLink connection on device side, using a simple token bucket algorithm. Useful for bandwidth throttling
Parameters
  • maxRateBytesPerSecond: Rate limit in Bytes/second
  • burstSize: Size in Bytes for how much to attempt to send once, 0 = auto
  • waitUs: Time in microseconds to wait for replenishing tokens, 0 = auto
function
DeviceInfo getDeviceInfo()
Get the Device Info object o the device which is currently running
Returns
DeviceInfo of the current device in execution
function
DeviceState getDeviceState()
State of this device from the point of view of the pipeline it belongs to: RUNNING while connected, DISCONNECTED / RECONNECTING while a lost connection is being re-established and FAILED once the device is gone for good. RUNNING for a device that is not part of a pipeline. Safe to call from any thread, including node threads.
function
std::string getDeviceName()
Get device name if available
Returns
device name or empty string if not available
function
std::string getProductName()
Get product name if available
Returns
product name or empty string if not available
function
std::string getMxId()
Get MxId of device
Returns
MxId of connected device
function
std::string getDeviceId()
Get DeviceId of device
Returns
DeviceId of connected device
function
std::string getTemporaryTelemetryDeviceId()
function
std::optional< std::string > getActiveTelemetryPipelineId()
function
void setLogOutputLevel(LogLevel level)
Sets logging level which decides printing level to standard output. If lower than setLogLevel, no messages will be printed
Parameters
  • level: Standard output printing severity
function
LogLevel getLogOutputLevel()
Gets logging level which decides printing level to standard output.
Returns
Standard output printing severity
function
bool setIrLaserDotProjectorIntensity(float intensity, int mask)
Sets the intensity of the IR Laser Dot Projector. Limits: up to 765mA at 30% frame time duty cycle when exposure time is longer than 30% frame time. Otherwise, duty cycle is 100% of exposure time, with current increased up to max 1200mA to make up for shorter duty cycle. The duty cycle is controlled by left camera STROBE, aligned to start of exposure. The emitter is turned off by default
Parameters
  • intensity: Intensity on range 0 to 1, that will determine brightness. 0 or negative to turn off
  • mask: Optional mask to modify only Left (0x1) or Right (0x2) sides on OAK-D-Pro-W-DEV
Returns
True on success, false if not found or other failure
function
bool setIrFloodLightIntensity(float intensity, int mask)
Sets the intensity of the IR Flood Light. Limits: Intensity is directly normalized to 0 - 1500mA current. The duty cycle is 30% when exposure time is longer than 30% frame time. Otherwise, duty cycle is 100% of exposure time. The duty cycle is controlled by the left camera STROBE, aligned to start of exposure. The emitter is turned off by default
Parameters
  • intensity: Intensity on range 0 to 1, that will determine brightness, 0 or negative to turn off
  • mask: Optional mask to modify only Left (0x1) or Right (0x2) sides on OAK-D-Pro-W-DEV
Returns
True on success, false if not found or other failure
function
std::vector< std::tuple< std::string, int, int > > getIrDrivers()
Retrieves detected IR laser/LED drivers.
Returns
Vector of tuples containing: driver name, I2C bus, I2C address. For OAK-D-Pro it should be [{"LM3644", 2, 0x63}]
function
std::unique_ptr< CrashDump > getState()
Retrieves current device state in a crash dump format. It halts the device temporarily and might affect the running pipeline, it's best to close the device after this operation. Supported only on RVC2.
function
std::unique_ptr< CrashDump > getCrashDump(bool clearCrashDump)
Retrieves crash dump for debugging.
Parameters
  • clearCrashDump: Clear the cached crash dump on device after collection
Returns
Unique pointer to the CrashDump. Platform-specific crash dump payload may be empty if no crash dump is available.
function
bool hasCrashDump()
Retrieves whether the is crash dump stored on device or not.
function
ProfilingData getProfilingData()
Get current accumulated profiling data
Returns
ProfilingData from the specific device
function
int addLogCallback(const std::function< void(LogMessage)> & callback)
Add a callback for device logging. The callback will be called from a separate thread with the LogMessage being passed.
Parameters
  • callback: Callback to call whenever a log message arrives
Returns
Id which can be used to later remove the callback
function
bool removeLogCallback(int callbackId)
Removes a callback
Parameters
  • callbackId: Id of callback to be removed
Returns
True if callback was removed, false otherwise
function
void setSystemInformationLoggingRate(float rateHz)
Sets rate of system information logging ("info" severity). Default 1Hz If parameter is less or equal to zero, then system information logging will be disabled
Parameters
  • rateHz: Logging rate in Hz
function
float getSystemInformationLoggingRate()
Gets current rate of system information logging ("info" severity) in Hz.
Returns
Logging rate in Hz
function
std::vector< CameraBoardSocket > getConnectedCameras()
Get cameras that are connected to the device
Returns
Vector of connected cameras
function
std::vector< CameraBoardSocket > getConnectedCameras(CameraSensorType type)
Get cameras that are connected to the device and support a given sensor type
Parameters
  • type: Sensor type to filter by (e.g. CameraSensorType::COLOR)
Returns
Vector of sockets of the connected cameras that support the given type
function
std::vector< ConnectionInterface > getConnectionInterfaces()
Get connection interfaces for device
Returns
Vector of connection type
function
std::vector< CameraFeatures > getConnectedCameraFeatures()
Get cameras that are connected to the device with their features/properties
Returns
Vector of connected camera features
function
std::vector< StereoPair > getStereoPairs()
Get stereo pairs based on the device type.
Returns
Vector of stereo pairs
function
std::vector< StereoPair > getAvailableStereoPairs()
Get stereo pairs taking into account the calibration and connected cameras.
Note
This method will always return a subset of getStereoPairs.
Returns
Vector of stereo pairs
function
std::unordered_map< CameraBoardSocket, std::string > getCameraSensorNames()
Get sensor names for cameras that are connected to the device
Returns
Map/dictionary with camera sensor names, indexed by socket
function
std::string getConnectedIMU()
Get connected IMU type
Returns
IMU type
function
dai::Version getIMUFirmwareVersion()
Get connected IMU firmware version
Returns
IMU firmware version
function
dai::Version getEmbeddedIMUFirmwareVersion()
Get embedded IMU firmware version to which IMU can be upgraded
Returns
Get embedded IMU firmware version to which IMU can be upgraded.
function
bool startIMUFirmwareUpdate(bool forceUpdate)
Starts IMU firmware update asynchronously only if IMU node is not running. If current firmware version is the same as embedded firmware version then it's no-op. Can be overridden by forceUpdate parameter. State of firmware update can be monitored using getIMUFirmwareUpdateStatus API.
Parameters
  • forceUpdate: Force firmware update or not. Will perform FW update regardless of current version and embedded firmware version.
Returns
Returns whether firmware update can be started. Returns false if IMU node is started.
function
std::tuple< bool, float > getIMUFirmwareUpdateStatus()
Get IMU firmware update status
Returns
Whether IMU firmware update is done and last firmware update progress as percentage. return value true and 100 means that the update was successful return value true and other than 100 means that the update failed
function
MemoryInfo getDdrMemoryUsage()
Retrieves current DDR memory information from device
Returns
Used, remaining and total ddr memory
function
MemoryInfo getCmxMemoryUsage()
Retrieves current CMX memory information from device
Returns
Used, remaining and total cmx memory
function
MemoryInfo getLeonCssHeapUsage()
Retrieves current CSS Leon CPU heap information from device
Returns
Used, remaining and total heap memory
function
MemoryInfo getLeonMssHeapUsage()
Retrieves current MSS Leon CPU heap information from device
Returns
Used, remaining and total heap memory
function
ChipTemperature getChipTemperature()
Retrieves current chip temperature as measured by device
Returns
Temperature of various onboard sensors
function
CpuUsage getLeonCssCpuUsage()
Retrieves average CSS Leon CPU usage
Returns
Average CPU usage and sampling duration
function
CpuUsage getLeonMssCpuUsage()
Retrieves average MSS Leon CPU usage
Returns
Average CPU usage and sampling duration
function
int64_t getProcessMemoryUsage()
Retrieves current Rss memory usage of the device process
Returns
Current Rss memory used
function
bool isEepromAvailable()
Check if EEPROM is available
Returns
True if EEPROM is present on board, false otherwise
function
bool isCBAEepromAvailable(CameraBoardSocket camSocket)
Check if EEPROM is available for a given CBA
Parameters
  • camSocket: CameraBoardSocket of the CBA (Camera Board Assembly)
Warning
Experimental feature. This API might change or be removed in a future release.
Returns
True if EEPROM is present on board, false otherwise
function
bool isCalibrationAvailable()
Check if Calibration is available on the device
Returns
True if calibration is present on device, false otherwise
function
bool tryFlashCalibration(const CalibrationHandler & calibrationDataHandler)
Stores the Calibration and Device information to the Device EEPROM
Parameters
Returns
true on successful flash, false on failure
function
bool tryFlashCBACalibration(const CBACalibrationHandler & calibrationDataHandler, CameraBoardSocket camSocket)
Stores the Calibration and Device information to the CBA EEPROM
Parameters
  • calibrationObj: CBACalibrationHandler object which is loaded with calibration information.
  • camSocket: CameraBoardSocket of the CBA (Camera Board Assembly)
Warning
Experimental feature. This API might change or be removed in a future release.
Returns
true on successful flash, false on failure
function
void flashCalibration(const CalibrationHandler & calibrationDataHandler)
Stores the Calibration and Device information to the Device EEPROM
Parameters
  • std::runtime_error: if failed to flash the calibration
Parameters
function
void flashCBACalibration(const CBACalibrationHandler & calibrationDataHandler, CameraBoardSocket camSocket)
Stores the Calibration and Device information to the CBA EEPROM
Parameters
  • std::runtime_error: if failed to flash the calibration
Parameters
  • calibrationObj: CBACalibrationHandler object which is loaded with calibration information.
  • camSocket: CameraBoardSocket of the CBA (Camera Board Assembly)
Warning
Experimental feature. This API might change or be removed in a future release.
function
void setCalibration(const CalibrationHandler & calibrationDataHandler)
Sets the Calibration at runtime. This is not persistent and will be lost after device reset.
Parameters
  • std::runtime_error: if failed to set the calibration
Parameters
function
void setCalibration(const std::optional< EepromData > & eepromData)
Sets the Calibration at runtime using EepromData. This is not persistent and will be lost after device reset.
Parameters
  • std::runtime_error: if failed to set the calibration
Parameters
  • eepromData: EepromData struct which contains the calibration information.
function
void setMultiDeviceCalibration(const std::optional< std::vector< MultiDeviceExtrinsics >> & graph)
Sets the cross-device calibration graph at runtime. This is not persistent and will be lost after device reset. The device re-validates the graph against its local calibration before applying it.
Parameters
  • std::runtime_error: if the device rejects the graph
Parameters
  • graph: Cross-device calibration edges, or std::nullopt to remove the graph
function
std::shared_ptr< CalibrationHandler > tryGetCalibration()
Retrieves the CalibrationHandler shared pointer; If can not get calibration returns nullptr
Returns
The CalibrationHandler object containing the non-persistent calibration
function
CalibrationHandler getCalibration()
Retrieves the CalibrationHandler object containing the non-persistent calibration
Parameters
  • std::runtime_error: if failed to get the calibration
Returns
The CalibrationHandler object containing the non-persistent calibration
function
CalibrationHandler readCalibration()
Fetches the EEPROM data from the device and loads it into CalibrationHandler object If no calibration is flashed, it returns default
Note
This reads EEPROM contents directly and does not merge calibration data from other sources.
Returns
The CalibrationHandler object containing the calibration currently flashed on device EEPROM
function
CBACalibrationHandler readCBACalibration(CameraBoardSocket camSocket)
Fetches the EEPROM data from the CBA and loads it into CalibrationHandler object If no calibration is flashed, it returns default
Note
This reads EEPROM contents directly and does not merge calibration data from other sources.
Parameters
  • camSocket: CameraBoardSocket of the CBA (Camera Board Assembly)
Warning
Experimental feature. This API might change or be removed in a future release.
Returns
The CalibrationHandler object containing the calibration currently flashed on CBA EEPROM
function
CalibrationHandler readCalibration2()
Fetches the EEPROM data from the device and loads it into CalibrationHandler object
Note
This reads EEPROM contents directly and does not merge calibration data from other sources.
Parameters
  • std::runtime_error: if no calibration is flashed
Returns
The CalibrationHandler object containing the calibration currently flashed on device EEPROM
function
CBACalibrationHandler readCBACalibration2(CameraBoardSocket camSocket)
Fetches the EEPROM data from the CBA and loads it into CalibrationHandler object
Note
This reads EEPROM contents directly and does not merge calibration data from other sources.
Parameters
  • camSocket: CameraBoardSocket of the CBA (Camera Board Assembly)
Parameters
  • std::runtime_error: if no calibration is flashed
Warning
Experimental feature. This API might change or be removed in a future release.
Returns
The CalibrationHandler object containing the calibration currently flashed on CBA EEPROM
function
CalibrationHandler readCalibrationOrDefault()
Fetches the EEPROM data from the device and loads it into CalibrationHandler object If no calibration is flashed, it returns default
Note
This reads EEPROM contents directly and does not merge calibration data from other sources.
Returns
The CalibrationHandler object containing the calibration currently flashed on device EEPROM
function
CBACalibrationHandler readCBACalibrationOrDefault(CameraBoardSocket camSocket)
Fetches the EEPROM data from the CBA and loads it into CalibrationHandler object If no calibration is flashed, it returns default
Note
This reads EEPROM contents directly and does not merge calibration data from other sources.
Parameters
  • camSocket: CameraBoardSocket of the CBA (Camera Board Assembly)
Warning
Experimental feature. This API might change or be removed in a future release.
Returns
The CalibrationHandler object containing the calibration currently flashed on CBA EEPROM
function
void factoryResetCalibration()
Factory reset EEPROM data if factory backup is available.
Parameters
  • std::runtime_error: If factory reset was unsuccessful
function
void factoryResetCBACalibration(CameraBoardSocket camSocket)
Factory reset EEPROM data of the CBA if factory backup is available.
Parameters
  • camSocket: CameraBoardSocket of the CBA (Camera Board Assembly)
Parameters
  • std::runtime_error: If factory reset was unsuccessful
Warning
Experimental feature. This API might change or be removed in a future release.
function
void flashFactoryCalibration(const CalibrationHandler & calibrationHandler)
Stores the Calibration and Device information to the Device EEPROM in Factory area To perform this action, correct env variable must be set
Parameters
  • std::runtime_error: if failed to flash the calibration
Returns
True on successful flash, false on failure
function
void flashFactoryCBACalibration(const CBACalibrationHandler & calibrationHandler, CameraBoardSocket camSocket)
Stores the Calibration and Device information to the CBA EEPROM in Factory area To perform this action, correct env variable must be set
Parameters
Parameters
  • std::runtime_error: if failed to flash the calibration
Warning
Experimental feature. This API might change or be removed in a future release.
Returns
True on successful flash, false on failure
function
void flashEepromClear()
Destructive action, deletes User area EEPROM contents Requires PROTECTED permissions
Parameters
  • std::runtime_error: if failed to flash the calibration
Returns
True on successful flash, false on failure
function
void flashCBAEepromClear(CameraBoardSocket camSocket)
Destructive action, deletes User area EEPROM contents on CBA Requires PROTECTED permissions
Parameters
  • camSocket: CameraBoardSocket of the CBA (Camera Board Assembly)
Parameters
  • std::runtime_error: if failed to flash the calibration
Warning
Experimental feature. This API might change or be removed in a future release.
Returns
True on successful flash, false on failure
function
void flashFactoryEepromClear()
Destructive action, deletes Factory area EEPROM contents Requires FACTORY PROTECTED permissions
Parameters
  • std::runtime_error: if failed to flash the calibration
Returns
True on successful flash, false on failure
function
void flashFactoryCBAEepromClear(CameraBoardSocket camSocket)
Destructive action, deletes Factory area EEPROM contents on CBA Requires FACTORY PROTECTED permissions
Parameters
  • camSocket: CameraBoardSocket of the CBA (Camera Board Assembly)
Parameters
  • std::runtime_error: if failed to flash the calibration
Warning
Experimental feature. This API might change or be removed in a future release.
Returns
True on successful flash, false on failure
function
CalibrationHandler readFactoryCalibration()
Fetches the EEPROM data from Factory area and loads it into CalibrationHandler object
Parameters
  • std::runtime_error: if no calibration is flashed
Returns
The CalibrationHandler object containing the calibration currently flashed on device EEPROM in Factory Area
function
CBACalibrationHandler readFactoryCBACalibration(CameraBoardSocket camSocket)
Fetches the CBA EEPROM data from Factory area and loads it into CalibrationHandler object
Parameters
  • camSocket: CameraBoardSocket of the CBA (Camera Board Assembly)
Parameters
  • std::runtime_error: if no calibration is flashed
Warning
Experimental feature. This API might change or be removed in a future release.
Returns
The CalibrationHandler object containing the calibration currently flashed on CBA EEPROM in Factory Area
function
CalibrationHandler readFactoryCalibrationOrDefault()
Fetches the EEPROM data from Factory area and loads it into CalibrationHandler object If no calibration is flashed, it returns default
Returns
The CalibrationHandler object containing the calibration currently flashed on device EEPROM in Factory Area
function
CBACalibrationHandler readFactoryCBACalibrationOrDefault(CameraBoardSocket camSocket)
Fetches the CBA EEPROM data from Factory area and loads it into CalibrationHandler object If no calibration is flashed, it returns default
Parameters
  • camSocket: CameraBoardSocket of the CBA (Camera Board Assembly)
Warning
Experimental feature. This API might change or be removed in a future release.
Returns
The CalibrationHandler object containing the calibration currently flashed on CBA EEPROM in Factory Area
function
std::vector< std::uint8_t > readCalibrationRaw()
Fetches the raw EEPROM data from User area
Parameters
  • std::runtime_error: if any error occurred
Returns
Binary dump of User area EEPROM data
function
std::vector< std::uint8_t > readFactoryCalibrationRaw()
Fetches the raw EEPROM data from Factory area
Parameters
  • std::runtime_error: if any error occurred
Returns
Binary dump of Factory area EEPROM data
function
std::vector< std::uint8_t > readCcmEepromRaw(CameraBoardSocket socket, int size, int offset)
Fetches the raw EEPROM data from the specified CCM (compact camera module). Note: only certain CCMs (e.g. ToF) do have an EEPROM chip on-module
Parameters
  • socket: CameraBoardSocket where the CCM is placed
  • size: Size in bytes to read
  • offset: Absolute offset in EEPROM memory to read from
Parameters
  • std::runtime_exception: if any error occurred
Returns
Binary dump of EEPROM data
function
void writeCcmEepromRaw(CameraBoardSocket socket, std::vector< uint8_t > data, int offset)
Writes the raw EEPROM data from the specified CCM (compact camera module). Note: only certain CCMs (e.g. ToF) do have an EEPROM chip on-module Requires FACTORY PROTECTED permissions
Parameters
  • socket: CameraBoardSocket where the CCM is placed
  • data: Data buffer to write
  • offset: Absolute offset in EEPROM memory to read from
Parameters
  • std::runtime_exception: if any error occurred
function
UsbSpeed getUsbSpeed()
Retrieves USB connection speed
Returns
USB connection speed of connected device if applicable. Unknown otherwise.
function
bool isNeuralDepthSupported()
Checks if Neural Depth is supported on the device
Returns
True if supported, false otherwise
function
bool hasGPU()
Checks if a GPU is available on the device.
Note
This is only meaningful on RVC4 platforms.
Returns
True if supported, false otherwise
function
bool isGpuStereoSupported()
Checks if GPUStereo is supported on the device.
Note
This is only meaningful on RVC4 platforms.
Returns
True if supported, false otherwise
function
std::vector< DeviceModelZoo > getSupportedDeviceModels()
Returns the subset of device zoo models currently available on the device.
Returns
Supported device zoo models
function
void setTimesync(std::chrono::milliseconds period, int numSamples, bool random)
Configures Timesync service on device. It keeps host and device clocks in sync First time timesync is started it waits until the initial sync is completed Afterwards the function changes the following parameters
Parameters
  • period: Interval between timesync runs
  • numSamples: Number of timesync samples per run which are used to compute a better value. Set to zero to disable timesync
  • random: If true partial timesync requests will be performed at random intervals, otherwise at fixed intervals
function
void setTimesync(bool enable)
Enables or disables Timesync service on device. It keeps host and device clocks in sync.
Parameters
  • enable: Enables or disables consistent timesyncing
function
void close()
Explicitly closes connection to device.
Note
This function does not need to be explicitly called as destructor closes the device automatically
function
bool isClosed()
Is the device already closed (or disconnected)
Warning
This function is thread-unsafe and may return outdated incorrect values. It is only meant for use in simple single-threaded code. Well written code should handle exceptions when calling any DepthAI apis to handle hardware events and multithreaded use.
function
void registerCrashdumpCallback(std::function< void(std::shared_ptr< CrashDump >)> callback)
Register a callback that will be called when the device crashes. The callback receives a shared pointer to the CrashDump, which can be modified before it is stored. Only one callback can be registered at a time.
Parameters
  • callback: Callback to call when a crash dump is collected
function
void removeCrashdumpCallback()
Removes the registered crash dump callback
function
bool hasCrashed()
Check if the device has crashed
Returns
True if the device has crashed (watchdog timeout detected), false otherwise
function
void crashDevice()
Crashes the device
Warning
ONLY FOR TESTING PURPOSES, it causes an unrecoverable crash on the device
function
void overrideCameraFeatures(const std::vector< CameraFeatures > & features, const std::string & imu)
Sets connected camera features. Used for holistic record and replay
Parameters
  • features: Vector of camera features to set
  • imu: IMU type to set (if any)
inline function
std::shared_ptr< XLinkConnection > getConnection()
Returns underlying XLinkConnection
inline function
std::shared_ptr< const XLinkConnection > getConnection()
Returns underlying XLinkConnection
function
void setMaxReconnectionAttempts(int maxAttempts, std::function< void(ReconnectionStatus)> callBack)
Sets max number of automatic reconnection attempts
Parameters
  • maxAttempts: Maximum number of reconnection attempts, 0 to disable reconnection
  • callBack: Callback to be called when reconnection is attempted
function
std::tuple< bool, std::string > setExternalFrameSyncRole(ExternalFrameSyncRole role)
Sets external frame sync role for the device
Parameters
  • role: External frame sync role to be set, AUTO_DETECT by default
Returns
Tuple of bool and string. Bool specifies if role was set without failures. String is the error message describing the failure reason.
function
ExternalFrameSyncRole getExternalFrameSyncRole()
Gets external frame sync role for the device
Returns
Gets external frame sync role
function
std::tuple< bool, std::string > setExternalStrobeRelativeLimits(float min, float max)
Sets the relative external strobe limits. Limits the strobe duty cycle, between 0 and 1, as a fraction of the whole period. 0 means always off, 1 means always on. The rising edge of the strobe signal is always synced to end of exposure. The falling edge of the strobe signal is then limited according to the min and max values. Default values are 0.005 and 0.995
Parameters
  • min: Minimum strobe value
  • max: Maximum strobe value
Returns
Tuple of bool and string. Bool specifies if role was set without failures. String is the error message describing the failure reason.
function
void setExternalStrobeEnable(bool enable)
Set whether the external strobe should be enabled. External strobe signal is low for the duration of exposure, and high for the rest of the frame.
Parameters
  • enable: Enables or disables strobe
function
void setExternalStrobeEnable(dai::CameraBoardSocket exposureMasterSocket)
Set which camera will control the external strobe exposure. Automaticaly enables external strobe. External strobe signal is low for the duration of exposure, and high for the rest of the frame.
Parameters
  • exposureMasterSocket: CameraBoardSocket of the camera which will control the external strobe exposure
function
void mockCameraFeatures(const std::filesystem::path & replayPath)
Mock camera features from a recording. Used for holistic record and replay.
struct

dai::DeviceBase::Config

#include DeviceBase.hpp
variable
variable
variable
bool nonExclusiveMode
variable
std::optional< LogLevel > outputLogLevel
variable
std::optional< LogLevel > logLevel
enum

ReconnectionStatus

enumerator
RECONNECTED
enumerator
RECONNECTING
enumerator
RECONNECT_FAILED
class

dai::DeviceBootloader

#include DeviceBootloader.hpp
using
Type = dai::bootloader::Type
using
Memory = dai::bootloader::Memory
using
Section = dai::bootloader::Section
using
using
using
Version = dai::Version
function
DeviceBootloader()
explicit function
DeviceBootloader(const DeviceInfo & devInfo)
Connects to or boots device in bootloader mode depending on devInfo state; flashing not allowed
Parameters
  • devInfo: DeviceInfo of which to boot or connect to
function
DeviceBootloader(const DeviceInfo & devInfo, T allowFlashingBootloader)
Connects to or boots device in bootloader mode depending on devInfo state.
Parameters
  • devInfo: DeviceInfo of which to boot or connect to
  • allowFlashingBootloader: (bool) Set to true to allow flashing the devices bootloader
function
DeviceBootloader(const DeviceInfo & devInfo, Type type, bool allowFlashingBootloader)
Connects to device in bootloader of specified type. Throws if it wasn't possible. This constructor will automatically boot into specified bootloader type if not already running
Parameters
  • devInfo: DeviceInfo of which to boot or connect to
  • type: Type of bootloader to boot/connect to.
  • allowFlashingBootloader: Set to true to allow flashing the devices bootloader. Defaults to false
function
DeviceBootloader(const DeviceInfo & devInfo, const fs::path & pathToBootloader, bool allowFlashingBootloader)
Connects to or boots device in bootloader mode depending on devInfo state with a custom bootloader firmware.
Parameters
  • devInfo: DeviceInfo of which to boot or connect to
  • pathToBootloader: Custom bootloader firmware to boot
  • allowFlashingBootloader: Set to true to allow flashing the devices bootloader. Defaults to false
function
DeviceBootloader(std::string nameOrDeviceId, bool allowFlashingBootloader)
Connects to device with specified name/device id
Parameters
  • nameOrDeviceId: Creates DeviceInfo with nameOrDeviceId to connect to
  • allowFlashingBootloader: Set to true to allow flashing the devices bootloader. Defaults to false
function
~DeviceBootloader()
Destroy the Device Bootloader object.
function
ApplicationInfo readApplicationInfo(Memory memory)
Reads information about flashed application in specified memory from device
Parameters
  • memory: Specifies which memory to query
function
std::tuple< bool, std::string > flashClear(Memory memory)
Clears flashed application on the device, by removing SBR boot structure Doesn't remove fast boot header capability to still boot the application
function
std::tuple< bool, std::string > flashBootloader(const std::function< void(float)> & progressCallback, const fs::path & path)
Flashes bootloader to the current board
Parameters
  • progressCallback: Callback that sends back a value between 0..1 which signifies current flashing progress
  • path: Optional parameter to custom bootloader to flash
function
std::tuple< bool, std::string > flashBootloader(Memory memory, Type type, std::function< void(float)> progressCallback, const fs::path & path)
Flash selected bootloader to the current board
Parameters
  • memory: Memory to flash
  • type: Bootloader type to flash
  • progressCallback: Callback that sends back a value between 0..1 which signifies current flashing progress
  • path: Optional parameter to custom bootloader to flash
function
std::tuple< bool, std::string > flashUserBootloader(std::function< void(float)> progressCallback, const fs::path & path)
Flashes user bootloader to the current board. Available for NETWORK bootloader type
Parameters
  • progressCallback: Callback that sends back a value between 0..1 which signifies current flashing progress
  • path: Optional parameter to custom bootloader to flash
function
std::tuple< bool, std::string > flashGpioModeBootHeader(Memory memory, int gpioMode)
Flash boot header which boots same as equivalent GPIO mode would
Parameters
  • gpioMode: GPIO mode equivalent
function
std::tuple< bool, std::string > flashUsbRecoveryBootHeader(Memory memory)
Flash USB recovery boot header. Switches to USB ROM Bootloader
Parameters
  • memory: Which memory to flash the header to
function
std::tuple< bool, std::string > flashBootHeader(Memory memory, int32_t frequency, int64_t location, int32_t dummyCycles, int64_t offset)
Flash optimized boot header
Parameters
  • memory: Which memory to flasht the header to
  • frequency: SPI specific parameter, frequency in MHz
  • location: Target location the header should boot to. Default to location of bootloader
  • dummyCycles: SPI specific parameter
  • offset: Offset in memory to flash the header to. Defaults to offset of boot header
Returns
status as std::tuple<bool, std::string>
function
std::tuple< bool, std::string > flashFastBootHeader(Memory memory, int32_t frequency, int64_t location, int32_t dummyCycles, int64_t offset)
Flash fast boot header. Application must already be present in flash, or location must be specified manually. Note - Can soft brick your device if firmware location changes.
Parameters
  • memory: Which memory to flash the header to
  • frequency: SPI specific parameter, frequency in MHz
  • location: Target location the header should boot to. Default to location of bootloader
  • dummyCycles: SPI specific parameter
  • offset: Offset in memory to flash the header to. Defaults to offset of boot header
Returns
status as std::tuple<bool, std::string>
function
std::tuple< bool, std::string > flashCustom(Memory memory, size_t offset, const std::vector< uint8_t > & data, const std::function< void(float)> & progressCb)
Flash arbitrary data at custom offset in specified memory
Parameters
  • memory: Memory to flash
  • offset: Offset at which to flash the given data in bytes
  • progressCallback: Callback that sends back a value between 0..1 which signifies current flashing progress
  • data: Data to flash
function
std::tuple< bool, std::string > flashCustom(Memory memory, size_t offset, const uint8_t * data, size_t size, const std::function< void(float)> & progressCb)
function
std::tuple< bool, std::string > flashCustom(Memory memory, size_t offset, const std::string & filename, const std::function< void(float)> & progressCb)
function
std::tuple< bool, std::string > readCustom(Memory memory, size_t offset, size_t size, std::vector< uint8_t > & data, const std::function< void(float)> & progressCb)
Reads arbitrary data at custom offset in specified memory
Parameters
  • memory: Memory to read
  • offset: Offset at which to read the specified bytes
  • size: Number of bytes to read
  • data: Data to read to. Must be at least 'size' number of bytes big
  • progressCallback: Callback that sends back a value between 0..1 which signifies current reading progress
function
std::tuple< bool, std::string > readCustom(Memory memory, size_t offset, size_t size, uint8_t * data, const std::function< void(float)> & progressCb)
function
std::tuple< bool, std::string > readCustom(Memory memory, size_t offset, size_t size, const std::string & filename, const std::function< void(float)> & progressCb)
function
std::tuple< bool, std::string, std::vector< uint8_t > > readCustom(Memory memory, size_t offset, size_t size, const std::function< void(float)> & progressCb)
function
nlohmann::json readConfigData(Memory memory, Type type)
Reads configuration data from bootloader
Returns
Unstructured configuration data
Parameters
  • memory: Optional - from which memory to read configuration data
  • type: Optional - from which type of bootloader to read configuration data
function
std::tuple< bool, std::string > flashConfigData(const nlohmann::json & configData, Memory memory, Type type)
Flashes configuration data to bootloader
Parameters
  • configData: Unstructured configuration data
  • memory: Optional - to which memory flash configuration
  • type: Optional - for which type of bootloader to flash configuration
function
std::tuple< bool, std::string > flashConfigFile(const fs::path & configPath, Memory memory, Type type)
Flashes configuration data to bootloader
Parameters
  • configPath: Unstructured configuration data
  • memory: Optional - to which memory flash configuration
  • type: Optional - for which type of bootloader to flash configuration
function
std::tuple< bool, std::string > flashConfigClear(Memory memory, Type type)
Clears configuration data
Parameters
  • memory: Optional - on which memory to clear configuration data
  • type: Optional - for which type of bootloader to clear configuration data
function
Config readConfig(Memory memory, Type type)
Reads configuration from bootloader
Parameters
  • memory: Optional - from which memory to read configuration
  • type: Optional - from which type of bootloader to read configuration
Returns
Configuration structure
function
std::tuple< bool, std::string > flashConfig(const Config & config, Memory memory, Type type)
Flashes configuration to bootloader
Parameters
  • configData: Configuration structure
  • memory: Optional - to which memory flash configuration
  • type: Optional - for which type of bootloader to flash configuration
function
MemoryInfo getMemoryInfo(Memory memory)
Retrieves information about specified memory
Parameters
  • memory: Specifies which memory to query
function
bool isUserBootloaderSupported()
Checks whether User Bootloader is supported with current bootloader
Returns
true of User Bootloader is supported, false otherwise
function
bool isUserBootloader()
Retrieves whether current bootloader is User Bootloader (B out of A/B configuration)
function
void bootMemory(const std::vector< uint8_t > & fw)
Boots a custom FW in memory
Parameters
  • fw:
Parameters
  • A: runtime exception if there are any communication issues
function
void bootUsbRomBootloader()
Boots into integrated ROM bootloader in USB mode
Parameters
  • A: runtime exception if there are any communication issues
function
Version getVersion()
Returns
Version of current running bootloader
function
bool isEmbeddedVersion()
Returns
True when bootloader was booted using latest bootloader integrated in the library. False when bootloader is already running on the device and just connected to.
function
Type getType()
Returns
Type of currently connected bootloader
function
bool isAllowedFlashingBootloader()
Returns
True if allowed to flash bootloader
function
void close()
Explicitly closes connection to device.
Note
This function does not need to be explicitly called as destructor closes the device automatically
function
bool isClosed()
Is the device already closed (or disconnected)
Warning
This function is thread-unsafe and may return outdated incorrect values. It is only meant for use in simple single-threaded code. Well written code should handle exceptions when calling any DepthAI apis to handle hardware events and multithreaded use.
struct

dai::DeviceBootloader::ApplicationInfo

variable
Memory memory
variable
bool hasApplication
variable
std::string firmwareVersion
variable
std::string applicationName
struct

dai::DeviceBootloader::Config

function
void setStaticIPv4(const std::string & ip, const std::string & mask, const std::string & gateway)
Setting a static IPv4 won't start DHCP client.
function
void setDynamicIPv4(const std::string & ip, const std::string & mask, const std::string & gateway)
Setting a dynamic IPv4 will set that IP as well as start DHCP client.
function
bool isStaticIPV4()
Get if static IPv4 configuration is set.
function
std::string getIPv4()
Get IPv4.
function
std::string getIPv4Mask()
Get IPv4 mask.
function
std::string getIPv4Gateway()
Get IPv4 gateway.
function
void setDnsIPv4(const std::string & dns, const std::string & dnsAlt)
Set IPv4 DNS options.
function
std::string getDnsIPv4()
Get primary IPv4 DNS server.
function
std::string getDnsAltIPv4()
Get alternate IPv4 DNS server.
function
void setUsbTimeout(std::chrono::milliseconds ms)
Set USB timeout.
function
std::chrono::milliseconds getUsbTimeout()
Get USB timeout.
function
void setNetworkTimeout(std::chrono::milliseconds ms)
Set NETWOR timeout.
function
std::chrono::milliseconds getNetworkTimeout()
Get NETWORK timeout.
function
void setMacAddress(const std::string & mac)
Set MAC address if not flashed on controller.
function
std::string getMacAddress()
Get MAC address if not flashed on controller.
function
void setUsbMaxSpeed(UsbSpeed speed)
Set maxUsbSpeed.
function
UsbSpeed getUsbMaxSpeed()
Get maxUsbSpeed.
function
nlohmann::json toJson()
To JSON.
struct

dai::DeviceBootloader::MemoryInfo

variable
bool available
variable
std::int64_t size
variable
std::string info
class

dai::DeviceGate

#include DeviceGate.hpp
function
DeviceGate(const DeviceInfo & deviceInfo)
Connects to DepthAI Gate
Parameters
  • deviceInfo: Device to connect to
function
~DeviceGate()
function
bool isOkay()
function
bool createSession(bool exclusive)
function
bool startSession()
function
bool stopSession()
function
bool deleteSession()
function
bool destroySession()
function
SessionState getState()
function
std::string getLastError()
function
void waitForSessionEnd()
function
std::optional< CrashDump > getCrashDump()
function
Version getVersion()
function
VersionInfo getAllVersion()
struct

dai::DeviceGate::CrashDump

variable
std::vector< uint8_t > data
variable
std::string filename
struct

dai::DeviceGate::VersionInfo

variable
std::string gate
variable
std::string os
enum

SessionState

enumerator
NOT_CREATED
enumerator
CREATED
enumerator
RUNNING
enumerator
STOPPED
enumerator
STOPPING
enumerator
CRASHED
enumerator
DESTROYED
enumerator
ERROR_STATE
struct

dai::EepromError

struct

dai::HealthCheckConfig

#include HealthCheck.hpp
variable
bool checkUsbGeneration
variable
bool measureBandwidth
variable
bool verifyCameraFunctionality
variable
bool verifyCameraCalibration
variable
bool verifyImuFunctionality
variable
bool verifyImuCalibration
variable
bool verifyPowerSupply
variable
std::chrono::milliseconds powerSupplyCheckDuration
inline explicit function
HealthCheckConfig(bool checkUsbGeneration, bool measureBandwidth, bool verifyCameraFunctionality, bool verifyCameraCalibration, bool verifyImuFunctionality, bool verifyImuCalibration, bool verifyPowerSupply, std::chrono::milliseconds powerSupplyCheckDuration)
struct

dai::HealthCheckIssue

#include HealthCheck.hpp
variable
HealthCheckIssueType type
variable
HealthCheckIssueStage stage
variable
std::string message
function
HealthCheckIssue()
inline function
HealthCheckIssue(HealthCheckIssueType type, HealthCheckIssueStage stage, std::string message)
struct

dai::HealthCheckMetrics

#include HealthCheck.hpp
variable
UsbGeneration usbGeneration
variable
float bandwidthMbps
variable
HealthCheckResult cameraFunctionality
variable
HealthCheckResult cameraCalibration
variable
HealthCheckResult imuFunctionality
variable
HealthCheckResult imuCalibration
variable
HealthCheckResult powerSupplyFunctionality
variable
bool deviceInUse
variable
bool deviceInSetupMode
variable
bool missingUdevRules
variable
std::vector< HealthCheckIssue > issues
function
std::string toString()
class

dai::DeviceHealthCheck

function
DeviceHealthCheck()
struct

dai::Version

#include Version.hpp
explicit function
Version(const std::string & v)
Construct Version from string.
function
Version(unsigned major, unsigned minor, unsigned patch, const PreReleaseType & type, const std::optional< uint16_t > & preReleaseVersion, const std::string & buildInfo)
Construct Version major, minor, patch, and pre-release information.
inline function
Version(unsigned major, unsigned minor, unsigned patch, const std::string & buildInfo)
function
bool operator==(const Version & other)
function
bool operator<(const Version & other)
inline function
bool operator!=(const Version & rhs)
inline function
bool operator>(const Version & rhs)
inline function
bool operator<=(const Version & rhs)
inline function
bool operator>=(const Version & rhs)
function
std::string toString()
Convert Version to string.
function
std::string toStringSemver()
Convert Version to semver (no build information) string.
function
std::string getBuildInfo()
Get build info.
enum

uint16_t PreReleaseType

enumerator
ALPHA
enumerator
BETA
enumerator
RC
enumerator
NONE
struct

dai::LogMessage

variable
std::string nodeIdName
variable
LogLevel level
variable
variable
size_t colorRangeStart
variable
size_t colorRangeEnd
variable
std::string payload
struct

dai::SlugComponents

variable
std::string teamName
variable
std::string modelSlug
variable
std::string modelVariantSlug
variable
std::string modelRef
function
std::string merge()
struct

dai::NNModelDescription

variable
std::string model
Model slug = REQUIRED parameter
variable
std::string platform
Hardware platform - RVC2, RVC3, RVC4, ... = REQUIRED parameter
variable
std::string optimizationLevel
Optimization level = OPTIONAL parameter
variable
std::string compressionLevel
Compression level = OPTIONAL parameter
variable
std::string snpeVersion
SNPE version = OPTIONAL parameter
variable
std::string modelPrecisionType
modelPrecisionType = OPTIONAL parameter
variable
std::string globalMetadataEntryName
Name of the entry in the global metadata file
function
void saveToYamlFile(const fs::path & yamlPath)
Save NNModelDescription to yaml file.
Parameters
  • yamlPath: Path to yaml file
function
bool check()
Check if the model description is valid (contains all required fields)
Returns
bool: True if the model description is valid, false otherwise
function
std::string toString()
Convert NNModelDescription to string for printing purposes. This can be used for debugging.
Returns
std::string: String representation
struct

dai::NNArchiveOptions

function
class

dai::NNArchive

function
NNArchive(const std::filesystem::path & archivePath, NNArchiveOptions options)
Construct a new NNArchive object - a container holding a model and its configuration.
Parameters
  • archivePath: Path to the archive file
  • options: Archive options such as compression, number of shaves, etc. See NNArchiveOptions.
function
std::optional< OpenVINO::Blob > getBlob()
Return a SuperVINO::Blob from the archive if getModelType() returns BLOB, nothing otherwise.
Returns
std::optional<OpenVINO::Blob>: Model blob
function
std::optional< OpenVINO::SuperBlob > getSuperBlob()
Return a SuperVINO::SuperBlob from the archive if getModelType() returns SUPERBLOB, nothing otherwise.
Returns
std::optional<OpenVINO::SuperBlob>: Model superblob
function
std::optional< std::vector< uint8_t > > getOtherModelFormat()
Return a model from the archive if getModelType() returns OTHER or DLC, nothing otherwise.
Returns
std::optional<std::vector<uint8_t>>: Model
function
const NNArchiveVersionedConfig & getVersionedConfig()
Get NNArchive config wrapper.
Returns
NNArchiveVersionedConfig: Archive config
function
std::optional< std::pair< uint32_t, uint32_t > > getInputSize(uint32_t index)
Get inputSize of the model.
Parameters
  • index: Index of input
Note
this function is only valid for models with NCHW and NHWC input formats
Returns
std::vector<std::pair<int, int>>: inputSize
function
std::optional< uint32_t > getInputWidth(uint32_t index)
Get inputWidth of the model.
Parameters
  • index: Index of input
Returns
int: inputWidth
function
std::optional< uint32_t > getInputHeight(uint32_t index)
Get inputHeight of the model.
Parameters
  • index: Index of input
Returns
int: inputHeight
function
std::vector< dai::Platform > getSupportedPlatforms()
Get supported platforms.
Returns
std::vector<dai::Platform>: Supported platforms
inline function
const T & getConfig()
Get NNArchive config.
Parameters
  • T: Type of config to get
Returns
const T&: Config
function
dai::nn_archive::v1::Head getHeadConfig(uint32_t index)
Get specific head configuration from NNArchive.
Parameters
  • headIndex: Index of the head to retrieve
Returns
dai::nn_archive::v1::Head: Head configuration
function
model::ModelType getModelType()
Get type of model contained in NNArchive.
Returns
model::ModelType: type of model in archive
class

dai::NNArchiveEntry

enum

uint8_t Compression

enumerator
AUTO
Try to guess the file format from the file extension. .json -> RAW_FS everything else use libarchive to guess the format supported formats are: https://github.com/libarchive/libarchive?tab=readme-ov-file#supported-formats
enumerator
RAW_FS
The entry isn't compressed. Access it directly on the filesystem.
enumerator
TAR
Force libarchive to treat the file as .tar
enumerator
TAR_GZ
Force libarchive to treat the file as .tar.gz
enumerator
TAR_XZ
Force libarchive to treat the file as .tar.xz
enum

uint8_t Seek

Check stdio.h SEEK_SET, SEEK_CUR, SEEK_END for meaning.
enumerator
SET
enumerator
CUR
enumerator
END
class

dai::NNArchiveVersionedConfig

explicit function
NNArchiveVersionedConfig(const std::vector< uint8_t > & data, NNArchiveEntry::Compression compression)
@data Should point to a whole compressed NNArchive read to memory if compression is not set to RAW_FS. If compression is set to RAW_FS, then this should point to just the config.json file read to memory.
explicit function
NNArchiveVersionedConfig(const std::filesystem::path & path, NNArchiveEntry::Compression compression)
@path Should point to: 1) if compression is set to RAW_FS: to just the config.json file. 2) if compression is set to AUTO: to whole compressed NNArchive or just the config.json file which must end in .json . 3) else: to whole compressed NNArchive. see NNArchive class for parameter explanation
function
NNArchiveVersionedConfig(const std::function< int()> & openCallback, const std::function< std::shared_ptr< std::vector< uint8_t >>()> & readCallback, const std::function< int64_t(int64_t offset, NNArchiveEntry::Seek whence)> & seekCallback, const std::function< int64_t(int64_t request)> & skipCallback, const std::function< int()> & closeCallback, NNArchiveEntry::Compression compression)
Returned data should be just the config.json if compression == RAW_FS or the whole NNArchive otherwise see NNArchive class for parameter explanation
inline function
NNArchiveVersionedConfig(const NNArchiveConfig & config)
Construct NNArchiveVersionedConfig from a specific version of a config.
Parameters
inline function
NNArchiveConfigVersion getVersion()
Get version of the underlying config.
inline function
const T & getConfig()
Get stored config cast to a specific version.
Parameters
  • T: Config type to cast to.
inline function
const NNArchiveConfig & getConfig()
class

dai::OpenVINO

#include OpenVINO.hpp
struct

dai::OpenVINO::Blob

#include OpenVINO.hpp
variable
Version version
OpenVINO version.
variable
Device device
Device for which the blob is compiled for.
variable
std::unordered_map< std::string, TensorInfo > networkInputs
Map of input names to additional information.
variable
std::unordered_map< std::string, TensorInfo > networkOutputs
Map of output names to additional information.
variable
uint32_t stageCount
Number of network stages.
variable
uint32_t numShaves
Number of shaves the blob was compiled for.
variable
uint32_t numSlices
Number of CMX slices the blob was compiled for.
variable
std::vector< uint8_t > data
Blob data.
function
Blob(std::vector< uint8_t > data)
Construct a new Blob from data in memory.
Parameters
  • data: In memory blob
function
Blob(const std::filesystem::path & path)
Construct a new Blob by loading from a filesystem path.
Parameters
  • path: Filesystem path to the blob
class

dai::OpenVINO::SuperBlob

#include OpenVINO.hpp
function
SuperBlob(std::vector< uint8_t > data)
Construct a new SuperBlob object.
Parameters
  • data: In memory superblob data
function
SuperBlob(const std::filesystem::path & pathToSuperBlobFile)
Construct a new SuperBlob object.
Parameters
  • pathToSuperBlobFile: Path to the superblob file (.superblob suffix)
function
dai::OpenVINO::Blob getBlobWithNumShaves(int numShaves)
Generate a blob with a specific number of shaves.
Parameters
  • numShaves: Number of shaves to generate the blob for. Must be between 1 and NUMBER_OF_PATCHES.
Returns
dai::OpenVINO::Blob: Blob compiled for the specified number of shaves
enum

Version

OpenVINOVersion supported version information.
enumerator
VERSION_2020_3
enumerator
VERSION_2020_4
enumerator
VERSION_2021_1
enumerator
VERSION_2021_2
enumerator
VERSION_2021_3
enumerator
VERSION_2021_4
enumerator
VERSION_2022_1
enumerator
VERSION_UNIVERSAL
enum

Device

enumerator
VPU
enumerator
VPUX
struct

dai::Asset

#include AssetManager.hpp
variable
const std::string key
variable
std::vector< std::uint8_t > data
variable
std::uint32_t alignment
function
Asset()
inline explicit function
Asset(std::string k)
function
std::vector< std::uint8_t > & getData()
function
const std::vector< std::uint8_t > & getData()
function
void setData(std::vector< std::uint8_t > data)
function
std::size_t getSize()
function
std::string getRelativeUri()
function
void setFile(std::filesystem::path path, std::size_t size)
Set the backing file and its expected size. The file must remain available and unchanged until the asset is materialized or serialized.
class

dai::AssetsMutable

function
void set(const std::string &, std::uint32_t offset, std::uint32_t size, std::uint32_t alignment)
class

dai::AssetManager

#include AssetManager.hpp
function
AssetManager()
function
AssetManager(const std::string & rootPath)
function
void addExisting(const std::vector< std::shared_ptr< Asset >> & assets)
Adds all assets in an array to the AssetManager
Parameters
  • assets: Vector of assets to add
function
std::string getRootPath()
Get root path of the asset manager
Returns
Root path
function
void setRootPath(const std::string & rootPath)
Set root path of the asset manager
Parameters
  • rootPath: Root path
function
std::shared_ptr< dai::Asset > set(Asset asset)
Adds or overwrites an asset object to AssetManager.
Parameters
Returns
Shared pointer to asset
function
std::shared_ptr< dai::Asset > set(const std::string & key, Asset asset)
Adds or overwrites an asset object to AssetManager with a specified key. Key value will be assigned to an Asset as well
Parameters
  • key: Key under which the asset should be stored
  • asset: Asset to store
Returns
Shared pointer to asset
function
std::shared_ptr< dai::Asset > set(const std::string & key, const std::filesystem::path & path, int alignment)
Loads a file into the asset manager under the specified key.
Parameters
  • key: Key under which the asset should be stored
  • path: Path to file which to load as asset
  • alignment: [Optional] alignment of asset data in asset storage. Default is 64B
function
std::shared_ptr< dai::Asset > setLazy(const std::string & key, const std::filesystem::path & path, int alignment)
Registers a file-backed asset under the specified key. Its contents are loaded lazily, so the file must remain available and unchanged until the pipeline is serialized or Asset::getData() is called.
Parameters
  • key: Key under which the asset should be stored
  • path: Path to the file backing the asset
  • alignment: [Optional] alignment of asset data in asset storage. Default is 64B
function
std::shared_ptr< dai::Asset > set(const std::string & key, const std::vector< std::uint8_t > & data, int alignment)
Loads data into the asset manager under the specified key.
Parameters
  • key: Key under which the asset should be stored
  • data: Asset data
  • alignment: [Optional] alignment of asset data in asset storage. Default is 64B
Returns
Shared pointer to asset
function
std::shared_ptr< dai::Asset > set(const std::string & key, std::vector< std::uint8_t > && data, int alignment)
function
std::shared_ptr< const Asset > get(const std::string & key)
Returns
Asset assigned to the specified key or a nullptr otherwise
function
std::shared_ptr< Asset > get(const std::string & key)
Returns
Asset assigned to the specified key or a nullptr otherwise
function
std::vector< std::shared_ptr< const Asset > > getAll()
Returns
All asset stored in the AssetManager
function
std::vector< std::shared_ptr< Asset > > getAll()
Returns
All asset stored in the AssetManager
function
std::size_t size()
Returns
Number of asset stored in the AssetManager
function
void remove(const std::string & key)
Removes asset with key
Parameters
  • key: Key of asset to remove
function
void serialize(AssetsMutable & assets, std::vector< std::uint8_t > & assetStorage, std::string prefix)
Serializes.
function
std::size_t getSerializedSize(std::size_t offset)
Calculates the size of the serialized data.
struct

dai::AssetView

variable
std::uint8_t * data
variable
std::uint32_t size
variable
std::uint32_t alignment
inline function
AssetView(std::uint8_t * d, std::uint32_t s, std::uint32_t a)
class

dai::Assets

Derived by dai::AssetsMutable
inline function
void setStorage(std::uint8_t * ps)
inline function
bool has(const std::string & key)
inline function
AssetView get(const std::string & key)
inline function
std::vector< std::pair< std::string, AssetView > > getAll()
function
DEPTHAI_SERIALIZE(Assets, map)
class

dai::DeviceNode

Derived by dai::DeviceNodeCRTP< DeviceNode, ToFDepthConfidenceFilter, ToFDepthConfidenceFilterProperties >, dai::DeviceNodeCRTP< DeviceNode, Rectification, RectificationProperties >, dai::DeviceNodeCRTP< DeviceNode, MessageDemux, MessageDemuxProperties >, dai::DeviceNodeCRTP< DeviceNode, ToFStereoFusion, ToFStereoFusionProperties >, dai::DeviceNodeCRTP< DeviceNode, IMU, IMUProperties >, dai::DeviceNodeCRTP< DeviceNode, EdgeDetector, EdgeDetectorProperties >, dai::DeviceNodeCRTP< DeviceNode, Align, AlignProperties >, dai::DeviceNodeCRTP< DeviceNode, SPIOut, SPIOutProperties >, dai::DeviceNodeCRTP< DeviceNode, ObjectTracker, ObjectTrackerProperties >, dai::DeviceNodeCRTP< DeviceNode, FeatureTracker, FeatureTrackerProperties >, dai::DeviceNodeCRTP< DeviceNode, BenchmarkIn, BenchmarkInProperties >, dai::DeviceNodeCRTP< DeviceNode, SystemLogger, SystemLoggerProperties >, dai::DeviceNodeCRTP< DeviceNode, Camera, CameraProperties >, dai::DeviceNodeCRTP< DeviceNode, Thermal, ThermalProperties >, dai::DeviceNodeCRTP< DeviceNode, Sync, SyncProperties >, dai::DeviceNodeCRTP< DeviceNode, StereoDepth, StereoDepthProperties >, dai::DeviceNodeCRTP< DeviceNode, Gate, GateProperties >, dai::DeviceNodeCRTP< DeviceNode, VideoEncoder, VideoEncoderProperties >, dai::DeviceNodeCRTP< DeviceNode, SpatialLocationCalculator, SpatialLocationCalculatorProperties >, dai::DeviceNodeCRTP< DeviceNode, BenchmarkOut, BenchmarkOutProperties >, dai::DeviceNodeCRTP< DeviceNode, ImageFilters, ImageFiltersProperties >, dai::DeviceNodeCRTP< DeviceNode, DynamicCalibration, DynamicCalibrationProperties >, dai::DeviceNodeCRTP< DeviceNode, ImageAlign, ImageAlignProperties >, dai::DeviceNodeCRTP< DeviceNode, GPUStereo, GPUStereoProperties >, dai::DeviceNodeCRTP< DeviceNode, DetectionParser, DetectionParserProperties >, dai::DeviceNodeCRTP< DeviceNode, AutoCalibration, AutoCalibrationProperties >, dai::DeviceNodeCRTP< DeviceNode, Warp, WarpProperties >, dai::DeviceNodeCRTP< DeviceNode, SegmentationParser, SegmentationParserProperties >, dai::DeviceNodeCRTP< DeviceNode, SPIIn, SPIInProperties >, dai::DeviceNodeCRTP< DeviceNode, NeuralNetwork, NeuralNetworkProperties >, dai::DeviceNodeCRTP< DeviceNode, ImageManip, ImageManipProperties >, dai::DeviceNodeCRTP< DeviceNode, AprilTag, AprilTagProperties >, dai::DeviceNodeCRTP< DeviceNode, XLinkOut, XLinkOutProperties >, dai::DeviceNodeCRTP< DeviceNode, Vpp, VppProperties >, dai::DeviceNodeCRTP< DeviceNode, ToFBase, ToFProperties >, dai::DeviceNodeCRTP< DeviceNode, PointCloud, PointCloudProperties >, dai::DeviceNodeCRTP< DeviceNode, NeuralDepth, NeuralDepthProperties >, dai::DeviceNodeCRTP< DeviceNode, MonoCamera, MonoCameraProperties >, dai::DeviceNodeCRTP< DeviceNode, ColorCamera, ColorCameraProperties >, dai::DeviceNodeCRTP< DeviceNode, XLinkIn, XLinkInProperties >, dai::DeviceNodeCRTP< DeviceNode, PipelineEventAggregation, PipelineEventAggregationProperties >, dai::DeviceNodeCRTP< DeviceNode, Script, ScriptProperties >, dai::DeviceNodeCRTP< DeviceNode, UVC, UVCProperties >, dai::DeviceNodeGroup, dai::beta::BetaNode
variable
copyable_unique_ptr< Properties > propertiesHolder
function
DeviceNode()
function
~DeviceNode()
function
void run()
inline function
bool runOnHost()
Returns true or false whether the node should be run on host or not.
function
const std::shared_ptr< Device > getDevice()
Get device for this node.
Returns
shared pointer to device
function
Properties & getProperties()
function
void setLogLevel(dai::LogLevel level)
Sets the logging severity level for this node.
Parameters
  • level: Logging severity level
function
dai::LogLevel getLogLevel()
Gets the logging severity level for this node.
Returns
Logging severity level
class

dai::DeviceNodeCRTP

using
Properties = Props
variable
Properties & properties
Underlying properties.
function
~DeviceNodeCRTP()
inline function
DEPTHAI_BEGIN_SUPPRESS_DEPRECATION_WARNING const char * getName()
inline function
DEPTHAI_END_SUPPRESS_DEPRECATION_WARNING bool isBuiltInNode()
class

dai::DeviceNodeGroup

Derived by dai::node::Depth, dai::node::DetectionNetwork, dai::node::NeuralAssistedStereo, dai::node::SpatialDetectionNetwork, dai::node::ToF
inline function
const char * getName()
Retrieves nodes name.
inline function
bool isBuiltInNode()
Returns whether this node is provided by depthai-core.
function
~DeviceNodeGroup()
inline function
DeviceNodeGroup(const std::shared_ptr< Device > & device)
function
void setLogLevel(dai::LogLevel level)
Sets the logging severity level for this node.
Parameters
  • level: Logging severity level
function
dai::LogLevel getLogLevel()
Gets the logging severity level for this node.
Returns
Logging severity level
function
DeviceNode()
function
DeviceNode(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool conf)
function
DeviceNode(std::unique_ptr< Properties > props, bool conf)
class

dai::InputQueue

function
void send(const std::shared_ptr< ADatatype > & msg)
Send a message to the connected input.
Parameters
  • msg: Message to send
function
bool trySend(const std::shared_ptr< ADatatype > & msg)
Try to send a message to the connected input, without waiting for space in the queue.
Parameters
  • msg: Message to send
Returns
True if the message was queued, false if the queue was full
class

dai::MessageQueue

#include MessageQueue.hppDerived by dai::Node::Input
using
CallbackId = int
Alias for callback id.
variable
std::mutex callbacksMtx
variable
std::unordered_map< CallbackId, std::function< void(std::string, std::shared_ptr< ADatatype >)> > callbacks
variable
CallbackId uniqueCallbackId
explicit function
MessageQueue(unsigned int maxSize, bool blocking)
explicit function
MessageQueue(std::string name, unsigned int maxSize, bool blocking, utility::PipelineEventDispatcherInterface * pipelineEventDispatcher)
inline function
MessageQueue(const MessageQueue & c)
inline function
MessageQueue(MessageQueue && m)
inline function
MessageQueue & operator=(const MessageQueue & c)
inline function
MessageQueue & operator=(MessageQueue && m)
function
~MessageQueue()
function
std::string getName()
Get name of the queue.
function
void setName(std::string name)
Set the name of the queue
function
bool isClosed()
Check whether queue is closed
function
void close()
Closes the queue and unblocks any waiting consumers or producers
function
void setBlocking(bool blocking)
Sets queue behavior when full (maxSize)
Parameters
  • blocking: Specifies if block or overwrite the oldest message in the queue
function
bool getBlocking()
Gets current queue behavior when full (maxSize)
Returns
True if blocking, false otherwise
function
void setMaxSize(unsigned int maxSize)
Sets queue maximum size
Parameters
  • maxSize: Specifies maximum number of messages in the queue
Note
If maxSize is smaller than size, queue will not be truncated immediately, only after messages are popped
function
unsigned int getMaxSize()
Gets queue maximum size
Returns
Maximum queue size
function
unsigned int getSize()
Gets queue current size
Returns
Current queue size
function
unsigned int isFull()
Gets whether queue is full
Returns
True if queue is full, false otherwise
function
CallbackId addCallback(std::function< void(std::string, std::shared_ptr< ADatatype >)>)
Adds a callback on message received
Parameters
  • callback: Callback function with queue name and message pointer
Returns
Callback id
function
CallbackId addCallback(const std::function< void(std::shared_ptr< ADatatype >)> &)
Adds a callback on message received
Parameters
  • callback: Callback function with message pointer
Returns
Callback id
function
CallbackId addCallback(const std::function< void()> & callback)
Adds a callback on message received
Parameters
  • callback: Callback function without any parameters
Returns
Callback id
function
CallbackId addNotifier(std::shared_ptr< utility::WaitAnyNotifier > notifier)
Adds a notifier to be pinged on message queue updates
Parameters
  • notifier: Notifier to be notified
Returns
Notifier id
function
bool removeCallback(CallbackId callbackId)
Removes a callback
Parameters
  • callbackId: Id of callback to be removed
Returns
True if callback was removed, false otherwise
function
bool removeNotifier(CallbackId notifierId)
Removes a notifier
Parameters
  • notifierId: Id of notifier to be removed
Returns
True if notifier was removed, false otherwise
inline function
bool has()
Check whether front of the queue has message of type T
Returns
True if queue isn't empty and the first element is of type T, false otherwise
inline function
bool has()
Check whether front of the queue has a message (isn't empty)
Returns
True if queue isn't empty, false otherwise
inline function
std::shared_ptr< T > tryGet()
Try to retrieve message T from queue. If message isn't of type T it returns nullptr
Returns
Message of type T or nullptr if no message available
inline function
std::shared_ptr< ADatatype > tryGet()
Try to retrieve message from queue. If no message available, return immediately with nullptr
Returns
Message or nullptr if no message available
inline function
std::shared_ptr< T > get()
Block until a message is available.
Returns
Message of type T or nullptr if no message available
inline function
std::shared_ptr< ADatatype > get()
Block until a message is available.
Returns
Message or nullptr if no message available
inline function
std::shared_ptr< T > front()
Gets first message in the queue.
Returns
Message of type T or nullptr if no message available
inline function
std::shared_ptr< ADatatype > front()
Gets first message in the queue.
Returns
Message or nullptr if no message available
inline function
std::shared_ptr< T > get(std::chrono::duration< Rep, Period > timeout, bool & hasTimedout)
Block until a message is available with a timeout.
Parameters
  • timeout: Duration for which the function should block
  • hasTimedout: Outputs true if timeout occurred, false otherwise
Returns
Message of type T otherwise nullptr if message isn't type T or timeout occurred
inline function
std::shared_ptr< ADatatype > get(std::chrono::duration< Rep, Period > timeout, bool & hasTimedout)
Block until a message is available with a timeout.
Parameters
  • timeout: Duration for which the function should block
  • hasTimedout: Outputs true if timeout occurred, false otherwise
Returns
Message of type T otherwise nullptr if message isn't type T or timeout occurred
inline function
std::vector< std::shared_ptr< T > > tryGetAll()
Try to retrieve all messages in the queue.
Returns
Vector of messages which can either be of type T or nullptr
inline function
std::vector< std::shared_ptr< ADatatype > > tryGetAll()
Try to retrieve all messages in the queue.
Returns
Vector of messages
inline function
std::vector< std::shared_ptr< T > > getAll()
Block until at least one message in the queue. Then return all messages from the queue.
Returns
Vector of messages which can either be of type T or nullptr
inline function
std::vector< std::shared_ptr< ADatatype > > getAll()
Block until at least one message in the queue. Then return all messages from the queue.
Returns
Vector of messages
inline function
std::vector< std::shared_ptr< T > > getAll(std::chrono::duration< Rep, Period > timeout, bool & hasTimedout)
Block for maximum timeout duration. Then return all messages from the queue.
Parameters
  • timeout: Maximum duration to block
  • hasTimedout: Outputs true if timeout occurred, false otherwise
Returns
Vector of messages which can either be of type T or nullptr
inline function
std::vector< std::shared_ptr< ADatatype > > getAll(std::chrono::duration< Rep, Period > timeout, bool & hasTimedout)
Block for maximum timeout duration. Then return all messages from the queue.
Parameters
  • timeout: Maximum duration to block
  • hasTimedout: Outputs true if timeout occurred, false otherwise
Returns
Vector of messages
function
void send(const std::shared_ptr< ADatatype > & msg)
Adds a message to the queue, which will be picked up and sent to the device. Can either block if 'blocking' behavior is true or overwrite oldest
Parameters
  • msg: Message to add to the queue
function
bool send(const std::shared_ptr< ADatatype > & msg, std::chrono::milliseconds timeout)
Adds message to the queue, which will be picked up and sent to the device. Can either block until timeout if 'blocking' behavior is true or overwrite oldest
Parameters
  • msg: Message to add to the queue
  • timeout: Maximum duration to block in milliseconds
function
bool send(const ADatatype & msg, std::chrono::milliseconds timeout)
Adds message to the queue, which will be picked up and sent to the device. Can either block until timeout if 'blocking' behavior is true or overwrite oldest
Parameters
  • msg: Message to add to the queue
  • timeout: Maximum duration to block in milliseconds
function
bool trySend(const std::shared_ptr< ADatatype > & msg)
Tries sending a message
Parameters
  • msg: message to send
class

dai::MessageQueue::QueueException

inline explicit function
QueueException(const std::string & message)
function
~QueueException()
class

dai::Node

#include Node.hppDerived by dai::NodeGroup, dai::ThreadedNode
using
Id = std::int64_t
Node identificator. Unique for every node on a single Pipeline.
variable
Id id
Id of node. Assigned after being placed on the pipeline.
variable
Id inputId
variable
Id outputId
variable
std::string alias
alias or name
function
Node(const Node &)
function
Node & operator=(const Node &)
function
Node(Node &&)
function
Node & operator=(Node &&)
function
std::string createUniqueInputName()
function
std::string createUniqueOutputName()
function
Pipeline getParentPipeline()
function
const Pipeline getParentPipeline()
inline function
std::string getAlias()
Get alias.
inline function
void setAlias(std::string alias)
Set alias.
function
const char * getName()
Retrieves nodes name.
inline function
void start()
Start node execution.
inline function
void wait()
Wait for node to finish execution.
inline function
void stop()
Stop node execution.
function
void stopPipeline()
function
void buildStage1()
Build stages;.
function
void buildStage2()
function
void buildStage3()
function
void postBuildStage()
function
std::vector< Output > getOutputs()
Retrieves all nodes outputs.
function
std::vector< Input > getInputs()
Retrieves all nodes inputs.
function
std::vector< Output * > getOutputRefs()
Retrieves reference to node outputs.
function
std::vector< const Output * > getOutputRefs()
Retrieves reference to node outputs.
function
std::vector< Input * > getInputRefs()
Retrieves reference to node inputs.
function
std::vector< const Input * > getInputRefs()
Retrieves reference to node inputs.
function
std::vector< OutputMap * > getOutputMapRefs()
Retrieves reference to node outputs.
function
std::vector< InputMap * > getInputMapRefs()
Retrieves reference to node inputs.
function
Output * getOutputRef(const std::string & name)
Retrieves reference to specific output.
function
Output * getOutputRef(const std::string & group, const std::string & name)
function
Input * getInputRef(const std::string & name)
Retrieves reference to specific input.
function
Input * getInputRef(const std::string & group, const std::string & name)
function
OutputMap * getOutputMapRef(const std::string & group)
Retrieves reference to specific output map.
function
InputMap * getInputMapRef(const std::string & group)
Retrieves reference to specific input map.
function
bool isSourceNode()
function
~Node()
function
const AssetManager & getAssetManager()
Get node AssetManager as a const reference.
function
AssetManager & getAssetManager()
Get node AssetManager as a reference.
function
std::vector< uint8_t > loadResource(const std::filesystem::path & uri)
Loads resource specified by URI and returns its data.
function
std::vector< uint8_t > moveResource(const std::filesystem::path & uri)
Moves the resource out.
inline function
std::shared_ptr< N > create()
Create and place Node to this Node.
function
void add(const std::shared_ptr< Node > & node)
Add existing node to nodeMap.
function
std::vector< std::shared_ptr< Node > > getAllNodes()
function
std::shared_ptr< const Node > getNode(Node::Id id)
function
std::shared_ptr< Node > getNode(Node::Id id)
function
void remove(const std::shared_ptr< Node > & node)
function
ConnectionMap getConnectionMap()
function
void link(const Node::Output & out, const Node::Input & in)
function
void unlink(const Node::Output & out, const Node::Input & in)
function
void link(std::shared_ptr< Node > in)
Get a reference to internal node map.
function
Node::Output * requestOutput(const Capability & capability, bool onHost)
function
std::vector< std::pair< Input &, std::shared_ptr< Capability > > > getRequiredInputs()
function
bool runOnHost()
Returns true or false whether the node should be run on host or not.
inline function
bool isBuiltInNode()
Returns whether this node is provided by depthai-core.
inline function
const NodeMap & getNodeMap()
inline function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
struct

dai::Node::Connection

#include Node.hpp
variable
Id outputId
variable
std::string outputName
variable
std::string outputGroup
variable
Id inputId
variable
std::string inputName
variable
std::string inputGroup
function
Connection(Output out, Input in)
function
Connection(const ConnectionInternal & c)
function
bool operator==(const Connection & rhs)
struct

dai::Node::ConnectionInternal

#include Node.hpp
variable
std::weak_ptr< Node > outputNode
variable
std::string outputName
variable
std::string outputGroup
variable
std::weak_ptr< Node > inputNode
variable
std::string inputName
variable
std::string inputGroup
variable
Output * out
variable
Input * in
function
ConnectionInternal(Output & out, Input & in)
function
bool operator==(const ConnectionInternal & rhs)
struct

dai::Node::ConnectionInternal::Hash

function
size_t operator()(const dai::Node::ConnectionInternal & obj)
struct

dai::Node::DatatypeHierarchy

variable
DatatypeEnum datatype
variable
bool descendants
inline function
DatatypeHierarchy(DatatypeEnum d, bool c)
class

dai::Node::Input

variable
std::vector< DatatypeHierarchy > possibleDatatypes
function
~Input()
inline explicit function
Input(Node & par, InputDescription desc, bool ref)
inline function
const Node & getParent()
Get the parent node
inline function
Node & getParent()
Get the parent node
inline function
Type getType()
Get type
function
std::string toString()
Input to string representation
function
void setWaitForMessage(bool waitForMessage)
Overrides default wait for message behavior. Applicable for nodes with multiple inputs. Specifies behavior whether to wait for this input when a Node processes certain data or not.
Parameters
  • waitForMessage: Whether to wait for message to arrive to this input or not
function
bool getWaitForMessage()
Get behavior whether to wait for this input when a Node processes certain data or not
Returns
Whether to wait for message to arrive to this input or not
function
std::vector< DatatypeHierarchy > getPossibleDatatypes()
Get possible datatypes that can be received
function
void setPossibleDatatypes(std::vector< DatatypeHierarchy > types)
Set possible datatypes that can be received
function
void setReusePreviousMessage(bool reusePreviousMessage)
Equivalent to setWaitForMessage but with inverted logic.
function
bool getReusePreviousMessage()
Equivalent to getWaitForMessage but with inverted logic.
function
void setGroup(std::string group)
Set group name for this input
function
std::string getGroup()
Get group name for this input
function
bool isConnected()
Check if this input is connected
function
std::shared_ptr< InputQueue > createInputQueue(unsigned int maxSize, bool blocking)
Create an shared pointer to an input queue that can be used to send messages to this input from onhost.
Parameters
  • maxSize: Maximum size of the input queue
  • blocking: Whether the input queue should block when full
Returns
std::shared_ptr<InputQueue>: shared pointer to an input queue
function
std::shared_ptr< dai::node::internal::XLinkInBridge > getXLinkBridge()
Get XLink bridge associated with this input (only valid for device inputs after pipeline build)
Returns
std::shared_ptr<dai::node::internal::XLinkInBridge>: pointer to the XLink bridge or nullptr if not applicable
function
std::shared_ptr< Device > getSourceDevice()
Get the device that produces the data arriving at this input, resolved at pipeline build.
Returns
The source device, or nullptr when the upstream node runs on the host. Throws if this input is connected to sources on more than one device.
enum

Type

enumerator
SReceiver
enumerator
MReceiver
struct

dai::Node::InputDescription

variable
std::string name
variable
std::string group
variable
bool blocking
variable
int queueSize
variable
std::vector< DatatypeHierarchy > types DEFAULT_TYPES
variable
bool waitForMessage
class

dai::Node::InputMap

#include Node.hpp
variable
std::string name
function
InputMap(Node & parent, InputDescription defaultInput)
function
InputMap(Node & parent, std::string name, InputDescription defaultInput)
function
Input & operator[](const std::string & key)
Create or modify an input.
function
Input & operator[](std::pair< std::string, std::string > groupKey)
Create or modify an input with specified group.
function
bool has(const std::string & key)
function
std::map< std::string, std::shared_ptr< Device > > getSourceDevices()
Get the source device of every input in this map, resolved at pipeline build.
Returns
Map of input name to source device; nullptr when the source runs on the host. Inputs created with a group are keyed "<group>/<name>".
class

dai::Node::Output

function
~Output()
inline function
Output(Node & par, OutputDescription desc, bool ref)
inline function
Node & getParent()
inline function
const Node & getParent()
function
std::string toString()
Output to string representation.
inline function
std::string getName()
Get name of the output
inline function
std::string getGroup()
Get group of the output
inline function
void setGroup(std::string group)
Set group name for this output
inline function
void setName(std::string name)
Set name for this output
inline function
Type getType()
Get type of the output
function
std::vector< DatatypeHierarchy > getPossibleDatatypes()
Get possible datatypes that can be sent
function
void setPossibleDatatypes(std::vector< DatatypeHierarchy > types)
Set possible datatypes that can be sent
function
bool isSamePipeline(const Input & in)
Check if this output and given input are on the same pipeline.
See also
canConnect for checking if connection is possible
Returns
True if output and input are on the same pipeline
function
bool canConnect(const Input & in)
Check if connection is possible
Parameters
Returns
True if connection is possible, false otherwise
function
std::vector< ConnectionInternal > getConnections()
Retrieve all connections from this output
Returns
Vector of connections
inline function
std::vector< QueueConnection > getQueueConnections()
Retrieve all queue connections from this output
Returns
Vector of queue connections
function
std::shared_ptr< dai::MessageQueue > createOutputQueue(unsigned int maxSize, bool blocking)
Construct and return a shared pointer to an output message queue.
Parameters
  • maxSize: Maximum size of the output queue
  • blocking: Whether the output queue should block when full
Returns
std::shared_ptr<dai::MessageQueue>: shared pointer to an output queue
function
void link(Input & in)
Link current output to input.Throws an error if this output cannot be linked to given input, or if they are already linked
Parameters
function
void link(std::shared_ptr< Node > in)
function
void unlink(Input & in)
Unlink a previously linked connectionThrows an error if not linked.
Parameters
  • in: Input from which to unlink from
function
void send(const std::shared_ptr< ADatatype > & msg)
Sends a Message to all connected inputs
Parameters
  • msg: Message to send to all connected inputs
function
bool trySend(const std::shared_ptr< ADatatype > & msg)
Try sending a message to all connected inputs
Parameters
  • msg: Message to send to all connected inputs
Returns
True if ALL connected inputs got the message, false otherwise
function
std::shared_ptr< dai::node::internal::XLinkOutBridge > getXLinkBridge()
Get XLink bridge associated with this output (only valid for device outputs after pipeline build)
Returns
std::shared_ptr<dai::node::internal::XLinkOutBridge>: pointer to the XLink bridge or nullptr if not applicable
struct

dai::Node::Output::QueueConnection

variable
Output * output
variable
std::shared_ptr< MessageQueue > queue
inline function
bool operator==(const QueueConnection & rhs)
enum

Type

enumerator
MSender
enumerator
SSender
struct

dai::Node::OutputDescription

variable
std::string name
variable
std::string group
variable
std::vector< DatatypeHierarchy > types DEFAULT_TYPES
class

dai::Node::OutputMap

#include Node.hpp
variable
std::string name
function
OutputMap(Node & parent, std::string name, const OutputDescription & defaultOutput, bool ref)
function
OutputMap(Node & parent, OutputDescription defaultOutput, bool ref)
function
Output & operator[](const std::string & key)
Create or modify an output.
function
Output & operator[](std::pair< std::string, std::string > groupKey)
Create or modify an output with specified group.
struct

dai::Node::PairHash

inline function
std::size_t operator()(const std::pair< T1, T2 > & pair)
class

dai::SourceNode

Derived by dai::node::Camera, dai::node::ColorCamera, dai::node::IMU, dai::node::MonoCamera
function
~SourceNode()
function
NodeRecordParams getNodeRecordParams()
function
Node::Output & getRecordOutput()
function
Node::Input & getReplayInput()
class

dai::NodeCRTP

variable
friend Derived
variable
friend Base
function
~NodeCRTP()
inline function
const char * getName()
inline function
bool isBuiltInNode()
struct

dai::NodeConnectionSchema

#include NodeConnectionSchema.hpp
variable
int64_t node1Id
variable
std::string node1OutputGroup
variable
std::string node1Output
variable
int64_t node2Id
variable
std::string node2InputGroup
variable
std::string node2Input
inline function
bool operator==(const NodeConnectionSchema & rhs)
class

dai::NodeGroup

function
NodeGroup()
function
~NodeGroup()
inline function
const char * getName()
Retrieves nodes name.
inline function
bool isBuiltInNode()
Returns whether this node is provided by depthai-core.
struct

dai::NodeIoInfo

#include NodeIoInfo.hpp
variable
std::string group
variable
std::string name
variable
Type type
variable
bool blocking
variable
int queueSize
variable
bool waitForMessage
variable
uint32_t id
enum

Type

enumerator
MSender
enumerator
SSender
enumerator
MReceiver
enumerator
SReceiver
struct

dai::NodeObjInfo

#include NodeObjInfo.hpp
variable
int64_t id
variable
int64_t parentId
variable
std::string name
variable
std::string alias
variable
std::string deviceId
variable
bool deviceNode
variable
bool builtInNode
variable
std::vector< std::uint8_t > properties
variable
LogLevel logLevel
variable
std::unordered_map< std::tuple< std::string, std::string >, NodeIoInfo, IoInfoKey > ioInfo
struct

dai::NodeObjInfo::IoInfoKey

inline function
std::size_t operator()(const std::tuple< std::string, std::string > & k)
class

dai::PipelineImpl

inline function
PipelineImpl(bool createImplicitDevice)
inline function
PipelineImpl(std::shared_ptr< Device > device)
function
PipelineImpl(const PipelineImpl &)
function
PipelineImpl & operator=(const PipelineImpl &)
function
PipelineImpl(PipelineImpl &&)
function
PipelineImpl & operator=(PipelineImpl &&)
function
~PipelineImpl()
class

dai::Pipeline

#include Pipeline.hpp
using
AutoCalibrationMode = PipelineAutoCalibrationMode
using
NodeConnectionMap = PipelineImpl::NodeConnectionMap
inline function
PipelineImpl * impl()
inline function
const PipelineImpl * impl()
inline function
std::vector< std::shared_ptr< Node > > getSourceNodes()
explicit function
Pipeline(bool createImplicitDevice)
Creates a pipeline
Parameters
  • createImplicitDevice: If true, creates a default device (default = true)
explicit function
Pipeline(std::shared_ptr< Device > device)
Creates a pipeline with specified device
explicit function
Pipeline(std::shared_ptr< PipelineImpl > pimpl)
Creates a pipeline with specified device
inline function
GlobalProperties getGlobalProperties()
Returns
Global properties of current pipeline
inline function
void setGlobalProperties(GlobalProperties globalProperties)
Sets global properties of pipeline
inline function
void setDefaultDeviceProperties(DeviceProperties deviceProperties)
Sets default device properties
inline function
void setDefaultDevicePropertiesRef(DeviceProperties * deviceProperties)
Sets default device properties reference. The properties should live at least as long as the pipeline.
inline function
std::optional< DeviceProperties > getDefaultDeviceProperties()
Gets a copy of default device properties. If pipeline is in host only mode, returns host properties, otherwise returns device properties
function
PipelineSchema getPipelineSchema(SerializationType type, bool includePipelineDebugging)
Returns
Pipeline schema
function
PipelineSchema getDevicePipelineSchema(SerializationType type, bool includePipelineDebugging)
Returns
Device pipeline schema (without host only nodes and connections)
inline function
void serialize(PipelineSchema & schema, Assets & assets, std::vector< std::uint8_t > & assetStorage)
inline function
nlohmann::json serializeToJson(bool includeAssests)
Returns whole pipeline represented as JSON.
inline function
std::shared_ptr< N > create(Args &&... args)
Creates and adds a node to the pipeline.Node is specified by template argument N
inline function
std::enable_if_t< std::is_base_of< DeviceNode, N >::value, std::shared_ptr< N > > create(std::shared_ptr< Device > device, Args &&... args)
Creates a device node on the specified device and adds it to the pipeline. The device becomes part of the pipeline on first use. Only device nodes can be created this way - creating a host node with a device is a compile-time error.
inline function
std::enable_if_t< std::is_base_of< DeviceNode, N >::value, std::shared_ptr< N > > createForDevice(std::shared_ptr< Device > device, Args &&... args)
Creates a device node on the specified device and adds it to the pipeline. Same as create(device, ...) - kept as an explicitly named alternative.
inline function
void add(std::shared_ptr< Node > node)
Adds an existing node to the pipeline
inline function
void remove(std::shared_ptr< Node > node)
Removes a node from pipeline.
inline function
std::vector< std::shared_ptr< Node > > getAllNodes()
Get a vector of all nodes.
inline function
std::shared_ptr< const Node > getNode(Node::Id id)
Get node with id if it exists, nullptr otherwise.
inline function
std::shared_ptr< Node > getNode(Node::Id id)
Get node with id if it exists, nullptr otherwise.
inline function
std::vector< Node::Connection > getConnections()
Get all connections.
inline function
NodeConnectionMap getConnectionMap()
inline function
const AssetManager & getAssetManager()
Get pipelines AssetManager as reference.
inline function
AssetManager & getAssetManager()
Get pipelines AssetManager as reference.
inline function
void setOpenVINOVersion(OpenVINO::Version version)
Set a specific OpenVINO version to use with this pipeline.
inline function
void setCalibrationData(CalibrationHandler calibrationDataHandler)
Sets the calibration in pipeline which overrides the calibration data in eeprom
Parameters
  • calibrationDataHandler: CalibrationHandler object which is loaded with calibration information.
inline function
CalibrationHandler getCalibrationData()
gets the calibration data which is set through pipeline
Returns
the calibrationHandler with calib data in the pipeline
inline function
bool isCalibrationDataAvailable()
check if calib data is available on the device
Returns
true - calib data is available
Returns
false - calib data is not available
inline function
std::optional< EepromData > getEepromData()
gets the eeprom data from the pipeline
Returns
eepromData from the the pipeline
inline function
void setEepromData(std::optional< EepromData > eepromData)
Sets the eeprom data in pipeline
Parameters
  • eepromData: EepromData object that is loaded in the pipeline.
inline function
void setMultiDeviceCalibration(std::vector< MultiDeviceExtrinsics > graph)
Sets the cross-device calibration graph shared by all devices in the pipeline.The graph is validated with beta::MultiDeviceCalibrationHandler. Before the pipeline is built it is only stored and travels to the devices with the pipeline schema. On a built pipeline it is additionally checked against every assigned device's local calibration and pushed to all assigned devices at runtime, so already streaming Camera and ToF nodes switch to the new graph.
Parameters
  • std::invalid_argument: when the graph structure is invalid
  • std::runtime_error: when a device's local calibration does not match the graph or a device rejects the update; devices updated before the failure are restored to the previous graph and the pipeline keeps the previous graph
Parameters
  • graph: Directed cross-device calibration edges.
inline function
std::optional< std::vector< MultiDeviceExtrinsics > > getMultiDeviceCalibration()
Gets the cross-device calibration graph from the pipeline
Returns
the graph when one is set, std::nullopt otherwise
inline function
void clearMultiDeviceCalibration()
Removes any cross-device calibration graph from the pipeline.On a built pipeline the removal is pushed to all assigned devices, which then publish their local calibration metadata again.
Parameters
  • std::runtime_error: when a device rejects the update
inline function
uint32_t getEepromId()
Gets the eeprom id from the pipeline
Returns
eeprom id from the pipeline
inline function
void setCameraTuningBlobPath(const fs::path & path)
Set a camera IQ (Image Quality) tuning blob, used for all cameras.
inline function
void setCameraTuningBlobPath(CameraBoardSocket socket, const fs::path & path)
Set a camera IQ (Image Quality) tuning blob, used for specific board socket.
inline function
void setXLinkChunkSize(int sizeBytes)
Set chunk size for splitting device-sent XLink packets, in bytes. A larger value could increase performance, with 0 disabling chunking. A negative value won't modify the device defaults - configured per protocol, currently 64*1024 for both USB and Ethernet.
inline function
void setSippBufferSize(int sizeBytes)
SIPP (Signal Image Processing Pipeline) internal memory pool. SIPP is a framework used to schedule HW filters, e.g. ISP, Warp, Median filter etc. Changing the size of this pool is meant for advanced use cases, pushing the limits of the HW. By default memory is allocated in high speed CMX memory. Setting to 0 will allocate in DDR 256 kilobytes. Units are bytes.
inline function
void setSippDmaBufferSize(int sizeBytes)
SIPP (Signal Image Processing Pipeline) internal DMA memory pool. SIPP is a framework used to schedule HW filters, e.g. ISP, Warp, Median filter etc. Changing the size of this pool is meant for advanced use cases, pushing the limits of the HW. Memory is allocated in high speed CMX memory Units are bytes.
inline function
void setBoardConfig(BoardConfig board)
Sets board configuration.
inline function
void setAutoCalibrationMode(AutoCalibrationMode mode)
Sets implicit automatic calibration policy for this pipeline.
inline function
AutoCalibrationMode getAutoCalibrationMode()
Gets implicit automatic calibration policy for this pipeline.
inline function
BoardConfig getBoardConfig()
Gets board configuration.
inline function
Device::Config getDeviceConfig()
Get device configuration needed for this pipeline.
inline function
bool isRunning()
inline function
bool isBuilt()
inline function
void build()
inline function
void buildDevice()
inline function
void start()
inline function
void wait()
inline function
void stop()
inline function
void processTasks(bool waitForTasks, double timeoutSeconds)
inline function
void run()
inline function
std::shared_ptr< Device > getDefaultDevice()
inline function
std::shared_ptr< const Device > getDefaultDevice()
function
std::shared_ptr< Device > addDevice(std::shared_ptr< Device > device)
Add a device to the pipeline. The first device added to a pipeline created without an implicit device is promoted to the default device (master), so nodes created without an explicit device run on it.
Parameters
  • device: Already constructed device to add
Returns
The added device
function
std::shared_ptr< Device > addDevice(const DeviceInfo & deviceInfo)
Construct a device from the given device info and add it to the pipeline.
Parameters
  • deviceInfo: Device info to construct the device from
Returns
The constructed device
function
std::shared_ptr< Device > addDevice(const std::string & idOrIpOrName)
Construct a device from a device id, IP address or name and add it to the pipeline.
Parameters
  • idOrIpOrName: Device id, IP address or name to construct the device from
Returns
The constructed device
function
std::vector< std::shared_ptr< Device > > getDevices()
Get all devices that are part of this pipeline - the default device (master) first, then the rest in registration order. Devices become part of the pipeline explicitly via addDevice or implicitly on first use by a node.
inline function
DeviceState getDeviceState(const std::shared_ptr< Device > & device)
Get the pipeline-level state of a device: RUNNING, DISCONNECTED, RECONNECTING or FAILED. Losing a device does not stop the pipeline (its streams go idle) unless it was the last device alive or a device consuming other devices' streams. See setStopOnDeviceLoss to stop on any device loss.
inline function
void setDeviceStateCallback(std::function< void(std::shared_ptr< Device >, DeviceState)> callback)
Set a callback invoked on every device state transition. The callback is invoked from the affected device's monitor thread; do not block in it and do not call pipeline stop/start from it directly.
inline function
void setStopOnDeviceLoss(bool stop)
Stop the pipeline when any device that runs a node is lost for good (strict mode). Off by default (permissive mode): the pipeline keeps running, the lost device's streams go idle and it stops only when the last device alive or a device consuming other devices' streams is lost.A device is lost for good when its state becomes FAILED - after the reconnection attempts are exhausted. To stop as soon as a device disconnects, disable reconnection on the devices (Device::setMaxReconnectionAttempts(0)). Can be changed while the pipeline runs.
Parameters
  • stop: True to stop the pipeline on any device loss
inline function
bool getStopOnDeviceLoss()
Get whether the pipeline stops when any device that runs a node is lost for good.
function
void setCameraTuningBlobPath(const std::shared_ptr< Device > & device, const fs::path & path)
Set a camera IQ (Image Quality) tuning blob for all cameras of the given pipeline device.
function
void setCameraTuningBlobPath(const std::shared_ptr< Device > & device, CameraBoardSocket socket, const fs::path & path)
Set a camera IQ (Image Quality) tuning blob for a specific board socket of the given pipeline device.
function
void setXLinkChunkSize(const std::shared_ptr< Device > & device, int sizeBytes)
Set chunk size for splitting device-sent XLink packets for the given pipeline device; see the no-device overload.
function
void setSippBufferSize(const std::shared_ptr< Device > & device, int sizeBytes)
Set the SIPP buffer size of the given pipeline device; see the no-device overload.
function
void setSippDmaBufferSize(const std::shared_ptr< Device > & device, int sizeBytes)
Set the SIPP DMA buffer size of the given pipeline device; see the no-device overload.
function
void setBoardConfig(const std::shared_ptr< Device > & device, const BoardConfig & board)
Sets the board configuration for the given pipeline device. Board configuration is applied when a device boots, so for an already connected device it only takes effect on flows that (re)boot with this pipeline's configuration.
function
BoardConfig getBoardConfig(const std::shared_ptr< Device > & device)
Gets the board configuration of the given pipeline device.
function
Device::Config getDeviceConfig(const std::shared_ptr< Device > & device)
Get device configuration needed for this pipeline, for the given pipeline device.
function
void setCalibrationData(const std::shared_ptr< Device > & device, const CalibrationHandler & calibrationDataHandler)
Sets the calibration of the given pipeline device, overriding the one in eeprom.
function
bool isCalibrationDataAvailable(const std::shared_ptr< Device > & device)
Check if calibration data is available on the given pipeline device.
function
CalibrationHandler getCalibrationData(const std::shared_ptr< Device > & device)
Gets the calibration data of the given pipeline device.
function
void setEepromData(const std::shared_ptr< Device > & device, const std::optional< EepromData > & eepromData)
Sets the eeprom data of the given pipeline device.
function
std::optional< EepromData > getEepromData(const std::shared_ptr< Device > & device)
Gets the eeprom data of the given pipeline device.
function
uint32_t getEepromId(const std::shared_ptr< Device > & device)
Gets the eeprom id of the given pipeline device.
function
void setDeviceProperties(const std::shared_ptr< Device > & device, const DeviceProperties & deviceProperties)
Sets device properties of the given pipeline device.
function
DeviceProperties getDeviceProperties(const std::shared_ptr< Device > & device)
Gets device properties of the given pipeline device.
inline function
std::string getTelemetryPipelineId()
inline function
void addTask(std::function< void()> task)
function
void enableHolisticRecord(const RecordConfig & config)
Record and Replay.
function
void enableHolisticReplay(const std::string & pathToRecording)
function
bool isHolisticRecordEnabled()
function
bool isHolisticReplayEnabled()
function
void enablePipelineDebugging(bool enable)
Pipeline debugging.
function
bool isPipelineDebuggingEnabled()
function
std::shared_ptr< MessageQueue > getPipelineStateOut()
function
std::shared_ptr< InputQueue > getPipelineStateRequest()
function
PipelineStateApi getPipelineState()
struct

dai::PipelineSchema

#include PipelineSchema.hpp
variable
std::vector< NodeConnectionSchema > connections
variable
GlobalProperties globalProperties
variable
std::unordered_map< int64_t, NodeObjInfo > nodes
variable
std::vector< std::pair< int64_t, int64_t > > bridges
class

dai::NodesStateApi

#include PipelineStateApi.hpp
inline explicit function
NodesStateApi(std::vector< Node::Id > nodeIds, std::shared_ptr< MessageQueue > pipelineStateOut, std::shared_ptr< InputQueue > pipelineStateRequest)
function
PipelineState summary()
function
PipelineState detailed()
function
std::unordered_map< Node::Id, std::unordered_map< std::string, NodeState::OutputQueueState > > outputs()
function
std::unordered_map< Node::Id, std::unordered_map< std::string, NodeState::InputQueueState > > inputs()
function
std::unordered_map< Node::Id, std::unordered_map< std::string, NodeState::Timing > > otherTimings()
class

dai::NodeStateApi

inline explicit function
NodeStateApi(Node::Id nodeId, std::shared_ptr< MessageQueue > pipelineStateOut, std::shared_ptr< InputQueue > pipelineStateRequest)
inline function
NodeState summary()
inline function
NodeState detailed()
inline function
std::unordered_map< std::string, NodeState::OutputQueueState > outputs()
inline function
std::unordered_map< std::string, NodeState::InputQueueState > inputs()
inline function
std::unordered_map< std::string, NodeState::Timing > otherTimings()
function
std::unordered_map< std::string, NodeState::OutputQueueState > outputs(const std::vector< std::string > & outputNames)
function
NodeState::OutputQueueState outputs(const std::string & outputName)
function
std::vector< NodeState::DurationEvent > events()
function
std::unordered_map< std::string, NodeState::InputQueueState > inputs(const std::vector< std::string > & inputNames)
function
NodeState::InputQueueState inputs(const std::string & inputName)
function
std::unordered_map< std::string, NodeState::Timing > otherTimings(const std::vector< std::string > & timingNames)
function
NodeState::Timing otherTimings(const std::string & timingName)
class

dai::PipelineStateApi

inline function
PipelineStateApi(std::shared_ptr< MessageQueue > pipelineStateOut, std::shared_ptr< InputQueue > pipelineStateRequest, const std::vector< std::shared_ptr< Node >> & allNodes)
inline function
inline function
NodesStateApi nodes(const std::vector< Node::Id > & nodeIds)
inline function
NodeStateApi nodes(Node::Id nodeId)
function
void stateAsync(std::function< void(const PipelineState &)> callback, const std::optional< PipelineEventAggregationConfig > & config)
class

dai::Subnode

inline function
Subnode(Node & parent, std::string alias)
inline function
T & operator*()
inline function
T * operator->()
class

dai::ThreadedNode

Derived by dai::DeviceNode, dai::node::ThreadedHostNode
variable
Output pipelineEventOutput
variable
spimpl::impl_ptr< Impl > pimpl
function
ThreadedNode()
function
~ThreadedNode()
inline function
void onStart()
Function called at the beginning of the start function. This function may be overridden by the user to perform any needed tasks prior to starting this node's main thread.
inline function
void onStop()
Function called at the end of the stop function. This function may be overridden by the user to perform any needed tasks directly after stopping this node's main thread.
function
void start()
Start node execution.
function
void wait()
Wait for node to finish execution.
function
void stop()
Stop node execution.
function
void run()
function
bool isRunning()
function
bool mainLoop()
function
void setLogLevel(dai::LogLevel level)
Sets the logging severity level for this node.
Parameters
  • level: Logging severity level
function
dai::LogLevel getLogLevel()
Gets the logging severity level for this node.
Returns
Logging severity level
function
utility::PipelineEventDispatcherInterface::BlockPipelineEvent inputBlockEvent(bool startNow)
Creates a scoped event that sends start and end events for the getting inputs state.
function
utility::PipelineEventDispatcherInterface::BlockPipelineEvent outputBlockEvent(bool startNow)
Creates a scoped event that sends start and end events for the sending outputs state.
function
utility::PipelineEventDispatcherInterface::BlockPipelineEvent blockEvent(PipelineEvent::Type type, const std::string & source, bool startNow)
Creates a scoped event that sends start and end events for a custom block event.
Parameters
  • type: Type of the event
  • source: Source name of the event
function
Node(const Node &)
function
Node(Node &&)
function
Node()
function
Node(bool conf)
struct

dai::TraceEvent

variable
Event event
variable
Status status
variable
uint32_t srcId
variable
uint32_t dstId
variable
Timestamp timestamp
enum

std::uint8_t Event

enumerator
SEND
enumerator
RECEIVE
enum

std::uint8_t Status

enumerator
START
enumerator
END
enumerator
TIMEOUT
class

dai::ADatatype

#include ADatatype.hppDerived by dai::Buffer
variable
std::shared_ptr< Memory > data
inline explicit function
ADatatype()
function
~ADatatype()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
class

dai::AlignConfig

#include AlignConfig.hpp
variable
uint16_t staticDepthPlane
Optional static depth plane to align to, in depth units, by default millimeters
function
AlignConfig()
function
~AlignConfig()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(AlignConfig, staticDepthPlane)
class

dai::AprilTagConfig

#include AprilTagConfig.hpp
variable
Family family
AprilTag family.
variable
std::int32_t quadDecimate
Detection of quads can be done on a lower-resolution image, improving speed at a cost of pose accuracy and a slight decrease in detection rate. Decoding the binary payload is still done at full resolution.
variable
float quadSigma
What Gaussian blur should be applied to the segmented image. Parameter is the standard deviation in pixels. Very noisy images benefit from non-zero values (e.g. 0.8).
variable
bool refineEdges
When non-zero, the edges of the each quad are adjusted to "snap to" strong gradients nearby. This is useful when decimation is employed, as it can increase the quality of the initial quad estimate substantially. Generally recommended to be on. Very computationally inexpensive. Option is ignored if quadDecimate = 1.
variable
float decodeSharpening
How much sharpening should be done to decoded images? This can help decode small tags but may or may not help in odd lighting conditions or low light conditions. The default value is 0.25.
variable
std::int32_t maxHammingDistance
Max number of error bits that should be corrected. Accepting large numbers of corrected errors leads to greatly increased false positive rates. As of this implementation, the detector cannot detect tags with a hamming distance greater than 2.
variable
QuadThresholds quadThresholds
AprilTag quad threshold parameters.
function
AprilTagConfig()
function
~AprilTagConfig()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
AprilTagConfig & setFamily(Family family)
Parameters
function
DEPTHAI_SERIALIZE(AprilTagConfig, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, family, quadDecimate, quadSigma, refineEdges, decodeSharpening, maxHammingDistance, quadThresholds)
struct

dai::AprilTagConfig::QuadThresholds

#include AprilTagConfig.hpp
variable
std::int32_t minClusterPixels
Reject quads containing too few pixels.
variable
std::int32_t maxNmaxima
How many corner candidates to consider when segmenting a group of pixels into a quad.
variable
float criticalDegree
Reject quads where pairs of edges have angles that are close to straight or close to 180 degrees. Zero means that no quads are rejected. (In degrees).
variable
float maxLineFitMse
When fitting lines to the contours, what is the maximum mean squared error allowed? This is useful in rejecting contours that are far from being quad shaped; rejecting these quads "early" saves expensive decoding processing.
variable
std::int32_t minWhiteBlackDiff
When we build our model of black & white pixels, we add an extra check that the white model must be (overall) brighter than the black model. How much brighter? (in pixel values: [0,255]).
variable
bool deglitch
Should the thresholded image be deglitched? Only useful for very noisy images
function
enum

std::int32_t Family

Supported AprilTag families.
enumerator
TAG_36H11
enumerator
TAG_36H10
enumerator
TAG_25H9
enumerator
TAG_16H5
enumerator
TAG_CIR21H7
enumerator
TAG_STAND41H12
struct

dai::AprilTag

#include AprilTags.hpp
variable
int id
The decoded ID of the tag
variable
int hamming
How many error bits were corrected? Note: accepting large numbers of corrected errors leads to greatly increased false positive rates. As of this implementation, the detector cannot detect tags with a hamming distance greater than 2.
variable
float decisionMargin
A measure of the quality of the binary decoding process; the average difference between the intensity of a data bit versus the decision threshold. Higher numbers roughly indicate better decodes. This is a reasonable measure of detection accuracy only for very small tags– not effective for larger tags (where we could have sampled anywhere within a bit cell and still gotten a good detection.
variable
Point2f topLeft
The detected top left coordinates.
variable
Point2f topRight
The detected top right coordinates.
variable
Point2f bottomRight
The detected bottom right coordinates.
variable
Point2f bottomLeft
The detected bottom left coordinates.
class

dai::AprilTags

#include AprilTags.hpp
variable
std::vector< AprilTag > aprilTags
variable
int64_t sequenceNum
variable
variable
Timestamp tsDevice
variable
std::optional< Timestamp > tsSystem
variable
std::optional< ImgTransformation > transformation
function
AprilTags()
Construct AprilTags message.
function
~AprilTags()
function
AprilTags transformTo(const ImgTransformation & target)
Returns a new AprilTags message with the tags transformed into the target image transformation.If the target transformation has a different coordinate system source (eg. different camera socket) then the remapping will be inaccurate due to the lack of depth information.
Parameters
  • target: Target image transformation.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(AprilTags, sequenceNum, ts, tsDevice, tsSystem, transformation, aprilTags)
struct

dai::AutoCalibrationConfig

#include AutoCalibrationConfig.hpp
variable
Mode mode
Calibration trigger mode (ON_START or CONTINUOUS).
variable
int sleepingTime
Seconds to sleep between calibration cycles in CONTINUOUS mode.
variable
double calibrationConfidenceThreshold
Minimum confidence score (0.0 to 1.0) required to apply a new calibration.
variable
double dataConfidenceThreshold
Minimum quality threshold (0.0 to 1.0) for input features to be used. A value below 0 selects the default based on the lens model.
variable
unsigned int maxIterations
Maximum number of optimization iterations per calibration cycle.
variable
unsigned int maxImagesPerRecalibration
Maximum number of images to collect for one recalibration event.
variable
int validationSetSize
Number of images used for validating the calibration result.
variable
bool flashCalibration
If true, saves successful calibration to non-volatile memory (EEPROM); otherwise, keeps in RAM only.
function
AutoCalibrationConfig()
inline function
AutoCalibrationConfig(Mode mode, int sleepingTime, double calibrationConfidence, double dataConfidence, unsigned int maxIter, unsigned int maxImg, int valSize, bool flash)
Full constructor for initializing auto-calibration parameters.
Parameters
  • mode: Calibration trigger mode (ON_START or CONTINUOUS).
  • sleepingTime: Time in seconds between calibration cycles.
  • calibrationConfidence: Threshold for accepting a new calibration result.
  • dataConfidence: Threshold for the quality of input data/features.
  • maxIter: Maximum number of optimization iterations.
  • maxImg: Maximum number of images to collect for a single recalibration.
  • valSize: Number of images used to validate the calibration result.
  • flash: Whether to save the resulting calibration to non-volatile memory.
function
~AutoCalibrationConfig()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
enum

int Mode

Defines when the auto-calibration process should be triggered.
enumerator
ON_START
Run calibration once upon pipeline startup.
enumerator
CONTINUOUS
Periodically run calibration while the pipeline is running.
class

dai::AutoCalibrationResult

#include AutoCalibrationResult.hpp
variable
double dataConfidence
Quality of input features used (0.0 to 1.0).
variable
double calibrationConfidence
Confidence in the final calibration result (0.0 to 1.0).
variable
bool passed
True if thresholds were met and calibration is valid.
variable
CalibrationHandler calibration
CalibrationHandler containing the resulting camera parameters.
function
AutoCalibrationResult()
inline function
AutoCalibrationResult(double dataConfidence, double calibrationConfidence, bool passed, CalibrationHandler calibration)
Full constructor for AutoCalibrationResult.
Parameters
  • dataConfidence: Confidence score of the input data used for calibration.
  • calibrationConfidence: Confidence score of the resulting calibration.
  • passed: Whether the calibration cycle met the required thresholds.
  • calibration: The actual calibration handler containing the new parameters.
function
~AutoCalibrationResult()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
class

dai::BenchmarkReport

#include BenchmarkReport.hpp
variable
float fps
variable
float timeTotal
variable
float numMessagesReceived
variable
float averageLatency
variable
std::vector< float > latencies
function
BenchmarkReport()
function
~BenchmarkReport()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(BenchmarkReport, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, fps, timeTotal, numMessagesReceived, averageLatency, latencies)
class

dai::Buffer

#include Buffer.hppDerived by dai::ImgDetectionsT< ImgDetection >, dai::ImgDetectionsT< SpatialImgDetection >, dai::AlignConfig, dai::AprilTagConfig, dai::AprilTags, dai::AutoCalibrationConfig, dai::AutoCalibrationResult, dai::BenchmarkReport, dai::CalibrationMetrics, dai::CalibrationQuality, dai::CameraControl, dai::CoverageData, dai::DetectionParserConfig, dai::DynamicCalibrationControl, dai::DynamicCalibrationResult, dai::EdgeDetectorConfig, dai::EncodedFrame, dai::FeatureTrackerConfig, dai::GPUStereoConfig, dai::GateControl, dai::IMUData, dai::ImageAlignConfig, dai::ImageFiltersConfig, dai::ImageManipConfig, dai::ImgAnnotations, dai::ImgDetectionsT< DetectionT >, dai::ImgFrame, dai::MapData, dai::MessageGroup, dai::NNData, dai::NeuralDepthConfig, dai::ObjectTrackerConfig, dai::PipelineEvent, dai::PipelineEventAggregationConfig, dai::PipelineState, dai::PointCloudConfig, dai::PointCloudData, dai::RGBDData, dai::SegmentationMask, dai::SegmentationParserConfig, dai::SpatialLocationCalculatorConfig, dai::SpatialLocationCalculatorData, dai::StereoDepthConfig, dai::SystemInformation, dai::SystemInformationRVC4, dai::ThermalConfig, dai::ToFConfig, dai::ToFDepthConfidenceFilterConfig, dai::TrackedFeatures, dai::Tracklets, dai::TransformData, dai::TransformableBuffer, dai::VppConfig, dai::beta::ClassificationSequenceParserConfig, dai::beta::Classifications, dai::beta::Clusters, dai::beta::FastSAMParserConfig, dai::beta::HRNetParserConfig, dai::beta::ImgDetectionsFilterConfig, dai::beta::Keypoints, dai::beta::Lines, dai::beta::MLSDParserConfig, dai::beta::MPPalmDetectionParserConfig, dai::beta::Map2D, dai::beta::MapOutputParserConfig, dai::beta::MultiDeviceCalibrationControl, dai::beta::MultiDeviceCalibrationResult, dai::beta::PPTextDetectionParserConfig, dai::beta::Predictions, dai::beta::RFDETRParserConfig, dai::beta::SCRFDParserConfig, dai::beta::SuperAnimalParserConfig, dai::beta::XFeatMonoParserConfig, dai::beta::XFeatStereoParserConfig, dai::beta::YuNetParserConfig
variable
int64_t sequenceNum
variable
variable
Timestamp tsDevice
variable
std::optional< Timestamp > tsSystem
function
Buffer()
function
Buffer(size_t size)
function
Buffer(long fd)
function
Buffer(long fd, size_t size)
function
~Buffer()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
span< uint8_t > getData()
Get non-owning reference to internal buffer.
Returns
Reference to internal buffer
function
span< const uint8_t > getData()
function
void setData(const std::vector< std::uint8_t > & data)
Parameters
  • data: Copies data to internal buffer
function
void setData(const long fd)
function
void setData(std::vector< std::uint8_t > && data)
Parameters
  • data: Moves data to internal buffer
function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestamp()
Retrieves timestamp related to dai::Clock::now()
function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestampDevice()
Retrieves timestamp directly captured from device's monotonic clock, not synchronized to host time. Used mostly for debugging
function
std::optional< std::chrono::time_point< std::chrono::system_clock, std::chrono::system_clock::duration > > getTimestampSystem()
Retrieves timestamp directly captured from device's system clock, that can be synchronized using PTP
function
void setTimestamp(std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > timestamp)
Sets image timestamp related to dai::Clock::now()
function
void setTimestampDevice(std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > timestamp)
Sets image timestamp related to dai::Clock::now()
function
void setTimestampSystem(std::optional< std::chrono::time_point< std::chrono::system_clock, std::chrono::system_clock::duration >> timestamp)
Sets optional system_clock timestamp (device system clock; may be PTP-synchronized).
function
int64_t getSequenceNum()
Retrieves image sequence number
function
void setSequenceNum(int64_t sequenceNum)
Sets image sequence number
function
void setBufferMetadataFrom(const Buffer * other)
Copies all metadata from another buffer
function
void setBufferMetadataFrom(const std::shared_ptr< Buffer > & other)
Copies all metadata from another buffer
function
span< const uint8_t > getRecordData()
function
dai::VisualizeType getVisualizationMessage()
Get visualizable message
Returns
Visualizable message, either ImgFrame, ImgAnnotations or std::monostate (None)
function
DEPTHAI_SERIALIZE(Buffer, sequenceNum, ts, tsDevice, tsSystem)
class

dai::CameraControl

#include CameraControl.hpp
variable
uint64_t cmdMask
variable
AutoFocusMode autoFocusMode
variable
uint8_t lensPosition
Lens/VCM position, range: 0..255. Used with autoFocusMode = OFF. With current IMX378 modules:
  • max 255: macro focus, at 8cm distance
  • infinite focus at about 120..130 (may vary from module to module)
  • lower values lead to out-of-focus (lens too close to the sensor array)
variable
float lensPositionRaw
variable
uint8_t lensPosAutoInfinity
variable
uint8_t lensPosAutoMacro
variable
variable
RegionParams aeRegion
variable
RegionParams afRegion
variable
variable
SceneMode sceneMode
variable
AntiBandingMode antiBandingMode
variable
CaptureIntent captureIntent
variable
ControlMode controlMode
variable
EffectMode effectMode
variable
FrameSyncMode frameSyncMode
variable
StrobeConfig strobeConfig
variable
StrobeTimings strobeTimings
variable
uint32_t aeMaxExposureTimeUs
variable
uint32_t aeMaxISO
variable
bool aeLockMode
variable
bool awbLockMode
variable
int8_t expCompensation
variable
int8_t brightness
variable
int8_t contrast
variable
int8_t saturation
variable
uint8_t sharpness
variable
uint8_t lumaDenoise
variable
uint8_t chromaDenoise
variable
uint16_t wbColorTemp
variable
uint8_t lowPowerNumFramesBurst
variable
uint8_t lowPowerNumFramesDiscard
variable
bool enableHdr
variable
std::vector< std::pair< std::string, std::string > > miscControls
function
CameraControl()
function
CameraControl & setCaptureStill(bool capture)
Set a command to capture a still image
function
CameraControl & setStartStreaming()
Set a command to start streaming
function
CameraControl & setStopStreaming()
Set a command to stop streaming
function
CameraControl & setExternalTrigger(int numFramesBurst, int numFramesDiscard)
Set a command to enable external trigger snapshot modeA rising edge on the sensor FSIN pin will make it capture a sequence of numFramesBurst frames. First numFramesDiscard will be skipped as configured (can be set to 0 as well), as they may have degraded quality
function
CameraControl & setFrameSyncMode(FrameSyncMode mode)
Set the frame sync mode for continuous streaming operation mode, translating to how the camera pin FSIN/FSYNC is used: auto/input/output/disabled
function
CameraControl & setStrobeSensor(int activeLevel)
Enable STROBE output on sensor pin, optionally configuring the polarity. Note: for many sensors the polarity is high-active and not configurable
function
CameraControl & setStrobeExternal(int gpioNumber, int activeLevel)
Enable STROBE output driven by a MyriadX GPIO, optionally configuring the polarity This normally requires a FSIN/FSYNC/trigger input for MyriadX (usually GPIO 41), to generate timings
function
CameraControl & setStrobeDisable()
Disable STROBE output
function
CameraControl & setAutoFocusMode(AutoFocusMode mode)
Set a command to specify autofocus mode. Default CONTINUOUS_VIDEO
function
CameraControl & setAutoFocusTrigger()
Set a command to trigger autofocus
function
CameraControl & setAutoFocusLensRange(int infinityPosition, int macroPosition)
Set autofocus lens range, infinityPosition < macroPosition, valid values 0..255. May help to improve autofocus in case the lens adjustment is not typical/tuned
function
CameraControl & setAutoFocusRegion(uint16_t startX, uint16_t startY, uint16_t width, uint16_t height)
Set a command to specify focus region in pixels. Note: the region should be mapped to the configured sensor resolution, before ISP scaling
Parameters
  • startX: X coordinate of top left corner of region
  • startY: Y coordinate of top left corner of region
  • width: Region width
  • height: Region height
function
CameraControl & setManualFocus(uint8_t lensPosition)
Set a command to specify manual focus position
Parameters
  • lensPosition: specify lens position 0..255
function
CameraControl & setManualFocusRaw(float lensPositionRaw)
Set a command to specify manual focus position (more precise control).
Parameters
  • lensPositionRaw: specify lens position 0.0f .. 1.0f
Returns
function
CameraControl & setAutoExposureEnable()
Set a command to enable auto exposure
function
CameraControl & setAutoExposureLock(bool lock)
Set a command to stop the auto-exposure algorithm. The latest AE sensor configuration is kept.
Parameters
  • lock: Auto exposure lock mode enabled or disabled
function
CameraControl & setAutoExposureRegion(uint16_t startX, uint16_t startY, uint16_t width, uint16_t height)
Set a command to specify auto exposure region in pixels. Note: the region should be mapped to the configured sensor resolution, before ISP scaling
Parameters
  • startX: X coordinate of top left corner of region
  • startY: Y coordinate of top left corner of region
  • width: Region width
  • height: Region height
function
CameraControl & setAutoExposureCompensation(int compensation)
Set a command to specify auto exposure compensation. This modifies the brightness target with positive numbers making the image brighter and negative numbers making the image darker.
Parameters
  • compensation: Compensation value between -9..9, default 0
function
CameraControl & setAutoExposureLimit(uint32_t maxExposureTimeUs)
Set a command to specify the maximum exposure time limit for auto-exposure. By default the AE algorithm prioritizes increasing exposure over ISO, up to around frame-time (subject to further limits imposed by anti-banding)
Parameters
  • maxExposureTimeUs: Maximum exposure time in microseconds
function
CameraControl & setAutoExposureLimit(std::chrono::microseconds maxExposureTime)
Set a command to specify the maximum exposure time limit for auto-exposure. By default the AE algorithm prioritizes increasing exposure over ISO, up to around frame-time (subject to further limits imposed by anti-banding)
Parameters
  • maxExposureTime: Maximum exposure time
function
CameraControl & setAutoExposureMaxISO(uint32_t aeMaxISO)
Set a command to specify the maximum ISO sensitivity limit for auto-exposure. This limits the AE algorithm from increasing sensitivity beyond a certain point and can help to reduce noise in low-light conditions.
Parameters
  • aeMaxISO: Maximum ISO
function
CameraControl & setAntiBandingMode(AntiBandingMode mode)
Set a command to specify anti-banding mode. Anti-banding / anti-flicker works in auto-exposure mode, by controlling the exposure time to be applied in multiples of half the mains period, for example in multiple of 10ms for 50Hz (period 20ms) AC-powered illumination sources.If the scene would be too bright for the smallest exposure step (10ms in the example, with ISO at a minimum of 100), anti-banding is not effective.
Parameters
  • mode: Anti-banding mode to use. Default: MAINS_50_HZ
function
CameraControl & setManualExposure(uint32_t exposureTimeUs, uint32_t sensitivityIso)
Set a command to manually specify exposure
Parameters
  • exposureTimeUs: Exposure time in microseconds
  • sensitivityIso: Sensitivity as ISO value, usual range 100..1600
function
CameraControl & setManualExposure(std::chrono::microseconds exposureTime, uint32_t sensitivityIso)
Set a command to manually specify exposure
Parameters
  • exposureTime: Exposure time
  • sensitivityIso: Sensitivity as ISO value, usual range 100..1600
function
CameraControl & setAutoWhiteBalanceMode(AutoWhiteBalanceMode mode)
Set a command to specify auto white balance mode
Parameters
  • mode: Auto white balance mode to use. Default AUTO
function
CameraControl & setAutoWhiteBalanceLock(bool lock)
Set a command to specify auto white balance lock
Parameters
  • lock: Auto white balance lock mode enabled or disabled
function
CameraControl & setManualWhiteBalance(int colorTemperatureK)
Set a command to manually specify white-balance color correction
Parameters
  • colorTemperatureK: Light source color temperature in kelvins, range 1000..12000
function
CameraControl & setBrightness(int value)
Set a command to adjust image brightness
Parameters
  • value: Brightness, range -10..10, default 0
function
CameraControl & setContrast(int value)
Set a command to adjust image contrast
Parameters
  • value: Contrast, range -10..10, default 0
function
CameraControl & setSaturation(int value)
Set a command to adjust image saturation
Parameters
  • value: Saturation, range -10..10, default 0
function
CameraControl & setSharpness(int value)
Set a command to adjust image sharpness
Parameters
  • value: Sharpness, range 0..4, default 1
function
CameraControl & setLumaDenoise(int value)
Set a command to adjust luma denoise amount
Parameters
  • value: Luma denoise amount, range 0..4, default 1
function
CameraControl & setChromaDenoise(int value)
Set a command to adjust chroma denoise amount
Parameters
  • value: Chroma denoise amount, range 0..4, default 1
function
CameraControl & setSceneMode(SceneMode mode)
Set a command to specify scene mode
Parameters
  • mode: Scene mode
function
CameraControl & setEffectMode(EffectMode mode)
Set a command to specify effect mode
Parameters
  • mode: Effect mode
function
CameraControl & setMisc(std::string control, std::string value)
Set a miscellaneous control. The controls set by this function get appended to a list, processed after the standard controls
Parameters
  • control: Control name
  • value: Value as a string
function
CameraControl & setMisc(const std::string & control, int value)
Set a miscellaneous control. The controls set by this function get appended to a list, processed after the standard controls
Parameters
  • control: Control name
  • value: Value as an integer number
function
CameraControl & setMisc(const std::string & control, float value)
Set a miscellaneous control. The controls set by this function get appended to a list, processed after the standard controls
Parameters
  • control: Control name
  • value: Value as a floating point number
function
void clearMiscControls()
Clear the list of miscellaneous controls set by setControl
function
std::vector< std::pair< std::string, std::string > > getMiscControls()
Get the list of miscellaneous controls set by setControl
Returns
A list of <key, value> pairs as strings
function
CameraControl & setControlMode(ControlMode mode)
Set a command to specify control mode
Parameters
  • mode: Control mode
function
CameraControl & setHdr(bool enable)
Whether or not to enable HDR (High Dynamic Range) mode
Parameters
  • enable: True to enable HDR mode, false to disable
function
CameraControl & setCaptureIntent(CaptureIntent mode)
Set a command to specify capture intent mode
Parameters
  • mode: Capture intent mode
function
bool getCaptureStill()
Check whether command to capture a still is set
Returns
True if capture still command is set
function
std::chrono::microseconds getExposureTime()
Retrieves exposure time
function
int getSensitivity()
Retrieves sensitivity, as an ISO value
function
int getLensPosition()
Retrieves lens position, range 0..255. Returns -1 if not available
function
bool getHdr()
Whether or not HDR (High Dynamic Range) mode is enabled
Returns
True if HDR mode is enabled, false otherwise
inline function
void setCommand(Command cmd, bool value)
inline function
void clearCommand(Command cmd)
inline function
bool getCommand(Command cmd)
function
~CameraControl()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(CameraControl, cmdMask, autoFocusMode, lensPosition, lensPositionRaw, lensPosAutoInfinity, lensPosAutoMacro, expManual, aeRegion, afRegion, awbMode, sceneMode, antiBandingMode, aeLockMode, awbLockMode, captureIntent, controlMode, effectMode, frameSyncMode, strobeConfig, strobeTimings, aeMaxExposureTimeUs, aeMaxISO, expCompensation, brightness, contrast, saturation, sharpness, lumaDenoise, chromaDenoise, wbColorTemp, lowPowerNumFramesBurst, lowPowerNumFramesDiscard, enableHdr, miscControls)
function
float getLensPositionRaw()
Retrieves lens position, range 0.0f..1.0f.
struct

dai::CameraControl::ManualExposureParams

variable
uint32_t exposureTimeUs
variable
uint32_t sensitivityIso
variable
uint32_t frameDurationUs
function
DEPTHAI_SERIALIZE(ManualExposureParams, exposureTimeUs, sensitivityIso, frameDurationUs)
struct

dai::CameraControl::RegionParams

variable
uint16_t x
variable
uint16_t y
variable
uint16_t width
variable
uint16_t height
variable
uint32_t priority
function
DEPTHAI_SERIALIZE(RegionParams, x, y, width, height, priority)
struct

dai::CameraControl::StrobeConfig

variable
uint8_t enable
Enable strobe output.
variable
uint8_t activeLevel
1 for normal polarity (high-active), 0 otherwise
variable
int8_t gpioNumber
GPIO number to drive, or -1 if sensor driven.
function
DEPTHAI_SERIALIZE(StrobeConfig, enable, activeLevel, gpioNumber)
struct

dai::CameraControl::StrobeTimings

variable
int32_t exposureBeginOffsetUs
Start offset in microseconds, relative to exposure window.
variable
int32_t exposureEndOffsetUs
End offset in microseconds, relative to exposure window.
variable
uint32_t durationUs
Fixed duration in microseconds. If set (non-zero), overrides exposureEndOffsetUs
function
enum

uint8_t Command

enumerator
START_STREAM
enumerator
STOP_STREAM
enumerator
STILL_CAPTURE
enumerator
MOVE_LENS
enumerator
AF_TRIGGER
enumerator
AE_MANUAL
enumerator
AE_AUTO
enumerator
AWB_MODE
enumerator
SCENE_MODE
enumerator
ANTIBANDING_MODE
enumerator
EXPOSURE_COMPENSATION
enumerator
AE_LOCK
enumerator
AE_TARGET_FPS_RANGE
enumerator
AWB_LOCK
enumerator
CAPTURE_INTENT
enumerator
CONTROL_MODE
enumerator
FRAME_DURATION
enumerator
SENSITIVITY
enumerator
EFFECT_MODE
enumerator
AF_MODE
enumerator
NOISE_REDUCTION_STRENGTH
enumerator
SATURATION
enumerator
BRIGHTNESS
enumerator
STREAM_FORMAT
enumerator
RESOLUTION
enumerator
SHARPNESS
enumerator
CUSTOM_USECASE
enumerator
CUSTOM_CAPT_MODE
enumerator
CUSTOM_EXP_BRACKETS
enumerator
CUSTOM_CAPTURE
enumerator
CONTRAST
enumerator
AE_REGION
enumerator
AF_REGION
enumerator
LUMA_DENOISE
enumerator
CHROMA_DENOISE
enumerator
WB_COLOR_TEMP
enumerator
EXTERNAL_TRIGGER
enumerator
AF_LENS_RANGE
enumerator
FRAME_SYNC
enumerator
STROBE_CONFIG
enumerator
STROBE_TIMINGS
enumerator
MOVE_LENS_RAW
enumerator
HDR
enumerator
AE_MAX_ISO
enum

uint8_t AutoFocusMode

enumerator
OFF
Autofocus disabled. Suitable for manual focus
enumerator
AUTO
Basic automatic focus mode. In this mode, the lens does not move unless the autofocus trigger action is called.
enumerator
MACRO
Close-up focusing mode - this mode is optimized for focusing on objects very close to the camera.
enumerator
CONTINUOUS_VIDEO
In this mode, the AF algorithm modifies the lens position continually to attempt to provide a constantly-in-focus image stream. The focusing behavior should be suitable for good quality video recording; typically this means slower focus movement and no overshoots.
enumerator
CONTINUOUS_PICTURE
In this mode, the AF algorithm modifies the lens position continually to attempt to provide a constantly-in-focus image stream. The focusing behavior should be suitable for still image capture; typically this means focusing as fast as possible
enumerator
EDOF
Extended depth of field (digital focus) mode. The camera device will produce images with an extended depth of field automatically. AF triggers are ignored.
enum

uint8_t AutoWhiteBalanceMode

enumerator
OFF
The camera device's auto-white balance routine is disabled.
enumerator
AUTO
The camera device's auto-white balance routine is active.
enumerator
INCANDESCENT
The camera device's auto-white balance routine is disabled; the camera device uses incandescent light as the assumed scene illumination for white balance.
enumerator
FLUORESCENT
The camera device's auto-white balance routine is disabled; the camera device uses fluorescent light as the assumed scene illumination for white balance.
enumerator
WARM_FLUORESCENT
The camera device's auto-white balance routine is disabled; the camera device uses warm fluorescent light as the assumed scene illumination for white balance.
enumerator
DAYLIGHT
The camera device's auto-white balance routine is disabled; the camera device uses daylight light as the assumed scene illumination for white balance.
enumerator
CLOUDY_DAYLIGHT
The camera device's auto-white balance routine is disabled; the camera device uses cloudy daylight light as the assumed scene illumination for white balance.
enumerator
TWILIGHT
The camera device's auto-white balance routine is disabled; the camera device uses twilight light as the assumed scene illumination for white balance.
enumerator
SHADE
The camera device's auto-white balance routine is disabled; the camera device uses shade light as the assumed scene illumination for white balance.
enum

uint8_t SceneMode

enumerator
UNSUPPORTED
Indicates that no scene modes are set for a given capture request.
enumerator
FACE_PRIORITY
If face detection support exists, use face detection data for auto-focus, auto-white balance, and auto-exposure routines.
enumerator
ACTION
Optimized for photos of quickly moving objects. Similar to SPORTS scene mode.
enumerator
PORTRAIT
Optimized for still photos of people.
enumerator
LANDSCAPE
Optimized for photos of distant macroscopic objects.
enumerator
NIGHT
Optimized for low-light settings.
enumerator
NIGHT_PORTRAIT
Optimized for still photos of people in low-light settings.
enumerator
THEATRE
Optimized for dim, indoor settings where flash must remain off.
enumerator
BEACH
Optimized for bright, outdoor beach settings.
enumerator
SNOW
Optimized for bright, outdoor settings containing snow.
enumerator
SUNSET
Optimized for scenes of the setting sun.
enumerator
STEADYPHOTO
Optimized to avoid blurry photos due to small amounts of device motion (for example: due to hand shake).
enumerator
FIREWORKS
Optimized for nighttime photos of fireworks.
enumerator
SPORTS
Optimized for photos of quickly moving people.
enumerator
PARTY
Optimized for dim, indoor settings with multiple moving people.
enumerator
CANDLELIGHT
Optimized for dim settings where the main light source is a candle.
enumerator
BARCODE
Optimized for accurately capturing a photo of barcode for use by camera applications that wish to read the barcode value.
enum

uint8_t AntiBandingMode

enumerator
OFF
The camera device will not adjust exposure duration to avoid banding problems.
enumerator
MAINS_50_HZ
The camera device will adjust exposure duration to avoid banding problems with 50Hz illumination sources.
enumerator
MAINS_60_HZ
The camera device will adjust exposure duration to avoid banding problems with 60Hz illumination sources.
enumerator
AUTO
The camera device will automatically adapt its antibanding routine to the current illumination condition. This is the default mode if AUTO is available on given camera device.
enum

uint8_t CaptureIntent

enumerator
CUSTOM
The goal of this request doesn't fall into the other categories. The camera device will default to preview-like behavior.
enumerator
PREVIEW
This request is for a preview-like use case.
enumerator
STILL_CAPTURE
This request is for a still capture-type use case.
enumerator
VIDEO_RECORD
This request is for a video recording use case.
enumerator
VIDEO_SNAPSHOT
This request is for a video snapshot (still image while recording video) use case. The camera device should take the highest-quality image possible (given the other settings) without disrupting the frame rate of video recording.
enumerator
ZERO_SHUTTER_LAG
This request is for a ZSL usecase; the application will stream full-resolution images and reprocess one or several later for a final capture.
enum

uint8_t ControlMode

enumerator
OFF
Full application control of pipeline. All control by the device's metering and focusing (3A) routines is disabled.
enumerator
AUTO
Use settings for each individual 3A routine. Manual control of capture parameters is disabled.
enumerator
USE_SCENE_MODE
Use a specific scene mode. Enabling this disables Auto-Exposure, AWB and AF controls;
enum

uint8_t EffectMode

enumerator
OFF
No color effect will be applied.
enumerator
MONO
A "monocolor" effect where the image is mapped into a single color. This will typically be grayscale.
enumerator
NEGATIVE
A "photo-negative" effect where the image's colors are inverted.
enumerator
SOLARIZE
A "solarisation" effect (Sabattier effect) where the image is wholly or partially reversed in tone.
enumerator
SEPIA
A "sepia" effect where the image is mapped into warm gray, red, and brown tones.
enumerator
POSTERIZE
A "posterization" effect where the image uses discrete regions of tone rather than a continuous gradient of tones.
enumerator
WHITEBOARD
A "whiteboard" effect where the image is typically displayed as regions of white, with black or grey details.
enumerator
BLACKBOARD
A "blackboard" effect where the image is typically displayed as regions of black, with white or grey details.
enumerator
AQUA
An "aqua" effect where a blue hue is added to the image.
enum

int8_t FrameSyncMode

enumerator
AUTO
enumerator
OFF
enumerator
OUTPUT
enumerator
INPUT
enumerator
TIME_PTP
class

dai::DetectionParserConfig

#include DetectionParserConfig.hpp
variable
float confidenceThreshold
Minimum detection confidence. Default matches DetectionParser's startup threshold.
variable
float iouThreshold
IoU threshold for YOLO non-maximum suppression. Not used by Mobilenet-SSD or end-to-end YOLO models.
function
DetectionParserConfig()
Construct a detection parser configuration message.
function
~DetectionParserConfig()
function
void setConfidenceThreshold(float threshold)
Set the minimum detection confidence.
function
float getConfidenceThreshold()
Get the minimum detection confidence.
function
void setIouThreshold(float threshold)
Set the IoU threshold for non-maximum suppression.
function
float getIouThreshold()
Get the IoU threshold for non-maximum suppression.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(DetectionParserConfig, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, confidenceThreshold, iouThreshold)
class

dai::DynamicCalibrationControl

#include DynamicCalibrationControl.hpp
using
Command = std::variant< std::monostate, Commands::Calibrate, Commands::CalibrationQuality, Commands::StartCalibration, Commands::StopCalibration, Commands::LoadImage, Commands::ApplyCalibration, Commands::ResetData, Commands::SetPerformanceMode, Commands::ComputeCalibrationMetrics >
Variant type representing a single calibration command. Only one command may be active at any time. If no command is present, the variant contains std::monostate.
variable
Command command
inline function
DynamicCalibrationControl()
inline explicit function
DynamicCalibrationControl(Command cmd)
function
~DynamicCalibrationControl()
inline function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
struct

dai::DynamicCalibrationControl::Commands

#include DynamicCalibrationControl.hpp
struct

dai::DynamicCalibrationControl::Commands::ApplyCalibration

#include DynamicCalibrationControl.hpp
variable
CalibrationHandler calibration
Calibration data to apply.
variable
bool flash
function
ApplyCalibration()
inline explicit function
ApplyCalibration(const CalibrationHandler & calibration, bool flash)
function
DEPTHAI_SERIALIZE(ApplyCalibration, calibration, flash)
struct

dai::DynamicCalibrationControl::Commands::Calibrate

#include DynamicCalibrationControl.hpp
variable
bool force
Force calibration even when unnecessary.
variable
bool keepCameraCenters
Keep the position of the cameras.
inline explicit function
Calibrate(bool force, bool keepCameraCenters)
function
DEPTHAI_SERIALIZE(Calibrate, force, keepCameraCenters)
struct

dai::DynamicCalibrationControl::Commands::CalibrationQuality

#include DynamicCalibrationControl.hpp
variable
bool force
Force check even if previous quality is valid.
inline explicit function
CalibrationQuality(bool force)
function
DEPTHAI_SERIALIZE(CalibrationQuality, force)
struct

dai::DynamicCalibrationControl::Commands::ComputeCalibrationMetrics

#include DynamicCalibrationControl.hpp
variable
inline explicit function
ComputeCalibrationMetrics(dai::CalibrationHandler & calibration)
function
DEPTHAI_SERIALIZE(ComputeCalibrationMetrics, calibration)
struct

dai::DynamicCalibrationControl::Commands::LoadImage

#include DynamicCalibrationControl.hpp
struct

dai::DynamicCalibrationControl::Commands::ResetData

#include DynamicCalibrationControl.hpp
struct

dai::DynamicCalibrationControl::Commands::SetPerformanceMode

#include DynamicCalibrationControl.hpp
variable
PerformanceMode performanceMode
Desired performance mode.
inline function
SetPerformanceMode()
inline explicit function
SetPerformanceMode(PerformanceMode performanceMode)
function
DEPTHAI_SERIALIZE(SetPerformanceMode, performanceMode)
struct

dai::DynamicCalibrationControl::Commands::StartCalibration

#include DynamicCalibrationControl.hpp
variable
float loadImagePeriod
Seconds between image loads.
variable
float calibrationPeriod
Seconds between calibration cycles.
variable
bool keepCameraCenters
Keep the position of the cameras.
inline explicit function
StartCalibration(float loadImagePeriod, float calibrationPeriod, bool keepCameraCenters)
function
struct

dai::DynamicCalibrationControl::Commands::StopCalibration

#include DynamicCalibrationControl.hpp
enum

int PerformanceMode

Performance mode for Dynamic Calibration. These modes influence how aggressively calibration and quality checks are performed on the device.
enumerator
DEFAULT
Default behavior (balance quality and speed)
enumerator
STATIC_SCENERY
Optimized for scenes with little or no motion.
enumerator
OPTIMIZE_SPEED
Favor faster processing at possible quality trade-off.
enumerator
OPTIMIZE_PERFORMANCE
Favor accuracy even at reduced speed.
enumerator
SKIP_CHECKS
Skip quality checks; force calibration actions.
enumerator
RELAXED_COVERAGE
Allow lower coverage requirements before calibration actions.
struct

dai::CoverageData

#include DynamicCalibrationResults.hpp
function
CoverageData()
function
~CoverageData()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
Serialize CoverageData to buffer.
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
struct

dai::CalibrationQuality

#include DynamicCalibrationResults.hpp
variable
std::optional< Data > qualityData
Optional quality metrics.
variable
std::string info
Human-readable result description.
function
CalibrationQuality()
function
~CalibrationQuality()
inline function
CalibrationQuality(Data qualityData, std::string info)
Construct a CalibrationQuality message with data.
Parameters
  • qualityData: Metrics describing the quality difference.
  • info: Informational text describing the result.
inline function
CalibrationQuality(std::string info)
Construct a CalibrationQuality message without metric data.
Parameters
  • info: Informational text describing the result.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(CalibrationQuality, qualityData, info)
struct

dai::CalibrationQuality::Data

#include DynamicCalibrationResults.hpp
variable
std::array< float, 3 > rotationChange
DeprecatedRotation difference between old and new extrinsics (degrees).
variable
std::vector< double > depthErrorDifference
DeprecatedPredicted relative depth error difference between current and new calibration. Reported at reference distances [1m, 2m, 5m, 10m]. Units: percent [%].
variable
float sampsonErrorCurrent
Sampson error of currently installed calibration.
variable
float sampsonErrorNew
Estimated new Sampson error if the new calibration is applied.
variable
std::map< std::pair< CameraBoardSocket, CameraBoardSocket >, RotationChangePerAxis > pairwiseRotationDifference
Pairwise per-axis rotation deltas keyed by camera socket pairs.
function
struct

dai::CalibrationMetrics

#include DynamicCalibrationResults.hpp
variable
double calibrationConfidence
Confidence score of the computed calibration. ** A normalized value between 0.0 and 1.0 indicating how much you can trust the resulting calibration.
variable
double dataConfidence
Quality score of the input data. ** A normalized value between 0.0 and 1.0 indicating how much you can trust the data.
inline function
CalibrationMetrics()
function
~CalibrationMetrics()
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
function
struct

dai::DynamicCalibrationResult

#include DynamicCalibrationResults.hpp
variable
std::optional< Data > calibrationData
Optional calibration result data.
variable
std::string info
Informational result message.
function
DynamicCalibrationResult()
function
~DynamicCalibrationResult()
inline function
DynamicCalibrationResult(const Data & data, std::string information)
Construct result including calibration data.
inline function
DynamicCalibrationResult(std::string information)
Construct result containing only info text.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
struct

dai::DynamicCalibrationResult::Data

#include DynamicCalibrationResults.hpp
variable
dai::CalibrationHandler newCalibration
Calibration produced by dynamic calibration.
variable
dai::CalibrationHandler currentCalibration
Calibration present before dynamic calibration.
variable
CalibrationQuality::Data calibrationDifference
Per-metric comparison of new vs old calibration.
variable
double dataConfidence
function
DEPTHAI_SERIALIZE(Data, newCalibration, currentCalibration, calibrationDifference, dataConfidence)
class

dai::EdgeDetectorConfig

#include EdgeDetectorConfig.hpp
variable
function
EdgeDetectorConfig()
function
~EdgeDetectorConfig()
function
void setSobelFilterKernels(const std::vector< std::vector< int >> & horizontalKernel, const std::vector< std::vector< int >> & verticalKernel)
Set sobel filter horizontal and vertical 3x3 kernels
Parameters
  • horizontalKernel: Used for horizontal gradient computation in 3x3 Sobel filter
  • verticalKernel: Used for vertical gradient computation in 3x3 Sobel filter
function
EdgeDetectorConfigData getConfigData()
Retrieve configuration data for EdgeDetector
Returns
EdgeDetectorConfigData: sobel filter horizontal and vertical 3x3 kernels
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(EdgeDetectorConfig, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, config)
struct

dai::EdgeDetectorConfig::EdgeDetectorConfigData

variable
std::vector< std::vector< int > > sobelFilterHorizontalKernel
Used for horizontal gradient computation in 3x3 Sobel filter Format - 3x3 matrix, 2nd column must be 0 Default - +1 0 -1; +2 0 -2; +1 0 -1
variable
std::vector< std::vector< int > > sobelFilterVerticalKernel
Used for vertical gradient computation in 3x3 Sobel filter Format - 3x3 matrix, 2nd row must be 0 Default - +1 +2 +1; 0 0 0; -1 -2 -1
function
class

dai::EncodedFrame

using
CameraSettings = ImgFrame::CameraSettings
using
Fsync = ImgFrame::Fsync
variable
variable
uint32_t instanceNum
variable
unsigned int width
variable
unsigned int height
variable
uint32_t quality
variable
uint32_t bitrate
variable
Profile profile
variable
bool lossless
variable
FrameType type
variable
uint32_t frameOffset
variable
uint32_t frameSize
variable
ImgTransformation transformation
function
~EncodedFrame()
function
unsigned int getInstanceNum()
Retrieves instance number
function
unsigned int getWidth()
Retrieves image width in pixels
function
unsigned int getHeight()
Retrieves image height in pixels
function
std::chrono::microseconds getExposureTime()
Retrieves exposure time
function
int getSensitivity()
Retrieves sensitivity, as an ISO value
function
int getColorTemperature()
Retrieves white-balance color temperature of the light source, in kelvins
function
int getLensPosition()
Retrieves lens position, range 0..255. Returns -1 if not available
function
float getLensPositionRaw()
Retrieves lens position, range 0.0f..1.0f. Returns -1 if not available
function
Fsync getFsync()
Retrieves effective frame sync mode for this frame.
function
int getSensorMode()
Retrieves selected sensor mode index for this frame.
function
float getFps()
Retrieves sensor FPS for this frame.
function
std::optional< float > getSensorTemperature()
Retrieves sensor temperature in degrees Celsius. Returns an empty optional if not available.
function
unsigned int getQuality()
Retrieves the encoding quality
function
unsigned int getBitrate()
Retrieves the encoding bitrate
function
bool getLossless()
Returns true if encoding is lossless (JPEG only)
function
FrameType getFrameType()
Retrieves frame type (H26x only)
function
Profile getProfile()
Retrieves the encoding profile (JPEG, AVC or HEVC)
function
EncodedFrame & setInstanceNum(unsigned int instance)
Instance number relates to the origin of the frame (which camera)
Parameters
  • instance: Instance number
function
EncodedFrame & setWidth(unsigned int width)
Specifies frame width
Parameters
  • width: frame width
function
EncodedFrame & setHeight(unsigned int height)
Specifies frame height
Parameters
  • height: frame height
function
EncodedFrame & setSize(unsigned int width, unsigned int height)
Specifies frame size
Parameters
  • height: frame height
  • width: frame width
function
EncodedFrame & setSize(std::tuple< unsigned int, unsigned int > size)
Specifies frame size
Parameters
  • size: frame size
function
EncodedFrame & setQuality(unsigned int quality)
Specifies the encoding quality
Parameters
  • quality: Encoding quality
function
EncodedFrame & setBitrate(unsigned int bitrate)
Specifies the encoding quality
Parameters
  • quality: Encoding quality
function
EncodedFrame & setLossless(bool lossless)
Specifies if encoding is lossless (JPEG only)
Parameters
  • lossless: True if lossless
function
EncodedFrame & setFrameType(FrameType type)
Specifies the frame type (H26x only)
Parameters
  • type: Type of h26x frame (I, P, B)
function
EncodedFrame & setProfile(Profile profile)
Specifies the encoding profile
Parameters
  • profile: Encoding profile
function
ImgFrame getImgFrameMeta()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(EncodedFrame, cam, instanceNum, width, height, quality, bitrate, profile, lossless, type, frameOffset, frameSize, transformation, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem)
enum

std::uint8_t Profile

enumerator
JPEG
enumerator
AVC
enumerator
HEVC
enum

std::uint8_t FrameType

enumerator
I
enumerator
P
enumerator
B
enumerator
Unknown
class

dai::FeatureTrackerConfig

#include FeatureTrackerConfig.hpp
variable
CornerDetector cornerDetector
Corner detector configuration. Used for feature detection.
variable
MotionEstimator motionEstimator
Motion estimator configuration. Used for feature reidentification between current and previous features.
variable
FeatureMaintainer featureMaintainer
FeatureMaintainer configuration. Used for feature maintaining.
function
FeatureTrackerConfig()
Construct FeatureTrackerConfig message.
function
~FeatureTrackerConfig()
function
FeatureTrackerConfig & setCornerDetector(CornerDetector::Type cornerDetector)
Set corner detector algorithm type.
Parameters
  • cornerDetector: Corner detector type, HARRIS or SHI_THOMASI
function
FeatureTrackerConfig & setCornerDetector(const CornerDetector & config)
Set corner detector full configuration.
Parameters
  • config: Corner detector configuration
function
FeatureTrackerConfig & setOpticalFlow()
Set optical flow as motion estimation algorithm type.
function
FeatureTrackerConfig & setOpticalFlow(const MotionEstimator::OpticalFlow & config)
Set optical flow full configuration.
Parameters
  • config: Optical flow configuration
function
FeatureTrackerConfig & setHwMotionEstimation()
Set hardware accelerated motion estimation using block matching. Faster than optical flow (software implementation) but might not be as accurate.
function
FeatureTrackerConfig & setNumTargetFeatures(std::int32_t numTargetFeatures)
Set number of target features to detect.
Parameters
  • numTargetFeatures: Number of features
function
FeatureTrackerConfig & setMotionEstimator(bool enable)
Enable or disable motion estimator.
Parameters
  • enable:
function
FeatureTrackerConfig & setMotionEstimator(const MotionEstimator & config)
Set motion estimator full configuration.
Parameters
  • config: Motion estimator configuration
function
FeatureTrackerConfig & setFeatureMaintainer(bool enable)
Enable or disable feature maintainer.
Parameters
  • enable:
function
FeatureTrackerConfig & setFeatureMaintainer(FeatureMaintainer config)
Set feature maintainer full configuration.
Parameters
  • config: feature maintainer configuration
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
struct

dai::FeatureTrackerConfig::CornerDetector

#include FeatureTrackerConfig.hpp
variable
Type type
Corner detector algorithm type.
variable
std::int32_t cellGridDimension
Ensures distributed feature detection across the image. Image is divided into horizontal and vertical cells, each cell has a target feature count = numTargetFeatures / cellGridDimension. Each cell has its own feature threshold. A value of 4 means that the image is divided into 4x4 cells of equal width/height. Maximum 4, minimum 1.
variable
std::int32_t numTargetFeatures
Target number of features to detect. Maximum number of features is determined at runtime based on algorithm type.
variable
std::int32_t numMaxFeatures
Hard limit for the maximum number of features that can be detected. 0 means auto, will be set to the maximum value based on memory constraints.
variable
bool enableSobel
Enable 3x3 Sobel operator to smoothen the image whose gradient is to be computed. If disabled, a simple 1D row/column differentiator is used for gradient.
variable
bool enableSorting
Enable sorting detected features based on their score or not.
variable
Thresholds thresholds
Threshold settings. These are advanced settings, suitable for debugging/special cases.
function
struct

dai::FeatureTrackerConfig::CornerDetector::Thresholds

#include FeatureTrackerConfig.hpp
variable
float initialValue
Minimum strength of a feature which will be detected. 0 means automatic threshold update. Recommended so the tracker can adapt to different scenes/textures. Each cell has its own threshold. Empirical value.
variable
float min
Minimum limit for threshold. Applicable when automatic threshold update is enabled. 0 means auto, 6000000 for HARRIS, 1200 for SHI_THOMASI. Empirical value.
variable
float max
Maximum limit for threshold. Applicable when automatic threshold update is enabled. 0 means auto. Empirical value.
variable
float decreaseFactor
When detected number of features exceeds the maximum in a cell threshold is lowered by multiplying its value with this factor.
variable
float increaseFactor
When detected number of features doesn't exceed the maximum in a cell, threshold is increased by multiplying its value with this factor.
function
enum

std::int32_t Type

enumerator
HARRIS
Harris corner detector.
enumerator
SHI_THOMASI
Shi-Thomasi corner detector.
struct

dai::FeatureTrackerConfig::FeatureMaintainer

#include FeatureTrackerConfig.hpp
variable
bool enable
Enable feature maintaining or not.
variable
float minimumDistanceBetweenFeatures
Used to filter out detected feature points that are too close. Requires sorting enabled in detector. Unit of measurement is squared euclidean distance in pixels.
variable
float lostFeatureErrorThreshold
Optical flow measures the tracking error for every feature. If the point can’t be tracked or it’s out of the image it will set this error to a maximum value. This threshold defines the level where the tracking accuracy is considered too bad to keep the point.
variable
float trackedFeatureThreshold
Once a feature was detected and we started tracking it, we need to update its Harris score on each image. This is needed because a feature point can disappear, or it can become too weak to be tracked. This threshold defines the point where such a feature must be dropped. As the goal of the algorithm is to provide longer tracks, we try to add strong points and track them until they are absolutely untrackable. This is why, this value is usually smaller than the detection threshold.
function
struct

dai::FeatureTrackerConfig::MotionEstimator

#include FeatureTrackerConfig.hpp
variable
bool enable
Enable motion estimation or not.
variable
Type type
Motion estimator algorithm type.
variable
OpticalFlow opticalFlow
Optical flow configuration. Takes effect only if MotionEstimator algorithm type set to LUCAS_KANADE_OPTICAL_FLOW.
function
DEPTHAI_SERIALIZE(MotionEstimator, enable, type, opticalFlow)
struct

dai::FeatureTrackerConfig::MotionEstimator::OpticalFlow

#include FeatureTrackerConfig.hpp
variable
std::int32_t pyramidLevels
Number of pyramid levels, only for optical flow. AUTO means it's decided based on input resolution: 3 if image width <= 640, else 4. Valid values are either 3/4 for VGA, 4 for 720p and above.
variable
std::int32_t searchWindowWidth
Image patch width used to track features. Must be an odd number, maximum 9. N means the algorithm will be able to track motion at most (N-1)/2 pixels in a direction per pyramid level. Increasing this number increases runtime
variable
std::int32_t searchWindowHeight
Image patch height used to track features. Must be an odd number, maximum 9. N means the algorithm will be able to track motion at most (N-1)/2 pixels in a direction per pyramid level. Increasing this number increases runtime
variable
float epsilon
Feature tracking termination criteria. Optical flow will refine the feature position on each pyramid level until the displacement between two refinements is smaller than this value. Decreasing this number increases runtime.
variable
std::int32_t maxIterations
Feature tracking termination criteria. Optical flow will refine the feature position maximum this many times on each pyramid level. If the Epsilon criteria described in the previous chapter is not met after this number of iterations, the algorithm will continue with the current calculated value. Increasing this number increases runtime.
function
enum

std::int32_t Type

enumerator
LUCAS_KANADE_OPTICAL_FLOW
Using the pyramidal Lucas-Kanade optical flow method.
enumerator
HW_MOTION_ESTIMATION
Using a dense motion estimation hardware block (Block matcher).
class

dai::GPUStereoConfig

#include GPUStereoConfig.hpp
variable
std::uint8_t confidenceThreshold
Confidence threshold for disparity filtering. Value in range [0, 255]. 0 disables the filter.
function
GPUStereoConfig()
function
~GPUStereoConfig()
function
GPUStereoConfig & setConfidenceThreshold(int threshold)
Set the confidence threshold for disparity filtering. Pixels with a matching cost above this threshold are invalidated.
Parameters
  • threshold: Value in range [0, 255]. 0 disables the filter. Values outside the range are clamped.
function
int getConfidenceThreshold()
Get the confidence threshold for disparity filtering.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
function
class

dai::GateControl

variable
bool open
variable
int numMessages
variable
int fps
function
GateControl()
inline function
GateControl(bool open, int numMessages, int fps)
function
~GateControl()
inline function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(GateControl, open, numMessages, fps)
struct

dai::IMUReport

Derived by dai::IMUReportAccelerometer, dai::IMUReportGyroscope, dai::IMUReportMagneticField, dai::IMUReportRotationVectorWAcc
variable
int32_t sequence
The sequence number increments once for each report sent. Gaps in the sequence numbers indicate missing or dropped reports. Max value 2^32 after which resets to 0.
variable
Accuracy accuracy
Accuracy of sensor
variable
Timestamp timestamp
Generation timestamp, synced to host time
variable
Timestamp tsDevice
Generation timestamp, direct device monotonic clock
variable
std::optional< Timestamp > tsSystem
Generation timestamp, direct device system clock
inline function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestamp()
Retrieves timestamp related to dai::Clock::now()
inline function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestampDevice()
Retrieves timestamp directly captured from device's monotonic clock, not synchronized to host time. Used mostly for debugging
inline function
std::optional< std::chrono::time_point< std::chrono::system_clock, std::chrono::system_clock::duration > > getTimestampSystem()
Retrieves timestamp directly captured from device's system clock, can be synchronized with PTP
inline function
int32_t getSequenceNum()
Retrieves IMU report sequence number
enum

std::uint8_t Accuracy

enumerator
UNRELIABLE
enumerator
LOW
enumerator
MEDIUM
enumerator
HIGH
struct

dai::IMUReportAccelerometer

#include IMUData.hpp
variable
float x
variable
float y
variable
float z
struct

dai::IMUReportGyroscope

#include IMUData.hpp
variable
float x
variable
float y
variable
float z
struct

dai::IMUReportMagneticField

#include IMUData.hpp
variable
float x
variable
float y
variable
float z
struct

dai::IMUReportRotationVectorWAcc

#include IMUData.hpp
variable
float i
Quaternion component i.
variable
float j
Quaternion component j.
variable
float k
Quaternion component k.
variable
float real
Quaternion component, real.
variable
float rotationVectorAccuracy
Accuracy estimate [radians], 0 means no estimate.
struct

dai::IMUPacket

#include IMUData.hpp
variable
variable
variable
variable
class

dai::IMUData

#include IMUData.hpp
variable
std::vector< IMUPacket > packets
Detections.
function
IMUData()
function
~IMUData()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(IMUData, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, Buffer::sequenceNum, packets)
class

dai::ImageAlignConfig

#include ImageAlignConfig.hpp
variable
uint16_t staticDepthPlane
Optional static depth plane to align to, in depth units, by default millimeters
function
ImageAlignConfig()
function
~ImageAlignConfig()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(ImageAlignConfig, staticDepthPlane)
class

dai::ImageFiltersConfig

variable
std::vector< std::int32_t > filterIndices
Index of the filter to be applied
variable
std::vector< FilterParams > filterParams
Parameters of the filter to be applied
function
~ImageFiltersConfig()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
ImageFiltersConfig & updateFilterAtIndex(std::int32_t index, const FilterParams & params)
Insert filter parameters describing how a filter at index index should be updated
Parameters
  • index: Index of the filter to be inserted
  • params: Parameters of the filter to be inserted
function
ImageFiltersConfig & insertFilter(const FilterParams & params)
Insert filter parameters describing how a new filter should be inserted
Parameters
  • params: Parameters of the filter to be inserted
function
void setProfilePreset(ImageFiltersPresetMode presetMode)
Set preset mode for ImageFiltersConfig.
Parameters
function
class

dai::ToFDepthConfidenceFilterConfig

variable
float confidenceThreshold
Threshold for the confidence filter
function
~ToFDepthConfidenceFilterConfig()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
void setProfilePreset(ImageFiltersPresetMode presetMode)
Set preset mode for ImageFiltersPresetMode.
Parameters
  • presetMode: Preset mode for ImageFiltersPresetMode.
function
struct

dai::OpBase

Derived by dai::Affine, dai::Crop, dai::CropRotated, dai::Flip, dai::FourPoints, dai::Perspective, dai::Resize, dai::Rotate, dai::Translate
function
~OpBase()
function
std::string toStr()
struct

dai::Translate

variable
float offsetX
variable
float offsetY
variable
bool normalized
function
~Translate()
function
Translate()
inline function
Translate(float offsetX, float offsetY, bool normalized)
inline function
std::string toStr()
function
DEPTHAI_SERIALIZE(Translate, offsetX, offsetY, normalized)
struct

dai::Rotate

variable
float angle
variable
bool center
variable
float offsetX
variable
float offsetY
variable
bool normalized
function
~Rotate()
function
Rotate()
inline explicit function
Rotate(float angle, bool center, float offsetX, float offsetY, bool normalized)
inline function
std::string toStr()
function
DEPTHAI_SERIALIZE(Rotate, angle, center, offsetX, offsetY, normalized)
struct

dai::Resize

variable
float width
variable
float height
variable
bool normalized
variable
Mode mode
function
~Resize()
function
Resize()
inline function
Resize(float width, float height, bool normalized)
inline function
std::string toStr()
function
DEPTHAI_SERIALIZE(Resize, width, height, normalized, mode)
enum

Mode

enumerator
VALUE
enumerator
FIT
enumerator
FILL
struct

dai::Flip

variable
Direction direction
variable
bool center
function
~Flip()
function
Flip()
inline explicit function
Flip(Direction direction, bool center)
inline function
std::string toStr()
function
DEPTHAI_SERIALIZE(Flip, direction, center)
enum

Direction

enumerator
HORIZONTAL
enumerator
VERTICAL
struct

dai::Affine

variable
std::array< float, 4 > matrix
function
~Affine()
function
Affine()
inline explicit function
Affine(std::array< float, 4 > matrix)
inline function
std::string toStr()
function
DEPTHAI_SERIALIZE(Affine, matrix)
struct

dai::Perspective

variable
std::array< float, 9 > matrix
function
~Perspective()
function
Perspective()
inline explicit function
Perspective(std::array< float, 9 > matrix)
inline function
std::string toStr()
function
DEPTHAI_SERIALIZE(Perspective, matrix)
struct

dai::FourPoints

variable
std::array< dai::Point2f, 4 > src
variable
std::array< dai::Point2f, 4 > dst
variable
bool normalized
function
~FourPoints()
function
FourPoints()
inline function
FourPoints(std::array< dai::Point2f, 4 > src, std::array< dai::Point2f, 4 > dst, bool normalized)
inline function
std::string toStr()
function
DEPTHAI_SERIALIZE(FourPoints, src, dst, normalized)
struct

dai::Crop

variable
float width
variable
float height
variable
bool normalized
variable
bool center
function
~Crop()
inline function
Crop()
inline function
Crop(float width, float height, bool normalized, bool center)
inline function
Crop clone()
inline function
std::string toStr()
function
DEPTHAI_SERIALIZE(Crop, width, height, normalized, center)
struct

dai::CropRotated

variable
float width
variable
float height
variable
float angle
variable
bool normalized
function
~CropRotated()
inline function
CropRotated()
inline function
CropRotated(float width, float height, float angle, bool normalized)
inline function
std::string toStr()
function
DEPTHAI_SERIALIZE(CropRotated, width, height, angle, normalized)
struct

dai::ManipOp

variable
function
ManipOp()
inline function
ManipOp(Translate op)
inline function
ManipOp(Rotate op)
inline function
ManipOp(Resize op)
inline function
ManipOp(Flip op)
inline function
ManipOp(Affine op)
inline function
ManipOp(Perspective op)
inline function
ManipOp(FourPoints op)
inline function
ManipOp(Crop op)
inline function
ManipOp(CropRotated op)
function
DEPTHAI_SERIALIZE(ManipOp, op)
class

dai::ImageManipOpsEnums

Derived by dai::ImageManipOpsBase< Container >, dai::ImageManipOpsBase< C >
enum

uint8_t Background

enumerator
COLOR
enum

uint8_t ResizeMode

enumerator
NONE
enumerator
STRETCH
enumerator
LETTERBOX
enumerator
CENTER_CROP
class

dai::ImageManipOpsBase

variable
uint32_t outputWidth
variable
uint32_t outputHeight
variable
bool center
variable
ResizeMode resizeMode
variable
Background background
variable
uint32_t backgroundR
variable
uint32_t backgroundG
variable
uint32_t backgroundB
variable
Colormap colormap
variable
bool undistort
variable
C operations
inline function
void cloneTo(ImageManipOpsBase< C2 > & to)
inline function
bool hasWarp(const size_t inputWidth, const size_t inputHeight)
inline function
inline function
ImageManipOpsBase & transformPerspective(std::array< float, 9 > matrix)
inline function
ImageManipOpsBase & transformAffine(std::array< float, 4 > matrix)
inline function
ImageManipOpsBase & transformFourPoints(std::array< dai::Point2f, 4 > src, std::array< dai::Point2f, 4 > dst, bool normalizedCoords)
inline function
ImageManipOpsBase & flipHorizontal(bool center)
inline function
ImageManipOpsBase & flipVertical(bool center)
inline function
ImageManipOpsBase & resize(float width, float height, bool normalized)
inline function
ImageManipOpsBase & crop(float x, float y, float w, float h, bool normalized, bool center)
inline function
ImageManipOpsBase & cropRotated(float x, float y, float w, float h, float angle, bool normalized)
inline function
ImageManipOpsBase & resizeFit()
inline function
ImageManipOpsBase & resizeFill()
inline function
ImageManipOpsBase & resizeWidthKeepAspectRatio(float width, bool normalized)
inline function
ImageManipOpsBase & resizeHeightKeepAspectRatio(float height, bool normalized)
inline function
ImageManipOpsBase & rotateRadians(float angle, bool center, float offsetX, float offsetY, bool normalized)
inline function
ImageManipOpsBase & rotateDegrees(float angle, bool center, float offsetX, float offsetY, bool normalized)
inline function
ImageManipOpsBase & translate(float offsetX, float offsetY, bool normalizedCoords)
inline function
ImageManipOpsBase & setOutputSize(float width, float height)
inline function
ImageManipOpsBase & setOutputResize(uint32_t width, uint32_t height, ResizeMode mode)
inline function
ImageManipOpsBase & setOutputCenter(bool c)
inline function
ImageManipOpsBase & setBackgroundColor(uint32_t red, uint32_t green, uint32_t blue)
inline function
ImageManipOpsBase & setBackgroundColor(uint32_t val)
inline function
ImageManipOpsBase & setColormap(Colormap clr)
inline function
ImageManipOpsBase & setUndistort(bool undistort)
inline function
bool getUndistort()
inline function
const C & getOperations()
inline function
function
DEPTHAI_SERIALIZE(ImageManipOpsBase, operations, outputWidth, outputHeight, center, resizeMode, background, backgroundR, backgroundG, backgroundB, colormap, undistort)
class

dai::ImageManipConfig

#include ImageManipConfig.hpp
using
ResizeMode = ImageManipOpsBase< Container >::ResizeMode
variable
ImageManipOpsBase< Container > base
variable
ImgFrame::Type outputFrameType
variable
bool reusePreviousImage
variable
bool skipCurrentImage
function
ImageManipConfig()
function
~ImageManipConfig()
function
ImageManipConfig & clearOps()
Removes all operations from the list (does not affect output configuration)
function
ImageManipConfig & addCrop(uint32_t x, uint32_t y, uint32_t w, uint32_t h)
Crops the image to the specified rectangle
Parameters
  • x: X coordinate of the top-left corner
  • y: Y coordinate of the top-left corner
  • w: Width of the rectangle
  • h: Height of the rectangle
function
ImageManipConfig & addCrop(const dai::Rect & rect, bool normalizedCoords)
Crops the image to the specified rectangle
Parameters
  • rect: Rect to crop
  • normalizedCoords: If true, the coordinates are normalized to range [0, 1] where 1 maps to the width/height of the image
function
ImageManipConfig & addCropRotatedRect(const dai::RotatedRect & rotatedRect, bool normalizedCoords)
Crops the image to the specified (rotated) rectangle
Parameters
  • rect: RotatedRect to crop
  • normalizedCoords: If true, the coordinates are normalized to range [0, 1] where 1 maps to the width/height of the image
function
ImageManipConfig & addScale(float scaleX, float scaleY)
Rescales the image using the specified factors
Parameters
  • scaleX: Scale factor for the X axis
  • scaleY: Scale factor for the Y axis. If not specified, scaleY is set to the same value as scaleX
function
ImageManipConfig & addRotateDeg(float angle)
Rotates the image around its center by the specified angle in degrees
Parameters
  • angle: Angle in radians
function
ImageManipConfig & addRotateDeg(float angle, Point2f center)
Rotates the image around the specified point by the specified angle in degrees
Parameters
  • angle: Angle in radians
  • center: Center of the rotation using normalized coordinates
function
ImageManipConfig & addFlipHorizontal()
Flips the image horizontally
function
ImageManipConfig & addFlipVertical()
Flips the image vertically
function
ImageManipConfig & addTransformAffine(std::array< float, 4 > matrix)
Applies an affine transformation to the image
Parameters
  • matrix: an array containing a 2x2 matrix representing the affine transformation
function
ImageManipConfig & addTransformPerspective(const std::array< float, 9 > & matrix)
Applies a perspective transformation to the image
Parameters
  • matrix: an array containing a 3x3 matrix representing the perspective transformation
function
ImageManipConfig & addTransformFourPoints(const std::array< dai::Point2f, 4 > & src, const std::array< dai::Point2f, 4 > & dst, bool normalizedCoords)
Applies a perspective transformation to the image
Parameters
  • src: Source points
  • dst: Destination points
  • normalizedCoords: If true, the coordinates are normalized to range [0, 1] where 1 maps to the width/height of the image
function
ImageManipConfig & setOutputSize(uint32_t w, uint32_t h, ResizeMode mode)
Sets the output size of the image
Parameters
  • w: Width of the output image
  • h: Height of the output image
  • mode: Resize mode. NONE - no resize, STRETCH - stretch to fit, LETTERBOX - keep aspect ratio and pad with background color, CENTER_CROP - keep aspect ratio and crop
function
ImageManipConfig & setOutputCenter(bool c)
Centers the content in the output image without resizing
Parameters
  • c: True to center the content, false otherwise
function
ImageManipConfig & setColormap(Colormap colormap)
Sets the colormap to be applied to a grayscale image
Parameters
  • colormap: Colormap type to be applied
function
ImageManipConfig & setBackgroundColor(uint32_t red, uint32_t green, uint32_t blue)
Sets the rgb background color of the output image
Parameters
  • red: Red component of the background color
  • green: Green component of the background color
  • blue: Blue component of the background color
function
ImageManipConfig & setBackgroundColor(uint32_t val)
Sets the grayscale background color of the output image
Parameters
  • val: Grayscale value of the background color
function
ImageManipConfig & setFrameType(ImgFrame::Type frameType)
Sets the frame type of the output image
Parameters
  • frameType: Frame type of the output image
function
ImageManipConfig & setUndistort(bool undistort)
Sets the undistort flag
function
bool getUndistort()
Gets the undistort flag
Returns
True if undistort is enabled, false otherwise
function
ImageManipConfig & setReusePreviousImage(bool reuse)
Instruct ImageManip to not remove current image from its queue and use the same for next message.
Parameters
  • reuse: True to enable reuse, false otherwise
function
ImageManipConfig & setSkipCurrentImage(bool skip)
Instructs ImageManip to skip current image and wait for next in queue.
Parameters
  • skip: True to skip current image, false otherwise
function
bool getReusePreviousImage()
Instruct ImageManip to not remove current image from its queue and use the same for next message.
Returns
True to enable reuse, false otherwise
function
bool getSkipCurrentImage()
Instructs ImageManip to skip current image and wait for next in queue.
Returns
True to skip current image, false otherwise
function
DEPTHAI_SERIALIZE(ImageManipConfig, base, outputFrameType, reusePreviousImage, skipCurrentImage)
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
struct

dai::CircleAnnotation

variable
Point2f position
variable
float diameter
variable
float thickness
variable
Color fillColor
variable
Color outlineColor
struct

dai::PointsAnnotation

variable
PointsAnnotationType type
variable
std::vector< Point2f > points
variable
Color outlineColor
variable
std::vector< Color > outlineColors
variable
Color fillColor
variable
float thickness
struct

dai::TextAnnotation

variable
Point2f position
variable
std::string text
variable
float fontSize
variable
Color textColor
variable
Color backgroundColor
struct

dai::ImgAnnotation

variable
std::vector< CircleAnnotation > circles
variable
std::vector< PointsAnnotation > points
variable
std::vector< TextAnnotation > texts
class

dai::ImgAnnotations

#include ImgAnnotations.hpp
variable
std::vector< ImgAnnotation > annotations
variable
std::optional< ImgTransformation > transformation
function
ImgAnnotations()
Construct ImgAnnotations message.
inline explicit function
ImgAnnotations(std::vector< ImgAnnotation > annotations)
function
~ImgAnnotations()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(ImgAnnotations, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, annotations, transformation)
struct

dai::ImgDetection

variable
uint32_t label
variable
std::string labelName
variable
float confidence
variable
float xmin
variable
float ymin
variable
float xmax
variable
float ymax
variable
std::optional< RotatedRect > boundingBox
variable
std::optional< KeypointsList > keypoints
function
ImgDetection()
function
ImgDetection(const RotatedRect & boundingBox, float confidence, uint32_t label)
function
ImgDetection(const RotatedRect & boundingBox, std::string labelName, float confidence, uint32_t label)
function
ImgDetection(const RotatedRect & boundingBox, const KeypointsList & keypoints, float confidence, uint32_t label)
function
ImgDetection(const RotatedRect & boundingBox, const KeypointsList & keypoints, std::string labelName, float confidence, uint32_t label)
function
void setBoundingBox(RotatedRect boundingBox)
Sets the bounding box and the legacy coordinates of the detection.
function
RotatedRect getBoundingBox()
Returns bounding box if it was set, else it constructs a new one from the legacy xmin, ymin, xmax, ymax values.
function
void setOuterBoundingBox(const float xmin, const float ymin, const float xmax, const float ymax)
Sets the bounding box and the legacy coordinates of the detection from the top-left and bottom-right points.
function
std::array< float, 4 > getOuterBoundingBox()
Returns the outer bounding box as [minx, miny, maxx, maxy].
function
void setKeypoints(const KeypointsList keypoints)
Sets the keypoints of the detection.
Parameters
  • keypoints: list of Keypoint objects to set.
Note
This will clear any existing keypoints and edges.
function
void setKeypoints(const std::vector< Keypoint > keypoints)
Sets the keypoints of the detection.
Parameters
  • keypoints: list of Keypoint objects to set.
Note
This will clear any existing keypoints and edges.
function
void setKeypoints(const std::vector< Keypoint > keypoints, const std::vector< Edge > edges)
Sets the keypoints of the detection.
Parameters
  • keypoints: list of Point2f objects to set.
Note
This will clear any existing keypoints and edges.
function
void setKeypoints(const std::vector< Point3f > keypoints)
Sets the keypoints of the detection.
Parameters
  • keypoints: list of Point3f objects to set.
Note
This will clear any existing keypoints and edges.
function
void setKeypoints(const std::vector< Point2f > keypoints)
Sets the keypoints of the detection.
Parameters
  • keypoints: list of Point2f objects to set.
Note
This will clear any existing keypoints and edges.
function
std::vector< Keypoint > getKeypoints()
Returns a list of Keypoint objects, or empty list if no keypoints were set.
function
std::vector< Point2f > getKeypoints2f()
Returns a list of Point2f coordinates of the keypoints, or empty list if no keypoints were set.
function
std::vector< Point3f > getKeypoints3f()
Returns a list of Point3f coordinates of the keypoints, or empty list if no keypoints were set.
function
void setEdges(const std::vector< Edge > edges)
Sets edges for the keypoints, throws if no keypoints were set beforehand.
function
std::vector< Edge > getEdges()
Returns a list of edges, each edge is a pair of indices, or empty list if no keypoints were set.
function
float getCenterX()
Returns the X coordinate of the center of the bounding box.
function
float getCenterY()
Returns the Y coordinate of the center of the bounding box.
function
float getWidth()
Returns the width of the (rotated) bounding box.
function
float getHeight()
Returns the height of the (rotated) bounding box.
function
float getAngle()
Returns the angle of the bounding box.
function
void transform(const ImgTransformation & source, const ImgTransformation & target)
Transforms the detection from the source ImgTransformation to the target ImgTransformation.
Parameters
  • source: Source image transformation.
  • target: Target image transformation.
function
DEPTHAI_SERIALIZE(ImgDetection, label, labelName, confidence, xmin, ymin, xmax, ymax, boundingBox, keypoints)
class

dai::ImgDetections

#include ImgDetections.hpp
using
variable
std::vector< DetectionT > detections
variable
size_t segmentationMaskHeight
variable
size_t segmentationMaskWidth
variable
std::optional< ImgTransformation > transformation
function
~ImgDetections()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
ImgDetections transformTo(const ImgTransformation & target)
Returns a new ImgDetections message with the detections transformed into the target image transformation.If the target transformation has a different source coordinate system (eg. different camera socket) than the one the detections were originally generated in, the remapping will be inaccurate due to the lack of depth information.The segmentation mask is not transformed. Use Align node to transform the segmentation mask to the target transformation if needed.
Parameters
  • target: Target image transformation.
function
DEPTHAI_SERIALIZE(ImgDetections, sequenceNum, ts, tsDevice, tsSystem, detections, transformation, segmentationMaskWidth, segmentationMaskHeight)
class

dai::ImgDetectionsT

variable
std::vector< DetectionT > detections
function
ImgDetectionsT()
function
~ImgDetectionsT()
function
std::size_t getSegmentationMaskWidth()
Returns the width of the segmentation mask.
function
std::size_t getSegmentationMaskHeight()
Returns the height of the segmentation mask.
function
void setSegmentationMask(const std::vector< std::uint8_t > & mask, size_t width, size_t height)
Sets the segmentation mask from a vector of bytes. The size of the vector must be equal to width * height.
function
void setSegmentationMask(dai::ImgFrame & frame)
Sets the segmentation mask from an ImgFrame.
Parameters
  • frame: Frame must be of type GRAY8
function
std::optional< std::vector< std::uint8_t > > getMaskData()
Returns a copy of the segmentation mask data as a vector of bytes. If mask data is not set, returns std::nullopt.
function
std::optional< dai::ImgFrame > getSegmentationMask()
Returns the segmentation mask as an ImgFrame. If mask data is not set, returns std::nullopt.
function
void setCvSegmentationMask(cv::Mat mask)
Note
This API only available if OpenCV support is enabled Copies cv::Mat data to Segmentation Mask buffer
Parameters
  • frame: Input cv::Mat frame from which to copy the data
Note
Throws if mask is not a single channel INT8 type.
function
std::optional< cv::Mat > getCvSegmentationMask(cv::MatAllocator * allocator)
Retrieves mask data as a cv::Mat copy with specified width and height. If mask data is not set, returns std::nullopt.
Parameters
  • allocator: Allows callers to supply a custom cv::MatAllocator for zero-copy/custom memory management; nullptr uses OpenCV’s default.
function
std::optional< cv::Mat > getCvSegmentationMaskByIndex(uint8_t index, cv::MatAllocator * allocator)
Returns a binary mask where pixels belonging to the instance index are set to 1, others to 0. If mask data is not set, returns std::nullopt.
Parameters
  • index: Instance index
  • allocator: Allows callers to supply a custom cv::MatAllocator for zero-copy/custom memory management; nullptr uses OpenCV’s default.
function
std::optional< cv::Mat > getCvSegmentationMaskByClass(uint8_t semanticClass, cv::MatAllocator * allocator)
Retrieves data by the semantic class. If no mask data is not set, returns std::nullopt.
Parameters
  • semanticClass: Semantic class index
  • allocator: Allows callers to supply a custom cv::MatAllocator for zero-copy/custom memory management; nullptr uses OpenCV’s default.
class

dai::ImgFrame

#include ImgFrame.hpp
variable
variable
Specs sourceFb
variable
variable
uint32_t category
variable
uint32_t instanceNum
variable
dai::FrameEvent event
variable
ImgTransformation transformation
function
ImgFrame()
Construct ImgFrame message. Timestamp is set to now
function
ImgFrame(long fd)
function
ImgFrame(size_t size)
function
ImgFrame(long fd, size_t size)
function
~ImgFrame()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestamp(CameraExposureOffset offset)
Retrieves image timestamp (at the specified offset of exposure) related to dai::Clock::now()
function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestampDevice(CameraExposureOffset offset)
Retrieves image timestamp (at the specified offset of exposure) directly captured from device's monotonic clock, not synchronized to host time. Used when monotonicity is required.
function
std::optional< std::chrono::time_point< std::chrono::system_clock, std::chrono::system_clock::duration > > getTimestampSystem(CameraExposureOffset offset)
Retrieves image timestamp (at the specified offset of exposure) directly captured from device's system clock, that can be synchronized using PTP
function
unsigned int getInstanceNum()
Retrieves instance number
function
unsigned int getCategory()
Retrieves image category
function
unsigned int getWidth()
Retrieves image width in pixels
function
unsigned int getStride()
Retrieves image line stride in bytes
function
unsigned int getPlaneStride(int planeIndex)
Retrieves image plane stride (offset to next plane) in bytes
Parameters
  • current: plane index, 0 or 1
function
unsigned int getHeight()
Retrieves image height in pixels
function
unsigned int getPlaneHeight()
Retrieves image plane height in lines
function
unsigned int getSourceWidth()
Retrieves source image width in pixels
function
unsigned int getSourceHeight()
Retrieves source image height in pixels
function
Type getType()
Retrieves image type
function
float getBytesPerPixel()
Retrieves image bytes per pixel
function
std::chrono::microseconds getExposureTime()
Retrieves exposure time
function
int getSensitivity()
Retrieves sensitivity, as an ISO value
function
int getColorTemperature()
Retrieves white-balance color temperature of the light source, in kelvins
function
int getLensPosition()
Retrieves lens position, range 0..255. Returns -1 if not available
function
float getLensPositionRaw()
Retrieves lens position, range 0.0f..1.0f. Returns -1 if not available
function
Fsync getFsync()
Retrieves effective frame sync mode for this frame.
function
int getSensorMode()
Retrieves selected sensor mode index for this frame.
function
float getFps()
Retrieves sensor FPS for this frame.
function
std::optional< float > getSensorTemperature()
Retrieves sensor temperature in degrees Celsius. Returns an empty optional if not available.
function
ImgTransformation & getTransformation()
Retrieves image transformation data
function
ImgFrame & setInstanceNum(unsigned int instance)
Instance number relates to the origin of the frame (which camera)
Parameters
  • instance: Instance number
function
ImgFrame & setCategory(unsigned int category)
Parameters
  • category: Image category
function
ImgFrame & setWidth(unsigned int width)
Specifies frame width
Parameters
  • width: frame width
function
ImgFrame & setStride(unsigned int stride)
Specifies frame stride
Parameters
  • stride: frame stride
function
ImgFrame & setHeight(unsigned int height)
Specifies frame height
Parameters
  • height: frame height
function
ImgFrame & setSize(unsigned int width, unsigned int height)
Specifies frame size
Parameters
  • height: frame height
  • width: frame width
function
ImgFrame & setSize(std::tuple< unsigned int, unsigned int > size)
Specifies frame size
Parameters
  • size: frame size
function
ImgFrame & setSourceSize(unsigned int width, unsigned int height)
Specifies source frame size
Parameters
  • height: frame height
  • width: frame width
function
ImgFrame & setSourceSize(std::tuple< unsigned int, unsigned int > size)
Specifies source frame size
Parameters
  • size: frame size
function
ImgFrame & setType(Type type)
Specifies frame type, RGB, BGR, ...
Parameters
  • type: Type of image
function
ImgFrame & setTransformation(const ImgTransformation & transformation)
Specifies image transformation data
Parameters
  • transformation: transformation data
function
Point2f remapPointFromSource(const Point2f & point)
Remap a point from the current frame to the source frame
Parameters
  • point: point to remap
Returns
remapped point
function
Point2f remapPointToSource(const Point2f & point)
Remap a point from the source frame to the current frame
Parameters
  • point: point to remap
Returns
remapped point
function
Rect remapRectFromSource(const Rect & rect)
Remap a rectangle from the source frame to the current frame
Parameters
  • rect: rectangle to remap
Returns
remapped rectangle
function
Rect remapRectToSource(const Rect & rect)
Remap a rectangle from the current frame to the source frame
Parameters
  • rect: rectangle to remap
Returns
remapped rectangle
function
ImgFrame & setMetadata(const ImgFrame & sourceFrame)
Convenience function to initialize meta data from another frame Copies over timestamps, transformations done on the image, etc.
Parameters
  • sourceFrame: source frame from which the metadata is taken from
function
ImgFrame & setMetadata(const std::shared_ptr< ImgFrame > & sourceFrame)
Convenience function to initialize meta data from another frame Copies over timestamps, transformations done on the image, etc.
Parameters
  • sourceFrame: shared pointer to source frame from which the metadata is taken from
function
ImgFrame & copyDataFrom(const ImgFrame & sourceFrame)
Convenience function to set the data of the ImgFrame
Parameters
  • data: data to set
function
ImgFrame & copyDataFrom(const std::shared_ptr< ImgFrame > & sourceFrame)
Convenience function to set the data of the ImgFrame
Parameters
  • data: data to set
function
std::shared_ptr< ImgFrame > clone()
Create a clone of the ImgFrame with metadata and data copied
Returns
cloned ImgFrame
function
float getSourceDFov()
Note
Fov API works correctly only on rectilinear frames Get the source diagonal field of view in degrees
Returns
field of view in degrees
function
float getSourceHFov()
Note
Fov API works correctly only on rectilinear frames Get the source horizontal field of view
Parameters
  • degrees: field of view in degrees
function
float getSourceVFov()
Note
Fov API works correctly only on rectilinear frames Get the source vertical field of view
Parameters
  • degrees: field of view in degrees
function
bool validateTransformations()
Check that the image transformation match the image size
Returns
true if the transformations are valid
function
ImgFrame & setFrame(cv::Mat frame)
Note
This API only available if OpenCV support is enabled
ImgFrame buffer
Parameters
  • frame: Input cv::Mat frame from which to copy the data
function
cv::Mat getFrame(bool copy)
Note
This API only available if OpenCV support is enabled
Parameters
  • copy: If false only a reference to data is made, otherwise a copy
Returns
cv::Mat with corresponding to ImgFrame parameters
function
cv::Mat getCvFrame(cv::MatAllocator * allocator)
Note
This API only available if OpenCV support is enabled
ImgFrame is converted to color BGR interleaved or grayscale depending on type.A copy is always made
Returns
cv::Mat for use in opencv functions
function
ImgFrame & setCvFrame(cv::Mat frame, Type type)
Note
This API only available if OpenCV support is enabled
ImgFrame buffer and converts to a specific type.
Parameters
  • frame: Input cv::Mat BGR frame or single channel frame from which to copy the data from.
  • type: Specifies the target image format for the internal buffer, including color space, layout, and bit depth.
function
DEPTHAI_SERIALIZE(ImgFrame, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, Buffer::sequenceNum, fb, sourceFb, cam, category, instanceNum, transformation)
function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestamp()
Retrieves timestamp related to dai::Clock::now()
function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestampDevice()
Retrieves timestamp directly captured from device's monotonic clock, not synchronized to host time. Used mostly for debugging
function
std::optional< std::chrono::time_point< std::chrono::system_clock, std::chrono::system_clock::duration > > getTimestampSystem()
Retrieves timestamp directly captured from device's system clock, that can be synchronized using PTP
struct

dai::ImgFrame::CameraSettings

variable
int32_t exposureTimeUs
variable
int32_t sensitivityIso
variable
int32_t lensPosition
variable
int32_t wbColorTemp
variable
float lensPositionRaw
variable
Fsync fsync
variable
int32_t sensorMode
variable
float fps
variable
std::optional< float > sensorTemperatureC
function
DEPTHAI_SERIALIZE(CameraSettings, exposureTimeUs, sensitivityIso, lensPosition, wbColorTemp, lensPositionRaw, fsync, sensorMode, fps, sensorTemperatureC)
struct

dai::ImgFrame::Specs

variable
Type type
variable
unsigned int width
variable
unsigned int height
variable
unsigned int stride
variable
unsigned int bytesPP
variable
unsigned int p1Offset
variable
unsigned int p2Offset
variable
unsigned int p3Offset
function
DEPTHAI_SERIALIZE(Specs, type, width, height, stride, bytesPP, p1Offset, p2Offset, p3Offset)
enum

int32_t Fsync

enumerator
NONE
enumerator
INPUT
enumerator
OUTPUT
enumerator
PTP
enum

Type

enumerator
YUV422i
enumerator
YUV444p
enumerator
YUV420p
enumerator
YUV422p
enumerator
YUV400p
enumerator
RGBA8888
enumerator
RGB161616
enumerator
RGB888p
enumerator
BGR888p
enumerator
RGB888i
enumerator
BGR888i
enumerator
LUT2
enumerator
LUT4
enumerator
LUT16
enumerator
RAW16
enumerator
RAW14
enumerator
RAW12
enumerator
RAW10
enumerator
RAW8
enumerator
PACK10
enumerator
PACK12
enumerator
YUV444i
enumerator
NV12
enumerator
NV21
enumerator
BITSTREAM
enumerator
HDR
enumerator
RGBF16F16F16p
enumerator
BGRF16F16F16p
enumerator
RGBF16F16F16i
enumerator
BGRF16F16F16i
enumerator
GRAY8
enumerator
GRAYF16
enumerator
RAW32
enumerator
NONE
class

dai::MapData

#include MapData.hpp
variable
variable
float minX
variable
float minY
function
MapData()
function
~MapData()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
function
DEPTHAI_SERIALIZE(MapData, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, Buffer::sequenceNum, map, minX, minY)
class

dai::MessageGroup

#include MessageGroup.hpp
variable
std::map< std::string, std::shared_ptr< ADatatype > > group
function
~MessageGroup()
function
std::shared_ptr< ADatatype > operator[](const std::string & name)
Group.
inline function
std::shared_ptr< T > get(const std::string & name)
inline function
std::shared_ptr< ADatatype > get(const std::string & name)
function
void add(const std::string & name, const std::shared_ptr< ADatatype > & value)
function
std::map< std::string, std::shared_ptr< ADatatype > >::iterator begin()
function
std::map< std::string, std::shared_ptr< ADatatype > >::iterator end()
function
bool isSynced(int64_t thresholdNs)
True if all messages in the group are in the interval
Parameters
  • thresholdNs: Maximal interval between messages
function
int64_t getIntervalNs()
Retrieves interval between the first and the last message in the group, measured with the timestamp source that produced the group.
inline function
SyncProperties::TimestampSource getTimestampSource()
Get the timestamp source this group was synced with.
inline function
void setTimestampSource(SyncProperties::TimestampSource source)
Set the timestamp source this group was synced with. Used by the host Sync node; groups received from a device keep the DEVICE default.
function
int64_t getNumMessages()
function
std::vector< std::string > getMessageNames()
Gets the names of messages in the group
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(MessageGroup, group, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, Buffer::sequenceNum)
class

dai::NNData

#include NNData.hpp
variable
std::vector< TensorInfo > tensors
variable
unsigned int batchSize
variable
std::optional< ImgTransformation > transformation
function
NNData()
Construct NNData message.
function
NNData(size_t size)
function
~NNData()
function
std::vector< std::string > getAllLayerNames()
Returns
Names of all layers added
function
std::vector< TensorInfo > getAllLayers()
Returns
All layers and their information
function
std::optional< TensorInfo > getTensorInfo(const std::string & name)
Retrieve tensor information
Parameters
  • name: Name of the tensor
Returns
Tensor information
function
bool getLayer(const std::string & name, TensorInfo & tensor)
Retrieve layers tensor information
Parameters
  • name: Name of the layer
  • tensor: Outputs tensor information of that layer
Returns
True if layer exists, false otherwise
function
bool hasLayer(const std::string & name)
Checks if given layer exists
Parameters
  • name: Name of the layer
Returns
True if layer exists, false otherwise
function
bool getLayerDatatype(const std::string & name, TensorInfo::DataType & datatype)
Retrieve datatype of a layers tensor
Parameters
  • name: Name of the layer
  • datatype: Datatype of layers tensor
Returns
True if layer exists, false otherwise
function
TensorInfo::DataType getTensorDatatype(const std::string & name)
Get the datatype of a given tensor
Returns
TensorInfo::DataType tensor datatype
function
TensorInfo::DataType getFirstTensorDatatype()
Get the datatype of the first tensor
Returns
TensorInfo::DataType tensor datatype
function
span< std::uint8_t > emplaceTensor(TensorInfo & tensor)
Emplace a tensor This function allocates memory for the tensor and return over the said memory. It is up to the caller to fill the memory out with meaningful data.
Returns
Span over the allocated memory
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(NNData, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, tensors, batchSize, transformation)
class

dai::NeuralDepthConfig

#include NeuralDepthConfig.hpp
variable
AlgorithmControl algorithmControl
Controls the flow of stereo algorithm - left-right check, subpixel etc.
variable
PostProcessing postProcessing
Controls the postprocessing of disparity and/or depth map.
function
NeuralDepthConfig()
Construct NeuralDepthConfig message.
function
~NeuralDepthConfig()
function
NeuralDepthConfig & setConfidenceThreshold(uint8_t confThr)
Confidence threshold for disparity calculation
Parameters
  • confThr: Confidence threshold value 0..255
function
uint8_t getConfidenceThreshold()
Get confidence threshold for disparity calculation
function
NeuralDepthConfig & setEdgeThreshold(uint8_t edgeThr)
Set edge threshold for disparity calculation
Parameters
  • edgeThr: Edge threshold value 0..255
function
uint8_t getEdgeThreshold()
Get edge threshold for disparity calculation
function
NeuralDepthConfig & setDepthUnit(AlgorithmControl::DepthUnit depthUnit)
Set depth unit of depth map.
function
AlgorithmControl::DepthUnit getDepthUnit()
Get depth unit of depth map.
function
NeuralDepthConfig & setCustomDepthUnitMultiplier(float multiplier)
Set custom depth unit multiplier relative to 1 meter.
function
float getCustomDepthUnitMultiplier()
Get custom depth unit multiplier relative to 1 meter.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
function
struct

dai::NeuralDepthConfig::AlgorithmControl

using
DepthUnit = dai::DepthUnit
variable
DepthUnit depthUnit
Measurement unit for depth data. Depth data is integer value, multiple of depth unit.
variable
float customDepthUnitMultiplier
Custom depth unit multiplier, if custom depth unit is enabled, relative to 1 meter. A multiplier of 1000 effectively means depth unit in millimeter.
function
struct

dai::NeuralDepthConfig::PostProcessing

using
using
variable
uint8_t confidenceThreshold
Confidence threshold for disparity calculation, Confidences above this value will be considered valid. Valid range is [0,255].
variable
uint8_t edgeThreshold
Edge threshold for disparity calculation, Pixels with edge magnitude below this value will be considered invalid. Valid range is [0,255].
variable
ThresholdFilter thresholdFilter
Threshold filtering. Filters out distances outside of a given interval.
variable
TemporalFilter temporalFilter
Temporal filtering with optional persistence.
function
class

dai::ObjectTrackerConfig

#include ObjectTrackerConfig.hpp
variable
std::vector< int32_t > trackletIdsToRemove
Tracklet IDs to remove from tracking. Tracklet will transition to REMOVED state.
function
ObjectTrackerConfig()
Construct ObjectTrackerConfig message.
function
~ObjectTrackerConfig()
function
ObjectTrackerConfig & forceRemoveID(int32_t id)
Force remove a tracklet with specified ID.
function
ObjectTrackerConfig & forceRemoveIDs(std::vector< int32_t > ids)
Force remove tracklets with specified IDs.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(ObjectTrackerConfig, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, trackletIdsToRemove)
class

dai::Odometry

#include Odometry.hpp
variable
Point3d velocity
Linear velocity in the pose reference coordinate system, in m/s.
variable
int64_t sequenceNum
variable
variable
Timestamp tsDevice
variable
std::optional< Timestamp > tsSystem
variable
Transform transform
function
Odometry()
Construct an Odometry message with an identity pose and zero velocity.
function
Odometry(const Transform & transform, const Point3d & velocity)
Construct an Odometry message.
Parameters
  • transform: Pose of the tracked body.
  • velocity: Linear velocity in the pose reference coordinate system, in m/s.
function
Odometry(double x, double y, double z, double qx, double qy, double qz, double qw, const Point3d & velocity)
Construct an Odometry message from translation, quaternion, and velocity.
Parameters
  • x: Translation along the x axis, in meters.
  • y: Translation along the y axis, in meters.
  • z: Translation along the z axis, in meters.
  • qx: Quaternion x component.
  • qy: Quaternion y component.
  • qz: Quaternion z component.
  • qw: Quaternion w component.
  • velocity: Linear velocity in the pose reference coordinate system, in m/s.
function
~Odometry()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(Odometry, sequenceNum, ts, tsDevice, tsSystem, transform, velocity)
class

dai::PipelineEvent

#include PipelineEvent.hpp
variable
int64_t nodeId
variable
Status status
variable
std::optional< uint32_t > queueSize
variable
Interval interval
variable
Type type
variable
std::string source
function
PipelineEvent()
function
~PipelineEvent()
inline function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(PipelineEvent, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, Buffer::sequenceNum, nodeId, status, queueSize, interval, type, source)
enum

std::int32_t Type

enumerator
CUSTOM
enumerator
LOOP
enumerator
INPUT
enumerator
OUTPUT
enumerator
INPUT_BLOCK
enumerator
OUTPUT_BLOCK
enum

std::int32_t Interval

enumerator
NONE
enumerator
START
enumerator
END
enum

std::int32_t Status

enumerator
SUCCESS
enumerator
BLOCKED
enumerator
CANCELLED
class

dai::NodeEventAggregationConfig

variable
int64_t nodeId
variable
std::optional< std::vector< std::string > > inputs
variable
std::optional< std::vector< std::string > > outputs
variable
std::optional< std::vector< std::string > > others
variable
bool events
function
DEPTHAI_SERIALIZE(NodeEventAggregationConfig, nodeId, inputs, outputs, others, events)
class

dai::PipelineEventAggregationConfig

#include PipelineEventAggregationConfig.hpp
variable
std::vector< NodeEventAggregationConfig > nodes
variable
std::optional< uint32_t > repeatIntervalSeconds
function
PipelineEventAggregationConfig()
function
~PipelineEventAggregationConfig()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(PipelineEventAggregationConfig, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, Buffer::sequenceNum, nodes, repeatIntervalSeconds)
class

dai::NodeState

variable
State state
variable
std::vector< DurationEvent > events
variable
std::unordered_map< std::string, OutputQueueState > outputStates
variable
std::unordered_map< std::string, InputQueueState > inputStates
variable
Timing inputsGetTiming
variable
Timing outputsSendTiming
variable
Timing mainLoopTiming
variable
std::unordered_map< std::string, Timing > otherTimings
function
DEPTHAI_SERIALIZE(NodeState, state, events, outputStates, inputStates, inputsGetTiming, outputsSendTiming, mainLoopTiming, otherTimings)
struct

dai::NodeState::DurationEvent

variable
PipelineEvent startEvent
variable
uint64_t durationUs
function
DEPTHAI_SERIALIZE(DurationEvent, startEvent, durationUs)
struct

dai::NodeState::DurationStats

variable
uint64_t minMicros
variable
uint64_t maxMicros
variable
uint64_t averageMicrosRecent
variable
uint64_t stdDevMicrosRecent
variable
uint64_t minMicrosRecent
variable
uint64_t maxMicrosRecent
variable
uint64_t medianMicrosRecent
function
DEPTHAI_SERIALIZE(DurationStats, minMicros, maxMicros, averageMicrosRecent, stdDevMicrosRecent, minMicrosRecent, maxMicrosRecent, medianMicrosRecent)
struct

dai::NodeState::InputQueueState

variable
enum dai::NodeState::InputQueueState::State state
variable
uint32_t numQueued
variable
Timing timing
variable
QueueStats queueStats
inline function
bool isValid()
function
DEPTHAI_SERIALIZE(InputQueueState, state, numQueued, timing, queueStats)
enum

std::int32_t State

enumerator
IDLE
enumerator
WAITING
enumerator
BLOCKED
struct

dai::NodeState::OutputQueueState

variable
enum dai::NodeState::OutputQueueState::State state
variable
Timing timing
inline function
bool isValid()
function
DEPTHAI_SERIALIZE(OutputQueueState, state, timing)
enum

std::int32_t State

enumerator
IDLE
enumerator
SENDING
struct

dai::NodeState::QueueStats

variable
uint32_t maxQueued
variable
uint32_t minQueuedRecent
variable
uint32_t maxQueuedRecent
variable
uint32_t medianQueuedRecent
function
DEPTHAI_SERIALIZE(QueueStats, maxQueued, minQueuedRecent, maxQueuedRecent, medianQueuedRecent)
struct

dai::NodeState::Timing

variable
float fps
variable
DurationStats durationStats
inline function
bool isValid()
function
DEPTHAI_SERIALIZE(Timing, fps, durationStats)
enum

std::int32_t State

enumerator
IDLE
enumerator
GETTING_INPUTS
enumerator
PROCESSING
enumerator
SENDING_OUTPUTS
class

dai::PipelineState

#include PipelineState.hpp
variable
std::unordered_map< int64_t, NodeState > nodeStates
variable
uint32_t configSequenceNum
function
PipelineState()
function
~PipelineState()
inline function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
nlohmann::json toJson()
function
DEPTHAI_SERIALIZE(PipelineState, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, Buffer::sequenceNum, nodeStates, configSequenceNum)
class

dai::PointCloudConfig

#include PointCloudConfig.hpp
function
PointCloudConfig()
function
~PointCloudConfig()
function
bool getOrganized()
Retrieve whether the point cloud is organized (all width*height points kept).
Returns
true if all width*height points are output, false if only valid (z > 0) points are kept
function
std::array< std::array< float, 4 >, 4 > getTransformationMatrix()
Retrieve transformation matrix applied to every output point.
Returns
4x4 row-major transformation matrix (identity by default)
function
LengthUnit getLengthUnit()
Retrieve the length unit used for output point coordinates.
function
PointCloudConfig & setOrganized(bool enable)
Enable or disable organized point cloud output. When true all width*height points are kept; when false only points with z > 0 are emitted.
function
PointCloudConfig & setTransformationMatrix(const std::array< std::array< float, 4 >, 4 > & transformationMatrix)
Set a 4x4 transformation matrix applied to every output point. Default is the identity matrix.
function
PointCloudConfig & setTransformationMatrix(const std::array< std::array< float, 3 >, 3 > & transformationMatrix)
Convenience overload: set a 3x3 rotation matrix (translation set to zero).
function
PointCloudConfig & setLengthUnit(LengthUnit unit)
Set the length unit for output point coordinates.
function
PointCloudConfig & setTargetCoordinateSystem(CameraBoardSocket targetCamera)
Set target coordinate system to another camera socket.
Parameters
  • targetCamera: Target camera socket
function
PointCloudConfig & setTargetCoordinateSystem(HousingCoordinateSystem housingCS)
Set target coordinate system to housing coordinate system.
Parameters
  • housingCS: Target housing coordinate system
function
PointCloudConfig & setTargetCoordinateSystem(CameraBoardSocket targetCamera, bool useSpecTranslation)
Deprecated: use setTargetCoordinateSystem(targetCamera) instead.
function
PointCloudConfig & setTargetCoordinateSystem(HousingCoordinateSystem housingCS, bool useSpecTranslation)
Deprecated: use setTargetCoordinateSystem(housingCS) instead.
function
CoordinateSystemType getCoordinateSystemType()
Retrieve the coordinate system type.
function
CameraBoardSocket getTargetCameraSocket()
Retrieve the target camera socket (valid when coordSystemType == CAMERA_SOCKET).
function
HousingCoordinateSystem getTargetHousingCS()
Retrieve the target housing coordinate system (valid when coordSystemType == HOUSING).
function
bool getUseSpecTranslation()
Retrieve whether spec translation is used.
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
function
DEPTHAI_SERIALIZE(PointCloudConfig, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, organized, transformationMatrix, lengthUnit, coordSystemType, targetCameraSocket, targetHousingCS, useSpecTranslation)
enum

uint8_t CoordinateSystemType

enumerator
DEFAULT
Default (camera coordinates, no additional transformation)
enumerator
CAMERA_SOCKET
Transform to another camera.
enumerator
HOUSING
Transform to housing coordinate system.
class

dai::PointCloudData

#include PointCloudData.hpp
variable
int64_t sequenceNum
variable
variable
Timestamp tsDevice
variable
std::optional< Timestamp > tsSystem
variable
std::optional< ImgTransformation > transformation
function
PointCloudData()
Construct PointCloudData message.
function
~PointCloudData()
function
std::vector< Point3f > getPoints()
function
std::vector< Point3fRGBA > getPointsRGB()
function
void setPoints(const std::vector< Point3f > & points)
function
void setPointsRGB(const std::vector< Point3fRGBA > & points)
function
unsigned int getInstanceNum()
Retrieves instance number
function
unsigned int getWidth()
Retrieves the height in pixels - in case of a sparse point cloud, this represents the hight of the frame which was used to generate the point cloud
function
unsigned int getHeight()
Retrieves the height in pixels - in case of a sparse point cloud, this represents the hight of the frame which was used to generate the point cloud
function
float getMinX()
Retrieves minimal x coordinate in depth units (millimeter by default)
function
float getMinY()
Retrieves minimal y coordinate in depth units (millimeter by default)
function
float getMinZ()
Retrieves minimal z coordinate in depth units (millimeter by default)
function
float getMaxX()
Retrieves maximal x coordinate in depth units (millimeter by default)
function
float getMaxY()
Retrieves maximal y coordinate in depth units (millimeter by default)
function
float getMaxZ()
Retrieves maximal z coordinate in depth units (millimeter by default)
function
bool isSparse()
Retrieves whether point cloud is sparse DeprecatedUse isOrganized() instead. Sparse means height == 1
function
bool isOrganized()
Retrieves whether point cloud is organized (height > 1) Organized point clouds have width x height structure from the original image Sparse point clouds have height == 1 and only contain valid points
function
bool isColor()
Retrieves whether point cloud is color
function
PointCloudData & setWidth(unsigned int width)
Specifies frame width
Parameters
  • width: frame width
function
PointCloudData & setHeight(unsigned int height)
Specifies frame height
Parameters
  • height: frame height
function
PointCloudData & setSize(unsigned int width, unsigned int height)
Specifies frame size
Parameters
  • height: frame height
  • width: frame width
function
PointCloudData & setSize(std::tuple< unsigned int, unsigned int > size)
Specifies frame size
Parameters
  • size: frame size
function
PointCloudData & setMinX(float val)
Specifies minimal x coordinate in depth units (millimeter by default)
Parameters
  • val: minimal x coordinate in depth units (millimeter by default)
function
PointCloudData & setMinY(float val)
Specifies minimal y coordinate in depth units (millimeter by default)
Parameters
  • val: minimal y coordinate in depth units (millimeter by default)
function
PointCloudData & setMinZ(float val)
Specifies minimal z coordinate in depth units (millimeter by default)
Parameters
  • val: minimal z coordinate in depth units (millimeter by default)
function
PointCloudData & setMaxX(float val)
Specifies maximal x coordinate in depth units (millimeter by default)
Parameters
  • val: maximal x coordinate in depth units (millimeter by default)
function
PointCloudData & setMaxY(float val)
Specifies maximal y coordinate in depth units (millimeter by default)
Parameters
  • val: maximal y coordinate in depth units (millimeter by default)
function
PointCloudData & setMaxZ(float val)
Specifies maximal z coordinate in depth units (millimeter by default)
Parameters
  • val: maximal z coordinate in depth units (millimeter by default)
function
PointCloudData & setSparse(bool val)
Specifies whether point cloud is sparse
Parameters
  • val: whether point cloud is sparse
DeprecatedThis setter is deprecated and will be removed in a future release
function
PointCloudData & setColor(bool val)
Specifies whether point cloud is color
Parameters
  • val: whether point cloud is color
function
PointCloudData & setInstanceNum(unsigned int instanceNum)
Specifies instance number
Parameters
  • instanceNum: instance number
function
const ImgTransformation & getTransformation()
Retrieves image transformation data.For PointCloud output, the distortion model and coefficients describe the source image used to generate the cloud. The 3D points themselves are already compensated for that distortion, so the distortion fields are informational.
function
PointCloudData transformTo(const ImgTransformation & target)
Returns a copy of this point cloud.Due to efficiency reasons, point cloud remapping is currently not implemented. Point clouds should be generated from already aligned source messages instead of being transformed after the fact. Use Align on the source inputs before creating the point cloud.
Parameters
  • target: Target image transformation.
function
PointCloudData & setTransformation(const ImgTransformation & transformation)
Specifies image transformation data
Parameters
  • transformation: transformation data
function
PointCloudData & updateBoundingBox()
Recomputes the bounding box (min/max X, Y, Z) from the current point data. All stored points are included regardless of their z value. If the cloud is empty, all bounds are set to 0.
inline function
void getPclData()
inline function
void setPclData(T...)
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(PointCloudData, width, height, minx, miny, minz, maxx, maxy, maxz, instanceNum, color, transformation, ts, tsDevice, tsSystem, sequenceNum)
function
int64_t getSequenceNum()
Retrieves image sequence number
function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestamp()
Retrieves timestamp related to dai::Clock::now()
function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestampDevice()
Retrieves timestamp directly captured from device's monotonic clock, not synchronized to host time. Used mostly for debugging
function
std::optional< std::chrono::time_point< std::chrono::system_clock, std::chrono::system_clock::duration > > getTimestampSystem()
Retrieves timestamp directly captured from device's system clock, that can be synchronized using PTP
function
std::optional< ImgTransformation > getTransformation()
Returns the current transformation if set, else std::nullopt.
function
void setTransformation(const ImgTransformation & transformation)
Sets the current transformation.
struct

dai::PointCloudData::dependent_false

class

dai::RGBDData

#include RGBDData.hpp
using
FrameVariant = std::variant< std::shared_ptr< ImgFrame >, std::shared_ptr< EncodedFrame > >
function
RGBDData()
Construct RGBD message.
function
~RGBDData()
function
void setRGBFrame(const FrameVariant & frame)
function
void setDepthFrame(const FrameVariant & frame)
function
std::optional< FrameVariant > getRGBFrame()
function
std::optional< FrameVariant > getDepthFrame()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(RGBDData, colorFrame, depthFrame, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, Buffer::sequenceNum)
class

dai::SegmentationMask

#include SegmentationMask.hpp
variable
int64_t sequenceNum
variable
variable
Timestamp tsDevice
variable
std::optional< Timestamp > tsSystem
variable
std::optional< ImgTransformation > transformation
function
SegmentationMask()
function
SegmentationMask(const std::vector< std::uint8_t > & data, size_t width, size_t height)
function
~SegmentationMask()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
SegmentationMask transformTo(const ImgTransformation & target)
Returns a copy of this segmentation mask.Segmentation mask remapping is not implemented. For optimal performance, segmentation masks should be generated from already aligned source messages instead of being transformed after the fact. Use Align on the source inputs to align segmentation masks.
Parameters
  • target: Target image transformation.
function
void setSize(size_t width, size_t height)
Sets the size of the segmentation mask.
Note
Use with caution as it sets the metadata of the mask without allocating or resizing the underlying data array.
function
std::size_t getWidth()
Returns the width of the segmentation mask.
function
std::size_t getHeight()
Returns the height of the segmentation mask.
function
void setMask(const std::vector< std::uint8_t > & mask, size_t width, size_t height)
Sets the segmentation mask from a vector of bytes. The size of the vector must be equal to width * height.
function
void setMask(dai::ImgFrame & frame)
Sets the segmentation mask from an ImgFrame.
Parameters
  • frame: Frame must be of type GRAY8
function
void setMask(span< const std::uint8_t > mask, size_t width, size_t height)
Sets the segmentation mask from a byte span without an extra temporary vector. The span size must be equal to width * height.
function
span< std::uint8_t > prepareMask(size_t width, size_t height)
Prepares internal storage for writing and returns a mutable view to it. The caller must fill exactly width * height bytes.
function
void setLabels(const std::vector< std::string > & labels)
Sets the class labels associated with the segmentation mask. The label at index i in the labels vector corresponds to the value i in the segmentation mask data array.
Parameters
  • labels: Vector of class labels
function
std::vector< std::uint8_t > getMaskData()
Returns a copy of the segmentation mask data as a vector of bytes. If mask data is not set, returns an empty vector.
function
dai::ImgFrame getFrame()
Returns the segmentation mask as an ImgFrame. If mask data is not set, returns an empty frame with only metadata set.
function
std::optional< uint32_t > getArea(uint8_t index)
Returns the area (number of pixels) of the specified instance/class index in the segmentation mask.
Parameters
  • index: Instance/Class index
Note
If index is not present in the mask, returns std::nullopt.
function
std::optional< dai::Point2f > getCentroid(uint8_t index)
Returns the normalized centroid (x,y) coordinates of the specified instance/class index in the segmentation mask.
Parameters
  • index: Instance/Class index
Note
If index is not present in the mask, returns std::nullopt.
function
std::vector< uint8_t > getUniqueIndices()
Returns a list of sorted unique indices present in the segmentation mask.
function
std::vector< std::string > getLabels()
Returns all class labels associated with the segmentation mask. If no labels are set, returns an empty vector.
function
std::vector< std::uint8_t > getMaskByIndex(uint8_t index)
Returns a binary mask where pixels belonging to the specified instance/class index are set to 1, others to 0. If mask data is not set, returns an empty vector.
function
std::vector< std::uint8_t > getMaskByLabel(const std::string & label)
Returns a binary mask where pixels belonging to the specified class label are set to 1, others to 0. If labels are not set or label not found, returns an empty vector.
function
bool hasValidMask()
Returns true if the mask data is not empty and has valid size (width * height).
function
void setCvMask(cv::Mat mask)
Note
This API only available if OpenCV support is enabled Copies cv::Mat data to Segmentation Mask buffer
Parameters
  • frame: Input cv::Mat frame from which to copy the data
Note
Throws if mask is not a single channel INT8 type.
function
cv::Mat getCvMask(cv::MatAllocator * allocator)
Retrieves mask data as a cv::Mat copy with specified width and height. If mask data is not set, returns an empty matrix.
Parameters
  • allocator: Allows callers to supply a custom cv::MatAllocator for zero-copy/custom memory management; nullptr uses OpenCV’s default.
function
cv::Mat getCvMaskByIndex(uint8_t index, cv::MatAllocator * allocator)
Returns a binary mask where pixels belonging to the instance index are set to 1, others to 0. If mask data is not set, returns an empty matrix.
Parameters
  • index: Instance index
  • allocator: Allows callers to supply a custom cv::MatAllocator for zero-copy/custom memory management; nullptr uses OpenCV’s default.
function
std::vector< std::vector< dai::Point2f > > getContour(uint8_t index)
Calls the opencv findContours function and filters the results based on the provided index. Returns filtered contour as a vector of vectors of non-normalized points. If mask data is not set, returns an empty vector.
Parameters
  • index: class index
function
std::vector< dai::RotatedRect > getBoundingBoxes(uint8_t index, bool calculateRotation)
Returns a bounding box for each continuous region with the specified index.
Parameters
  • index: class index
  • calculateRotation: If true, returns rotated bounding boxes, otherwise returns the outer, axis-aligned bounding boxes.
function
DEPTHAI_SERIALIZE(SegmentationMask, ts, tsDevice, tsSystem, sequenceNum, transformation, width, height, labels)
function
int64_t getSequenceNum()
Retrieves image sequence number
function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestamp()
Retrieves timestamp related to dai::Clock::now()
function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestampDevice()
Retrieves timestamp directly captured from device's monotonic clock, not synchronized to host time. Used mostly for debugging
class

dai::SegmentationParserConfig

variable
float confidenceThreshold
variable
unsigned int stepSize
function
SegmentationParserConfig()
Construct SegmentationParserConfig message.
function
~SegmentationParserConfig()
function
void setConfidenceThreshold(float threshold)
Add a confidence threshold to the argmax operation over the segmentation tensor. Pixels with confidence values below this threshold will be assigned the background class (255).
Parameters
  • threshold: Confidence threshold for segmentation parsing
Note
Default is -1.0f, which means no thresholding is applied.
Note
Only applicable if output classes are not in a single layer (eg. classesInOneLayer = false).
function
float getConfidenceThreshold()
Get confidence threshold
function
void setStepSize(unsigned int stepSize)
Sets the step size for segmentation parsing. A step size of 1 means every pixel is processed, a step size of 2 means every second pixel is processed, and so on. This can be used to speed up processing at the cost of lower resolution masks.
Parameters
  • stepSize: Step size for segmentation parsing
function
unsigned int getStepSize()
Gets the step size for segmentation parsing.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(SegmentationParserConfig, confidenceThreshold, stepSize)
struct

dai::SpatialImgDetection

#include SpatialImgDetections.hpp
variable
uint32_t label
variable
std::string labelName
variable
float confidence
variable
float xmin
variable
float ymin
variable
float xmax
variable
float ymax
variable
std::optional< RotatedRect > boundingBox
variable
std::optional< SpatialKeypointsList > keypoints
variable
Point3f spatialCoordinates
variable
function
SpatialImgDetection()
function
SpatialImgDetection(const RotatedRect & boundingBox, Point3f spatialCoordinates, float confidence, uint32_t label)
function
SpatialImgDetection(const RotatedRect & boundingBox, Point3f spatialCoordinates, std::string labelName, float confidence, uint32_t label)
function
SpatialImgDetection(const RotatedRect & boundingBox, Point3f spatialCoordinates, const SpatialKeypointsList & keypoints, float confidence, uint32_t label)
function
SpatialImgDetection(const RotatedRect & boundingBox, Point3f spatialCoordinates, const SpatialKeypointsList & keypoints, std::string labelName, float confidence, uint32_t label)
function
void setBoundingBox(RotatedRect boundingBox)
Sets the bounding box and the legacy coordinates of the detection.
function
RotatedRect getBoundingBox()
Returns bounding box if it was set, else it constructs a new one from the legacy xmin, ymin, xmax, ymax values.
function
void setOuterBoundingBox(const float xmin, const float ymin, const float xmax, const float ymax)
Sets the bounding box and the legacy coordinates of the detection from the top-left and bottom-right points.
function
void setKeypoints(const SpatialKeypointsList keypoints)
Sets the keypoints of the detection.
Parameters
  • keypoints: list of Keypoint objects to set.
Note
This will clear any existing keypoints and edges.
function
void setKeypoints(const std::vector< SpatialKeypoint > keypoints)
Sets the keypoints of the detection.
Parameters
  • keypoints: list of Keypoint objects to set.
Note
This will clear any existing keypoints and edges.
function
void setKeypoints(const std::vector< SpatialKeypoint > keypoints, const std::vector< Edge > edges)
Sets the keypoints of the detection.
Parameters
  • keypoints: list of Point2f objects to set.
Note
This will clear any existing keypoints and edges.
function
void setKeypoints(const std::vector< Point3f > keypoints)
Sets the keypoints of the detection.
Parameters
  • keypoints: list of Point3f objects to set.
Note
This will clear any existing keypoints and edges.
function
void setSpatialCoordinate(const Point3f spatialCoordinates)
Sets spatial coordinates for the detection.
Parameters
  • spatialCoordinates: list of Point3f objects to set.
Note
The size of spatialCoordinates.
function
void setEdges(const std::vector< Edge > edges)
Sets edges for the keypoints, throws if no keypoints were set beforehand.
function
dai::ImgDetection getImgDetection()
Converts SpatialImgDetection to ImgDetection by dropping spatial data.
Returns
function
std::vector< SpatialKeypoint > getKeypoints()
Returns a list of Keypoint objects, or empty list if no keypoints were set.
function
std::vector< dai::Point3f > getKeypointSpatialCoordinates()
Returns a list of spatial coordinates for each keypoint, or empty list if no keypoints were set.
function
std::vector< Edge > getEdges()
Returns a list of edges, each edge is a pair of indices, or empty list if no keypoints were set.
function
float getCenterX()
Returns the X coordinate of the center of the bounding box.
function
float getCenterY()
Returns the Y coordinate of the center of the bounding box.
function
float getWidth()
Returns the width of the (rotated) bounding box.
function
float getHeight()
Returns the height of the (rotated) bounding box.
function
float getAngle()
Returns the angle of the bounding box.
function
void transform(const ImgTransformation & source, const ImgTransformation & target, LengthUnit lengthUnit)
Transforms the spatial detection to the target image transformation.
Parameters
  • source: Source image transformation.
  • target: Target image transformation.
  • lengthUnit: Length unit to use for the transformation. By default, millimeters are assumed.
function
DEPTHAI_SERIALIZE(SpatialImgDetection, label, labelName, confidence, xmin, ymin, xmax, ymax, boundingBox, keypoints, spatialCoordinates, boundingBoxMapping)
class

dai::SpatialImgDetections

#include SpatialImgDetections.hpp
using
variable
LengthUnit unit
Length unit used by all imgDetections' spatialCoordinates in this list.
variable
std::optional< ImgTransformation > transformation
function
~SpatialImgDetections()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
SpatialImgDetections transformTo(const ImgTransformation & target)
Returns a new SpatialImgDetections message with the spatial detections transformed into the target image transformation.For each detection, the bounding box is assumed to lie on a plane parallel to the image plane at depth detection.spatialCoordinates.z (that is, all four bounding-box corners are projected using the same depth value). The transformed corners are then fit with the smallest enclosing rotated rectangle to preserve rectangularity.
Parameters
  • target: Target image transformation.
Returns
SpatialImgDetections with transformed detections.
function
DEPTHAI_SERIALIZE(SpatialImgDetections, sequenceNum, ts, tsDevice, tsSystem, detections, transformation, segmentationMaskWidth, segmentationMaskHeight, unit)
struct

dai::SpatialLocationCalculatorConfigThresholds

#include SpatialLocationCalculatorConfig.hpp
variable
uint32_t lowerThreshold
Values less or equal than this threshold are not taken into calculation.
variable
uint32_t upperThreshold
Values greater or equal than this threshold are not taken into calculation.
struct

dai::SpatialLocationCalculatorConfigData

#include SpatialLocationCalculatorConfig.hpp
variable
Rect roi
Region of interest for spatial location calculation.
variable
SpatialLocationCalculatorConfigThresholds depthThresholds
Upper and lower thresholds for depth values to take into consideration.
variable
SpatialLocationCalculatorAlgorithm calculationAlgorithm
Calculation method used to obtain spatial locations Average/mean: the average of ROI is used for calculation. Min: the minimum value inside ROI is used for calculation. Max: the maximum value inside ROI is used for calculation. Mode: the most frequent value inside ROI is used for calculation. Median: the median value inside ROI is used for calculation. Default: median.
variable
std::int32_t stepSize
Step size for calculation. Step size 1 means that every pixel is taken into calculation, size 2 means every second etc. Default value AUTO: for AVERAGE, MIN, MAX step size is 1; for MODE/MEDIAN it's 2.
class

dai::SpatialLocationCalculatorConfig

#include SpatialLocationCalculatorConfig.hpp
variable
int32_t globalStepSize
variable
uint32_t globalLowerThreshold
variable
uint32_t globalUpperThreshold
variable
SpatialLocationCalculatorAlgorithm globalCalculationAlgorithm
variable
int32_t globalKeypointRadius
variable
bool calculateSpatialKeypoints
variable
bool useSegmentation
variable
bool segmentationPassthrough
variable
float bBoxScaleFactor
variable
function
SpatialLocationCalculatorConfig()
function
~SpatialLocationCalculatorConfig()
function
void setROIs(const std::vector< SpatialLocationCalculatorConfigData > & ROIs)
Specify additional regions of interest (ROI) to calculate their spatial coordinates. Results of ROI coordinates are available on SpatialLocationCalculatorData output.
Parameters
  • ROIs: Vector of configuration parameters for ROIs (region of interests)
function
void addROI(SpatialLocationCalculatorConfigData & ROI)
Add a new region of interest (ROI) to configuration data.
Parameters
  • roi: Configuration parameters for ROI
function
void setDepthThresholds(uint32_t lowerThreshold, uint32_t upperThreshold)
Set the lower and upper depth value thresholds to be used in the spatial calculations.
Parameters
  • lowerThreshold: Lower threshold in depth units (millimeter by default).
  • upperThreshold: Upper threshold in depth units (millimeter by default).
function
void setCalculationAlgorithm(SpatialLocationCalculatorAlgorithm calculationAlgorithm)
Set spatial location calculation algorithm. Possible values:
  • MEDIAN: Median of all depth values in the ROI
  • AVERAGE: Average of all depth values in the ROI
  • MIN: Minimum depth value in the ROI
  • MAX: Maximum depth value in the ROI
  • MODE: Most frequent depth value in the ROI
function
void setStepSize(int32_t stepSize)
Set step size for spatial location calculation. Step size 1 means that every pixel is taken into calculation, size 2 means every second etc. for AVERAGE, MIN, MAX step size is 1; for MODE/MEDIAN it's 2.
function
void setKeypointRadius(int32_t radius)
Set radius around keypoints to calculate spatial coordinates.
Parameters
  • radius: Radius in pixels.
Warning
Only applicable to Keypoints or ImgDetections with keypoints.
function
void setCalculateSpatialKeypoints(bool calculateSpatialKeypoints)
If false, spatial coordinates of keypoints will not be calculated.
Parameters
  • calculateSpatialKeypoints:
Warning
Only applicable to ImgDetections with keypoints.
function
void setUseSegmentation(bool useSegmentation)
Specify whether to consider only segmented pixels within a detection bounding box for spatial calculations.
Parameters
  • useSegmentation:
Warning
Only applicable to ImgDetections with segmentation masks.
function
void setSegmentationPassthrough(bool passthroughSegmentation)
Specify whether to passthrough segmentation mask along with spatial detections.
Parameters
  • passthroughSegmentation:
Warning
Only applicable to ImgDetections with segmentation masks.
function
void setBoundingBoxScaleFactor(float scaleFactor)
Set scale factor for bounding boxes used in spatial calculations.
Parameters
  • scaleFactor: Scale factor must be in the interval (0,1].
function
std::vector< SpatialLocationCalculatorConfigData > getConfigData()
Retrieve configuration data for SpatialLocationCalculator
Returns
Vector of configuration parameters for ROIs (region of interests)
function
std::pair< int32_t, int32_t > getDepthThresholds()
function
SpatialLocationCalculatorAlgorithm getCalculationAlgorithm()
function
int32_t getStepSize()
function
int32_t getKeypointRadius()
Retrieve radius around keypoints used to calculate spatial coordinates.
function
bool getCalculateSpatialKeypoints()
Retrieve whether keypoints are used for spatial location calculation.
Warning
Only applicable to ImgDetections with keypoints.
function
bool getUseSegmentation()
Retrieve whether segmentation is used for spatial location calculation.
Warning
Only applicable to ImgDetections with segmentation masks.
function
bool getSegmentationPassthrough()
Retrieve whether segmentation is passed through along with spatial detections.
Warning
Only applicable to ImgDetections with segmentation masks.
function
float getBoundingBoxScaleFactor()
Retrieve scale factor for bounding boxes used in spatial calculations.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(SpatialLocationCalculatorConfig, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, globalStepSize, globalLowerThreshold, globalUpperThreshold, globalCalculationAlgorithm, globalKeypointRadius, calculateSpatialKeypoints, useSegmentation, segmentationPassthrough, bBoxScaleFactor, config)
struct

dai::SpatialLocations

#include SpatialLocationCalculatorData.hpp
variable
SpatialLocationCalculatorConfigData config
Configuration for selected ROI
variable
float depthAverage
Average of depth values inside the ROI between the specified thresholds in config. Calculated only if calculation method is set to AVERAGE or MIN oR MAX.
variable
float depthMode
Most frequent of depth values inside the ROI between the specified thresholds in config. Calculated only if calculation method is set to MODE.
variable
float depthMedian
Median of depth values inside the ROI between the specified thresholds in config. Calculated only if calculation method is set to MEDIAN.
variable
std::uint16_t depthMin
Minimum of depth values inside the ROI between the specified thresholds in config. Calculated only if calculation method is set to AVERAGE or MIN oR MAX.
variable
std::uint16_t depthMax
Maximum of depth values inside the ROI between the specified thresholds in config. Calculated only if calculation method is set to AVERAGE or MIN oR MAX.
variable
std::uint32_t depthAveragePixelCount
Number of depth values used in calculations.
variable
Point3f spatialCoordinates
Spatial coordinates - x,y,z; x,y are the relative positions of the center of ROI to the center of depth map
class

dai::SpatialLocationCalculatorData

#include SpatialLocationCalculatorData.hpp
variable
std::vector< SpatialLocations > spatialLocations
function
SpatialLocationCalculatorData()
Construct SpatialLocationCalculatorData message.
function
~SpatialLocationCalculatorData()
function
std::vector< SpatialLocations > getSpatialLocations()
Retrieve configuration data for SpatialLocationCalculatorData.
Returns
Vector of spatial location data, carrying spatial information (X,Y,Z)
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(SpatialLocationCalculatorData, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, spatialLocations)
class

dai::StereoDepthConfig

#include StereoDepthConfig.hpp
using
MedianFilter = filters::params::MedianFilter
variable
AlgorithmControl algorithmControl
Controls the flow of stereo algorithm - left-right check, subpixel etc.
variable
PostProcessing postProcessing
Controls the postprocessing of disparity and/or depth map.
variable
CensusTransform censusTransform
Census transform settings.
variable
CostMatching costMatching
Cost matching settings.
variable
CostAggregation costAggregation
Cost aggregation settings.
variable
ConfidenceMetrics confidenceMetrics
Confidence metrics settings. RVC4 only.
variable
dai::ProcessorType filtersBackend
Compute backend for post-processing filters. RVC4 only.
function
StereoDepthConfig()
Construct StereoDepthConfig message.
function
~StereoDepthConfig()
function
StereoDepthConfig & setDepthAlign(AlgorithmControl::DepthAlign align)
Parameters
  • align: Set the disparity/depth alignment: centered (between the 'left' and 'right' inputs), or from the perspective of a rectified output stream
function
StereoDepthConfig & setConfidenceThreshold(int confThr)
Confidence threshold for disparity calculation
Parameters
  • confThr: Confidence threshold value 0..255
function
int getConfidenceThreshold()
Get confidence threshold for disparity calculation
function
StereoDepthConfig & setMedianFilter(MedianFilter median)
Parameters
  • median: Set kernel size for disparity/depth median filtering, or disable
function
MedianFilter getMedianFilter()
Get median filter setting
function
StereoDepthConfig & setBilateralFilterSigma(uint16_t sigma)
A larger value of the parameter means that farther colors within the pixel neighborhood will be mixed together, resulting in larger areas of semi-equal color.
Parameters
  • sigma: Set sigma value for 5x5 bilateral filter. 0..65535
function
uint16_t getBilateralFilterSigma()
Get sigma value for 5x5 bilateral filter
function
StereoDepthConfig & setLeftRightCheckThreshold(int threshold)
Parameters
  • threshold: Set threshold for left-right, right-left disparity map combine, 0..255
function
int getLeftRightCheckThreshold()
Get threshold for left-right check combine
function
StereoDepthConfig & setLeftRightCheck(bool enable)
Computes and combines disparities in both L-R and R-L directions, and combine them.For better occlusion handling, discarding invalid disparity values
function
bool getLeftRightCheck()
Get left-right check setting
function
StereoDepthConfig & setExtendedDisparity(bool enable)
Disparity range increased from 95 to 190, combined from full resolution and downscaled images. Suitable for short range objects
function
bool getExtendedDisparity()
Get extended disparity setting
function
StereoDepthConfig & setSubpixel(bool enable)
Computes disparity with sub-pixel interpolation (3 fractional bits by default).Suitable for long range. Currently incompatible with extended disparity
function
bool getSubpixel()
Get subpixel setting
function
StereoDepthConfig & setSubpixelFractionalBits(int subpixelFractionalBits)
Number of fractional bits for subpixel mode. Default value: 3. Valid values: 3,4,5. Defines the number of fractional disparities: 2^x. Median filter postprocessing is supported only for 3 fractional bits.
function
int getSubpixelFractionalBits()
Get number of fractional bits for subpixel mode
function
StereoDepthConfig & setDepthUnit(AlgorithmControl::DepthUnit depthUnit)
Set depth unit of depth map.Meter, centimeter, millimeter, inch, foot or custom unit is available.
function
AlgorithmControl::DepthUnit getDepthUnit()
Get depth unit of depth map.
function
StereoDepthConfig & setCustomDepthUnitMultiplier(float multiplier)
Set custom depth unit multiplier relative to 1 meter.
function
float getCustomDepthUnitMultiplier()
Get custom depth unit multiplier relative to 1 meter.
function
StereoDepthConfig & setDisparityShift(int disparityShift)
Shift input frame by a number of pixels to increase minimum depth. For example shifting by 48 will change effective disparity search range from (0,95] to [48,143]. An alternative approach to reducing the minZ. We normally only recommend doing this when it is known that there will be no objects farther away than MaxZ, such as having a depth camera mounted above a table pointing down at the table surface.
function
StereoDepthConfig & setNumInvalidateEdgePixels(int32_t numInvalidateEdgePixels)
Invalidate X amount of pixels at the edge of disparity frame. For right and center alignment X pixels will be invalidated from the right edge, for left alignment from the left edge.
function
StereoDepthConfig & setFiltersComputeBackend(dai::ProcessorType filtersBackend)
Set filters compute backend RVC4 only.
function
dai::ProcessorType getFiltersComputeBackend()
Get filters compute backend RVC4 only.
function
float getMaxDisparity()
Useful for normalization of the disparity map.
Returns
Maximum disparity value that the node can return
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
struct

dai::StereoDepthConfig::AlgorithmControl

using
DepthUnit = dai::DepthUnit
variable
DepthAlign depthAlign
Set the disparity/depth alignment to the perspective of a rectified output, or center it
variable
DepthUnit depthUnit
Measurement unit for depth data. Depth data is integer value, multiple of depth unit.
variable
float customDepthUnitMultiplier
Custom depth unit multiplier, if custom depth unit is enabled, relative to 1 meter. A multiplier of 1000 effectively means depth unit in millimeter.
variable
bool enableLeftRightCheck
Computes and combines disparities in both L-R and R-L directions, and combine them. For better occlusion handling
variable
bool enableSwLeftRightCheck
Enables software left right check. RVC4 only.
variable
bool enableExtended
Disparity range increased from 95 to 190, combined from full resolution and downscaled images. Suitable for short range objects
variable
bool enableSubpixel
Computes disparity with sub-pixel interpolation (5 fractional bits), suitable for long range RVC2 only.
variable
std::int32_t leftRightCheckThreshold
Left-right check threshold for left-right, right-left disparity map combine, 0..128 Used only when left-right check mode is enabled. Defines the maximum difference between the confidence of pixels from left-right and right-left confidence maps
variable
std::int32_t subpixelFractionalBits
Number of fractional bits for subpixel modeValid values: 3,4,5Defines the number of fractional disparities: 2^xMedian filter postprocessing is supported only for 3 fractional bits RVC2 only.
variable
std::int32_t disparityShift
Shift input frame by a number of pixels to increase minimum depth. For example shifting by 48 will change effective disparity search range from (0,95] to [48,143]. An alternative approach to reducing the minZ. We normally only recommend doing this when it is known that there will be no objects farther away than MaxZ, such as having a depth camera mounted above a table pointing down at the table surface. RVC2 only.
variable
std::optional< float > centerAlignmentShiftFactor
variable
std::int32_t numInvalidateEdgePixels
Invalidate X amount of pixels at the edge of disparity frame. For right and center alignment X pixels will be invalidated from the right edge, for left alignment from the left edge. RVC2 only.
function
enum

int32_t DepthAlign

Align the disparity/depth to the perspective of a rectified output, or center it
enumerator
AUTO
enumerator
RECTIFIED_RIGHT
enumerator
RECTIFIED_LEFT
enumerator
CENTER
enumerator
RIGHT
enumerator
LEFT
struct

dai::StereoDepthConfig::CensusTransform

#include StereoDepthConfig.hpp
variable
KernelSize kernelSize
Census transform kernel size. RVC2 only.
variable
uint64_t kernelMask
Census transform mask, default - auto, mask is set based on resolution and kernel size. Disabled for 400p input resolution. Enabled for 720p. 0XA82415 for 5x5 census transform kernel. 0XAA02A8154055 for 7x7 census transform kernel. 0X2AA00AA805540155 for 7x9 census transform kernel. Empirical values. RVC2 only.
variable
bool enableMeanMode
If enabled, each pixel in the window is compared with the mean window value instead of the central pixel. RVC2 only.
variable
uint32_t threshold
Census transform comparison threshold value. RVC2 only.
variable
int8_t noiseThresholdOffset
Used to reduce small fixed levels of noise across all luminance values in the current image. Valid range is [0,127]. Default value is 1. RVC4 only.
variable
int8_t noiseThresholdScale
Used to reduce noise values that increase with luminance in the current image. Valid range is [-128,127]. Default value is 1. RVC4 only.
function
enum

std::int32_t KernelSize

Census transform kernel size possible values.
enumerator
AUTO
enumerator
KERNEL_5x5
enumerator
KERNEL_7x7
enumerator
KERNEL_7x9
struct

dai::StereoDepthConfig::ConfidenceMetrics

#include StereoDepthConfig.hpp
variable
uint8_t occlusionConfidenceWeight
Weight used with occlusion estimation to generate final confidence map. Valid range is [0,32]
variable
uint8_t motionVectorConfidenceWeight
Weight used with local neighborhood motion vector variance estimation to generate final confidence map. Valid range is [0,32].
variable
uint8_t motionVectorConfidenceThreshold
Threshold offset for MV variance in confidence generation. A value of 0 allows most variance. Valid range is [0,3].
variable
uint8_t flatnessConfidenceWeight
Weight used with flatness estimation to generate final confidence map. Valid range is [0,32].
variable
uint8_t flatnessConfidenceThreshold
Threshold for flatness check in SGM block. Valid range is [1,7].
variable
bool flatnessOverride
Flag to indicate whether final confidence value will be overidden by flatness value. Valid range is {true,false}.
function
struct

dai::StereoDepthConfig::CostAggregation

#include StereoDepthConfig.hpp
variable
uint8_t divisionFactor
Cost calculation linear equation parameters. RVC2 only.
variable
uint16_t horizontalPenaltyCostP1
Horizontal P1 penalty cost parameter. RVC2 only.
variable
uint16_t horizontalPenaltyCostP2
Horizontal P2 penalty cost parameter. RVC2 only.
variable
uint16_t verticalPenaltyCostP1
Vertical P1 penalty cost parameter. RVC2 only.
variable
uint16_t verticalPenaltyCostP2
Vertical P2 penalty cost parameter. RVC2 only.
variable
P1Config p1Config
Adaptive P1 penalty configuration. RVC4 only.
variable
P2Config p2Config
Adaptive P2 penalty configuration. RVC4 only.
function
struct

dai::StereoDepthConfig::CostAggregation::P1Config

#include StereoDepthConfig.hpp
variable
bool enableAdaptive
Used to disable/enable adaptive penalty.
variable
uint8_t defaultValue
Used as the default penalty value when nAdapEnable is disabled. A bigger value enforces higher smoothness and reduced noise at the cost of lower edge accuracy. This value must be smaller than P2 default penalty. Valid range is [10,50].
variable
uint8_t edgeValue
Penalty value on edges when nAdapEnable is enabled. A smaller penalty value permits higher change in disparity. This value must be smaller than or equal to P2 edge penalty. Valid range is [10,50].
variable
uint8_t smoothValue
Penalty value on low texture regions when nAdapEnable is enabled. A smaller penalty value permits higher change in disparity. This value must be smaller than or equal to P2 smoothness penalty. Valid range is [10,50].
variable
uint8_t edgeThreshold
Threshold value on edges when nAdapEnable is enabled. A bigger value permits higher neighboring feature dissimilarity tolerance. This value is shared with P2 penalty configuration. Valid range is [8,16].
variable
uint8_t smoothThreshold
Threshold value on low texture regions when nAdapEnable is enabled. A bigger value permits higher neighboring feature dissimilarity tolerance. This value is shared with P2 penalty configuration. Valid range is [2,12].
function
struct

dai::StereoDepthConfig::CostAggregation::P2Config

#include StereoDepthConfig.hpp
variable
bool enableAdaptive
Used to disable/enable adaptive penalty.
variable
uint8_t defaultValue
Used as the default penalty value when nAdapEnable is disabled. A bigger value enforces higher smoothness and reduced noise at the cost of lower edge accuracy. This value must be larger than P1 default penalty. Valid range is [20,100].
variable
uint8_t edgeValue
Penalty value on edges when nAdapEnable is enabled. A smaller penalty value permits higher change in disparity. This value must be larger than or equal to P1 edge penalty. Valid range is [20,100].
variable
uint8_t smoothValue
Penalty value on low texture regions when nAdapEnable is enabled. A smaller penalty value permits higher change in disparity. This value must be larger than or equal to P1 smoothness penalty. Valid range is [20,100].
function
struct

dai::StereoDepthConfig::CostMatching

#include StereoDepthConfig.hpp
variable
DisparityWidth disparityWidth
Disparity search range, default 96 pixels. RVC2 only.
variable
bool enableCompanding
Disparity companding using sparse matching. Matching pixel by pixel for N disparities. Matching every 2nd pixel for M disparitites. Matching every 4th pixel for T disparities. In case of 96 disparities: N=48, M=32, T=16. This way the search range is extended to 176 disparities, by sparse matching. Note: when enabling this flag only depth map will be affected, disparity map is not. RVC2 only.
variable
uint8_t invalidDisparityValue
Used only for debug purposes, SW postprocessing handled only invalid value of 0 properly. RVC2 only.
variable
uint8_t confidenceThreshold
Disparities with confidence value over this threshold are accepted.
variable
bool enableSwConfidenceThresholding
Enable software confidence thresholding. RVC4 only.
variable
LinearEquationParameters linearEquationParameters
Cost calculation linear equation parameters. RVC2 only.
function
struct

dai::StereoDepthConfig::CostMatching::LinearEquationParameters

#include StereoDepthConfig.hpp
variable
uint8_t alpha
variable
uint8_t beta
variable
uint8_t threshold
function
DEPTHAI_SERIALIZE(LinearEquationParameters, alpha, beta, threshold)
enum

std::uint32_t DisparityWidth

Disparity search range: 64 or 96 pixels are supported by the HW.
enumerator
DISPARITY_64
enumerator
DISPARITY_96
struct

dai::StereoDepthConfig::PostProcessing

#include StereoDepthConfig.hpp
using
using
using
using
variable
std::array< Filter, 5 > filteringOrder
Order of filters to be applied if filtering is enabled.
variable
MedianFilter median
Set kernel size for disparity/depth median filtering, or disable
variable
std::int16_t bilateralSigmaValue
Sigma value for bilateral filter. 0 means disabled. A larger value of the parameter means that farther colors within the pixel neighborhood will be mixed together. RVC2 only.
variable
SpatialFilter spatialFilter
Edge-preserving filtering: This type of filter will smooth the depth noise while attempting to preserve edges.
variable
TemporalFilter temporalFilter
Temporal filtering with optional persistence.
variable
ThresholdFilter thresholdFilter
Threshold filtering. Filters out distances outside of a given interval.
variable
BrightnessFilter brightnessFilter
Brightness filtering. If input frame pixel is too dark or too bright, disparity will be invalidated. The idea is that for too dark/too bright pixels we have low confidence, since that area was under/over exposed and details were lost.
variable
SpeckleFilter speckleFilter
Speckle filtering. Removes speckle noise.
variable
DecimationFilter decimationFilter
Decimation filter. Reduces disparity/depth map x/y complexity, reducing runtime complexity for other filters.
variable
HoleFilling holeFilling
Hole-filling configuration. RVC4 only.
variable
AdaptiveMedianFilter adaptiveMedianFilter
Adaptive median filter configuration. RVC4 only.
function
struct

dai::StereoDepthConfig::PostProcessing::AdaptiveMedianFilter

#include StereoDepthConfig.hpp
variable
bool enable
Flag to enable adaptive median filtering for a final pass of filtering on low confidence pixels.
variable
uint8_t confidenceThreshold
Confidence threshold for adaptive median filtering. Should be less than nFillConfThresh value used in evaDfsHoleFillConfig. Valid range is [0,255].
function
struct

dai::StereoDepthConfig::PostProcessing::BrightnessFilter

#include StereoDepthConfig.hpp
variable
std::int32_t minBrightness
Minimum pixel brightness. If input pixel is less or equal than this value the depth value is invalidated.
variable
std::int32_t maxBrightness
Maximum range in depth units. If input pixel is less or equal than this value the depth value is invalidated.
function
struct

dai::StereoDepthConfig::PostProcessing::DecimationFilter

#include StereoDepthConfig.hpp
variable
std::uint32_t decimationFactor
Decimation factor. Valid values are 1,2,3,4. Disparity/depth map x/y resolution will be decimated with this value.
variable
DecimationMode decimationMode
Decimation algorithm type.
function
enum

int32_t DecimationMode

Decimation algorithm type.
enumerator
PIXEL_SKIPPING
enumerator
NON_ZERO_MEDIAN
enumerator
NON_ZERO_MEAN
struct

dai::StereoDepthConfig::PostProcessing::HoleFilling

#include StereoDepthConfig.hpp
variable
bool enable
Flag to enable post-processing hole-filling.
variable
uint8_t highConfidenceThreshold
Pixels with confidence higher than this value are used to calculate an average disparity per superpixel. Valid range is [1,255]
variable
uint8_t fillConfidenceThreshold
Pixels with confidence below this value will be filled with the average disparity of their corresponding superpixel. Valid range is [1,255].
variable
uint8_t minValidDisparity
Represents the required percentange of pixels with confidence value above nHighConfThresh that are used to calculate average disparity per superpixel, where 1 means 50% or half, 2 means 25% or a quarter and 3 means 12.5% or an eighth. If the required number of pixels are not found, the holes will not be filled.
variable
bool invalidateDisparities
If enabled, sets to 0 the disparity of pixels with confidence below nFillConfThresh, which did not pass nMinValidPixels criteria. Valid range is {true, false}.
function
enum

int32_t Filter

enumerator
NONE
enumerator
DECIMATION
enumerator
SPECKLE
enumerator
MEDIAN
enumerator
SPATIAL
enumerator
TEMPORAL
enumerator
FILTER_COUNT
class

dai::StreamMessageParser

class

dai::SystemInformation

#include SystemInformation.hpp
variable
MemoryInfo ddrMemoryUsage
variable
MemoryInfo cmxMemoryUsage
variable
MemoryInfo leonCssMemoryUsage
variable
MemoryInfo leonMssMemoryUsage
variable
CpuUsage leonCssCpuUsage
variable
CpuUsage leonMssCpuUsage
variable
ChipTemperature chipTemperature
function
SystemInformation()
Construct SystemInformation message.
function
~SystemInformation()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(SystemInformation, ddrMemoryUsage, cmxMemoryUsage, leonCssMemoryUsage, leonMssMemoryUsage, leonCssCpuUsage, leonMssCpuUsage, chipTemperature)
class

dai::SystemInformationRVC4

#include SystemInformationRVC4.hpp
variable
MemoryInfo ddrMemoryUsage
variable
int64_t processMemoryUsage
variable
CpuUsage cpuAvgUsage
variable
CpuUsage processCpuAvgUsage
variable
std::vector< CpuUsage > cpuUsages
variable
ChipTemperatureRVC4 chipTemperature
function
SystemInformationRVC4()
Construct SystemInformation message.
function
~SystemInformationRVC4()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(SystemInformationRVC4, ddrMemoryUsage, processMemoryUsage, cpuAvgUsage, processCpuAvgUsage, cpuUsages, chipTemperature)
class

dai::ThermalConfig

#include ThermalConfig.hpp
variable
ThermalAmbientParams ambientParams
Ambient factors that affect the temperature measurement of a Thermal sensor.
variable
ThermalFFCParams ffcParams
Parameters for Flat-Field-Correction.
variable
ThermalImageParams imageParams
Image signal processing parameters on the sensor.
function
ThermalConfig()
Construct ThermalConfig message.
function
~ThermalConfig()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
struct

dai::ThermalConfig::ThermalAmbientParams

#include ThermalConfig.hpp
variable
std::optional< uint16_t > distance
Distance to the measured object. unit:cnt(128cnt=1m), range:0-25600(0-200m)
variable
std::optional< uint16_t > reflectionTemperature
Reflection temperature. unit:K, range:230-500(high gain), 230-900(low gain)
variable
std::optional< uint16_t > atmosphericTemperature
Atmospheric temperature. unit:K, range:230-500(high gain), 230-900(low gain)
variable
std::optional< uint8_t > targetEmissivity
Emissivity. unit:1/128, range:1-128(0.01-1)
variable
std::optional< uint8_t > atmosphericTransmittance
Atmospheric transmittance. unit:1/128, range:1-128(0.01-1)
variable
std::optional< ThermalGainMode > gainMode
Gain mode, low or high.
function
struct

dai::ThermalConfig::ThermalFFCParams

variable
std::optional< bool > autoFFC
Auto Flat-Field-Correction. Controls wheather the shutter is controlled by the sensor module automatically or not.
variable
std::optional< uint16_t > minFFCInterval
Minimum FFC interval when auto FFC is enabled. The time interval between two FFC should not be less than this value.
variable
std::optional< uint16_t > maxFFCInterval
Maximum FFC interval when auto FFC is enabled. The time interval between two FFC should not be more than this value.
variable
std::optional< uint16_t > autoFFCTempThreshold
Auto FFC trigger threshold. The condition for triggering the auto FFC is that the change of Vtemp value exceeds a certain threshold, which is called the Auto FFC trigger threshold.
variable
std::optional< bool > fallProtection
The shutter blade may open/close abnormally during strong mechanical shock (such as fall), and a monitoring process is designed in the firmware to correct the abnormal shutter switch in time. Turn on or off the fall protect mechanism.
variable
std::optional< uint16_t > minShutterInterval
Frequent FFC will cause shutter heating, resulting in abnormal FFC effect and abnormal temperature measurement. Regardless of which mechanism triggers FFC, the minimum trigger interval must be limited.
variable
std::optional< bool > closeManualShutter
Set this to True/False to close/open the shutter when autoFFC is disabled.
variable
std::optional< uint16_t > antiFallProtectionThresholdHighGainMode
variable
std::optional< uint16_t > antiFallProtectionThresholdLowGainMode
function
DEPTHAI_SERIALIZE(ThermalFFCParams, autoFFC, minFFCInterval, maxFFCInterval, autoFFCTempThreshold, fallProtection, minShutterInterval, closeManualShutter, antiFallProtectionThresholdHighGainMode, antiFallProtectionThresholdLowGainMode)
struct

dai::ThermalConfig::ThermalImageParams

variable
std::optional< uint8_t > timeNoiseFilterLevel
0-3. Time noise filter level. Filters out the noise that appears over time.
variable
std::optional< uint8_t > spatialNoiseFilterLevel
0-3. Spatial noise filter level.
variable
std::optional< uint8_t > digitalDetailEnhanceLevel
0-4 Digital etail enhance level.
variable
std::optional< uint8_t > brightnessLevel
Image brightness level, 0-255.
variable
std::optional< uint8_t > contrastLevel
Image contrast level, 0-255.
variable
std::optional< ThermalImageOrientation > orientation
Orientation of the image. Computed on the sensor.
function
enum

ThermalImageOrientation

Orientation of the image.
enumerator
Normal
enumerator
Mirror
enumerator
Flip
enumerator
MirrorFlip
enum

ThermalGainMode

Thermal sensor gain mode. Use low gain in high energy environments.
enumerator
LOW
enumerator
HIGH
class

dai::ToFConfig

#include ToFConfig.hpp
variable
Profile profile
variable
filters::params::MedianFilter median
Set kernel size for depth median filtering, or disable
variable
int phaseUnwrappingLevel
variable
uint16_t phaseUnwrapErrorThreshold
variable
bool enablePhaseShuffleTemporalFilter
variable
bool enableBurstMode
variable
bool enableDistortionCorrection
variable
std::optional< bool > enableFPPNCorrection
variable
std::optional< bool > enableOpticalCorrection
variable
std::optional< bool > enableTemperatureCorrection
variable
std::optional< bool > enableWiggleCorrection
variable
std::optional< bool > enablePhaseUnwrapping
function
ToFConfig()
Construct ToFConfig message.
function
~ToFConfig()
function
ToFConfig & setMedianFilter(filters::params::MedianFilter median)
Parameters
  • median: Set kernel size for median filtering, or disable
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
void setProfilePreset(Profile profile)
Set preset mode for ToFConfig.
Parameters
function
DEPTHAI_SERIALIZE(ToFConfig, profile, median, enablePhaseShuffleTemporalFilter, enableBurstMode, enableDistortionCorrection, enableFPPNCorrection, enableOpticalCorrection, enableTemperatureCorrection, enableWiggleCorrection, enablePhaseUnwrapping, phaseUnwrappingLevel, phaseUnwrapErrorThreshold)
enum

uint32_t Profile

enumerator
LOW_RANGE
enumerator
MID_RANGE
enumerator
HIGH_RANGE
struct

dai::TrackedFeature

#include TrackedFeatures.hpp
variable
Point2f position
x, y position of the detected feature
variable
uint32_t id
Feature ID. Persistent between frames if motion estimation is enabled.
variable
uint32_t age
Feature age in frames
variable
float harrisScore
Feature harris score
variable
float trackingError
Feature tracking error
variable
std::array< uint8_t, 32 > descriptor
Feature descriptor
class

dai::TrackedFeatures

#include TrackedFeatures.hpp
variable
std::vector< TrackedFeature > trackedFeatures
function
TrackedFeatures()
Construct TrackedFeatures message.
function
~TrackedFeatures()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(TrackedFeatures, trackedFeatures, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem)
struct

dai::Tracklet

#include Tracklets.hpp
variable
Rect roi
Tracked region of interest.
variable
std::int32_t id
Tracklet's ID.
variable
std::int32_t label
Tracklet's label ID.
variable
std::int32_t age
Number of frames it is being tracked for.
variable
TrackingStatus status
Status of tracklet.
variable
ImgDetection srcImgDetection
Image detection that is tracked.
variable
Point3f spatialCoordinates
Spatial coordinates of tracklet.
variable
std::optional< Point3f > velocity
Estimated 3D velocity of the tracklet in m/s. nullopt when spatial data is unavailable.
variable
std::optional< float > speed
Magnitude of the estimated 3D velocity in m/s. nullopt when spatial data is unavailable.
function
void transform(const ImgTransformation & source, const ImgTransformation & target, LengthUnit lengthUnit)
Transforms the tracklet to the target image transformation.
Parameters
  • source: Source image transformation.
  • target: Target image transformation.
  • lengthUnit: Length unit used by this tracklet's spatial coordinates.
function
enum

std::int32_t TrackingStatus

enumerator
NEW
The object is newly added.
enumerator
TRACKED
The object is being tracked.
enumerator
LOST
The object gets lost now. The object can be tracked again automatically(long term tracking) or by specifying detected object manually(short term and zero term tracking).
enumerator
REMOVED
The object is removed.
class

dai::Tracklets

#include Tracklets.hpp
variable
LengthUnit unit
Measurement unit used by all tracklets' spatialCoordinates in this list.
variable
std::vector< Tracklet > tracklets
Retrieve data for Tracklets.
Returns
Vector of object tracker data, carrying tracking information.
variable
int64_t sequenceNum
variable
variable
Timestamp tsDevice
variable
std::optional< Timestamp > tsSystem
variable
std::optional< ImgTransformation > transformation
function
Tracklets()
Construct Tracklets message.
function
~Tracklets()
function
Tracklets transformTo(const ImgTransformation & target)
Returns a new Tracklets message with the tracklets transformed into the target image transformation.For each tracklet, the bounding box is assumed to lie on a plane parallel to the image plane at depth tracklet.spatialCoordinates.z (that is, all four bounding-box corners are projected using the same depth value). The transformed corners are then fit with the smallest enclosing rotated rectangle to preserve rectangularity.
Parameters
  • target: Target image transformation.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(Tracklets, tracklets, transformation, ts, tsDevice, tsSystem, sequenceNum, unit)
function
std::optional< ImgTransformation > getTransformation()
Returns the current transformation if set, else std::nullopt.
function
void setTransformation(const ImgTransformation & transformation)
Sets the current transformation.
struct

dai::Transform

variable
std::array< std::array< double, 4 >, 4 > matrix
class

dai::TransformData

#include TransformData.hppDerived by dai::Odometry
variable
Transform transform
function
TransformData()
Construct TransformData message.
function
TransformData(const Transform & transform)
function
TransformData(const std::array< std::array< double, 4 >, 4 > & data)
function
TransformData(double x, double y, double z, double qx, double qy, double qz, double qw)
function
TransformData(double x, double y, double z, double roll, double pitch, double yaw)
function
~TransformData()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
Point3d getTranslation()
function
Point3d getRotationEuler()
function
Quaterniond getQuaternion()
function
DEPTHAI_SERIALIZE(TransformData, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, Buffer::tsSystem, transform)
class

dai::Transformable

#include Transformable.hppDerived by dai::TransformableCRTP< Classifications >, dai::TransformableCRTP< AprilTags >, dai::TransformableCRTP< PointCloudData >, dai::TransformableCRTP< SegmentationMask >, dai::TransformableCRTP< SpatialImgDetections >, dai::TransformableCRTP< Map2D >, dai::TransformableCRTP< ImgDetections >, dai::TransformableCRTP< Lines >, dai::TransformableCRTP< Keypoints >, dai::TransformableCRTP< Predictions >, dai::TransformableCRTP< Clusters >, dai::TransformableCRTP< Tracklets >, dai::TransformableBuffer, dai::TransformableCRTP< Derived >
variable
std::optional< ImgTransformation > transformation
function
~Transformable()
function
std::optional< ImgTransformation > getTransformation()
Returns the current transformation if set, else std::nullopt.
function
void setTransformation(const ImgTransformation & transformation)
Sets the current transformation.
function
DEPTHAI_SERIALIZE(Transformable, transformation)
class

dai::TransformableCRTP

inline function
Derived transformTo(const ImgTransformation & target)
class

dai::TransformableBuffer

#include Transformable.hpp
variable
int64_t sequenceNum
variable
variable
Timestamp tsDevice
variable
std::optional< Timestamp > tsSystem
variable
std::optional< ImgTransformation > transformation
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
TransformableBuffer()
function
~TransformableBuffer()
function
std::shared_ptr< TransformableBuffer > transformTo(const ImgTransformation & target)
Returns a transformed copy of this message.Python subclasses of TransformableBuffer should override this method to implement custom transformation logic. Generic callers use this entry point when they need to transform a custom message without knowing its concrete type. The base implementation throws, because it cannot preserve Python subclass state automatically.
Parameters
  • target: Target image transformation.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
function
DEPTHAI_SERIALIZE(TransformableBuffer, sequenceNum, ts, tsDevice, tsSystem, Transformable::transformation)
function
std::optional< ImgTransformation > getTransformation()
Returns the current transformation if set, else std::nullopt.
function
void setTransformation(const ImgTransformation & transformation)
Sets the current transformation.
class

dai::VppConfig

#include VppConfig.hpp
variable
float blending
variable
float distanceGamma
variable
uint8_t maxPatchSize
variable
PatchColoringType patchColoringType
variable
bool uniformPatch
variable
InjectionParameters injectionParameters
variable
int maxNumThreads
variable
int maxFPS
function
VppConfig()
function
~VppConfig()
inline function
float getBlending()
Get blending factor between 0 and 1.
Returns
Current blending value
inline function
void setBlending(float value)
Set blending factor between 0 and 1: resulting pixel: patchColor * blending + (1 - blending) * imgFrame.
Parameters
  • value: Blending value to set
inline function
float getDistanceGamma()
Get distance gamma.
Returns
Current distance gamma
inline function
void setDistanceGamma(float value)
Set distance gamma.
Parameters
  • value: Distance gamma to set
inline function
uint8_t getMaxPatchSize()
Get maximum patch size.
Returns
Maximum patch size
inline function
void setMaxPatchSize(uint8_t value)
Set maximum patch size.
Parameters
  • value: Patch size to set
inline function
PatchColoringType getPatchColoringType()
Get patch coloring type: UNIFORM/MAXDIST.
Returns
Current patch coloring type
inline function
void setPatchColoringType(PatchColoringType type)
Set patch coloring type: UNIFORM/MAXDIST.
Parameters
  • type: Patch coloring type to set
inline function
bool getUniformPatch()
Check if uniform patching is enabled.
Returns
True if uniform patching is enabled
inline function
void setUniformPatch(bool value)
Enable or disable uniform patching.
Parameters
  • value: True to enable, false to disable
inline function
InjectionParameters getInjectionParameters()
Get injection parameters.
Returns
Current injection parameters
inline function
void setInjectionParameters(const InjectionParameters & params)
Set injection parameters.
Parameters
  • params: Injection parameters to set
inline function
int getMaxNumThreads()
Get maximum number of threads.
Returns
Maximum number of threads
inline function
void setMaxNumThreads(int value)
Set maximum number of threads.
Parameters
  • value: Number of threads to set
inline function
int getMaxFPS()
Get maximum FPS.
Returns
Maximum FPS
inline function
void setMaxFPS(int value)
Set maximum FPS.
Parameters
  • value: Maximum FPS to set
inline function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
function
DEPTHAI_SERIALIZE(VppConfig, blending, distanceGamma, maxPatchSize, patchColoringType, uniformPatch, injectionParameters, maxNumThreads, maxFPS)
struct

dai::VppConfig::InjectionParameters

variable
bool useInjection
variable
int kernelSize
variable
float textureThreshold
variable
float confidenceThreshold
variable
int morphologyIterations
variable
bool useMorphology
inline function
bool getUseInjection()
Check if injection is enabled False: all possible pixels will be used.
Returns
True if injection is used
inline function
void setUseInjection(bool value)
Enable or disable injection.
Parameters
  • value: True to use injection, false to disable
inline function
int getKernelSize()
Get kernel size for injection.
Returns
Kernel size
inline function
void setKernelSize(int value)
Set kernel size for injection.
Parameters
  • value: Kernel size to set
inline function
float getTextureThreshold()
Get texture threshold.
Returns
Texture threshold value
inline function
void setTextureThreshold(float value)
Set texture threshold.
Parameters
  • value: Texture threshold to set
inline function
float getConfidenceThreshold()
Get confidence threshold.
Returns
Confidence threshold value
inline function
void setConfidenceThreshold(float value)
Set confidence threshold.
Parameters
  • value: Confidence threshold to set
inline function
int getMorphologyIterations()
Get number of morphology iterations.
Returns
Number of iterations
inline function
void setMorphologyIterations(int value)
Set number of morphology iterations.
Parameters
  • value: Number of iterations
inline function
bool isUseMorphology()
Check if morphology is used.
Returns
True if morphology is applied
inline function
void setUseMorphology(bool value)
Enable or disable morphology.
Parameters
  • value: True to use morphology, false to disable
function
DEPTHAI_SERIALIZE(InjectionParameters, useInjection, kernelSize, textureThreshold, confidenceThreshold, morphologyIterations, useMorphology)
enum

int PatchColoringType

enumerator
RANDOM
enumerator
MAXDIST
struct

dai::AlignProperties

#include AlignProperties.hpp
variable
AlignConfig initialConfig
variable
int numFramesPool
Num frames in output pool.
function
~AlignProperties()
struct

dai::AprilTagProperties

#include AprilTagProperties.hpp
variable
AprilTagConfig initialConfig
variable
bool inputConfigSync
Whether to wait for config at 'inputConfig' IO.
variable
int numThreads
How many threads to use for AprilTag detection.
function
~AprilTagProperties()
struct

dai::AutoCalibrationProperties

variable
AutoCalibrationConfig initialConfig
function
~AutoCalibrationProperties()
struct

dai::BenchmarkInProperties

#include BenchmarkInProperties.hpp
variable
uint32_t reportEveryNMessages
Specify how many messages to measure for each report
variable
bool attachLatencies
Specify whether the latenices are attached to the report individually
variable
bool logReportsAsWarnings
Send the reports also as logger warnings
function
~BenchmarkInProperties()
struct

dai::BenchmarkOutProperties

#include BenchmarkOutProperties.hpp
variable
int numMessages
Number of messages to send
variable
float fps
FPS for sending, 0 means as fast as possible
function
~BenchmarkOutProperties()
struct

dai::CameraProperties

#include CameraProperties.hpp
variable
std::vector< ImgFrameCapability > outputRequests
variable
CameraControl initialControl
Initial controls applied to the camera node
variable
CameraBoardSocket boardSocket
Which socket will this camera node use
variable
CameraSensorType sensorType
Camera sensor type (you can pick one in case the given sensor supports multiple types)
variable
std::string cameraName
Which camera name will this camera node use (e.g. "IMX378", "OV9282")
variable
CameraImageOrientation imageOrientation
Camera sensor image orientation / pixel readout
variable
int32_t resolutionWidth
Select the camera sensor width (e.g. 1920, 1280, 640, etc.)
variable
int32_t resolutionHeight
Select the camera sensor height (e.g. 1080, 720, 400, etc.)
variable
int32_t mockIspWidth
Select the mock isp width. Overrides resolutionWidth/height if mockIsp is connected (e.g. 1920, 1280, 640, etc.)
variable
int32_t mockIspHeight
Select the mock isp height. Overrides resolutionWidth/height if mockIsp is connected (e.g. 1080, 720, 400, etc.)
variable
float mockIspFps
Select the mock isp fps. Overrides fps if mockIsp is connected (e.g. 30, 25, 20, etc.)
variable
float fps
Camera sensor FPS (e.g. 30, 25, 20, etc.)
variable
int isp3aFps
Isp 3A rate (auto focus, auto exposure, auto white balance, camera controls etc.). Default (0) matches the camera FPS, meaning that 3A is running on each frame. Reducing the rate of 3A reduces the CPU usage on CSS, but also increases the convergence rate of 3A. Note that camera controls will be processed at this rate. E.g. if camera is running at 30 fps, and camera control is sent at every frame, but 3A fps is set to 15, the camera control messages will be processed at 15 fps rate, which will lead to queueing.
variable
int numFramesPoolRaw
Number of frames in different pools and the maximum size in bytes of each pool (number of frames will be automatically reduced if the size is exceeded) Raw pool
variable
int maxSizePoolRaw
variable
int numFramesPoolIsp
Isp pool
variable
int maxSizePoolIsp
variable
int numFramesPoolVideo
Video pool
variable
int numFramesPoolPreview
Preview pool
variable
int numFramesPoolStill
Still pool
variable
std::optional< int > numFramesPoolOutputs
Outputs frame pools
variable
std::optional< int > maxSizePoolOutputs
function
~CameraProperties()
struct

dai::CastProperties

#include CastProperties.hpp
variable
dai::ImgFrame::Type outputType
variable
std::optional< float > scale
variable
std::optional< float > offset
variable
int numFramesPool
function
~CastProperties()
struct

dai::ColorCameraProperties

#include ColorCameraProperties.hpp
variable
CameraControl initialControl
Initial controls applied to ColorCamera node
variable
CameraBoardSocket boardSocket
Which socket will color camera use
variable
std::string cameraName
Which camera name will color camera use
variable
CameraImageOrientation imageOrientation
Camera sensor image orientation / pixel readout
variable
ImgFrame::Type previewType
Frame type
variable
uint32_t previewHeight
Preview frame output height
variable
uint32_t previewWidth
Preview frame output width
variable
int32_t videoWidth
Preview frame output width
variable
int32_t videoHeight
Preview frame output height
variable
int32_t stillWidth
Preview frame output width
variable
int32_t stillHeight
Preview frame output height
variable
int32_t mockIspWidth
Select the mock isp width. Overrides resolutionWidth/height if mockIsp is connected.
variable
int32_t mockIspHeight
Select the mock isp height. Overrides resolutionWidth/height if mockIsp is connected.
variable
SensorResolution resolution
Select the camera sensor resolution
variable
float fps
Camera sensor FPS
variable
int isp3aFps
Isp 3A rate (auto focus, auto exposure, auto white balance, camera controls etc.). Default (0) matches the camera FPS, meaning that 3A is running on each frame. Reducing the rate of 3A reduces the CPU usage on CSS, but also increases the convergence rate of 3A. Note that camera controls will be processed at this rate. E.g. if camera is running at 30 fps, and camera control is sent at every frame, but 3A fps is set to 15, the camera control messages will be processed at 15 fps rate, which will lead to queueing.
variable
float sensorCropX
Initial sensor crop, -1 signifies center crop
variable
float sensorCropY
variable
bool previewKeepAspectRatio
Whether to keep aspect ratio of input (video size) or not
variable
IspScale ispScale
Configure scaling for isp output.
variable
int numFramesPoolRaw
Pool sizes
variable
int numFramesPoolIsp
variable
int numFramesPoolVideo
variable
int numFramesPoolPreview
variable
int numFramesPoolStill
variable
WarpMeshSource warpMeshSource
variable
std::string warpMeshUri
variable
int warpMeshWidth
variable
int warpMeshHeight
variable
float calibAlpha
variable
int warpMeshStepWidth
variable
int warpMeshStepHeight
variable
std::vector< dai::FrameEvent > eventFilter
List of events to receive, the rest will be ignored
variable
std::optional< bool > rawPacked
Configures whether the camera raw frames are saved as MIPI-packed to memory. The packed format is more efficient, consuming less memory on device, and less data to send to host: RAW10: 4 pixels saved on 5 bytes, RAW12: 2 pixels saved on 3 bytes. When packing is disabled (false), data is saved lsb-aligned, e.g. a RAW10 pixel will be stored as uint16, on bits 9..0: 0b0000'00pp'pppp'pppp. Default is auto: enabled for standard color/monochrome cameras where ISP can work with both packed/unpacked, but disabled for other cameras like ToF.
function
~ColorCameraProperties()
struct

dai::ColorCameraProperties::IspScale

variable
int32_t horizNumerator
variable
int32_t horizDenominator
variable
int32_t vertNumerator
variable
int32_t vertDenominator
function
DEPTHAI_SERIALIZE(IspScale, horizNumerator, horizDenominator, vertNumerator, vertDenominator)
enum

int32_t SensorResolution

Select the camera sensor resolution
enumerator
THE_1080_P
1920 × 1080
enumerator
THE_4_K
3840 × 2160
enumerator
THE_12_MP
4056 × 3040
enumerator
THE_13_MP
4208 × 3120
enumerator
THE_720_P
1280 × 720
enumerator
THE_800_P
1280 × 800
enumerator
THE_1200_P
1920 × 1200
enumerator
THE_5_MP
2592 × 1944
enumerator
THE_4000X3000
4000 × 3000
enumerator
THE_5312X6000
5312 × 6000
enumerator
THE_48_MP
8000 × 6000
enumerator
THE_240X180
240 x 180
enumerator
THE_1280X962
1280 x 962
enumerator
THE_2000X1500
2000 × 1500
enumerator
THE_2028X1520
2028 × 1520
enumerator
THE_2104X1560
2104 × 1560
enumerator
THE_1440X1080
1440 × 1080
enumerator
THE_1352X1012
1352 × 1012
enumerator
THE_2024X1520
2024 × 1520
enum

int32_t ColorOrder

For 24 bit color these can be either RGB or BGR
enumerator
BGR
enumerator
RGB
enum

WarpMeshSource

Warp mesh source
enumerator
AUTO
enumerator
NONE
enumerator
CALIBRATION
enumerator
URI
struct

dai::DetectionParserProperties

#include DetectionParserProperties.hpp
variable
int numFramesPool
Num frames in output pool.
variable
std::unordered_map< std::string, TensorInfo > networkInputs
Network inputs.
variable
DetectionParserOptions parser
Options for parser.
function
~DetectionParserProperties()
struct

dai::DeviceNodeGroupProperties

#include DeviceNodeGroupProperties.hpp
variable
int dummy
function
~DeviceNodeGroupProperties()
struct

dai::DynamicCalibrationProperties

#include DynamicCalibrationProperties.hpp
variable
bool emptyBool
function
~DynamicCalibrationProperties()
struct

dai::EdgeDetectorProperties

#include EdgeDetectorProperties.hpp
variable
EdgeDetectorConfig initialConfig
Initial edge detector config.
variable
int outputFrameSize
Maximum output frame size in bytes (eg: 300x300 BGR image -> 300*300*3 bytes)
variable
int numFramesPool
Num frames in output pool.
function
~EdgeDetectorProperties()
struct

dai::FeatureTrackerProperties

#include FeatureTrackerProperties.hpp
variable
FeatureTrackerConfig initialConfig
Initial feature tracker config
variable
std::int32_t numShaves
Number of shaves reserved for feature tracking. Optical flow can use 1 or 2 shaves, while for corner detection only 1 is enough. Hardware motion estimation doesn't require shaves. Maximum 2, minimum 1.
variable
std::int32_t numMemorySlices
Number of memory slices reserved for feature tracking. Optical flow can use 1 or 2 memory slices, while for corner detection only 1 is enough. Maximum number of features depends on the number of allocated memory slices. Hardware motion estimation doesn't require memory slices. Maximum 2, minimum 1.
function
~FeatureTrackerProperties()
struct

dai::GPUStereoProperties

variable
GPUStereoConfig initialConfig
function
~GPUStereoProperties()
struct

dai::GateProperties

#include GateProperties.hpp
variable
GateControl initialConfig
function
~GateProperties()
struct

dai::GlobalProperties

#include GlobalProperties.hpp
variable
std::optional< std::string > pipelineName
variable
std::optional< std::string > pipelineVersion
variable
std::optional< std::vector< MultiDeviceExtrinsics > > multiDeviceCalibration
Optional cross-device calibration graph shared by all devices in a multi-device pipeline. Use beta::MultiDeviceCalibrationHandler to build, validate and resolve it.
function
~GlobalProperties()
struct

dai::DeviceProperties

#include GlobalProperties.hpp
variable
double leonCssFrequencyHz
Set frequency of Leon OS - Increasing can improve performance, at the cost of higher power draw
variable
double leonMssFrequencyHz
Set frequency of Leon RT - Increasing can improve performance, at the cost of higher power draw
variable
std::optional< dai::EepromData > calibData
Calibration data sent through pipeline
variable
uint32_t eepromId
Unique identifier for the eeprom data in the pipeline.
variable
std::optional< std::uint32_t > cameraTuningBlobSize
Camera tuning blob size in bytes
variable
std::string cameraTuningBlobUri
Uri which points to camera tuning blob
variable
std::unordered_map< CameraBoardSocket, std::uint32_t > cameraSocketTuningBlobSize
Socket specific camera tuning blob size in bytes
variable
std::unordered_map< CameraBoardSocket, std::string > cameraSocketTuningBlobUri
Socket specific camera tuning blob uri
variable
int32_t xlinkChunkSize
Chunk size for splitting device-sent XLink packets, in bytes. A larger value could increase performance, with 0 disabling chunking. A negative value won't modify the device defaults - configured per protocol, currently 64*1024 for both USB and Ethernet.
variable
uint32_t sippBufferSize
SIPP (Signal Image Processing Pipeline) internal memory pool. SIPP is a framework used to schedule HW filters, e.g. ISP, Warp, Median filter etc. Changing the size of this pool is meant for advanced use cases, pushing the limits of the HW. By default memory is allocated in high speed CMX memory. Setting to 0 will allocate in DDR 256 kilobytes. Units are bytes.
variable
uint32_t sippDmaBufferSize
SIPP (Signal Image Processing Pipeline) internal DMA memory pool. SIPP is a framework used to schedule HW filters, e.g. ISP, Warp, Median filter etc. Changing the size of this pool is meant for advanced use cases, pushing the limits of the HW. Memory is allocated in high speed CMX memory Units are bytes.
function
~DeviceProperties()
inline function
DeviceProperties & setFrom(const DeviceProperties & other)
struct

dai::IMUSensorConfig

variable
bool sensitivityEnabled
variable
bool sensitivityRelative
Change reports relative (vs absolute)
variable
uint16_t changeSensitivity
Report-on-change threshold.
variable
uint32_t reportRate
variable
IMUSensor sensorId
struct

dai::IMUProperties

variable
std::vector< IMUSensorConfig > imuSensors
variable
std::int32_t batchReportThreshold
variable
std::int32_t maxBatchReports
variable
std::optional< bool > enableFirmwareUpdate
Whether to perform firmware update or not. Default value: false.
function
~IMUProperties()
struct

dai::ImageAlignProperties

#include ImageAlignProperties.hpp
using
Interpolation = dai::Interpolation
variable
ImageAlignConfig initialConfig
variable
int numFramesPool
Num frames in output pool.
variable
int alignWidth
Optional output width
variable
int alignHeight
Optional output height
variable
std::vector< int > warpHwIds
Warp HW IDs to use, if empty, use auto/default.
variable
Interpolation interpolation
Interpolation type to use.
variable
bool outKeepAspectRatio
Whether to keep aspect ratio of the input or not
variable
std::int32_t numShaves
Number of shaves reserved.
function
~ImageAlignProperties()
struct

dai::ImageFiltersProperties

variable
ImageFiltersConfig initialConfig
Initial config for the filter pipeline
function
~ImageFiltersProperties()
struct

dai::ToFDepthConfidenceFilterProperties

variable
ToFDepthConfidenceFilterConfig initialConfig
Initial config for the ToF depth confidence filter
function
~ToFDepthConfidenceFilterProperties()
struct

dai::ImageManipProperties

#include ImageManipProperties.hpp
variable
ImageManipConfig initialConfig
Initial configuration for ImageManip node.
variable
int outputFrameSize
Maximum output frame size in bytes (eg: 300x300 BGR image -> 300*300*3 bytes)
variable
int numFramesPool
Num frames in output pool.
variable
unsigned int maxPoolSize
Maximum pool size for automatic calculation of pool size. Currently only used on RVC4.
variable
Backend backend
Backend preference for ImageManip. Only applied on RVC4.
variable
PerformanceMode performanceMode
Performance mode for ImageManip. Only applied on RVC4.
function
~ImageManipProperties()
enum

uint8_t Backend

Backend preference for ImageManip on RVC4.
  • CPU: Run ImageManip on the CPU.
  • HW: Prefer the dedicated hardware image manipulation backend.
  • GPU: Prefer the GPU backend.
  • AUTO: Let the runtime select the backend automatically (GPU with CPU fallback).
Hardware-accelerated backends can cause some unexpected behavior when using multiple ImageManip nodes in series. Currently, the only operation affected is downscaling.
enumerator
CPU
enumerator
HW
enumerator
GPU
enumerator
AUTO
enum

uint8_t PerformanceMode

Set performance mode for ImageManip with a tradeoff between performance and power consumption. Only applied on RVC4. This only affects scaling NV12 and GRAY images.
  • PERFORMANCE: High performance, high power consumption. Uses the OpenCV backend.
  • BALANCED: Balanced performance and power consumption. Uses the FastCV backend configured for high performance where possible with a fallback to OpenCV.
  • LOW_POWER: Low performance, low power consumption. Uses the FastCV backend configured for low power where possible with a fallback to OpenCV.
enumerator
PERFORMANCE
enumerator
BALANCED
enumerator
LOW_POWER
struct

dai::MessageDemuxProperties

#include MessageDemuxProperties.hpp
variable
ProcessorType processor
Which processor should execute the node.
function
~MessageDemuxProperties()
struct

dai::MonoCameraProperties

#include MonoCameraProperties.hpp
variable
CameraControl initialControl
Initial controls applied to MonoCamera node
variable
CameraBoardSocket boardSocket
Which socket will mono camera use
variable
std::string cameraName
Which camera name will mono camera use
variable
CameraImageOrientation imageOrientation
Camera sensor image orientation / pixel readout
variable
SensorResolution resolution
Select the camera sensor resolution
variable
int32_t mockIspWidth
Select the mock isp width. Overrides resolutionWidth/height if mockIsp is connected.
variable
int32_t mockIspHeight
Select the mock isp height. Overrides resolutionWidth/height if mockIsp is connected.
variable
float fps
Camera sensor FPS
variable
int isp3aFps
Isp 3A rate (auto focus, auto exposure, auto white balance, camera controls etc.). Default (0) matches the camera FPS, meaning that 3A is running on each frame. Reducing the rate of 3A reduces the CPU usage on CSS, but also increases the convergence rate of 3A. Note that camera controls will be processed at this rate. E.g. if camera is running at 30 fps, and camera control is sent at every frame, but 3A fps is set to 15, the camera control messages will be processed at 15 fps rate, which will lead to queueing.
variable
int numFramesPool
Frame pool size for the main output, ISP processed
variable
int numFramesPoolRaw
Frame pool size for the raw output
variable
std::vector< dai::FrameEvent > eventFilter
List of events to receive, the rest will be ignored
variable
std::optional< bool > rawPacked
Configures whether the camera raw frames are saved as MIPI-packed to memory. The packed format is more efficient, consuming less memory on device, and less data to send to host: RAW10: 4 pixels saved on 5 bytes, RAW12: 2 pixels saved on 3 bytes. When packing is disabled (false), data is saved lsb-aligned, e.g. a RAW10 pixel will be stored as uint16, on bits 9..0: 0b0000'00pp'pppp'pppp. Default is auto: enabled for standard color/monochrome cameras where ISP can work with both packed/unpacked, but disabled for other cameras like ToF.
function
~MonoCameraProperties()
enum

int32_t SensorResolution

Select the camera sensor resolution: 1280×720, 1280×800, 640×400, 640×480, 1920×1200, ...
enumerator
THE_720_P
enumerator
THE_800_P
enumerator
THE_400_P
enumerator
THE_480_P
enumerator
THE_1200_P
enumerator
THE_4000X3000
enumerator
THE_4224X3136
struct

dai::NeuralDepthProperties

#include NeuralDepthProperties.hpp
variable
NeuralDepthConfig initialConfig
function
~NeuralDepthProperties()
struct

dai::NeuralNetworkProperties

#include NeuralNetworkProperties.hpp
variable
ModelSource modelSource
variable
std::optional< std::uint32_t > blobSize
Blob binary size in bytes
variable
std::string blobUri
Uri which points to blob
variable
std::string modelUri
Uri which points to the model description
variable
std::uint32_t numFrames
Number of available output tensors in pool
variable
std::uint32_t numThreads
Number of threads to create for running inference. 0 = auto
variable
std::uint32_t numNCEPerThread
Number of NCE (Neural Compute Engine) per inference thread. 0 = auto
variable
std::uint32_t numShavesPerThread
Number of Shaves per inference thread. 0 = auto
variable
std::string backend
Specify which backend is used. "" = auto
variable
std::map< std::string, std::string > backendProperties
Specify backend properties
variable
std::optional< DeviceModelZoo > deviceModel
Device model from device model zoo
function
~NeuralNetworkProperties()
enum

ModelSource

Specify where the node should source the model
enumerator
BLOB
enumerator
CUSTOM_MODEL
struct

dai::ObjectTrackerProperties

#include ObjectTrackerProperties.hpp
variable
float trackerThreshold
Confidence threshold for tracklets. Above this threshold detections will be tracked. Default 0, all detections are tracked.
variable
std::int32_t maxObjectsToTrack
Maximum number of objects to track. Maximum 60 for SHORT_TERM_KCF, maximum 1000 for other tracking methods. Default 60.
variable
std::vector< std::uint32_t > detectionLabelsToTrack
Which detections labels to track. Default all labels are tracked.
variable
TrackerType trackerType
Tracking method.
variable
TrackerIdAssignmentPolicy trackerIdAssignmentPolicy
New ID assignment policy.
variable
bool trackingPerClass
Whether tracker should take into consideration class label for tracking.
variable
float occlusionRatioThreshold
Occlusion ratio threshold. Used to filter out overlapping tracklets.
variable
uint32_t trackletMaxLifespan
Tracklet lifespan in number of frames. Number of frames after which a LOST tracklet is removed.
variable
uint32_t trackletBirthThreshold
Tracklet birth threshold. Minimum consecutive tracked frames required to consider a tracklet as a new instance.
variable
bool spatialAssociation
Whether to use spatial coordinates in association when available.
variable
float spatialAssociationWeight
Weight for spatial distance in association cost [0,1].
variable
float spatialDistanceThreshold
Base 3D gating threshold in meters used for spatial association.
variable
float spatialDepthAwareScale
Depth-aware gating scale. Gate grows with depth: gate = base * (1 + scale * depthMeters).
function
~ObjectTrackerProperties()
struct

dai::PointCloudProperties

#include PointCloudProperties.hpp
variable
PointCloudConfig initialConfig
variable
int numFramesPool
function
~PointCloudProperties()
struct

dai::PoolProperties

#include PoolProperties.hpp
variable
std::optional< int > numMessages
Number of messages in pool
variable
std::optional< std::int64_t > maxMessageSize
Size of data allocated for each message
variable
std::optional< DatatypeEnum > datatype
Optional datatype of messages in the pool
variable
std::optional< ProcessorType > processor
Which processor should hold the pool
function
~PoolProperties()
struct

dai::Properties

#include Properties.hppDerived by dai::PropertiesSerializable< Properties, ToFProperties >, dai::PropertiesSerializable< Properties, ImageAlignProperties >, dai::PropertiesSerializable< Properties, DeviceProperties >, dai::PropertiesSerializable< Properties, CameraProperties >, dai::PropertiesSerializable< Properties, AlignProperties >, dai::PropertiesSerializable< Properties, MPPalmDetectionParserProperties >, dai::PropertiesSerializable< Properties, ClassificationSequenceParserProperties >, dai::PropertiesSerializable< Properties, ObjectTrackerProperties >, dai::PropertiesSerializable< Properties, NeuralNetworkProperties >, dai::PropertiesSerializable< Properties, GateProperties >, dai::PropertiesSerializable< Properties, EdgeDetectorProperties >, dai::PropertiesSerializable< Properties, PPTextDetectionParserProperties >, dai::PropertiesSerializable< Properties, VideoEncoderProperties >, dai::PropertiesSerializable< Properties, PoolProperties >, dai::PropertiesSerializable< Properties, FeatureTrackerProperties >, dai::PropertiesSerializable< Properties, DeviceNodeGroupProperties >, dai::PropertiesSerializable< Properties, ColorCameraProperties >, dai::PropertiesSerializable< Properties, VppProperties >, dai::PropertiesSerializable< Properties, UVCProperties >, dai::PropertiesSerializable< Properties, MLSDParserProperties >, dai::PropertiesSerializable< Properties, ImageOutputParserProperties >, dai::PropertiesSerializable< Properties, SystemLoggerProperties >, dai::PropertiesSerializable< Properties, SyncProperties >, dai::PropertiesSerializable< Properties, SPIInProperties >, dai::PropertiesSerializable< Properties, MonoCameraProperties >, dai::PropertiesSerializable< Properties, ImageFiltersProperties >, dai::PropertiesSerializable< Properties, XLinkOutProperties >, dai::PropertiesSerializable< Properties, HRNetParserProperties >, dai::PropertiesSerializable< Properties, GlobalProperties >, dai::PropertiesSerializable< Properties, MapOutputParserProperties >, dai::PropertiesSerializable< Properties, ToFDepthConfidenceFilterProperties >, dai::PropertiesSerializable< Properties, StereoDepthProperties >, dai::PropertiesSerializable< Properties, SPIOutProperties >, dai::PropertiesSerializable< Properties, XLinkInProperties >, dai::PropertiesSerializable< Properties, KeypointParserProperties >, dai::PropertiesSerializable< Properties, PipelineEventAggregationProperties >, dai::PropertiesSerializable< Properties, BenchmarkInProperties >, dai::PropertiesSerializable< Properties, AprilTagProperties >, dai::PropertiesSerializable< Properties, XFeatMonoParserProperties >, dai::PropertiesSerializable< Properties, RFDETRParserProperties >, dai::PropertiesSerializable< Properties, ClassificationParserProperties >, dai::PropertiesSerializable< Properties, RectificationProperties >, dai::PropertiesSerializable< Properties, IMUProperties >, dai::PropertiesSerializable< Properties, YuNetParserProperties >, dai::PropertiesSerializable< Properties, MessageDemuxProperties >, dai::PropertiesSerializable< Properties, GPUStereoProperties >, dai::PropertiesSerializable< Properties, SuperAnimalParserProperties >, dai::PropertiesSerializable< Properties, SCRFDParserProperties >, dai::PropertiesSerializable< Properties, LaneDetectionParserProperties >, dai::PropertiesSerializable< Properties, DynamicCalibrationProperties >, dai::PropertiesSerializable< Properties, CastProperties >, dai::PropertiesSerializable< Properties, RegressionParserProperties >, dai::PropertiesSerializable< Properties, EmbeddingsParserProperties >, dai::PropertiesSerializable< Properties, WarpProperties >, dai::PropertiesSerializable< Properties, SpatialLocationCalculatorProperties >, dai::PropertiesSerializable< Properties, SegmentationParserProperties >, dai::PropertiesSerializable< Properties, BenchmarkOutProperties >, dai::PropertiesSerializable< Properties, StitchingProperties >, dai::PropertiesSerializable< Properties, FastSAMParserProperties >, dai::PropertiesSerializable< Properties, ScriptProperties >, dai::PropertiesSerializable< Properties, PointCloudProperties >, dai::PropertiesSerializable< Properties, DetectionParserProperties >, dai::PropertiesSerializable< Properties, AutoCalibrationProperties >, dai::PropertiesSerializable< Properties, XFeatStereoParserProperties >, dai::PropertiesSerializable< Properties, ImgDetectionsFilterProperties >, dai::PropertiesSerializable< Properties, SpatialDetectionNetworkProperties >, dai::PropertiesSerializable< Properties, NeuralDepthProperties >, dai::PropertiesSerializable< Properties, ToFStereoFusionProperties >, dai::PropertiesSerializable< Properties, ThermalProperties >, dai::PropertiesSerializable< Properties, ImageManipProperties >
function
void serialize(std::vector< std::uint8_t > & data, SerializationType type)
function
std::unique_ptr< Properties > clone()
function
~Properties()
struct

dai::PropertiesSerializable

#include Properties.hpp
inline function
void serialize(std::vector< std::uint8_t > & data, SerializationType type)
inline function
std::unique_ptr< Properties > clone()
struct

dai::RectificationProperties

variable
std::optional< uint32_t > outputWidth
variable
std::optional< uint32_t > outputHeight
variable
bool enableRectification
function
~RectificationProperties()
struct

dai::SPIInProperties

#include SPIInProperties.hpp
variable
std::string streamName
Name of stream
variable
int busId
SPI bus to use
variable
std::uint32_t maxDataSize
Maximum input data size
variable
std::uint32_t numFrames
Number of frames in pool
function
~SPIInProperties()
struct

dai::SPIOutProperties

#include SPIOutProperties.hpp
variable
std::string streamName
Name of stream
variable
int busId
SPI bus to use
function
~SPIOutProperties()
struct

dai::ScriptProperties

#include ScriptProperties.hpp
variable
std::string scriptUri
Uri which points to actual script
variable
std::string scriptName
Name of script
variable
ProcessorType processor
Which processor should execute the script
function
~ScriptProperties()
struct

dai::SegmentationParserProperties

variable
std::vector< std::string > labels
variable
std::string networkOutputName
variable
bool classesInOneLayer
variable
bool backgroundClass
function
~SegmentationParserProperties()
struct

dai::SpatialDetectionNetworkProperties

#include SpatialDetectionNetworkProperties.hpp
variable
float detectedBBScaleFactor
variable
variable
SpatialLocationCalculatorAlgorithm calculationAlgorithm
variable
std::int32_t stepSize
function
~SpatialDetectionNetworkProperties()
struct

dai::SpatialLocationCalculatorProperties

#include SpatialLocationCalculatorProperties.hpp
variable
function
~SpatialLocationCalculatorProperties()
struct

dai::StereoDepthProperties

#include StereoDepthProperties.hpp
using
MedianFilter = dai::StereoDepthConfig::MedianFilter
variable
StereoDepthConfig initialConfig
Initial stereo config.
variable
CameraBoardSocket depthAlignCamera
Which camera to align disparity/depth to. When configured (not AUTO), takes precedence over 'depthAlign'
variable
bool enableRectification
Enable stereo rectification/dewarp or not. Useful to disable when replaying pre-recorded rectified frames.
variable
std::int32_t rectifyEdgeFillColor
Fill color for missing data at frame edges - grayscale 0..255, or -1 to replicate pixels
variable
std::optional< std::int32_t > width
Input frame width. Optional (taken from MonoCamera nodes if they exist)
variable
std::optional< std::int32_t > height
Input frame height. Optional (taken from MonoCamera nodes if they exist)
variable
std::optional< std::int32_t > outWidth
Output disparity/depth width. Currently only used when aligning to RGB
variable
std::optional< std::int32_t > outHeight
Output disparity/depth height. Currently only used when aligning to RGB
variable
bool outKeepAspectRatio
Whether to keep aspect ratio of the input (rectified) or not
variable
RectificationMesh mesh
Specify a direct warp mesh to be used for rectification, instead of intrinsics + extrinsic matrices
variable
bool enableRuntimeStereoModeSwitch
Whether to enable switching stereo modes at runtime or not. E.g. standard to subpixel, standard+LR-check to subpixel + LR-check. Note: It will allocate resources for worst cases scenario, should be enabled only if dynamic mode switch is required. Default value: false. RVC2 only.
variable
int numFramesPool
Num frames in output pool.
variable
std::int32_t numPostProcessingShaves
Number of shaves reserved for stereo depth post processing. Post processing can use multiple shaves to increase performance. -1 means auto, resources will be allocated based on enabled filters. 0 means that it will reuse the shave assigned for main stereo algorithm. For optimal performance it's recommended to allocate more than 0, so post processing will run in parallel with main stereo algorithm. Minimum 1, maximum 10. RVC2 only.
variable
std::int32_t numPostProcessingMemorySlices
Number of memory slices reserved for stereo depth post processing. -1 means auto, memory will be allocated based on initial stereo settings and number of shaves. 0 means that it will reuse the memory slices assigned for main stereo algorithm. For optimal performance it's recommended to allocate more than 0, so post processing will run in parallel with main stereo algorithm. Minimum 1, maximum 6. RVC2 only.
variable
bool focalLengthFromCalibration
Whether to use horizontal focal length from calibration intrinsics (fx) or calculate based on calibration FOV. Default value is true. If set to false it's calculated from FOV and image resolution: focalLength = calib.width / (2.f * tan(calib.fov / 2 / 180.f * pi));
variable
std::optional< bool > useHomographyRectification
Use 3x3 homography matrix for stereo rectification instead of sparse mesh generated on device. Default behaviour is AUTO, for lenses with FOV over 85 degrees sparse mesh is used, otherwise 3x3 homography. If custom mesh data is provided through loadMeshData or loadMeshFiles this option is ignored. true: 3x3 homography matrix generated from calibration data is used for stereo rectification, can't correct lens distortion. false: sparse mesh is generated on-device from calibration data with mesh step specified with setMeshStep (Default: (16, 16)), can correct lens distortion. Implementation for generating the mesh is same as opencv's initUndistortRectifyMap function. Only the first 8 distortion coefficients are used from calibration data.
variable
bool enableFrameSync
Whether to enable frame syncing inside stereo node or not. Suitable if inputs are known to be synced. RVC3 only.
variable
std::optional< float > baseline
Override baseline from calibration. Used only in disparity to depth conversion. Units are centimeters.
variable
std::optional< float > focalLength
Override focal length from calibration. Used only in disparity to depth conversion. Units are pixels.
variable
std::optional< bool > disparityToDepthUseSpecTranslation
Use baseline information for disparity to depth conversion from specs (design data) or from calibration. Suitable for debugging. Utilizes calibrated value as default
variable
std::optional< bool > rectificationUseSpecTranslation
Obtain rectification matrices using spec translation (design data) or from calibration in calculations. Suitable for debugging. Default: false
variable
std::optional< bool > depthAlignmentUseSpecTranslation
Use baseline information for depth alignment from specs (design data) or from calibration. Suitable for debugging. Utilizes calibrated value as default
variable
std::optional< float > alphaScaling
Free scaling parameter between 0 (when all the pixels in the undistorted image are valid) and 1 (when all the source image pixels are retained in the undistorted image). On some high distortion lenses, and/or due to rectification (image rotated) invalid areas may appear even with alpha=0, in these cases alpha < 0.0 helps removing invalid areas.
Warning
On RVC4 the DEFAULT, DENSITY, and FAST_DENSITY presets can produce inaccurate depth in black padded regions, as they prioritize coverage.
function
~StereoDepthProperties()
struct

dai::StereoDepthProperties::RectificationMesh

variable
std::string meshLeftUri
Uri which points to the mesh array for 'left' input rectification
variable
std::string meshRightUri
Uri which points to the mesh array for 'right' input rectification
variable
std::optional< std::uint32_t > meshSize
Mesh array size in bytes, for each of 'left' and 'right' (need to match)
variable
uint16_t stepWidth
Distance between mesh points, in the horizontal direction
variable
uint16_t stepHeight
Distance between mesh points, in the vertical direction
function
Align the disparity/depth to the perspective of a rectified output, or center it
enumerator
AUTO
enumerator
RECTIFIED_RIGHT
enumerator
RECTIFIED_LEFT
enumerator
CENTER
enumerator
RIGHT
enumerator
LEFT
struct

dai::SyncProperties

#include SyncProperties.hpp
variable
int64_t syncThresholdNs
The maximal interval the messages can be apart in nanoseconds.
variable
int32_t syncAttempts
The number of syncing attempts before fail (num of replaced messages).
variable
ProcessorType processor
Which processor should execute the node.
variable
TimestampSource timestampSource
Which timestamp to use for synchronization. On device the default is DEVICE, on host the default is HOST
function
~SyncProperties()
enum

uint8_t TimestampSource

enumerator
DEFAULT
enumerator
DEVICE
enumerator
HOST
enumerator
SYSTEM
struct

dai::SystemLoggerProperties

#include SystemLoggerProperties.hpp
variable
float rateHz
Rate at which the messages are going to be sent in hertz
function
~SystemLoggerProperties()
struct

dai::ThermalProperties

#include ThermalProperties.hpp
variable
ThermalConfig initialConfig
Initial Thermal config
variable
int numFramesPool
Num frames in output pool
variable
CameraBoardSocket boardSocket
Which socket will color camera use
variable
float fps
Camera sensor FPS
function
~ThermalProperties()
struct

dai::ToFProperties

#include ToFProperties.hpp
variable
ToFConfig initialConfig
Initial ToF config
variable
int numFramesPool
Num frames in output pool
variable
std::optional< std::int32_t > numShaves
Number of shaves reserved for ToF decoding.
variable
std::vector< int > warpHwIds
Warp HW IDs to use for undistortion, if empty, use auto/default.
variable
bool enableUndistortion
Undistort depth and auxiliary outputs before publishing them.
variable
CameraBoardSocket boardSocket
Which socket will color camera use
variable
std::string cameraName
Which camera name will color camera use
variable
CameraImageOrientation imageOrientation
Camera sensor image orientation / pixel readout
variable
float fps
Camera sensor FPS
variable
int numFramesPoolRaw
Pool sizes
function
~ToFProperties()
struct

dai::UVCProperties

#include UVCProperties.hpp
variable
std::unordered_map< int, int > gpioInit
<gpio_number, value> list for GPIOs to set at init
variable
std::unordered_map< int, int > gpioStreamOn
<gpio_number, value> list for GPIOs to set when streaming is enabled
variable
std::unordered_map< int, int > gpioStreamOff
<gpio_number, value> list for GPIOs to set when streaming is disabled
function
~UVCProperties()
struct

dai::VideoEncoderProperties

#include VideoEncoderProperties.hpp
variable
std::int32_t bitrate
Specifies preferred bitrate (in bit/s) of compressed output bitstream in CBR mode"0" for automatic computation, based on input resolution and FPS: 720p30: 4Mbps, 1080p30: 8.5Mbps, 1440p30: 14Mbps, 2160p30: 20Mbps
variable
std::int32_t keyframeFrequency
Every x number of frames a keyframe will be inserted
variable
std::int32_t maxBitrate
Specifies maximum bitrate (in bit/s) of compressed output bitstream in CBR mode"0" to follow bitrate setting
variable
std::int32_t numBFrames
Specifies number of B frames to be inserted
variable
std::uint32_t numFramesPool
This options specifies how many frames are available in this node's pool. Helps when receiver is slow at consuming.Value "0" indicates automatic number of frames assignment
variable
std::int32_t outputFrameSize
Specifies max output frame size in pool. Value "0" indicates auto
variable
Profile profile
Encoding profile, H264, H265 or MJPEG
variable
std::int32_t quality
Value between 0-100% (approximates quality)
variable
bool lossless
Lossless mode ([M]JPEG only)
variable
RateControlMode rateCtrlMode
Rate control mode specifies if constant or variable bitrate should be used (H264 / H265)
variable
float frameRate
Frame rate
function
~VideoEncoderProperties()
enum

int RateControlMode

Rate control mode specifies if constant or variable bitrate should be used (H264 / H265)
enumerator
CBR
enumerator
VBR
enum

int Profile

Encoding profile, H264 (AVC), H265 (HEVC) or MJPEG
enumerator
H264_BASELINE
enumerator
H264_HIGH
enumerator
H264_MAIN
enumerator
H265_MAIN
enumerator
MJPEG
struct

dai::VppProperties

#include VppProperties.hpp
variable
VppConfig initialConfig
Initial VPP configuration
variable
int numFramesPool
Number of frames in pool for output frames
function
~VppProperties()
struct

dai::WarpProperties

#include WarpProperties.hpp
variable
int outputWidth
Output width.
variable
int outputHeight
Output height.
variable
int outputFrameSize
Maximum output frame size in bytes (eg: 300x300 BGR image -> 300*300*3 bytes)
variable
int numFramesPool
Num frames in output pool.
variable
int meshWidth
Custom warp mesh width. Set to zero to disable.
variable
int meshHeight
Custom warp mesh height. Set to zero to disable.
variable
std::string meshUri
Custom warp mesh uri. Set to empty string to disable.
variable
std::vector< int > warpHwIds
Warp HW IDs to use, if empty, use auto/default.
variable
Interpolation interpolation
function
~WarpProperties()
struct

dai::PipelineEventAggregationProperties

#include PipelineEventAggregationProperties.hpp
variable
uint32_t aggregationWindowSize
variable
uint32_t statsUpdateIntervalMs
variable
uint32_t eventWaitWindow
variable
bool traceOutput
function
~PipelineEventAggregationProperties()
class

dai::RemoteConnection

#include RemoteConnection.hpp
explicit function
RemoteConnection(const std::string & address, uint16_t webSocketPort, bool serveFrontend, uint16_t httpPort)
Constructs a RemoteConnection instance.
Parameters
  • address: The address to bind the connection to.
  • webSocketPort: The port for WebSocket communication.
  • serveFrontend: Whether to serve a frontend UI.
  • httpPort: The port for HTTP communication.
function
~RemoteConnection()
Destroys the RemoteConnection instance.
function
void addTopic(const std::string & topicName, Node::Output & output, const std::string & group, bool useVisualizationIfAvailable)
Adds a topic to the remote connection.
Parameters
  • topicName: The name of the topic.
  • output: The output to link to the topic.
  • group: An optional group name for the topic.
  • useVisualizationIfAvailable: Whether to enable visualization on the message if available or send message as is.
function
std::shared_ptr< MessageQueue > addTopic(const std::string & topicName, const std::string & group, unsigned int maxSize, bool blocking, bool useVisualizationIfAvailable)
Adds a topic with a message queue.
Parameters
  • topicName: The name of the topic.
  • group: An optional group name for the topic.
  • maxSize: The maximum queue size.
  • blocking: Whether the queue is blocking or non-blocking.
  • useVisualizationIfAvailable: Whether to enable visualization on the message if available or send message as is.
Returns
A shared pointer to the created message queue.
function
bool removeTopic(const std::string & topicName)
Removes a topic from the remote connection.
Parameters
  • topicName: The name of the topic to remove.
Note
After removing a topic any messages sent to it will cause an exception to be called on the sender, since this closes the queue.
Returns
True if the topic was successfully removed, false otherwise.
function
void registerPipeline(const Pipeline & pipeline)
Registers a pipeline with the remote connection.
Parameters
  • pipeline: The pipeline to register.
function
int waitKey(int delayMs)
Waits for a key event.
Parameters
  • delayMs: The delay in milliseconds to wait for a key press.
Returns
The key code of the pressed key.
function
void registerService(const std::string & serviceName, std::function< nlohmann::json(const nlohmann::json &)> callback)
Registers a service with a callback function.
Parameters
  • serviceName: The name of the service.
  • callback: The callback function to handle requests.
function
void registerBinaryService(const std::string & serviceName, std::function< std::vector< uint8_t >(const std::vector< uint8_t > &)> callback)
Registers a binary service with a callback function.
Parameters
  • serviceName: The name of the service.
  • callback: The callback function to handle requests.
class

dai::AtomicBool

function
AtomicBool()
function
~AtomicBool()
inline function
AtomicBool(const AtomicBool & othr)
inline function
AtomicBool & operator=(const AtomicBool & othr)
inline function
AtomicBool(AtomicBool &&)
inline function
AtomicBool & operator=(AtomicBool && othr)
class

dai::JoiningThread

function
JoiningThread()
inline function
JoiningThread(const JoiningThread &)
function
JoiningThread(JoiningThread &&)
inline function
JoiningThread & operator=(JoiningThread && thr)
inline function
~JoiningThread()
inline function
JoiningThread(std::thread t)
inline function
void swap(JoiningThread & x)
class

dai::LockingQueue

function
LockingQueue()
inline explicit function
LockingQueue(unsigned maxSize, bool blocking)
inline function
LockingQueue(const LockingQueue & obj)
inline function
LockingQueue(LockingQueue && obj)
inline function
LockingQueue & operator=(const LockingQueue & obj)
inline function
LockingQueue & operator=(LockingQueue && obj)
inline function
void setMaxSize(unsigned sz)
inline function
void setBlocking(bool bl)
inline function
unsigned getMaxSize()
inline function
unsigned getSize()
inline function
unsigned isFull()
inline function
bool getBlocking()
inline function
void destruct()
inline function
bool isDestroyed()
function
~LockingQueue()
inline function
bool waitAndConsumeAll(std::function< void(T &)> callback, std::chrono::duration< Rep, Period > timeout)
inline function
bool waitAndConsumeAll(std::function< void(T &)> callback)
inline function
bool consumeAll(std::function< void(T &)> callback)
inline function
bool push(T const & data, std::function< void(LockingQueueState, size_t)> callback)
inline function
bool push(T && data, std::function< void(LockingQueueState, size_t)> callback)
inline function
bool tryWaitAndPush(T const & data, std::chrono::duration< Rep, Period > timeout, std::function< void(LockingQueueState, size_t)> callback)
inline function
bool tryWaitAndPush(T && data, std::chrono::duration< Rep, Period > timeout, std::function< void(LockingQueueState, size_t)> callback)
inline function
bool empty()
inline function
bool front(T & value)
inline function
bool tryPop(T & value)
inline function
bool waitAndPop(T & value)
inline function
bool tryWaitAndPop(T & value, std::chrono::duration< Rep, Period > timeout)
inline function
void waitEmpty()
class

dai::Memory

Derived by dai::OffsetMemory, dai::SharedMemory, dai::StreamPacketMemory, dai::VectorMemory
function
~Memory()
function
span< std::uint8_t > getData()
function
span< const std::uint8_t > getData()
function
std::size_t getMaxSize()
function
std::size_t getOffset()
function
void setSize(std::size_t)
inline function
std::size_t getSize()
class

dai::OffsetMemory

#include OffsetMemory.hppDerived by dai::ConvertedOffsetMemory, dai::impl::_ImageManipMemory
function
void setOffset(std::size_t)
Advances the logical offset within the buffer.The resulting offset is clamped to the current buffer size.
Parameters
  • offset: Number of bytes to advance from the current offset.
function
span< std::uint8_t > getOffsetData()
Gets a mutable view of the data starting at the current offset.
Returns
Span over the remaining bytes after the offset.
function
span< const std::uint8_t > getOffsetData()
Gets a read-only view of the data starting at the current offset.
Returns
Span over the remaining bytes after the offset.
function
std::shared_ptr< OffsetMemory > offset(std::size_t offset)
Creates a new offset-aware view advanced from the current offset.
Parameters
  • offset: Number of bytes to advance from the current offset.
Returns
Shared pointer to a memory view with the updated offset applied.
inline function
std::size_t getOffsetSize()
Gets the number of bytes available from the current offset to the end of the buffer.
Returns
Remaining buffer size after the offset.
class

dai::ConvertedOffsetMemory

#include OffsetMemory.hpp
function
ConvertedOffsetMemory()
inline explicit function
ConvertedOffsetMemory(std::shared_ptr< Memory > memory)
Wraps an existing memory object with offset-aware access.
Parameters
  • memory: Underlying memory object to expose through this adapter.
inline function
span< std::uint8_t > getData()
inline function
span< const std::uint8_t > getData()
inline function
std::size_t getMaxSize()
inline function
std::size_t getOffset()
inline function
void setSize(std::size_t size)
inline function
void setOffset(std::size_t)
Advances the logical offset within the buffer.The resulting offset is clamped to the current buffer size.
Parameters
  • offset: Number of bytes to advance from the current offset.
inline function
span< std::uint8_t > getOffsetData()
Gets a mutable view of the data starting at the current offset.
Returns
Span over the remaining bytes after the offset.
inline function
span< const std::uint8_t > getOffsetData()
Gets a read-only view of the data starting at the current offset.
Returns
Span over the remaining bytes after the offset.
inline function
std::shared_ptr< OffsetMemory > offset(std::size_t offset)
Creates a new offset-aware view advanced from the current offset.
Parameters
  • offset: Number of bytes to advance from the current offset.
Returns
Shared pointer to a memory view with the updated offset applied.
inline function
std::shared_ptr< Memory > getInternal()
Gets the wrapped memory instance.
Returns
Shared pointer to the underlying memory object.
class

dai::Pimpl

function
Pimpl()
function
Pimpl(Args && ...)
function
~Pimpl()
function
T * operator->()
function
const T * operator->()
function
T & operator*()
function
const T & operator*()
struct

dai::ProfilingData

variable
long long numBytesWritten
variable
long long numBytesRead
class

dai::ProtoSerializable

Derived by dai::EncodedFrame, dai::IMUData, dai::ImgAnnotations, dai::ImgDetections, dai::ImgFrame, dai::NNData, dai::PointCloudData, dai::RGBDData, dai::SegmentationMask, dai::SpatialImgDetections
function
~ProtoSerializable()
inline function
std::vector< std::uint8_t > serializeProto(T...)
Placeholder for serializeProto when Protobuf is disabled.
Returns
Throws compile-time error if used
inline function
SchemaPair serializeSchema(T...)
Placeholder for serializeSchema when Protobuf is disabled.
Returns
Throws compile-time error if used
struct

dai::ProtoSerializable::dependent_false

struct

dai::ProtoSerializable::SchemaPair

variable
std::string schemaName
variable
std::string schema
struct

dai::RecordConfig

#include RecordReplay.hpp
variable
RecordReplayState state
variable
std::filesystem::path outputDir
variable
VideoEncoding videoEncoding
variable
CompressionLevel compressionLevel
variable
bool syncCameraOutputs
struct

dai::RecordConfig::VideoEncoding

variable
bool enabled
variable
int bitrate
variable
Profile profile
variable
bool lossless
variable
int quality
enum

RecordReplayState

enumerator
RECORD
enumerator
REPLAY
enumerator
NONE
enum

uint8_t CompressionLevel

enumerator
NONE
enumerator
FASTEST
enumerator
FAST
enumerator
DEFAULT
enumerator
SLOW
enumerator
SLOWEST
Encoding profile, H264 (AVC), H265 (HEVC) or MJPEG
enumerator
H264_BASELINE
enumerator
H264_HIGH
enumerator
H264_MAIN
enumerator
H265_MAIN
enumerator
MJPEG
struct

dai::NodeRecordParams

variable
bool video
variable
std::string name
class

dai::SharedMemory

function
SharedMemory()
inline function
SharedMemory(long argFd)
inline function
SharedMemory(long argFd, std::size_t size)
inline function
SharedMemory(const char * name)
inline function
SharedMemory(const char * name, std::size_t size)
function
~SharedMemory()
inline function
SharedMemory & operator=(long argFd)
inline function
span< std::uint8_t > getData()
inline function
span< const std::uint8_t > getData()
inline function
std::size_t getMaxSize()
inline function
std::size_t getOffset()
inline function
void setSize(std::size_t size)
inline function
std::size_t getSize()
inline function
long getFd()
class

dai::VectorMemory

function
VectorMemory()
inline function
VectorMemory(const std::vector< std::uint8_t > & d)
inline function
VectorMemory(std::vector< std::uint8_t > && d)
inline function
VectorMemory & operator=(std::vector< std::uint8_t > && d)
function
~VectorMemory()
function
span< std::uint8_t > getData()
function
span< const std::uint8_t > getData()
function
std::size_t getMaxSize()
function
std::size_t getOffset()
function
void setSize(std::size_t size)
class

dai::copyable_unique_ptr

#include copyable_unique_ptr.hpp
struct

dai::DeviceInfo

#include XLinkConnection.hpp
variable
std::string name
variable
std::string deviceId
variable
XLinkDeviceState_t state
variable
XLinkProtocol_t protocol
variable
XLinkPlatform_t platform
variable
XLinkError_t status
function
DeviceInfo()
function
DeviceInfo(std::string name, std::string deviceId, XLinkDeviceState_t state, XLinkProtocol_t protocol, XLinkPlatform_t platform, XLinkError_t status)
explicit function
DeviceInfo(std::string deviceIdOrName)
Creates a DeviceInfo by checking whether supplied parameter is a DeviceID or IP/USB name. A dotted-quad name ("10.12.234.143") sets protocol TCP_IP, any other name keeps ANY_PROTOCOL. See XLinkConnection::findFirstSuitableDevice for how a USB port path that looks like an IPv4 address ("1.2.1.4") is still found.
Parameters
  • deviceIdOrName: Either DeviceId, IP Address or USB port name
explicit function
DeviceInfo(const deviceDesc_t & desc)
function
deviceDesc_t getXLinkDeviceDesc()
function
std::string getMxId()
function
std::string getDeviceId()
function
std::string toString()
class

dai::XLinkConnection

#include XLinkConnection.hpp
function
XLinkConnection(const DeviceInfo & deviceDesc, std::vector< std::uint8_t > mvcmdBinary, XLinkDeviceState_t expectedState)
function
XLinkConnection(const DeviceInfo & deviceDesc, std::filesystem::path pathToMvcmd, XLinkDeviceState_t expectedState)
explicit function
XLinkConnection(const DeviceInfo & deviceDesc, XLinkDeviceState_t expectedState)
function
~XLinkConnection()
function
void setRebootOnDestruction(bool reboot)
function
bool getRebootOnDestruction()
function
int getLinkId()
function
DeviceInfo getDeviceInfo()
Get device information of this connection. The protocol reflects the actually negotiated protocol (e.g. TCP_IP_OR_LOCAL_SHDMEM resolves to the transport in use).
function
void close()
Explicitly closes xlink connection.
Note
This function does not need to be explicitly called as destructor closes the connection automatically
function
bool isClosed()
Is the connection already closed (or disconnected)
Warning
This function is thread-unsafe and may return outdated incorrect values. It is only meant for use in simple single-threaded code. Well written code should handle exceptions when calling any DepthAI apis to handle hardware events and multithreaded use.
function
ProfilingData getProfilingData()
Get current accumulated profiling data
Returns
ProfilingData from the specific connection
class

dai::StreamPacketDesc

Derived by dai::StreamPacketMemory
inline function
StreamPacketDesc()
function
StreamPacketDesc(const StreamPacketDesc &)
function
StreamPacketDesc(StreamPacketDesc && other)
function
StreamPacketDesc & operator=(const StreamPacketDesc &)
function
StreamPacketDesc & operator=(StreamPacketDesc && other)
function
~StreamPacketDesc()
class

dai::StreamPacketMemory

function
StreamPacketMemory()
inline function
StreamPacketMemory(StreamPacketDesc && d)
inline function
function
span< std::uint8_t > getData()
function
span< const std::uint8_t > getData()
function
std::size_t getMaxSize()
function
std::size_t getOffset()
function
void setSize(size_t size)
class

dai::XLinkStream

function
XLinkStream(const std::shared_ptr< XLinkConnection > & conn, const std::string & name, std::size_t maxWriteSize)
function
XLinkStream(const XLinkStream &)
function
XLinkStream(XLinkStream && stream)
function
XLinkStream & operator=(const XLinkStream &)
function
XLinkStream & operator=(XLinkStream && stream)
function
~XLinkStream()
function
void write(span< const uint8_t > data, span< const uint8_t > data2)
function
void write(span< const uint8_t > data)
function
void write(long fd)
function
void write(long fd, span< const uint8_t > data)
function
void write(const void * data, std::size_t size)
function
std::vector< std::uint8_t > read()
function
std::vector< std::uint8_t > read(std::chrono::milliseconds timeout)
function
std::vector< std::uint8_t > read(XLinkTimespec & timestampReceived)
function
void read(std::vector< std::uint8_t > & data)
function
void read(std::vector< std::uint8_t > & data, long & fd)
function
void read(std::vector< std::uint8_t > & data, XLinkTimespec & timestampReceived)
function
void read(std::vector< std::uint8_t > & data, long & fd, XLinkTimespec & timestampReceived)
function
void writeSplit(const void * data, std::size_t size, std::size_t split)
function
void writeSplit(const std::vector< uint8_t > & data, std::size_t split)
function
StreamPacketDesc readMove()
function
bool write(const void * data, std::size_t size, std::chrono::milliseconds timeout)
function
bool write(const std::uint8_t * data, std::size_t size, std::chrono::milliseconds timeout)
function
bool write(const std::vector< std::uint8_t > & data, std::chrono::milliseconds timeout)
function
bool read(std::vector< std::uint8_t > & data, std::chrono::milliseconds timeout)
function
bool readMove(StreamPacketDesc & packet, const std::chrono::milliseconds timeout)
function
streamPacketDesc_t * readRaw()
function
bool readRaw(streamPacketDesc_t *& pPacket, std::chrono::milliseconds timeout)
function
void readRawRelease()
function
streamId_t getStreamId()
function
std::string getStreamName()
struct

dai::XLinkError

Derived by dai::XLinkReadError, dai::XLinkWriteError
variable
const XLinkError_t status
variable
const std::string streamName
function
~XLinkError()
inline function
XLinkError(XLinkError_t statusID, std::string stream, const std::string & message)
struct

dai::XLinkReadError

using
XLinkError = XLinkError
function
~XLinkReadError()
function
XLinkReadError(XLinkError_t status, const std::string & stream)
struct

dai::XLinkWriteError

using
XLinkError = XLinkError
function
~XLinkWriteError()
function
XLinkWriteError(XLinkError_t status, const std::string & stream)
namespace

dai::beta

function
DEPTHAI_SERIALIZE_EXT(ToFStereoFusionConfig, confidenceThreshold, cropToOverlap)
function
DEPTHAI_SERIALIZE_EXT(ClassificationParserProperties, outputLayerName, classes, nClasses, isSoftmax)
function
DEPTHAI_SERIALIZE_EXT(ClassificationSequenceParserProperties, outputLayerName, classes, nClasses, isSoftmax, initialConfig)
function
DEPTHAI_SERIALIZE_EXT(EmbeddingsParserProperties, outputLayerName)
function
DEPTHAI_SERIALIZE_EXT(FastSAMParserProperties, initialConfig, numClasses, yoloOutputs, maskOutputs, protosOutput)
function
DEPTHAI_SERIALIZE_EXT(HRNetParserProperties, outputLayerName, initialConfig, labelNames, edges)
function
DEPTHAI_SERIALIZE_EXT(ImageOutputParserProperties, outputLayerName, outputIsBGR)
function
DEPTHAI_SERIALIZE_EXT(ImgDetectionsFilterProperties, initialConfig)
function
DEPTHAI_SERIALIZE_EXT(KeypointParserProperties, outputLayerName, scaleFactor, nKeypoints, scoreThreshold, labelNames, edges)
function
DEPTHAI_SERIALIZE_EXT(LaneDetectionParserProperties, outputLayerName, rowAnchors, gridingNum, clsNumPerLane, inputSize)
function
DEPTHAI_SERIALIZE_EXT(MLSDParserProperties, outputLayerTPMap, outputLayerHeat, initialConfig, inputSize)
function
DEPTHAI_SERIALIZE_EXT(MPPalmDetectionParserProperties, outputLayerNames, initialConfig, scale, labelNames)
function
DEPTHAI_SERIALIZE_EXT(MapOutputParserProperties, outputLayerName, initialConfig)
function
DEPTHAI_SERIALIZE_EXT(PPTextDetectionParserProperties, outputLayerName, initialConfig)
function
DEPTHAI_SERIALIZE_EXT(RFDETRParserProperties, initialConfig, labelNames, outputLayerNames, inputSize)
function
DEPTHAI_SERIALIZE_EXT(RegressionParserProperties, outputLayerName)
function
DEPTHAI_SERIALIZE_EXT(SCRFDParserProperties, outputLayerNames, initialConfig, inputSize, featStrideFpn, numAnchors, labelNames)
function
DEPTHAI_SERIALIZE_EXT(StitchingProperties::Plane, point, normal, unit)
function
DEPTHAI_SERIALIZE_EXT(StitchingProperties::VirtualCamera, pose, unit, intrinsics, width, height)
function
DEPTHAI_SERIALIZE_EXT(StitchingProperties, mode, cameraModel, continuous, estimationFrames, maxPanoramaWidth, maxPanoramaHeight, panoConfidenceThreshold, seamFinder, plane, view, maxViewWidth, maxViewHeight, maxRange, minIncidenceAngle, numInputs, useInputCalibration)
function
DEPTHAI_SERIALIZE_EXT(SuperAnimalParserProperties, outputLayerName, scaleFactor, nKeypoints, initialConfig, labelNames, edges)
function
DEPTHAI_SERIALIZE_EXT(ToFStereoFusionProperties, initialConfig)
function
DEPTHAI_SERIALIZE_EXT(XFeatMonoParserProperties, outputLayerFeats, outputLayerKeypoints, outputLayerHeatmaps, originalSize, inputSize, initialConfig)
function
DEPTHAI_SERIALIZE_EXT(XFeatStereoParserProperties, outputLayerFeats, outputLayerKeypoints, outputLayerHeatmaps, originalSize, inputSize, initialConfig)
function
DEPTHAI_SERIALIZE_EXT(YuNetParserProperties, locOutputLayerName, confOutputLayerName, iouOutputLayerName, initialConfig, inputSize, labelNames)
class

dai::beta::BetaNode

function
~BetaNode()
function
void setRunOnHost(bool runOnHost)
class

dai::beta::ClassificationSequenceParserConfig

#include ClassificationSequenceParserConfig.hpp
variable
std::vector< std::int32_t > ignoredIndexes
variable
bool removeDuplicates
variable
bool concatenateClasses
function
ClassificationSequenceParserConfig()
function
~ClassificationSequenceParserConfig()
function
void setIgnoredIndexes(const std::vector< std::int32_t > & indexes)
Sets the class indexes ignored while decoding the sequence.
Parameters
  • indexes: Nonnegative class indexes to ignore
function
std::vector< std::int32_t > getIgnoredIndexes()
Gets the class indexes ignored while decoding the sequence.
Returns
Ignored class indexes
function
void setRemoveDuplicates(bool removeDuplicates)
Sets whether consecutive duplicate classes are removed.
Parameters
  • removeDuplicates: Whether duplicate classes are removed
function
bool getRemoveDuplicates()
Gets whether consecutive duplicate classes are removed.
Returns
Whether duplicate classes are removed
function
void setConcatenateClasses(bool concatenateClasses)
Sets whether decoded class labels are concatenated.
Parameters
  • concatenateClasses: Whether class labels are concatenated
function
bool getConcatenateClasses()
Gets whether decoded class labels are concatenated.
Returns
Whether class labels are concatenated
function
bool validate()
Validates this configuration.
Returns
True if all ignored indexes are nonnegative
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
Serializes this configuration into message metadata.
Parameters
  • metadata: Destination metadata buffer
  • datatype: Datatype identifier written during serialization
inline function
DatatypeEnum getDatatype()
Returns the datatype identifier for this configuration.
Returns
Configuration datatype identifier
function
DEPTHAI_SERIALIZE(ClassificationSequenceParserConfig, ignoredIndexes, removeDuplicates, concatenateClasses)
class

dai::beta::Classifications

#include Classifications.hpp
variable
std::vector< std::string > classes
Class names, index-aligned with the scores vector.
variable
std::vector< float > scores
Classification scores, index-aligned with the classes vector.
variable
int64_t sequenceNum
variable
variable
Timestamp tsDevice
variable
std::optional< Timestamp > tsSystem
variable
std::optional< ImgTransformation > transformation
function
Classifications()
Construct Classifications message.
function
~Classifications()
function
std::string getTopClass()
Returns the most probable class name.Assumes the classes are sorted in descending order of score, which holds for parser-emitted messages.
Parameters
  • std::runtime_error: if the message contains no classes.
function
float getTopScore()
Returns the score of the most probable class.Assumes the scores are sorted in descending order, which holds for parser-emitted messages.
Parameters
  • std::runtime_error: if the message contains no scores.
function
Classifications transformTo(const ImgTransformation & target)
Returns a new Classifications message with the transformation metadata replaced by the target transformation. Classification results carry no spatial data, so classes and scores are unchanged.
Parameters
  • target: Target image transformation.
function
dai::VisualizeType getVisualizationMessage()
Returns an ImgAnnotations visualization with up to the top five classes and their scores, or std::monostate when no transformation metadata is available to derive the annotation layout from.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(Classifications, sequenceNum, ts, tsDevice, tsSystem, transformation, classes, scores)
struct

dai::beta::Cluster

#include Clusters.hpp
variable
std::int32_t label
Label of the cluster.
variable
std::vector< Point2f > points
Points in the cluster.
function
DEPTHAI_SERIALIZE(Cluster, label, points)
class

dai::beta::Clusters

#include Clusters.hpp
variable
std::vector< Cluster > clusters
Detected clusters of points.
variable
int64_t sequenceNum
variable
variable
Timestamp tsDevice
variable
std::optional< Timestamp > tsSystem
variable
std::optional< ImgTransformation > transformation
function
Clusters()
Construct Clusters message.
function
~Clusters()
function
Clusters transformTo(const ImgTransformation & target)
Returns a new Clusters message with the cluster point image coordinates remapped from this message's transformation into the target transformation.
Parameters
  • target: Target image transformation.
Parameters
  • std::runtime_error: if this message carries no transformation metadata.
function
dai::VisualizeType getVisualizationMessage()
Returns an ImgAnnotations visualization with each cluster drawn as points in a distinct color sampled from a rainbow colormap.
Parameters
  • std::runtime_error: if the message contains more than 255 clusters.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(Clusters, sequenceNum, ts, tsDevice, tsSystem, transformation, clusters)
class

dai::beta::FastSAMParserConfig

#include FastSAMParserConfig.hpp
variable
float confidenceThreshold
variable
float iouThreshold
variable
float maskConfidence
variable
Prompt prompt
variable
std::optional< std::pair< std::int32_t, std::int32_t > > points
variable
std::optional< std::int32_t > pointLabel
variable
std::optional< std::array< std::int32_t, 4 > > boundingBox
function
FastSAMParserConfig()
function
~FastSAMParserConfig()
function
void setConfidenceThreshold(float threshold)
Sets the minimum detection confidence.
Parameters
  • threshold: Confidence threshold in the range [0, 1]
function
float getConfidenceThreshold()
Gets the minimum detection confidence.
Returns
Confidence threshold
function
void setIouThreshold(float threshold)
Sets the intersection-over-union threshold used by non-maximum suppression.
Parameters
  • threshold: IoU threshold in the range [0, 1]
function
float getIouThreshold()
Gets the intersection-over-union threshold.
Returns
IoU threshold
function
void setMaskConfidence(float threshold)
Sets the threshold used to binarize instance masks.
Parameters
  • threshold: Mask confidence threshold in the range [0, 1]
function
float getMaskConfidence()
Gets the threshold used to binarize instance masks.
Returns
Mask confidence threshold
function
void setPrompt(Prompt prompt)
Sets the prompt mode. Required point or bounding-box data must already be present.
Parameters
  • prompt: Prompt mode
function
Prompt getPrompt()
Gets the prompt mode.
Returns
Prompt mode
function
void setPoints(std::int32_t x, std::int32_t y)
Sets the prompt point.
Parameters
  • x: Point x coordinate
  • y: Point y coordinate
function
std::optional< std::pair< std::int32_t, std::int32_t > > getPoints()
Gets the prompt point.
Returns
Optional prompt point as (x, y)
function
void setPointLabel(std::int32_t label)
Sets the prompt point label.
Parameters
  • label: Point label, 0 for negative or 1 for positive
function
std::optional< std::int32_t > getPointLabel()
Gets the prompt point label.
Returns
Optional point label
function
void setBoundingBox(const std::array< std::int32_t, 4 > & boundingBox)
Sets the prompt bounding box.
Parameters
  • boundingBox: Bounding box as {x1, y1, x2, y2}, with ordered coordinates and positive x2/y2
function
std::optional< std::array< std::int32_t, 4 > > getBoundingBox()
Gets the prompt bounding box.
Returns
Optional bounding box as {x1, y1, x2, y2}
function
bool validate()
Validates thresholds, prompt payload, point label, and bounding-box coordinates.
Returns
True if the complete configuration is valid
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
Serializes this configuration into message metadata.
Parameters
  • metadata: Destination metadata buffer
  • datatype: Datatype identifier written during serialization
inline function
DatatypeEnum getDatatype()
Returns the datatype identifier for this configuration.
Returns
Configuration datatype identifier
function
DEPTHAI_SERIALIZE(FastSAMParserConfig, confidenceThreshold, iouThreshold, maskConfidence, prompt, points, pointLabel, boundingBox)
enum

std::int32_t Prompt

Prompt mode used to select emitted segmentation masks.
enumerator
EVERYTHING
Keep all detected instances.
enumerator
POINT
Select instances using a point and point label.
enumerator
BOUNDING_BOX
Select an instance using a bounding box.
class

dai::beta::HRNetParserConfig

#include HRNetParserConfig.hpp
variable
float scoreThreshold
function
HRNetParserConfig()
function
~HRNetParserConfig()
function
void setScoreThreshold(float threshold)
Sets the minimum keypoint score.
Parameters
  • threshold: Score threshold in the range [0, 1]
function
float getScoreThreshold()
Gets the minimum keypoint score.
Returns
Score threshold
function
bool validate()
Validates this configuration.
Returns
True if the score threshold is in the range [0, 1]
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
Serializes this configuration into message metadata.
Parameters
  • metadata: Destination metadata buffer
  • datatype: Datatype identifier written during serialization
inline function
DatatypeEnum getDatatype()
Returns the datatype identifier for this configuration.
Returns
Configuration datatype identifier
function
DEPTHAI_SERIALIZE(HRNetParserConfig, scoreThreshold)
class

dai::beta::ImgDetectionsFilterConfig

#include ImgDetectionsFilterConfig.hpp
variable
std::optional< std::vector< std::uint32_t > > labelsToKeep
If set, only detections with one of these labels are kept. Takes precedence over labelsToReject when both are set.
variable
std::optional< std::vector< std::uint32_t > > labelsToReject
If set, detections with one of these labels are removed.
variable
std::optional< float > confidenceThreshold
If set, detections below this confidence are removed.
variable
std::optional< float > minArea
If set, detections with a normalized bounding-box area below this value are removed.
variable
bool nmsDisabled
Disable non-maximum suppression. Disabled by default to preserve all detections.
variable
float nmsConfidenceThreshold
Confidence threshold applied by non-maximum suppression.
variable
float nmsIouThreshold
Intersection-over-union threshold applied by non-maximum suppression.
variable
bool sortingDisabled
Disable confidence sorting. Disabled by default to preserve input order.
variable
bool sortDescending
Sort detections in descending confidence order when sorting is enabled.
variable
std::optional< std::uint32_t > firstK
If set, retain at most this many detections after filtering and sorting.
function
~ImgDetectionsFilterConfig()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
bool isNoOp()
Returns true when this configuration preserves every detection and its order.
function
class

dai::beta::Keypoints

#include Keypoints.hpp
variable
KeypointsList keypointsList
Native keypoints list carrying the keypoints and the skeleton edges connecting them.
variable
int64_t sequenceNum
variable
variable
Timestamp tsDevice
variable
std::optional< Timestamp > tsSystem
variable
std::optional< ImgTransformation > transformation
function
Keypoints()
Construct Keypoints message.
function
~Keypoints()
function
std::vector< Keypoint > getKeypoints()
Returns the keypoints.
function
void setKeypoints(const std::vector< Keypoint > & keypoints)
Sets the keypoints.
Parameters
Note
This clears any existing keypoints and edges.
function
void setKeypoints(const std::vector< Keypoint > & keypoints, const std::vector< Edge > & edges)
Sets the keypoints together with the skeleton edges connecting them.
Parameters
  • keypoints: Keypoints to set.
  • edges: Pairs of keypoint indices to connect. Example: {{0, 1}, {1, 2}} connects keypoint 0 to keypoint 1 and keypoint 1 to keypoint 2.
Parameters
  • std::invalid_argument: if an edge index is out of range or an edge is a self-loop.
function
std::vector< Edge > getEdges()
Returns the skeleton edges as pairs of keypoint indices.
function
void setEdges(const std::vector< Edge > & edges)
Sets the skeleton edges.
Parameters
  • edges: Pairs of keypoint indices to connect.
Parameters
  • std::invalid_argument: if an edge index is out of range or an edge is a self-loop.
function
std::vector< Point2f > getPoints2f()
Returns the 2D image coordinates of the keypoints, dropping the z axis values.
function
std::vector< Point3f > getPoints3f()
Returns the 3D image coordinates of the keypoints. 2D keypoints carry a z coordinate of 0.
function
Keypoints transformTo(const ImgTransformation & target)
Returns a new Keypoints message with the keypoint image coordinates remapped from this message's transformation into the target transformation.
Parameters
  • target: Target image transformation.
Parameters
  • std::runtime_error: if this message carries no transformation metadata.
function
dai::VisualizeType getVisualizationMessage()
Returns an ImgAnnotations visualization with the keypoints drawn as points and the skeleton edges drawn as lines.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(Keypoints, sequenceNum, ts, tsDevice, tsSystem, transformation, keypointsList)
struct

dai::beta::Line

#include Lines.hpp
variable
Point2f startPoint
Start point of the line with x and y coordinate.
variable
Point2f endPoint
End point of the line with x and y coordinate.
variable
float confidence
Confidence of the line, in [0, 1].
function
DEPTHAI_SERIALIZE(Line, startPoint, endPoint, confidence)
class

dai::beta::Lines

#include Lines.hpp
variable
std::vector< Line > lines
Detected lines.
variable
int64_t sequenceNum
variable
variable
Timestamp tsDevice
variable
std::optional< Timestamp > tsSystem
variable
std::optional< ImgTransformation > transformation
function
Lines()
Construct Lines message.
function
~Lines()
function
Lines transformTo(const ImgTransformation & target)
Returns a new Lines message with the line point image coordinates remapped from this message's transformation into the target transformation.
Parameters
  • target: Target image transformation.
Parameters
  • std::runtime_error: if this message carries no transformation metadata.
function
dai::VisualizeType getVisualizationMessage()
Returns an ImgAnnotations visualization with each line drawn as a two-point line strip.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(Lines, sequenceNum, ts, tsDevice, tsSystem, transformation, lines)
class

dai::beta::MLSDParserConfig

#include MLSDParserConfig.hpp
variable
int topK
variable
float scoreThreshold
variable
float distanceThreshold
function
MLSDParserConfig()
function
~MLSDParserConfig()
function
void setTopK(int topK)
Sets the number of highest-scoring candidates retained for decoding.
Parameters
  • topK: Positive candidate count
function
int getTopK()
Gets the number of highest-scoring candidates retained for decoding.
Returns
Candidate count
function
void setScoreThreshold(float threshold)
Sets the minimum candidate score.
Parameters
  • threshold: Score threshold in the range [0, 1]
function
float getScoreThreshold()
Gets the minimum candidate score.
Returns
Score threshold
function
void setDistanceThreshold(float threshold)
Sets the distance threshold used while decoding line segments.
Parameters
  • threshold: Nonnegative distance threshold
function
float getDistanceThreshold()
Gets the distance threshold used while decoding line segments.
Returns
Distance threshold
function
bool validate()
Validates this configuration.
Returns
True if topK is positive, the score threshold is in [0, 1], and the distance threshold is nonnegative
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
Serializes this configuration into message metadata.
Parameters
  • metadata: Destination metadata buffer
  • datatype: Datatype identifier written during serialization
inline function
DatatypeEnum getDatatype()
Returns the datatype identifier for this configuration.
Returns
Configuration datatype identifier
function
DEPTHAI_SERIALIZE(MLSDParserConfig, topK, scoreThreshold, distanceThreshold)
class

dai::beta::MPPalmDetectionParserConfig

#include MPPalmDetectionParserConfig.hpp
variable
float confidenceThreshold
variable
float iouThreshold
variable
int maxDetections
function
MPPalmDetectionParserConfig()
function
~MPPalmDetectionParserConfig()
function
void setConfidenceThreshold(float threshold)
Sets the minimum detection confidence.
Parameters
  • threshold: Confidence threshold in the range [0, 1]
function
float getConfidenceThreshold()
Gets the minimum detection confidence.
Returns
Confidence threshold
function
void setIouThreshold(float threshold)
Sets the intersection-over-union threshold used by non-maximum suppression.
Parameters
  • threshold: IoU threshold in the range [0, 1]
function
float getIouThreshold()
Gets the intersection-over-union threshold.
Returns
IoU threshold
function
void setMaxDetections(int maxDetections)
Sets the maximum number of emitted detections.
Parameters
  • maxDetections: Positive maximum detection count
function
int getMaxDetections()
Gets the maximum number of emitted detections.
Returns
Maximum detection count
function
bool validate()
Validates this configuration.
Returns
True if both thresholds are in [0, 1] and maxDetections is positive
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
Serializes this configuration into message metadata.
Parameters
  • metadata: Destination metadata buffer
  • datatype: Datatype identifier written during serialization
inline function
DatatypeEnum getDatatype()
Returns the datatype identifier for this configuration.
Returns
Configuration datatype identifier
function
DEPTHAI_SERIALIZE(MPPalmDetectionParserConfig, confidenceThreshold, iouThreshold, maxDetections)
class

dai::beta::Map2D

#include Map2D.hpp
variable
int64_t sequenceNum
variable
variable
Timestamp tsDevice
variable
std::optional< Timestamp > tsSystem
variable
std::optional< ImgTransformation > transformation
function
Map2D()
Construct Map2D message.
function
Map2D(const std::vector< float > & map, size_t width, size_t height)
Construct Map2D message with the given map values and dimensions.
Parameters
  • map: Map values in row-major order, of size width * height.
  • width: Map width in values per row.
  • height: Map height in rows.
Parameters
  • std::runtime_error: if the map size does not equal width * height.
function
~Map2D()
function
void setMap(const std::vector< float > & map, size_t width, size_t height)
Sets the 2D map. The values are copied into the buffer payload.
Parameters
  • map: Map values in row-major order, of size width * height.
  • width: Map width in values per row.
  • height: Map height in rows.
Parameters
  • std::runtime_error: if the map size does not equal width * height.
function
void setMap(span< const float > map, size_t width, size_t height)
Sets the 2D map from a float span without an extra temporary vector. The values are copied into the buffer payload.
Parameters
  • map: Map values in row-major order, of size width * height.
  • width: Map width in values per row.
  • height: Map height in rows.
Parameters
  • std::runtime_error: if the map size does not equal width * height.
function
std::vector< float > getMap()
Returns a copy of the 2D map values in row-major order. If no map is set, returns an empty vector.
function
size_t getWidth()
Returns the width of the 2D map.
function
size_t getHeight()
Returns the height of the 2D map.
function
Map2D transformTo(const ImgTransformation & target)
Returns a new Map2D message with the transformation metadata replaced by the target transformation. The map values and dimensions are unchanged.
Parameters
  • target: Target image transformation.
Parameters
  • std::runtime_error: if this message carries no transformation metadata.
function
dai::VisualizeType getVisualizationMessage()
Returns an ImgFrame visualization of the map colored with a plasma colormap.When any map value is below 1 the values are scaled by 255, so maps normalized to [0, 1] use the full colormap range. The values are then truncated to 8-bit indices into the colormap and emitted as an interleaved BGR frame.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(Map2D, sequenceNum, ts, tsDevice, tsSystem, transformation, width, height)
class

dai::beta::MapOutputParserConfig

#include MapOutputParserConfig.hpp
variable
bool minMaxScaling
function
MapOutputParserConfig()
function
~MapOutputParserConfig()
function
void setMinMaxScaling(bool enabled)
Sets whether output values are scaled using their minimum and maximum.
Parameters
  • enabled: Whether min-max scaling is enabled
function
bool getMinMaxScaling()
Gets whether output values are scaled using their minimum and maximum.
Returns
Whether min-max scaling is enabled
function
bool validate()
Validates this configuration.
Returns
True because every value of the boolean option is valid
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
Serializes this configuration into message metadata.
Parameters
  • metadata: Destination metadata buffer
  • datatype: Datatype identifier written during serialization
inline function
DatatypeEnum getDatatype()
Returns the datatype identifier for this configuration.
Returns
Configuration datatype identifier
function
DEPTHAI_SERIALIZE(MapOutputParserConfig, minMaxScaling)
class

dai::beta::MultiDeviceCalibrationControl

#include MultiDeviceCalibrationControl.hpp
using
Command = std::variant< std::monostate, Commands::Start, Commands::Stop, Commands::Reset >
variable
Command command
function
MultiDeviceCalibrationControl()
inline explicit function
MultiDeviceCalibrationControl(Command command)
function
~MultiDeviceCalibrationControl()
inline function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
struct

dai::beta::MultiDeviceCalibrationControl::Commands

struct

dai::beta::MultiDeviceCalibrationControl::Commands::Reset

struct

dai::beta::MultiDeviceCalibrationControl::Commands::Start

struct

dai::beta::MultiDeviceCalibrationControl::Commands::Stop

struct

dai::beta::MultiDeviceCalibrationResult

#include MultiDeviceCalibrationResult.hpp
variable
std::optional< std::vector< MultiDeviceExtrinsics > > graph
Validated, meter-normalized cross-device calibration edges. One edge per non-reference device, mapping that device's local origin to the local origin of the reference device. Present only when passed is true.
variable
bool passed
True if the calibration completed and graph holds a pose for every registered device. False when data collection or the solver failed; info explains why.
variable
double dataConfidence
Quality score of the input data. A normalized value between 0.0 and 1.0 indicating how much you can trust the collected samples. Remains 0.0 when the solver was not reached.
variable
double sampsonError
Sampson error of the estimated calibration over the collected samples. Lower is better. Remains 0.0 when the solver was not reached.
variable
std::string info
Human-readable result description. Explains why passed is false; empty when the calibration passed.
function
MultiDeviceCalibrationResult()
inline explicit function
MultiDeviceCalibrationResult(std::string information)
function
~MultiDeviceCalibrationResult()
function
std::optional< MultiDeviceCalibrationHandler > getHandler()
Build a MultiDeviceCalibrationHandler from the calibration graph.
Returns
The handler when the result carries a graph, or std::nullopt when it does not.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
class

dai::beta::PPTextDetectionParserConfig

#include PPTextDetectionParserConfig.hpp
variable
float confidenceThreshold
variable
float maskThreshold
variable
int maxDetections
function
PPTextDetectionParserConfig()
function
~PPTextDetectionParserConfig()
function
void setConfidenceThreshold(float threshold)
Sets the minimum detection confidence.
Parameters
  • threshold: Confidence threshold in the range [0, 1]
function
float getConfidenceThreshold()
Gets the minimum detection confidence.
Returns
Confidence threshold
function
void setMaskThreshold(float threshold)
Sets the threshold applied to the text probability mask.
Parameters
  • threshold: Mask threshold in the range [0, 1]
function
float getMaskThreshold()
Gets the threshold applied to the text probability mask.
Returns
Mask threshold
function
void setMaxDetections(int maxDetections)
Sets the maximum number of emitted detections.
Parameters
  • maxDetections: Positive maximum detection count
function
int getMaxDetections()
Gets the maximum number of emitted detections.
Returns
Maximum detection count
function
bool validate()
Validates this configuration.
Returns
True if both thresholds are in [0, 1] and maxDetections is positive
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
Serializes this configuration into message metadata.
Parameters
  • metadata: Destination metadata buffer
  • datatype: Datatype identifier written during serialization
inline function
DatatypeEnum getDatatype()
Returns the datatype identifier for this configuration.
Returns
Configuration datatype identifier
function
DEPTHAI_SERIALIZE(PPTextDetectionParserConfig, confidenceThreshold, maskThreshold, maxDetections)
struct

dai::beta::Prediction

#include Predictions.hpp
variable
float prediction
The predicted value.
function
DEPTHAI_SERIALIZE(Prediction, prediction)
class

dai::beta::Predictions

#include Predictions.hpp
variable
std::vector< Prediction > predictions
Predicted values, in the order the model emitted them.
variable
int64_t sequenceNum
variable
variable
Timestamp tsDevice
variable
std::optional< Timestamp > tsSystem
variable
std::optional< ImgTransformation > transformation
function
Predictions()
Construct Predictions message.
function
~Predictions()
function
float getFirstPrediction()
Returns the first predicted value. Useful for single-prediction models.
Parameters
  • std::runtime_error: if the message contains no predictions.
function
Predictions transformTo(const ImgTransformation & target)
Returns a new Predictions message with the transformation metadata replaced by the target transformation. Regression results carry no spatial data, so the predictions are unchanged.
Parameters
  • target: Target image transformation.
function
dai::VisualizeType getVisualizationMessage()
Returns an ImgAnnotations visualization with each predicted value drawn as text, one below the other, or std::monostate when no transformation metadata is available to derive the annotation layout from.
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
inline function
DatatypeEnum getDatatype()
Get the datatype of this specific message.
Returns
DatatypeEnum
function
DEPTHAI_SERIALIZE(Predictions, sequenceNum, ts, tsDevice, tsSystem, transformation, predictions)
class

dai::beta::RFDETRParserConfig

#include RFDETRParserConfig.hpp
variable
float confidenceThreshold
variable
int maxDetections
variable
float maskConfidence
function
RFDETRParserConfig()
function
~RFDETRParserConfig()
function
void setConfidenceThreshold(float threshold)
Set the minimum detection confidence.
Parameters
  • threshold: Confidence threshold in the inclusive range [0, 1]
function
float getConfidenceThreshold()
Get the minimum detection confidence.
Returns
Confidence threshold in the inclusive range [0, 1]
function
void setMaxDetections(int maxDetections)
Set the maximum number of detections to retain.
Parameters
  • maxDetections: Maximum detection count, which must be positive
function
int getMaxDetections()
Get the maximum number of detections to retain.
Returns
Maximum detection count
function
void setMaskConfidence(float threshold)
Set the minimum per-pixel confidence used when creating instance masks.
Parameters
  • threshold: Mask confidence threshold in the inclusive range [0, 1]
function
float getMaskConfidence()
Get the minimum per-pixel confidence used when creating instance masks.
Returns
Mask confidence threshold in the inclusive range [0, 1]
function
bool validate()
Check whether all configuration values are valid.
Returns
True when both confidence thresholds are in the inclusive range [0, 1] and maxDetections is positive
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
Serialize this configuration into stream metadata.
Parameters
  • metadata: Output buffer that receives the serialized configuration
  • datatype: Output datatype identifier, set to RFDETRParserConfig
inline function
DatatypeEnum getDatatype()
Get the datatype identifier for RFDETRParserConfig.
Returns
DatatypeEnum::RFDETRParserConfig
function
DEPTHAI_SERIALIZE(RFDETRParserConfig, confidenceThreshold, maxDetections, maskConfidence)
class

dai::beta::SCRFDParserConfig

#include SCRFDParserConfig.hpp
variable
float confidenceThreshold
variable
float iouThreshold
variable
int maxDetections
function
SCRFDParserConfig()
function
~SCRFDParserConfig()
function
void setConfidenceThreshold(float threshold)
Set the minimum detection confidence.
Parameters
  • threshold: Confidence threshold in the inclusive range [0, 1]
function
float getConfidenceThreshold()
Get the minimum detection confidence.
Returns
Confidence threshold in the inclusive range [0, 1]
function
void setIouThreshold(float threshold)
Set the non-maximum suppression intersection-over-union threshold.
Parameters
  • threshold: Intersection-over-union threshold in the inclusive range [0, 1]
function
float getIouThreshold()
Get the non-maximum suppression intersection-over-union threshold.
Returns
Intersection-over-union threshold in the inclusive range [0, 1]
function
void setMaxDetections(int maxDetections)
Set the maximum number of post-suppression detections to retain.
Parameters
  • maxDetections: Maximum detection count, which must be positive
function
int getMaxDetections()
Get the maximum number of post-suppression detections to retain.
Returns
Maximum post-suppression detection count
function
bool validate()
Check whether all configuration values are valid.
Returns
True when both thresholds are in the inclusive range [0, 1] and maxDetections is positive
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
Serialize this configuration into stream metadata.
Parameters
  • metadata: Output buffer that receives the serialized configuration
  • datatype: Output datatype identifier, set to SCRFDParserConfig
inline function
DatatypeEnum getDatatype()
Get the datatype identifier for SCRFDParserConfig.
Returns
DatatypeEnum::SCRFDParserConfig
function
DEPTHAI_SERIALIZE(SCRFDParserConfig, confidenceThreshold, iouThreshold, maxDetections)
class

dai::beta::SuperAnimalParserConfig

#include SuperAnimalParserConfig.hpp
variable
float scoreThreshold
function
SuperAnimalParserConfig()
function
~SuperAnimalParserConfig()
function
void setScoreThreshold(float threshold)
Set the minimum keypoint score.
Parameters
  • threshold: Score threshold in the inclusive range [0, 1]
function
float getScoreThreshold()
Get the minimum keypoint score.
Returns
Score threshold in the inclusive range [0, 1]
function
bool validate()
Check whether all configuration values are valid.
Returns
True when scoreThreshold is in the inclusive range [0, 1]
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
Serialize this configuration into stream metadata.
Parameters
  • metadata: Output buffer that receives the serialized configuration
  • datatype: Output datatype identifier, set to SuperAnimalParserConfig
inline function
DatatypeEnum getDatatype()
Get the datatype identifier for SuperAnimalParserConfig.
Returns
DatatypeEnum::SuperAnimalParserConfig
function
DEPTHAI_SERIALIZE(SuperAnimalParserConfig, scoreThreshold)
struct

dai::beta::ToFStereoFusionConfig

variable
float confidenceThreshold
variable
bool cropToOverlap
Crop depth and confidence to the largest rectangle in the geometric overlap. Uses viewing directions (projection at infinity), independent of measured depth. Recomputed when input transformations or dimensions change; empty overlap throws.
inline function
ToFStereoFusionConfig & setCropToOverlap(bool enabled)
Enable cropping depth and confidence to the largest rectangle inside their geometric overlap. The overlap uses projection at infinity, independently of measured depth. Outputs retain native pixel resolution, with updated intrinsics and unchanged camera extrinsics.
Parameters
  • enabled: Whether to crop the outputs. Disabled by default.
Returns
This configuration for chaining.
Note
Set on initialConfig before starting the pipeline. The crop is computed from the first synchronized input pair and reused until either input transformation or dimensions change. If the geometric overlap is empty, the node throws an error while processing that pair.
inline function
ToFStereoFusionConfig & setConfidenceThreshold(float threshold)
class

dai::beta::XFeatMonoParserConfig

#include XFeatMonoParserConfig.hpp
variable
int maxKeypoints
function
XFeatMonoParserConfig()
function
~XFeatMonoParserConfig()
function
void setMaxKeypoints(int maxKeypoints)
Set the maximum number of keypoints to retain per frame.
Parameters
  • maxKeypoints: Maximum keypoint count, which must be positive
function
int getMaxKeypoints()
Get the maximum number of keypoints to retain per frame.
Returns
Maximum keypoint count
function
bool validate()
Check whether all configuration values are valid.
Returns
True when maxKeypoints is positive
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
Serialize this configuration into stream metadata.
Parameters
  • metadata: Output buffer that receives the serialized configuration
  • datatype: Output datatype identifier, set to XFeatMonoParserConfig
inline function
DatatypeEnum getDatatype()
Get the datatype identifier for XFeatMonoParserConfig.
Returns
DatatypeEnum::XFeatMonoParserConfig
function
DEPTHAI_SERIALIZE(XFeatMonoParserConfig, maxKeypoints)
class

dai::beta::XFeatStereoParserConfig

#include XFeatStereoParserConfig.hpp
variable
int maxKeypoints
function
XFeatStereoParserConfig()
function
~XFeatStereoParserConfig()
function
void setMaxKeypoints(int maxKeypoints)
Set the maximum number of keypoints to retain from each frame in the stereo pair.
Parameters
  • maxKeypoints: Maximum keypoint count, which must be positive
function
int getMaxKeypoints()
Get the maximum number of keypoints to retain from each frame in the stereo pair.
Returns
Maximum keypoint count applied to each frame
function
bool validate()
Check whether all configuration values are valid.
Returns
True when maxKeypoints is positive
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
Serialize this configuration into stream metadata.
Parameters
  • metadata: Output buffer that receives the serialized configuration
  • datatype: Output datatype identifier, set to XFeatStereoParserConfig
inline function
DatatypeEnum getDatatype()
Get the datatype identifier for XFeatStereoParserConfig.
Returns
DatatypeEnum::XFeatStereoParserConfig
function
DEPTHAI_SERIALIZE(XFeatStereoParserConfig, maxKeypoints)
class

dai::beta::YuNetParserConfig

#include YuNetParserConfig.hpp
variable
float confidenceThreshold
variable
float iouThreshold
variable
int maxDetections
function
YuNetParserConfig()
function
~YuNetParserConfig()
function
void setConfidenceThreshold(float threshold)
Set the minimum face detection confidence.
Parameters
  • threshold: Confidence threshold in the inclusive range [0, 1]
function
float getConfidenceThreshold()
Get the minimum face detection confidence.
Returns
Confidence threshold in the inclusive range [0, 1]
function
void setIouThreshold(float threshold)
Set the non-maximum suppression intersection-over-union threshold.
Parameters
  • threshold: Intersection-over-union threshold in the inclusive range [0, 1]
function
float getIouThreshold()
Get the non-maximum suppression intersection-over-union threshold.
Returns
Intersection-over-union threshold in the inclusive range [0, 1]
function
void setMaxDetections(int maxDetections)
Set the maximum number of detections to retain.
Parameters
  • maxDetections: Maximum detection count; a value less than or equal to zero means unlimited
function
int getMaxDetections()
Get the maximum number of detections to retain.
Returns
Maximum detection count; a value less than or equal to zero means unlimited
function
bool validate()
Check whether all configuration values are valid.
Returns
True when confidenceThreshold and iouThreshold are in the inclusive range [0, 1]; maxDetections may have any integer value
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
Serialize this configuration into stream metadata.
Parameters
  • metadata: Output buffer that receives the serialized configuration
  • datatype: Output datatype identifier, set to YuNetParserConfig
inline function
DatatypeEnum getDatatype()
Get the datatype identifier for YuNetParserConfig.
Returns
DatatypeEnum::YuNetParserConfig
function
DEPTHAI_SERIALIZE(YuNetParserConfig, confidenceThreshold, iouThreshold, maxDetections)
class

dai::beta::MultiDeviceCalibrationHandler

#include MultiDeviceCalibrationHandler.hpp
function
MultiDeviceCalibrationHandler()
explicit function
MultiDeviceCalibrationHandler(std::vector< MultiDeviceExtrinsics > graph)
explicit function
MultiDeviceCalibrationHandler(std::filesystem::path calibrationDataPath)
Construct and validate a handler from a JSON file.
function
nlohmann::json toJson()
Return the handler's JSON representation with translations in centimeters.
function
bool toJsonFile(std::filesystem::path destPath)
Write the handler's centimeter-normalized JSON representation to a file.
function
const std::vector< MultiDeviceExtrinsics > & getGraph()
Return the validated, meter-normalized calibration edges.
function
std::optional< CameraBoardSocket > getDeviceSocket(const std::string & deviceId)
Get the local calibration-origin socket used by a device in the graph.
Returns
The socket when the device participates in the graph, or std::nullopt when it does not.
function
std::optional< Extrinsics > getExtrinsicsToOrigin(const std::string & deviceId, CameraBoardSocket localOriginSocket)
Get the transform from a device's local calibration origin to its connected component's automatically selected origin.
Returns
A meter-normalized transform when the device participates in the graph, or std::nullopt when it does not.
Parameters
  • std::invalid_argument: when the graph is invalid or the supplied local socket does not match the graph.
struct

dai::beta::ClassificationParserProperties

#include ClassificationParserProperties.hpp
variable
std::string outputLayerName
variable
std::vector< std::string > classes
variable
std::int64_t nClasses
variable
bool isSoftmax
function
~ClassificationParserProperties()
struct

dai::beta::ClassificationSequenceParserProperties

#include ClassificationSequenceParserProperties.hpp
variable
std::string outputLayerName
variable
std::vector< std::string > classes
variable
std::int64_t nClasses
variable
bool isSoftmax
variable
function
~ClassificationSequenceParserProperties()
struct

dai::beta::EmbeddingsParserProperties

#include EmbeddingsParserProperties.hpp
variable
std::string outputLayerName
function
~EmbeddingsParserProperties()
struct

dai::beta::FastSAMParserProperties

#include FastSAMParserProperties.hpp
variable
FastSAMParserConfig initialConfig
variable
std::int32_t numClasses
variable
std::vector< std::string > yoloOutputs
variable
std::vector< std::string > maskOutputs
variable
std::string protosOutput
function
~FastSAMParserProperties()
struct

dai::beta::HRNetParserProperties

#include HRNetParserProperties.hpp
variable
std::string outputLayerName
variable
HRNetParserConfig initialConfig
variable
std::vector< std::string > labelNames
variable
std::vector< Edge > edges
function
~HRNetParserProperties()
struct

dai::beta::ImageOutputParserProperties

#include ImageOutputParserProperties.hpp
variable
std::string outputLayerName
variable
bool outputIsBGR
function
~ImageOutputParserProperties()
struct

dai::beta::ImgDetectionsFilterProperties

#include ImgDetectionsFilterProperties.hpp
variable
ImgDetectionsFilterConfig initialConfig
Configuration used until a message is received on inputConfig.
function
~ImgDetectionsFilterProperties()
struct

dai::beta::KeypointParserProperties

#include KeypointParserProperties.hpp
variable
std::string outputLayerName
variable
float scaleFactor
variable
std::optional< std::int64_t > nKeypoints
variable
std::optional< float > scoreThreshold
variable
std::vector< std::string > labelNames
variable
std::vector< Edge > edges
function
~KeypointParserProperties()
struct

dai::beta::LaneDetectionParserProperties

#include LaneDetectionParserProperties.hpp
variable
std::string outputLayerName
variable
std::vector< std::int64_t > rowAnchors
variable
std::optional< std::int64_t > gridingNum
variable
std::optional< std::int64_t > clsNumPerLane
variable
std::optional< std::pair< std::uint32_t, std::uint32_t > > inputSize
function
~LaneDetectionParserProperties()
struct

dai::beta::MLSDParserProperties

#include MLSDParserProperties.hpp
variable
std::string outputLayerTPMap
variable
std::string outputLayerHeat
variable
MLSDParserConfig initialConfig
variable
std::pair< std::uint32_t, std::uint32_t > inputSize
function
~MLSDParserProperties()
struct

dai::beta::MPPalmDetectionParserProperties

#include MPPalmDetectionParserProperties.hpp
variable
std::vector< std::string > outputLayerNames
variable
variable
int scale
variable
std::vector< std::string > labelNames
function
~MPPalmDetectionParserProperties()
struct

dai::beta::MapOutputParserProperties

#include MapOutputParserProperties.hpp
variable
std::string outputLayerName
variable
MapOutputParserConfig initialConfig
function
~MapOutputParserProperties()
struct

dai::beta::PPTextDetectionParserProperties

#include PPTextDetectionParserProperties.hpp
variable
std::string outputLayerName
variable
function
~PPTextDetectionParserProperties()
struct

dai::beta::RFDETRParserProperties

#include RFDETRParserProperties.hpp
variable
RFDETRParserConfig initialConfig
variable
std::vector< std::string > labelNames
variable
std::vector< std::string > outputLayerNames
variable
std::optional< std::pair< std::uint32_t, std::uint32_t > > inputSize
function
~RFDETRParserProperties()
struct

dai::beta::RegressionParserProperties

#include RegressionParserProperties.hpp
variable
std::string outputLayerName
function
~RegressionParserProperties()
struct

dai::beta::SCRFDParserProperties

#include SCRFDParserProperties.hpp
variable
std::vector< std::string > outputLayerNames
variable
SCRFDParserConfig initialConfig
variable
std::pair< std::uint32_t, std::uint32_t > inputSize
variable
std::vector< std::int64_t > featStrideFpn
variable
std::int64_t numAnchors
variable
std::vector< std::string > labelNames
function
~SCRFDParserProperties()
struct

dai::beta::StitchingProperties

#include StitchingProperties.hpp
variable
Mode mode
variable
CameraModel cameraModel
Projection model the panorama images are warped onto: Equirectangular (the OpenCV default), Cylindrical or Perspective.
variable
std::uint32_t numInputs
Number of image inputs configured by Stitching::build().
variable
bool continuous
variable
std::uint32_t estimationFrames
variable
std::uint32_t maxPanoramaWidth
variable
std::uint32_t maxPanoramaHeight
variable
double panoConfidenceThreshold
variable
SeamFinder seamFinder
variable
std::optional< Plane > plane
variable
std::optional< VirtualCamera > view
variable
std::uint32_t maxViewWidth
variable
std::uint32_t maxViewHeight
variable
float maxRange
Maximum planar projection range, stored in centimeters.
variable
float minIncidenceAngle
variable
bool useInputCalibration
Use the rotations and intrinsics carried by the input frames instead of visually registering a panorama.
function
~StitchingProperties()
struct

dai::beta::StitchingProperties::Plane

#include StitchingProperties.hpp
variable
Point3f point
A point lying on the plane.
variable
Point3f normal
Normal of the plane; it does not have to be of unit length.
variable
LengthUnit unit
Length unit of point.
struct

dai::beta::StitchingProperties::VirtualCamera

#include StitchingProperties.hpp
variable
std::array< std::array< float, 4 >, 4 > pose
Pose of the camera with respect to the reference frame.
variable
LengthUnit unit
Length unit of the translation part of pose.
variable
std::array< std::array< float, 3 >, 3 > intrinsics
Intrinsic matrix of the camera.
variable
std::uint32_t width
Width of the rendered image in pixels.
variable
std::uint32_t height
Height of the rendered image in pixels.
enum

std::uint8_t Mode

Stitching mode.
enumerator
PANORAMA
Photo panorama registered from overlapping image content.
enumerator
PLANAR_PROJECTION
Projection of calibrated views onto a plane.
enum

std::uint8_t SeamFinder

Seam estimation method.
enumerator
NONE
enumerator
VORONOI
enumerator
DP_COLOR
enumerator
DP_COLOR_GRAD
enumerator
GRAPHCUT_COLOR
enumerator
GRAPHCUT_COLOR_GRAD
struct

dai::beta::SuperAnimalParserProperties

#include SuperAnimalParserProperties.hpp
variable
std::string outputLayerName
variable
float scaleFactor
variable
std::int64_t nKeypoints
variable
variable
std::vector< std::string > labelNames
variable
std::vector< Edge > edges
function
~SuperAnimalParserProperties()
struct

dai::beta::ToFStereoFusionProperties

variable
ToFStereoFusionConfig initialConfig
function
~ToFStereoFusionProperties()
struct

dai::beta::XFeatMonoParserProperties

#include XFeatMonoParserProperties.hpp
variable
std::string outputLayerFeats
variable
std::string outputLayerKeypoints
variable
std::string outputLayerHeatmaps
variable
std::optional< std::pair< std::uint32_t, std::uint32_t > > originalSize
variable
std::pair< std::uint32_t, std::uint32_t > inputSize
variable
XFeatMonoParserConfig initialConfig
function
~XFeatMonoParserProperties()
struct

dai::beta::XFeatStereoParserProperties

#include XFeatStereoParserProperties.hpp
variable
std::string outputLayerFeats
variable
std::string outputLayerKeypoints
variable
std::string outputLayerHeatmaps
variable
std::optional< std::pair< std::uint32_t, std::uint32_t > > originalSize
variable
std::pair< std::uint32_t, std::uint32_t > inputSize
variable
function
~XFeatStereoParserProperties()
struct

dai::beta::YuNetParserProperties

#include YuNetParserProperties.hpp
variable
std::string locOutputLayerName
variable
std::string confOutputLayerName
variable
std::string iouOutputLayerName
variable
YuNetParserConfig initialConfig
variable
std::optional< std::pair< std::uint32_t, std::uint32_t > > inputSize
variable
std::vector< std::string > labelNames
function
~YuNetParserProperties()
namespace

dai::beta::node

class

dai::beta::node::ClassificationParser

#include ClassificationParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
Input input
Input NN results with classification data to parse.
variable
Output out
Outputs Classifications message with classes and scores sorted in descending order of score.
function
std::shared_ptr< ClassificationParser > build(Node::Output & nnInput, const Model & model)
Build ClassificationParser node. Links the supplied output to this node's input and configures the parser from the model's classification head.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< ClassificationParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build ClassificationParser node with the specific head from an NNArchive. Useful when the model has multiple classification heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one ClassificationParser head; use setNNArchiveHead() to select a specific head from a multi-head archive.
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be a ClassificationParser head with exactly one output layer.
Parameters
function
void setOutputLayerName(const std::string & outputLayerName)
Sets the name of the model output layer to parse.When left empty, the parser selects the tensor automatically if the incoming NNData contains exactly one tensor and fails otherwise.
Parameters
  • outputLayerName: Name of the output layer
function
std::string getOutputLayerName()
Returns the name of the model output layer to parse.
function
void setClasses(const std::vector< std::string > & classes)
Sets the class names to link with the classification scores.The class names are expected to be in the same order as the neural network's output. The number of class names must match the number of scores produced by the model.
Parameters
  • classes: Vector of class names
function
std::vector< std::string > getClasses()
Returns the class names to link with the classification scores.
function
void setSoftmax(bool isSoftmax)
Sets whether the model output is already softmaxed.When false, the parser applies softmax to convert the raw scores to probabilities.
Parameters
  • isSoftmax: True when the model output is already softmaxed
function
bool getSoftmax()
Returns whether the model output is treated as already softmaxed.
function
void setRunOnHost(bool runOnHost)
Select whether the node runs on the host or device.
function
bool runOnHost()
Returns true when this node runs on the host.Host-only pipelines always run the node on the host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::ClassificationSequenceParser

#include ClassificationSequenceParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
std::shared_ptr< ClassificationSequenceParserConfig > initialConfig
Configuration used until a message is received on inputConfig.
variable
Input inputConfig
Runtime parser configuration. When synchronized, one configuration is consumed per frame; otherwise all queued configurations are drained and the newest valid one is used.
variable
Input input
Input NN results with classification sequence data to parse.
variable
Output out
Outputs Classifications message with classes and scores ordered by their position in the sequence.
function
ClassificationSequenceParser()
function
ClassificationSequenceParser(std::unique_ptr< Properties > props)
function
std::shared_ptr< ClassificationSequenceParser > build(Node::Output & nnInput, const Model & model)
Build ClassificationSequenceParser node. Links the supplied output to this node's input and configures the parser from the model's classification sequence head.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< ClassificationSequenceParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build ClassificationSequenceParser node with the specific head from an NNArchive. Useful when the model has multiple classification sequence heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one ClassificationSequenceParser head; use setNNArchiveHead() to select a specific head from a multi-head archive.
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be a ClassificationSequenceParser head with exactly one output layer.
Parameters
function
void setOutputLayerName(const std::string & outputLayerName)
Sets the name of the model output layer to parse.When left empty, the parser selects the tensor automatically if the incoming NNData contains exactly one tensor and fails otherwise.
Parameters
  • outputLayerName: Name of the output layer
function
std::string getOutputLayerName()
Returns the name of the model output layer to parse.
function
void setClasses(const std::vector< std::string > & classes)
Sets the class names to link with the per-step classification scores.The class names are expected to be in the same order as the neural network's output. The number of class names must match the number of scores produced by the model at each sequence step.
Parameters
  • classes: Vector of class names
function
std::vector< std::string > getClasses()
Returns the class names to link with the per-step classification scores.
function
void setSoftmax(bool isSoftmax)
Sets whether the model output is already softmaxed.When false, the parser applies softmax along each sequence step to convert the raw scores to probabilities.
Parameters
  • isSoftmax: True when the model output is already softmaxed
function
bool getSoftmax()
Returns whether the model output is treated as already softmaxed.
function
void setIgnoredIndexes(const std::vector< std::int32_t > & ignoredIndexes)
Sets the class indexes to ignore during classification sequence generation (e.g. background class, blank space).Sequence steps whose most probable class index is listed here are dropped from the output. Every index must be within [0, nClasses - 1].
Parameters
  • ignoredIndexes: Vector of class indexes to ignore
Note
Configures startup behavior. Send ClassificationSequenceParserConfig to inputConfig after the pipeline starts.
function
std::vector< std::int32_t > getIgnoredIndexes()
Returns the class indexes ignored during classification sequence generation.
function
void setRemoveDuplicates(bool removeDuplicates)
Sets whether consecutive duplicate classes are removed from the sequence.Only consecutive duplicates are removed; repeated classes separated by other classes are kept.
Parameters
  • removeDuplicates: True to remove consecutive duplicates from the sequence
Note
Configures startup behavior. Send ClassificationSequenceParserConfig to inputConfig after the pipeline starts.
function
bool getRemoveDuplicates()
Returns whether consecutive duplicate classes are removed from the sequence.
function
void setConcatenateClasses(bool concatenateClasses)
Sets whether the remaining classes are concatenated. Used mostly for text processing.When true and more than one class remains: when all remaining class names are at most one character long, they are joined and split on whitespace into words with a per-word mean score; otherwise all class names are joined into a single string with a " " separator and one mean score.
Parameters
  • concatenateClasses: True to concatenate the remaining classes
Note
Configures startup behavior. Send ClassificationSequenceParserConfig to inputConfig after the pipeline starts.
function
bool getConcatenateClasses()
Returns whether the remaining classes are concatenated.
function
void setRunOnHost(bool runOnHost)
Select whether the node runs on the host or device.
function
bool runOnHost()
Returns true when this node runs on the host.Host-only pipelines always run the node on the host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::EmbeddingsParser

#include EmbeddingsParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
Input input
Input NN results with embeddings data to validate and forward.
variable
Output out
Outputs the unchanged NNData message containing the embeddings output layer.
function
std::shared_ptr< EmbeddingsParser > build(Node::Output & nnInput, const Model & model)
Build EmbeddingsParser node. Links the supplied output to this node's input and configures the parser from the model's embeddings head.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< EmbeddingsParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build EmbeddingsParser node with the specific head from an NNArchive. Useful when the model has multiple embeddings heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one EmbeddingsParser head; use setNNArchiveHead() to select a specific head from a multi-head archive.
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be an EmbeddingsParser head with exactly one output layer.
Parameters
function
void setOutputLayerName(const std::string & outputLayerName)
Sets the name of the model output layer carrying the embeddings.When left empty, the parser requires the incoming NNData to contain exactly one tensor and fails otherwise.
Parameters
  • outputLayerName: Name of the output layer
function
std::string getOutputLayerName()
Returns the name of the model output layer carrying the embeddings.
function
void setRunOnHost(bool runOnHost)
Select whether the node runs on the host or device.
function
bool runOnHost()
Returns true when this node runs on the host.Host-only pipelines always run the node on the host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::FastSAMParser

#include FastSAMParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
std::shared_ptr< FastSAMParserConfig > initialConfig
Configuration used until a message is received on inputConfig.
variable
Input inputConfig
Runtime parser configuration. When synchronized, one configuration is consumed per frame; otherwise all queued configurations are drained and the newest valid one is used.
variable
Input input
Input NN results with FastSAM data to parse.
variable
Output out
Outputs SegmentationMask message with the resulting segmentation masks given the prompt.
function
FastSAMParser()
function
FastSAMParser(std::unique_ptr< Properties > props)
function
std::shared_ptr< FastSAMParser > build(Node::Output & nnInput, const Model & model)
Build FastSAMParser node. Links the supplied output to this node's input and configures the parser from the model's FastSAMParser head.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< FastSAMParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build FastSAMParser node with the specific head from an NNArchive. Useful when the model has multiple heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one FastSAMParser head; use setNNArchiveHead() to select a specific head from a multi-head archive.
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head's output layer names containing "_yolo" configure the YOLO output layers and those containing "_masks" the mask output layers (each only when at least one matches). The confidence threshold, number of classes, NMS threshold, mask confidence, prompt, points, point label and bounding box are read from the head metadata when present.
Parameters
function
void setConfidenceThreshold(float threshold)
Sets the confidence score threshold for detected objects. Detections whose score is strictly greater than the threshold are kept. Defaults to 0.5.
Parameters
  • threshold: Confidence score threshold, must be between 0 and 1
Note
Configures startup behavior. Send FastSAMParserConfig to inputConfig after the pipeline starts.
function
float getConfidenceThreshold()
Returns the confidence score threshold for detected objects.
function
void setNumClasses(std::int32_t numClasses)
Sets the number of classes in the model. The YOLO output tensors must have numClasses + 5 channels. Defaults to 1.
Parameters
  • numClasses: Number of classes, must be greater than 0
function
std::int32_t getNumClasses()
Returns the number of classes in the model.
function
void setIouThreshold(float iouThreshold)
Sets the non-maximum suppression overlap threshold. Boxes whose overlap with a kept box is strictly greater than the threshold are suppressed. Defaults to 0.5.
Parameters
  • iouThreshold: Overlap threshold, must be between 0 and 1
Note
Configures startup behavior. Send FastSAMParserConfig to inputConfig after the pipeline starts.
function
float getIouThreshold()
Returns the non-maximum suppression overlap threshold.
function
void setMaskConfidence(float maskConfidence)
Sets the mask confidence threshold used to binarize instance masks. Mask pixels with a sigmoid probability strictly greater than the threshold belong to the instance. Defaults to 0.5.
Parameters
  • maskConfidence: Mask confidence threshold, must be between 0 and 1
Note
Configures startup behavior. Send FastSAMParserConfig to inputConfig after the pipeline starts.
function
float getMaskConfidence()
Returns the mask confidence threshold.
function
void setPrompt(const std::string & prompt)
Sets the prompt type: "everything" emits every detected instance, "bbox" the single instance mask with the highest IoU against the prompt bounding box (see setBoundingBox()), and "point" the combination of the instance masks containing the prompt point (see setPoints() and setPointLabel()). Defaults to "everything".
Parameters
  • prompt: Prompt type, one of "everything", "bbox" or "point"
Note
Configures startup behavior. Send FastSAMParserConfig to inputConfig after the pipeline starts.
function
std::string getPrompt()
Returns the prompt type.
function
void setPoints(std::int32_t x, std::int32_t y)
Sets the prompt point as (x, y) in model-input pixels, used by the "point" prompt. Unset by default; the "point" prompt requires it.
Parameters
  • x: Point x coordinate
  • y: Point y coordinate
Note
Configures startup behavior. Send FastSAMParserConfig to inputConfig after the pipeline starts.
function
std::optional< std::pair< std::int32_t, std::int32_t > > getPoints()
Returns the prompt point as (x, y), or std::nullopt when it is not set.
function
void setPointLabel(std::int32_t pointLabel)
Sets the prompt point label, used by the "point" prompt: 1 adds the instance masks containing the point, 0 subtracts them. Unset by default; the "point" prompt requires it.
Parameters
  • pointLabel: Point label
Note
Configures startup behavior. Send FastSAMParserConfig to inputConfig after the pipeline starts.
function
std::optional< std::int32_t > getPointLabel()
Returns the prompt point label, or std::nullopt when it is not set.
function
void setBoundingBox(const std::array< std::int32_t, 4 > & bbox)
Sets the prompt bounding box as (x1, y1, x2, y2) in model-input pixels, used by the "bbox" prompt. Unset by default; the "bbox" prompt requires it and its x2 and y2 coordinates must not be 0.
Parameters
  • bbox: Bounding box as (x1, y1, x2, y2)
Note
Configures startup behavior. Send FastSAMParserConfig to inputConfig after the pipeline starts.
function
std::optional< std::array< std::int32_t, 4 > > getBoundingBox()
Returns the prompt bounding box as (x1, y1, x2, y2), or std::nullopt when it is not set.
function
void setYoloOutputs(const std::vector< std::string > & yoloOutputs)
Sets the names of the model's YOLO output layers. The layers are processed sorted by name, so the stride-8 head must come first in sort order. Defaults to ["output1_yolov8", "output2_yolov8", "output3_yolov8"].
Parameters
  • yoloOutputs: Names of the YOLO output layers
function
std::vector< std::string > getYoloOutputs()
Returns the names of the model's YOLO output layers.
function
void setMaskOutputs(const std::vector< std::string > & maskOutputs)
Sets the names of the model's mask-coefficient output layers. Only names containing "mask" are used, sorted by name and index-aligned with the sorted YOLO output layers; when empty, all layer names of the incoming NNData containing "mask" are used. Defaults to ["output1_masks", "output2_masks", "output3_masks"].
Parameters
  • maskOutputs: Names of the mask output layers
function
std::vector< std::string > getMaskOutputs()
Returns the names of the model's mask-coefficient output layers.
function
void setProtosOutput(const std::string & protosOutput)
Sets the name of the model's prototype-masks output layer; when empty, "protos_output" is used. Defaults to "protos_output".
Parameters
  • protosOutput: Name of the protos output layer
function
std::string getProtosOutput()
Returns the name of the model's prototype-masks output layer.
function
void setRunOnHost(bool runOnHost)
Select whether the node runs on the host or device.
function
bool runOnHost()
Returns true when this node runs on the host.Host-only pipelines always run the node on the host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::HRNetParser

#include HRNetParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
std::shared_ptr< HRNetParserConfig > initialConfig
Configuration used until a message is received on inputConfig.
variable
Input inputConfig
Runtime parser configuration. When synchronized, one configuration is consumed per frame; otherwise all queued configurations are drained and the newest valid one is used.
variable
Input input
Input NN results with heatmaps data to parse.
variable
Output out
Outputs Keypoints message with the detected body keypoints.
function
HRNetParser()
function
HRNetParser(std::unique_ptr< Properties > props)
function
std::shared_ptr< HRNetParser > build(Node::Output & nnInput, const Model & model)
Build HRNetParser node. Links the supplied output to this node's input and configures the parser from the model's HRNetParser head.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< HRNetParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build HRNetParser node with the specific head from an NNArchive. Useful when the model has multiple heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one HRNetParser head; use setNNArchiveHead() to select a specific head from a multi-head archive.
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be an HRNetParser head with exactly one output layer.
Parameters
function
void setOutputLayerName(const std::string & outputLayerName)
Sets the name of the model output layer to parse.When left empty, the parser selects the tensor automatically if the incoming NNData contains exactly one tensor and fails otherwise.
Parameters
  • outputLayerName: Name of the output layer
function
std::string getOutputLayerName()
Returns the name of the model output layer to parse.
function
void setScoreThreshold(float threshold)
Sets the confidence score threshold for detected keypoints. Keypoints with a score strictly below the threshold are dropped.
Parameters
  • threshold: Confidence score threshold, must be between 0 and 1
Note
Configures startup behavior. Send HRNetParserConfig to inputConfig after the pipeline starts.
function
float getScoreThreshold()
Returns the confidence score threshold for detected keypoints.
function
void setLabelNames(const std::vector< std::string > & labelNames)
Sets the label names for the keypoints, indexed by keypoint index.
Parameters
  • labelNames: Vector of label names
function
std::vector< std::string > getLabelNames()
Returns the label names for the keypoints.
function
void setEdges(const std::vector< Edge > & edges)
Sets the skeleton edges as pairs of keypoint indices used for visualizing the skeleton.Example: {{0, 1}, {1, 2}, {2, 3}, {3, 0}} connects keypoint 0 to keypoint 1, keypoint 1 to keypoint 2, etc.
Parameters
  • edges: Vector of keypoint index pairs
function
std::vector< Edge > getEdges()
Returns the skeleton edges as pairs of keypoint indices.
function
void setRunOnHost(bool runOnHost)
Select whether the node runs on the host or device.
function
bool runOnHost()
Returns true when this node runs on the host.Host-only pipelines always run the node on the host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::ImageOutputParser

#include ImageOutputParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
Input input
Input NN results with image tensor data to parse.
variable
Output out
Outputs ImgFrame message with the model output image, e.g. a denoised or enhanced image.
function
std::shared_ptr< ImageOutputParser > build(Node::Output & nnInput, const Model & model)
Build ImageOutputParser node. Links the supplied output to this node's input and configures the parser from the model's ImageOutputParser head.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< ImageOutputParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build ImageOutputParser node with the specific head from an NNArchive. Useful when the model has multiple heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one ImageOutputParser head; use setNNArchiveHead() to select a specific head from a multi-head archive.
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be an ImageOutputParser head with exactly one output layer.
Parameters
function
void setOutputLayerName(const std::string & outputLayerName)
Sets the name of the model output layer to parse.When left empty, the parser selects the tensor automatically if the incoming NNData contains exactly one tensor and fails otherwise.
Parameters
  • outputLayerName: Name of the output layer
function
std::string getOutputLayerName()
Returns the name of the model output layer to parse.
function
void setBGROutput(bool outputIsBGR)
Sets the flag indicating whether the model output image is in BGR (Blue-Green-Red) channel order.When false (the default), a color model output is treated as RGB and its channels are swapped to BGR before being emitted.
Parameters
  • outputIsBGR: True when the model output image is already BGR, defaults to true
function
bool getBGROutput()
Returns the flag indicating whether the model output image is in BGR (Blue-Green-Red) channel order.
function
void setRunOnHost(bool runOnHost)
Select whether the node runs on the host or device.
function
bool runOnHost()
Returns true when this node runs on the host.Host-only pipelines always run the node on the host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::ImgDetectionsFilter

#include ImgDetectionsFilter.hpp
variable
std::shared_ptr< ImgDetectionsFilterConfig > initialConfig
Configuration used until a message is received on inputConfig.The default configuration forwards detections unchanged.
variable
Input input
Image detections to filter.
variable
Input inputConfig
Runtime filter configuration. The most recently received configuration is reused for subsequent detection messages.
variable
Output output
Filtered image detections.
function
ImgDetectionsFilter()
function
ImgDetectionsFilter(std::unique_ptr< Properties > props)
function
~ImgDetectionsFilter()
function
void setRunOnHost(bool runOnHost)
Select whether the node runs on the host or device.
function
bool runOnHost()
Returns true when this node runs on the host.Host-only pipelines always run the node on the host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::KeypointParser

#include KeypointParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
Input input
Input NN results with keypoints data to parse.
variable
Output out
Outputs Keypoints message with the parsed 2D or 3D keypoints.
function
std::shared_ptr< KeypointParser > build(Node::Output & nnInput, const Model & model)
Build KeypointParser node. Links the supplied output to this node's input and configures the parser from the model's keypoints head.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< KeypointParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build KeypointParser node with the specific head from an NNArchive. Useful when the model has multiple heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one KeypointParser head; use setNNArchiveHead() to select a specific head from a multi-head archive.
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be a KeypointParser head with exactly one output layer.
Parameters
function
void setOutputLayerName(const std::string & outputLayerName)
Sets the name of the model output layer to parse.When left empty, the parser selects the tensor automatically if the incoming NNData contains exactly one tensor and fails otherwise.
Parameters
  • outputLayerName: Name of the output layer
function
std::string getOutputLayerName()
Returns the name of the model output layer to parse.
function
void setScaleFactor(float scaleFactor)
Sets the scale factor to divide the keypoint coordinates by.
Parameters
  • scaleFactor: Scale factor, must be greater than 0
function
float getScaleFactor()
Returns the scale factor to divide the keypoint coordinates by.
function
void setNumKeypoints(std::int64_t nKeypoints)
Sets the number of keypoints the model detects.Must be configured before the pipeline starts, either explicitly or through an NNArchive head.
Parameters
  • nKeypoints: Number of keypoints, must be greater than 0
function
std::optional< std::int64_t > getNumKeypoints()
Returns the number of keypoints the model detects, or std::nullopt when not configured.
function
void setScoreThreshold(float threshold)
Sets the confidence score threshold for detected keypoints.
Parameters
  • threshold: Confidence score threshold, must be between 0 and 1
function
std::optional< float > getScoreThreshold()
Returns the confidence score threshold for detected keypoints, or std::nullopt when not configured.
function
void setLabelNames(const std::vector< std::string > & labelNames)
Sets the label names for the keypoints, indexed by keypoint index.
Parameters
  • labelNames: Vector of label names
function
std::vector< std::string > getLabelNames()
Returns the label names for the keypoints.
function
void setEdges(const std::vector< Edge > & edges)
Sets the skeleton edges as pairs of keypoint indices used for visualizing the skeleton.Example: {{0, 1}, {1, 2}, {2, 3}, {3, 0}} connects keypoint 0 to keypoint 1, keypoint 1 to keypoint 2, etc.
Parameters
  • edges: Vector of keypoint index pairs
function
std::vector< Edge > getEdges()
Returns the skeleton edges as pairs of keypoint indices.
function
void setRunOnHost(bool runOnHost)
Select whether the node runs on the host or device.
function
bool runOnHost()
Returns true when this node runs on the host.Host-only pipelines always run the node on the host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::LaneDetectionParser

#include LaneDetectionParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
Input input
Input NN results with lane detection data to parse.
variable
Output out
Outputs Clusters message with the detected lanes represented as clusters of points.
function
std::shared_ptr< LaneDetectionParser > build(Node::Output & nnInput, const Model & model)
Build LaneDetectionParser node. Links the supplied output to this node's input and configures the parser from the model's LaneDetectionParser head and the model input's declared shape and layout.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< LaneDetectionParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build LaneDetectionParser node with the specific head from an NNArchive. Useful when the model has multiple heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
Note
A head carries no model input metadata, so the input size must additionally be configured with setInputSize().
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one LaneDetectionParser head and exactly one model input; use setNNArchiveHead() to select a specific head from a multi-head archive. The input size is derived from the model input's declared shape and layout (NHWC or NCHW).
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be a LaneDetectionParser head with exactly one output layer.
Parameters
Note
A head carries no model input metadata, so the input size must additionally be configured with setInputSize().
function
void setOutputLayerName(const std::string & outputLayerName)
Sets the name of the model output layer to parse.When left empty, the parser selects the tensor automatically if the incoming NNData contains exactly one tensor and fails otherwise.
Parameters
  • outputLayerName: Name of the output layer
function
std::string getOutputLayerName()
Returns the name of the model output layer to parse.
function
void setRowAnchors(const std::vector< std::int64_t > & rowAnchors)
Sets the row anchors, the image rows at which the model predicts lane positions.Must be configured before the pipeline starts, either explicitly or through an NNArchive head, and must contain at least as many entries as the number of points per lane.
Parameters
  • rowAnchors: Row anchors, must not be empty
function
std::vector< std::int64_t > getRowAnchors()
Returns the row anchors, or an empty vector when not configured.
function
void setGridingNum(std::int64_t gridingNum)
Sets the griding number, the number of column samples the model predicts lane positions over.Must be configured before the pipeline starts, either explicitly or through an NNArchive head.
Parameters
  • gridingNum: Griding number, must be greater than 1
function
std::optional< std::int64_t > getGridingNum()
Returns the griding number, or std::nullopt when not configured.
function
void setClsNumPerLane(std::int64_t clsNumPerLane)
Sets the number of points per lane.Must be configured before the pipeline starts, either explicitly or through an NNArchive head.
Parameters
  • clsNumPerLane: Number of points per lane, must be greater than 0
function
std::optional< std::int64_t > getClsNumPerLane()
Returns the number of points per lane, or std::nullopt when not configured.
function
void setInputSize(std::uint32_t width, std::uint32_t height)
Sets the model input image size the emitted points are computed against and normalized by.Must be configured before the pipeline starts. Configuring from a full NNArchive derives it from the model input's declared shape and layout; the most recent configuration wins.
Parameters
  • width: Input image width, must be greater than 0
  • height: Input image height, must be greater than 0
function
std::optional< std::pair< std::uint32_t, std::uint32_t > > getInputSize()
Returns the model input image size as (width, height), or std::nullopt when not configured.
function
void setRunOnHost(bool runOnHost)
Select whether the node runs on the host or device.
function
bool runOnHost()
Returns true when this node runs on the host.Host-only pipelines always run the node on the host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::MLSDParser

#include MLSDParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
std::shared_ptr< MLSDParserConfig > initialConfig
Configuration used until a message is received on inputConfig.
variable
Input inputConfig
Runtime parser configuration. When synchronized, one configuration is consumed per frame; otherwise all queued configurations are drained and the newest valid one is used.
variable
Input input
Input NN results with line detection data to parse.
variable
Output out
Outputs Lines message with the detected lines and confidence scores.
function
MLSDParser()
function
MLSDParser(std::unique_ptr< Properties > props)
function
std::shared_ptr< MLSDParser > build(Node::Output & nnInput, const Model & model)
Build MLSDParser node. Links the supplied output to this node's input and configures the parser from the model's MLSDParser head and the model input's declared shape and layout.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< MLSDParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build MLSDParser node with the specific head from an NNArchive. Useful when the model has multiple heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
Note
A head carries no model input metadata, so the input size keeps its current value (512x512 by default); use setInputSize() for models with a different input size.
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one MLSDParser head and exactly one model input; use setNNArchiveHead() to select a specific head from a multi-head archive. The input size is derived from the model input's declared shape and layout (NHWC or NCHW).
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be an MLSDParser head with exactly two output layers; the layer whose name contains "tpMap" is used as the tpMap layer and the layer whose name contains "heat" as the heat layer.
Parameters
Note
A head carries no model input metadata, so the input size keeps its current value (512x512 by default); use setInputSize() for models with a different input size.
function
void setOutputLayerTPMap(const std::string & outputLayerTPMap)
Sets the name of the output layer containing the tpMap tensor.Must be configured before the pipeline starts, either explicitly or through an NNArchive head.
Parameters
  • outputLayerTPMap: Name of the output layer containing the tpMap tensor
function
std::string getOutputLayerTPMap()
Returns the name of the output layer containing the tpMap tensor, or an empty string when not configured.
function
void setOutputLayerHeat(const std::string & outputLayerHeat)
Sets the name of the output layer containing the heat tensor.Must be configured before the pipeline starts, either explicitly or through an NNArchive head.
Parameters
  • outputLayerHeat: Name of the output layer containing the heat tensor
function
std::string getOutputLayerHeat()
Returns the name of the output layer containing the heat tensor, or an empty string when not configured.
function
void setTopK(int topK)
Sets the number of top candidates to keep.The number of candidates is capped at the heat map size when decoding.
Parameters
  • topK: Number of top candidates to keep, must be positive
Note
Configures startup behavior. Send MLSDParserConfig to inputConfig after the pipeline starts.
function
int getTopK()
Returns the number of top candidates to keep.
function
void setScoreThreshold(float scoreThreshold)
Sets the confidence score threshold for detected lines. Candidates with a heat score strictly above the threshold are kept.
Parameters
  • scoreThreshold: Confidence score threshold
Note
Configures startup behavior. Send MLSDParserConfig to inputConfig after the pipeline starts.
function
float getScoreThreshold()
Returns the confidence score threshold for detected lines.
function
void setDistanceThreshold(float distanceThreshold)
Sets the distance threshold for detected lines. Candidates whose length in heat map grid units is strictly above the threshold are kept.
Parameters
  • distanceThreshold: Distance threshold
Note
Configures startup behavior. Send MLSDParserConfig to inputConfig after the pipeline starts.
function
float getDistanceThreshold()
Returns the distance threshold for detected lines.
function
void setInputSize(std::uint32_t width, std::uint32_t height)
Sets the model input image size the emitted line coordinates are normalized by, x coordinates by the width and y coordinates by the height.Defaults to 512x512, the input size of all known M-LSD models. Configuring from a full NNArchive derives it from the model input's declared shape and layout; the most recent configuration wins.
Parameters
  • width: Input image width, must be greater than 0
  • height: Input image height, must be greater than 0
function
std::pair< std::uint32_t, std::uint32_t > getInputSize()
Returns the model input image size as (width, height).
function
void setRunOnHost(bool runOnHost)
Select whether the node runs on the host or device.
function
bool runOnHost()
Returns true when this node runs on the host.Host-only pipelines always run the node on the host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::MPPalmDetectionParser

#include MPPalmDetectionParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
std::shared_ptr< MPPalmDetectionParserConfig > initialConfig
Configuration used when the parser starts.
variable
Input inputConfig
Runtime parser configuration. In synchronized mode one configuration is consumed per input frame; otherwise all queued configurations are drained and the newest valid one is retained.
variable
Input input
Input NN results with palm detection data to parse.
variable
Output out
Outputs ImgDetections message with the rotated bounding boxes, labels and confidence scores of the detected hands.
function
MPPalmDetectionParser()
function
MPPalmDetectionParser(std::unique_ptr< Properties > props)
function
std::shared_ptr< MPPalmDetectionParser > build(Node::Output & nnInput, const Model & model)
Build MPPalmDetectionParser node. Links the supplied output to this node's input and configures the parser from the model's MPPalmDetectionParser head.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< MPPalmDetectionParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build MPPalmDetectionParser node with the specific head from an NNArchive. Useful when the model has multiple heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one MPPalmDetectionParser head; use setNNArchiveHead() to select a specific head from a multi-head archive.
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be an MPPalmDetectionParser head with exactly two output layers.
Parameters
function
void setOutputLayerNames(const std::vector< std::string > & outputLayerNames)
Sets the names of the model output layers relevant to the parser. Exactly two layer names are required.
Parameters
  • outputLayerNames: Names of the output layers
function
std::vector< std::string > getOutputLayerNames()
Returns the names of the model output layers relevant to the parser.
function
void setConfidenceThreshold(float threshold)
Sets the confidence score threshold for detected hands. Detections with a sigmoid score strictly above the threshold are kept.
Parameters
  • threshold: Confidence score threshold
Note
Configures startup behavior. Send MPPalmDetectionParserConfig to inputConfig after the pipeline starts.
function
float getConfidenceThreshold()
Returns the confidence score threshold for detected hands.
function
void setIouThreshold(float threshold)
Sets the non-maximum suppression (IoU) threshold.
Parameters
  • threshold: Non-maximum suppression threshold
Note
Configures startup behavior. Send MPPalmDetectionParserConfig to inputConfig after the pipeline starts.
function
float getIouThreshold()
Returns the non-maximum suppression (IoU) threshold.
function
void setMaxDetections(int maxDetections)
Sets the maximum number of detections to keep.
Parameters
  • maxDetections: Maximum number of detections to keep
Note
Configures startup behavior. Send MPPalmDetectionParserConfig to inputConfig after the pipeline starts.
function
int getMaxDetections()
Returns the maximum number of detections to keep.
function
void setScale(int scale)
Sets the scale of the model input image in pixels (e.g. 192 for a 192x192 model). The SSD anchors used for decoding are generated from the scale; a scale that does not match the model input size fails decoding with an anchor count mismatch.
Parameters
  • scale: Scale of the input image
function
int getScale()
Returns the scale of the model input image in pixels.
function
void setLabelNames(const std::vector< std::string > & labelNames)
Sets the label names for the detected hands. The first label name is assigned to every detection (all detections carry label 0). When empty, no label name is assigned.
Parameters
  • labelNames: List of label names
function
std::vector< std::string > getLabelNames()
Returns the label names for the detected hands.
function
void setRunOnHost(bool runOnHost)
Select whether the node runs on the host or device.
function
bool runOnHost()
Returns true when this node runs on the host.Host-only pipelines always run the node on the host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::MapOutputParser

#include MapOutputParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
std::shared_ptr< MapOutputParserConfig > initialConfig
Configuration used until a message is received on inputConfig.
variable
Input inputConfig
Runtime parser configuration. When synchronized, one configuration is consumed per frame; otherwise all queued configurations are drained and the newest valid one is used.
variable
Input input
Input NN results with map tensor data to parse.
variable
Output out
Outputs Map2D message with the parsed 2D map, e.g. a depth or density map.
function
MapOutputParser()
function
MapOutputParser(std::unique_ptr< Properties > props)
function
std::shared_ptr< MapOutputParser > build(Node::Output & nnInput, const Model & model)
Build MapOutputParser node. Links the supplied output to this node's input and configures the parser from the model's MapOutputParser head.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< MapOutputParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build MapOutputParser node with the specific head from an NNArchive. Useful when the model has multiple heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one MapOutputParser head; use setNNArchiveHead() to select a specific head from a multi-head archive.
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be a MapOutputParser head with exactly one output layer.
Parameters
function
void setOutputLayerName(const std::string & outputLayerName)
Sets the name of the model output layer to parse.When left empty, the parser selects the tensor automatically if the incoming NNData contains exactly one tensor and fails otherwise.
Parameters
  • outputLayerName: Name of the output layer
function
std::string getOutputLayerName()
Returns the name of the model output layer to parse.
function
void setMinMaxScaling(bool minMaxScaling)
Sets the flag indicating whether the map is scaled to the [0, 1] range.When true, the map values are min-max scaled to [0, 1]; a constant map is left unchanged. Defaults to false.
Parameters
  • minMaxScaling: True to scale the map to the [0, 1] range, defaults to true
Note
Configures startup behavior. Send MapOutputParserConfig to inputConfig after the pipeline starts.
function
bool getMinMaxScaling()
Returns the flag indicating whether the map is scaled to the [0, 1] range.
function
void setRunOnHost(bool runOnHost)
Select whether the node runs on the host or device.
function
bool runOnHost()
Returns true when this node runs on the host.Host-only pipelines always run the node on the host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::MultiDeviceCalibration

#include MultiDeviceCalibration.hpp
variable
Subnode< dai::node::Sync > sync
Synchronized camera streams, keyed internally by device ID and socket.
variable
InputMap & inputs
variable
Input inputControl
Explicit lifecycle control.
variable
Input syncInput
Synchronized image groups.
variable
Output calibrationOutput
Pure-data calibration result.
function
MultiDeviceCalibration()
function
~MultiDeviceCalibration()
function
void addCamera(Node::Output & cameraOutput)
Register a live camera stream.The device ID and socket are taken from the Camera node that owns the output, so the output must come directly from a built Camera created on a device. For outputs of other nodes (ImageManip, host nodes, replayed streams) use the explicit overload.
function
void addCamera(std::string deviceId, CameraBoardSocket socket, Node::Output & cameraOutput)
Register an image stream with an explicit identity.Use this when the output does not come directly from a Camera node, for example for replayed or recorded streams. Image metadata is not a reliable source of cross-device identity, so the identity is passed in.
function
void setSampleCount(std::size_t sampleCount)
Set the number of complete synchronized groups required before solving.
function
std::size_t getSampleCount()
function
void setKnownDistance(std::string fromDeviceId, CameraBoardSocket fromSocket, std::string toDeviceId, CameraBoardSocket toSocket, float distance, LengthUnit unit)
Supply a metric camera-center distance for an endpoint pair.
function
void setInitialGuess(const MultiDeviceExtrinsics & guess)
Supply an optional initial pose estimate between two devices.The edge may connect any two sockets known to the devices' calibrations, registered or not; the node converts it to the devices' calibration origins when the run starts. One guess per device pair, the last one set wins. Sockets unknown to a device's calibration fail the run with a descriptive result.
function
void setInitialGuesses(const std::vector< MultiDeviceExtrinsics > & guesses)
Supply several initial guesses at once, for example a previous result's graph.
function
void setInitialGuesses(const MultiDeviceCalibrationHandler & previous)
Seed the run with every edge of a previous calibration.
function
void setStereoPair(std::string deviceId, CameraBoardSocket leftSocket, CameraBoardSocket rightSocket)
Optional. Restrict metric scale recovery to an explicit factory-calibrated stereo pair. By default every pair of registered cameras on the same device may anchor the metric scale.
function
void setDeviceCalibration(std::string deviceId, const CalibrationHandler & calibration)
Override live calibration for recorded/offline streams and tests.
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
class

dai::beta::node::PPTextDetectionParser

#include PPTextDetectionParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
std::shared_ptr< PPTextDetectionParserConfig > initialConfig
Configuration used when the parser starts.
variable
Input inputConfig
Runtime parser configuration. In synchronized mode one configuration is consumed per input frame; otherwise all queued configurations are drained and the newest valid one is retained.
variable
Input input
Input NN results with text detection probability map to parse.
variable
Output out
Outputs ImgDetections message with the rotated bounding boxes and confidence scores of the detected text.
function
PPTextDetectionParser()
function
PPTextDetectionParser(std::unique_ptr< Properties > props)
function
std::shared_ptr< PPTextDetectionParser > build(Node::Output & nnInput, const Model & model)
Build PPTextDetectionParser node. Links the supplied output to this node's input and configures the parser from the model's PPTextDetectionParser head.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< PPTextDetectionParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build PPTextDetectionParser node with the specific head from an NNArchive. Useful when the model has multiple heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one PPTextDetectionParser head; use setNNArchiveHead() to select a specific head from a multi-head archive.
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head configures the confidence threshold, the mask threshold and the maximum number of detections when present in its metadata. The head's declared output names are not consumed: the parser resolves the single runtime output tensor by itself (or uses the explicitly configured output layer name), mirroring the source parser; archives whose head output name differs from the model's declared output name therefore parse correctly.
Parameters
function
void setOutputLayerName(const std::string & outputLayerName)
Sets the name of the model output layer holding the text probability map. When empty (the default), the layer is resolved automatically from single-tensor NN results; multi-tensor results require an explicit name.
Parameters
  • outputLayerName: Name of the output layer
function
std::string getOutputLayerName()
Returns the name of the model output layer holding the text probability map.
function
void setConfidenceThreshold(float threshold)
Sets the confidence score threshold for the detected text bounding boxes. Candidates with a score strictly below the threshold are dropped.
Parameters
  • threshold: Confidence score threshold
Note
Configures startup behavior. Send PPTextDetectionParserConfig to inputConfig after the pipeline starts.
function
float getConfidenceThreshold()
Returns the confidence score threshold for the detected text bounding boxes.
function
void setMaskThreshold(float maskThreshold)
Sets the mask threshold for creating the binary text mask from the model output probabilities. Probabilities strictly above the threshold belong to the mask.
Parameters
  • maskThreshold: Mask threshold
Note
Configures startup behavior. Send PPTextDetectionParserConfig to inputConfig after the pipeline starts.
function
float getMaskThreshold()
Returns the mask threshold for creating the binary text mask from the model output probabilities.
function
void setMaxDetections(int maxDetections)
Sets the maximum number of candidate bounding boxes. When more candidate contours are found, only the largest by area are kept.
Parameters
  • maxDetections: Maximum number of candidate bounding boxes
Note
Configures startup behavior. Send PPTextDetectionParserConfig to inputConfig after the pipeline starts.
function
int getMaxDetections()
Returns the maximum number of candidate bounding boxes.
function
void setRunOnHost(bool runOnHost)
Select whether the node runs on the host or device.
function
bool runOnHost()
Returns true when this node runs on the host.Host-only pipelines always run the node on the host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::RFDETRParser

#include RFDETRParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
std::shared_ptr< RFDETRParserConfig > initialConfig
Configuration used when the parser starts.
variable
Input inputConfig
Runtime parser configuration. In synchronized mode one configuration is consumed per input frame; otherwise all queued configurations are drained and the newest valid one is retained.
variable
Input input
Input NN results with RF-DETR detection data to parse.
variable
Output out
Outputs ImgDetections message with the bounding boxes, labels and confidence scores of the detected objects and, in segmentation mode, the instance segmentation mask.
function
RFDETRParser()
function
RFDETRParser(std::unique_ptr< Properties > props)
function
std::shared_ptr< RFDETRParser > build(Node::Output & nnInput, const Model & model)
Build RFDETRParser node. Links the supplied output to this node's input and configures the parser from the model's RFDETRParser head and the model input's declared shape and layout.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< RFDETRParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build RFDETRParser node with the specific head from an NNArchive. Useful when the model has multiple heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
Note
A head carries no model input metadata, so the input size keeps its current value; segmentation mode requires it to be configured with setInputSize() when it is not set yet.
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one RFDETRParser head; use setNNArchiveHead() to select a specific head from a multi-head archive. The input size is derived from the first model input's declared shape and layout (NHWC or NCHW).
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be an RFDETRParser head with 2 output layers (boxes, class logits) for detection or 3 (boxes, class logits, mask logits) for segmentation.
Parameters
Note
A head carries no model input metadata, so the input size keeps its current value; segmentation mode requires it to be configured with setInputSize() when it is not set yet.
function
void setConfidenceThreshold(float threshold)
Sets the confidence score threshold for detected objects. Detections with a score strictly greater than the threshold are kept. Defaults to 0.5.
Parameters
  • threshold: Confidence score threshold, must be between 0 and 1
Note
Configures startup behavior. Send RFDETRParserConfig to inputConfig after the pipeline starts.
function
float getConfidenceThreshold()
Returns the confidence score threshold for detected objects.
function
void setMaxDetections(int maxDetections)
Sets the maximum number of detections to keep, applied to the detections ordered by descending score. In segmentation mode the applied limit is additionally capped at 255, the maximum number of instances the segmentation mask can encode. Defaults to 300.
Parameters
  • maxDetections: Maximum number of detections to keep, must be greater than 0
Note
Configures startup behavior. Send RFDETRParserConfig to inputConfig after the pipeline starts.
function
int getMaxDetections()
Returns the maximum number of detections to keep.
function
void setLabelNames(const std::vector< std::string > & labelNames)
Sets the label names for the detected objects, indexed by the class label. A detection whose label is out of range receives the name "class_<label>". When empty, no label names are assigned. Defaults to empty.
Parameters
  • labelNames: List of label names
function
std::vector< std::string > getLabelNames()
Returns the label names for the detected objects.
function
void setMaskConfidence(float maskConfidence)
Sets the mask confidence threshold used to binarize instance segmentation masks in segmentation mode. Mask pixels with a sigmoid probability strictly greater than the threshold belong to the instance. Defaults to 0.5.
Parameters
  • maskConfidence: Mask confidence threshold, must be between 0 and 1
Note
Configures startup behavior. Send RFDETRParserConfig to inputConfig after the pipeline starts.
function
float getMaskConfidence()
Returns the mask confidence threshold.
function
void setOutputLayerNames(const std::vector< std::string > & outputLayerNames)
Sets the names of the model output layers, positionally: the boxes layer, the class logits layer and, in segmentation mode, the mask logits layer. Must hold 2 or 3 names.When left empty, all layer names of the incoming NNData are used in their reported order.
Parameters
  • outputLayerNames: Names of the output layers
function
std::vector< std::string > getOutputLayerNames()
Returns the names of the model output layers.
function
void setInputSize(std::uint32_t width, std::uint32_t height)
Sets the model input image size the segmentation mask is emitted at. Unset by default; segmentation mode requires it to be configured from an NNArchive or with this setter before the parser processes messages. Detection mode does not use it.Configuring from a full NNArchive derives it from the first model input's declared shape and layout; the most recent configuration wins.
Parameters
  • width: Input image width, must be greater than 0
  • height: Input image height, must be greater than 0
function
std::optional< std::pair< std::uint32_t, std::uint32_t > > getInputSize()
Returns the model input image size as (width, height), or std::nullopt when it is not set.
function
void setRunOnHost(bool runOnHost)
Select whether the node runs on the host or device.
function
bool runOnHost()
Returns true when this node runs on the host.Host-only pipelines always run the node on the host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::RegressionParser

#include RegressionParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
Input input
Input NN results with regression data to parse.
variable
Output out
Outputs Predictions message with the predicted value(s).
function
std::shared_ptr< RegressionParser > build(Node::Output & nnInput, const Model & model)
Build RegressionParser node. Links the supplied output to this node's input and configures the parser from the model's RegressionParser head.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< RegressionParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build RegressionParser node with the specific head from an NNArchive. Useful when the model has multiple regression heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one RegressionParser head; use setNNArchiveHead() to select a specific head from a multi-head archive.
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be a RegressionParser head with exactly one output layer.
Parameters
function
void setOutputLayerName(const std::string & outputLayerName)
Sets the name of the model output layer to parse.When left empty, the parser selects the tensor automatically if the incoming NNData contains exactly one tensor and fails otherwise.
Parameters
  • outputLayerName: Name of the output layer
function
std::string getOutputLayerName()
Returns the name of the model output layer to parse.
function
void setRunOnHost(bool runOnHost)
Select whether the node runs on the host or device.
function
bool runOnHost()
Returns true when this node runs on the host.Host-only pipelines always run the node on the host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::SCRFDParser

#include SCRFDParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
std::shared_ptr< SCRFDParserConfig > initialConfig
Configuration used when the parser starts.
variable
Input inputConfig
Runtime parser configuration. In synchronized mode one configuration is consumed per input frame; otherwise all queued configurations are drained and the newest valid one is retained.
variable
Input input
Input NN results with SCRFD detection data to parse.
variable
Output out
Outputs ImgDetections message with the bounding boxes, labels, confidence scores and keypoints of the detected objects.
function
SCRFDParser()
function
SCRFDParser(std::unique_ptr< Properties > props)
function
std::shared_ptr< SCRFDParser > build(Node::Output & nnInput, const Model & model)
Build SCRFDParser node. Links the supplied output to this node's input and configures the parser from the model's SCRFDParser head and the model input's declared shape and layout.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< SCRFDParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build SCRFDParser node with the specific head from an NNArchive. Useful when the model has multiple heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
Note
A head carries no model input metadata, so the input size keeps its current value; configure it with setInputSize() when it differs from the default.
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one SCRFDParser head and exactly one model input; use setNNArchiveHead() to select a specific head from a multi-head archive. The input size is derived from the model input's declared shape and layout (NHWC or NCHW).
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be an SCRFDParser head with an equal number of score, bbox and kps output layers.
Parameters
Note
A head carries no model input metadata, so the input size keeps its current value; configure it with setInputSize() when it differs from the default.
function
void setOutputLayerNames(const std::vector< std::string > & outputLayerNames)
Sets the names of the model output layers relevant to the parser. The parser looks up the per-stride score_{stride}, bbox_{stride} and kps_{stride} layer names in this list.When left empty, the list is resolved from the layer names of the first incoming NNData.
Parameters
  • outputLayerNames: Names of the output layers
function
std::vector< std::string > getOutputLayerNames()
Returns the names of the model output layers relevant to the parser.
function
void setConfidenceThreshold(float threshold)
Sets the confidence score threshold for detected objects. Detections with a score greater than or equal to the threshold (inclusive) are kept.
Parameters
  • threshold: Confidence score threshold
Note
Configures startup behavior. Send SCRFDParserConfig to inputConfig after the pipeline starts.
function
float getConfidenceThreshold()
Returns the confidence score threshold for detected objects.
function
void setIouThreshold(float threshold)
Sets the non-maximum suppression (IoU) threshold. Candidates whose overlap with a kept detection is at most the threshold (inclusive) survive suppression.
Parameters
  • threshold: Non-maximum suppression threshold
Note
Configures startup behavior. Send SCRFDParserConfig to inputConfig after the pipeline starts.
function
float getIouThreshold()
Returns the non-maximum suppression (IoU) threshold.
function
void setMaxDetections(int maxDetections)
Sets the maximum number of detections to keep.
Parameters
  • maxDetections: Maximum number of detections to keep
Note
Configures startup behavior. Send SCRFDParserConfig to inputConfig after the pipeline starts.
function
int getMaxDetections()
Returns the maximum number of detections to keep.
function
void setInputSize(std::uint32_t width, std::uint32_t height)
Sets the model input image size the anchor centers are computed against and the emitted coordinates are normalized by. Defaults to (640, 640).Configuring from a full NNArchive derives it from the model input's declared shape and layout; the most recent configuration wins.
Parameters
  • width: Input image width, must be greater than 0
  • height: Input image height, must be greater than 0
function
std::pair< std::uint32_t, std::uint32_t > getInputSize()
Returns the model input image size as (width, height).
function
void setFeatStrideFPN(const std::vector< std::int64_t > & featStrideFpn)
Sets the feature strides of the FPN. One score_{stride}, bbox_{stride} and kps_{stride} layer triple is parsed per stride. Defaults to (8, 16, 32).
Parameters
  • featStrideFpn: Feature strides, every stride must be greater than 0
function
std::vector< std::int64_t > getFeatStrideFPN()
Returns the feature strides of the FPN.
function
void setNumAnchors(std::int64_t numAnchors)
Sets the number of anchors per feature map position. Defaults to 2.
Parameters
  • numAnchors: Number of anchors; values of 1 or less yield one anchor per position, mirroring the source behavior
function
std::int64_t getNumAnchors()
Returns the number of anchors per feature map position.
function
void setLabelNames(const std::vector< std::string > & labelNames)
Sets the label names for the detected objects. The first label name is assigned to every detection (all detections carry label 0). When empty, no label name is assigned. Defaults to ("Face").
Parameters
  • labelNames: List of label names
function
std::vector< std::string > getLabelNames()
Returns the label names for the detected objects.
function
void setRunOnHost(bool runOnHost)
Select whether the node runs on the host or device.
function
bool runOnHost()
Returns true when this node runs on the host.Host-only pipelines always run the node on the host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::Stitching

#include Stitching.hpp
using
Plane = StitchingProperties::Plane
A plane the images are projected onto in Mode::PLANAR_PROJECTION, expressed in the common origin frame of the input transformations.
using
VirtualCamera = StitchingProperties::VirtualCamera
The pinhole camera Mode::PLANAR_PROJECTION renders the plane from.
variable
Subnode< dai::node::Sync > sync
Internal Sync node time-aligning the inputs.
variable
InputMap & inputs
A map of inputs, one per stitched source. Populated by build().
variable
Output out
Stitched image, ImgFrame of type BGR888i. Its transformation describes the virtual camera that rendered it, see the class documentation.
function
Stitching()
function
Stitching(std::unique_ptr< Properties > props)
function
~Stitching()
function
std::shared_ptr< Stitching > build(const std::vector< Node::Output * > & sources)
Build the node with a fixed set of sources. The number of inputs cannot change afterwards.
Parameters
  • sources: Outputs to stitch, at least two. Inputs are named input0..inputN-1 in this order
function
std::shared_ptr< Stitching > build(size_t numInputs)
Build the node with a fixed number of unlinked inputs, to be fed from host queues.
Parameters
  • numInputs: Number of inputs to stitch, at least two. Inputs are named input0..inputN-1
function
size_t getNumInputs()
Number of inputs the node was built with.
function
void setSyncThreshold(std::chrono::nanoseconds syncThreshold)
Set the maximal interval between messages of a synced group.
Parameters
  • syncThreshold: Maximal interval between messages in the group
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or an RVC4 device. By default, the node runs on host.
function
bool runOnHost()
Check whether the node is configured to run on host.
function
void setMode(Mode mode)
Set the stitching mode. Mode::PLANAR_PROJECTION additionally needs a plane, see setPlane().
function
Mode getMode()
function
void setPlane(const Plane & plane)
Plane the images are projected onto, in Mode::PLANAR_PROJECTION. Required in that mode.The plane is expressed in the common origin frame of the incoming transformations, which is the camera socket their extrinsics are relative to. A plane that all cameras look at from the same side gives the usual bird's-eye view; the plane does not have to be horizontal.
function
void setPlane(const Point3f & point, const Point3f & normal, LengthUnit unit)
function
std::optional< Plane > getPlane()
function
void setView(const VirtualCamera & view)
Camera the plane is rendered from, in Mode::PLANAR_PROJECTION.By default the view is computed from the content: the node intersects the field of view of every input with the plane and places a camera looking straight at the plane so that all of the footprints fit, at a resolution derived from the inputs and bounded by setMaxViewSize().
function
void setViewAuto()
function
std::optional< VirtualCamera > getView()
function
void setMaxViewSize(uint32_t width, uint32_t height)
Upper bound on the size of the automatically computed view, in pixels. Defaults to 1920x1920.
function
void setMaxRange(float range, LengthUnit unit)
Distance from a camera center beyond which the plane is not painted anymore. Bounds the automatic view and cuts off the region around the horizon, where a few pixels are stretched over a large part of the plane. Defaults to 10 meters.
function
float getMaxRange(LengthUnit unit)
function
void setMinIncidenceAngle(float degrees)
Smallest angle between a camera ray and the plane for the ray to still be used. Rays hitting the plane at a shallower angle are heavily stretched, so they are dropped. Defaults to 5 degrees.
function
float getMinIncidenceAngle()
function
void setCameraModel(CameraModel model)
Set the projection surface the images are warped onto. Defaults to Equirectangular (a sphere), same as OpenCV. Only used in Mode::PANORAMA.
Parameters
  • model: dai::CameraModel::Equirectangular, Cylindrical or Perspective
Parameters
  • std::invalid_argument: for any other model
function
CameraModel getCameraModel()
function
void setUseInputCalibration(bool useInputCalibration)
Use the intrinsics and rotations carried by the input ImgTransformations to compose a panorama.All inputs must be expressed relative to exactly the same destination device ID and camera socket. Translation is ignored, so all camera centers are treated as coincident. Cylindrical panoramas use the normalized mean input camera Y axis as the cylinder axis. When enabled, panorama composition starts from the first synchronized group without feature matching or bundle adjustment. With SeamFinder::NONE, warped inputs are copied in order and later inputs replace earlier ones in overlapping regions. Other seam finders enable seam estimation, exposure compensation, and multiband blending. The prepared composition is reused for subsequent groups. Only undistorted inputs are accepted. Only used in Mode::PANORAMA.
function
bool getUseInputCalibration()
Return whether panorama composition uses the calibration carried by the input ImgTransformations.
function
void setContinuous(bool continuous)
Re-estimate the camera parameters on every frame. Only used in Mode::PANORAMA.When true, registration runs for every synced group, which is slow but tolerates cameras that move relative to each other. When false, registration evaluates getEstimationFrames() complete candidates without composing them, selects the one with the strongest geometrically consistent feature-match score, and then starts emitting panoramas using that transform. Projection maps, output regions, seam masks and exposure parameters are prepared with the first emitted panorama and reused for subsequent groups.
function
bool getContinuous()
function
void setEstimationFrames(uint32_t frames)
Number of complete registration candidates evaluated before the strongest transform is fixed. Failed registrations, oversized candidates, and candidates that omit an input do not count. No panorama is emitted while the candidates are being evaluated. Only used when continuous is false.
function
uint32_t getEstimationFrames()
function
void setMaxPanoramaSize(uint32_t width, uint32_t height)
Reject panorama registrations whose projected canvas exceeds this size before OpenCV allocates and composes it. This protects against degenerate feature matches producing extremely large canvases. By default the size is unbounded.
function
void resetTransform()
Discard the fixed transform and composition state and re-run the estimation. In Mode::PLANAR_PROJECTION the projection maps, seams and exposure gains are rebuilt from the next synced group. In non-continuous Mode::PANORAMA, registration is repeated and the fixed maps, regions, seams and exposure parameters are rebuilt.
function
void setPanoConfidenceThreshold(double threshold)
Confidence below which an image is dropped from the panorama.
function
double getPanoConfidenceThreshold()
function
void setSeamFinder(SeamFinder finder)
Set the panorama seam finder. In calibrated panorama mode, NONE selects direct composition; other values also enable exposure compensation and multiband blending.
function
SeamFinder getSeamFinder()
function
void buildInternal()
function
void run()
Stitching mode.
enumerator
PANORAMA
Photo panorama registered from overlapping image content.
enumerator
PLANAR_PROJECTION
Projection of calibrated views onto a plane.
Seam estimation method.
enumerator
NONE
enumerator
VORONOI
enumerator
DP_COLOR
enumerator
DP_COLOR_GRAD
enumerator
GRAPHCUT_COLOR
enumerator
GRAPHCUT_COLOR_GRAD
class

dai::beta::node::SuperAnimalParser

#include SuperAnimalParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
std::shared_ptr< SuperAnimalParserConfig > initialConfig
Configuration used until a message is received on inputConfig.
variable
Input inputConfig
Runtime parser configuration. When synchronized, one configuration is consumed per frame; otherwise all queued configurations are drained and the newest valid one is used.
variable
Input input
Input NN results with heatmaps data to parse.
variable
Output out
Outputs Keypoints message with the detected animal keypoints.
function
SuperAnimalParser()
function
SuperAnimalParser(std::unique_ptr< Properties > props)
function
std::shared_ptr< SuperAnimalParser > build(Node::Output & nnInput, const Model & model)
Build SuperAnimalParser node. Links the supplied output to this node's input and configures the parser from the model's SuperAnimalParser head.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< SuperAnimalParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build SuperAnimalParser node with the specific head from an NNArchive. Useful when the model has multiple heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one SuperAnimalParser head; use setNNArchiveHead() to select a specific head from a multi-head archive.
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be a SuperAnimalParser head with exactly one output layer.
Parameters
function
void setOutputLayerName(const std::string & outputLayerName)
Sets the name of the model output layer to parse.When left empty, the parser selects the tensor automatically if the incoming NNData contains exactly one tensor and fails otherwise.
Parameters
  • outputLayerName: Name of the output layer
function
std::string getOutputLayerName()
Returns the name of the model output layer to parse.
function
void setScaleFactor(float scaleFactor)
Sets the scale factor the keypoint coordinates are scaled and normalized by, typically the model input size.
Parameters
  • scaleFactor: Scale factor, must be greater than 0
function
float getScaleFactor()
Returns the scale factor the keypoint coordinates are scaled and normalized by.
function
void setNumKeypoints(std::int64_t nKeypoints)
Sets the number of keypoints the model detects.Informational only: the decoding derives the number of keypoints from the heatmap tensor's last dimension.
Parameters
  • nKeypoints: Number of keypoints, must be greater than 0
function
std::int64_t getNumKeypoints()
Returns the number of keypoints the model detects.
function
void setScoreThreshold(float threshold)
Sets the confidence score threshold for detected keypoints. Keypoints with a score strictly below the threshold are dropped.
Parameters
  • threshold: Confidence score threshold, must be between 0 and 1
Note
Configures startup behavior. Send SuperAnimalParserConfig to inputConfig after the pipeline starts.
function
float getScoreThreshold()
Returns the confidence score threshold for detected keypoints.
function
void setLabelNames(const std::vector< std::string > & labelNames)
Sets the label names for the keypoints, indexed by keypoint index.
Parameters
  • labelNames: Vector of label names
function
std::vector< std::string > getLabelNames()
Returns the label names for the keypoints.
function
void setEdges(const std::vector< Edge > & edges)
Sets the skeleton edges as pairs of keypoint indices used for visualizing the skeleton.Example: {{0, 1}, {1, 2}, {2, 3}, {3, 0}} connects keypoint 0 to keypoint 1, keypoint 1 to keypoint 2, etc.
Parameters
  • edges: Vector of keypoint index pairs
function
std::vector< Edge > getEdges()
Returns the skeleton edges as pairs of keypoint indices.
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device. By default, the node runs on the device.
function
bool runOnHost()
Check if the node is set to run on host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::ToFStereoFusion

#include ToFStereoFusion.hpp
using
Input = Node::Input
using
Output = Node::Output
variable
std::shared_ptr< ToFStereoFusionConfig > initialConfig
Initial confidence threshold and optional geometric-overlap crop configuration.
variable
Subnode< dai::node::ToF > tof
Internal ToF pipeline; its depth output is available for downstream use.
variable
Subnode< dai::node::NeuralDepth > neuralDepth
Internal neural stereo-depth pipeline; its depth output is available for downstream use.
variable
Subnode< dai::node::NeuralNetwork > neuralNetwork
Internal alpha fusion network.
variable
Output depth
Fused depth output, aligned to the ToF sensor. Optional cropping updates intrinsics and preserves the ToF camera pose.
variable
Output confidence
Confidence output produced by the ToF-neural fusion network, with the same optional crop and transformation as depth.
variable
Input & inputLeft
Left camera input used when the node runs outside the RVC4 device build.
variable
Input & inputRight
Right camera input used when the node runs outside the RVC4 device build.
explicit function
ToFStereoFusion(const std::shared_ptr< Device > & device)
Creates a ToFStereoFusion node for the supplied device.
inline explicit function
ToFStereoFusion(std::unique_ptr< Properties > props)
Creates a ToFStereoFusion node from serialized properties.
function
~ToFStereoFusion()
function
std::shared_ptr< ToFStereoFusion > build(const std::shared_ptr< dai::node::Camera > & left, const std::shared_ptr< dai::node::Camera > & right, float fps)
Configures fusion from a synchronized left and right camera pair.
Note
This node is supported on RVC4 devices only.
Parameters
  • left: Left camera node.
  • right: Right camera node.
  • fps: Frame rate for the neural-depth camera inputs and ToF subnode. Must be finite and positive. Defaults to 30 FPS.
Returns
This node.
class

dai::beta::node::XFeatMonoParser

#include XFeatMonoParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
std::shared_ptr< XFeatMonoParserConfig > initialConfig
Configuration used until a message is received on inputConfig.
variable
Input inputConfig
Runtime parser configuration. When synchronized, one configuration is consumed per frame; otherwise all queued configurations are drained and the newest valid one is used.
variable
Input input
Input NN results with XFeat data to parse.
variable
Output out
Outputs TrackedFeatures message with the matched keypoint pairs.
function
XFeatMonoParser()
function
XFeatMonoParser(std::unique_ptr< Properties > props)
function
std::shared_ptr< XFeatMonoParser > build(Node::Output & nnInput, const Model & model)
Build XFeatMonoParser node. Links the supplied output to this node's input and configures the parser from the model's XFeatMonoParser head; when the head metadata carries no input size, the input size is derived from the model input's declared shape and layout.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< XFeatMonoParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build XFeatMonoParser node with the specific head from an NNArchive. Useful when the model has multiple heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one XFeatMonoParser head; use setNNArchiveHead() to select a specific head from a multi-head archive. When the head metadata carries no input size, the input size is derived from the model input's declared shape and layout (NHWC or NCHW).
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be an XFeatMonoParser head with exactly three output layers; the layer whose name contains "feats" is used as the feature map layer, the layer whose name contains "keypoints" as the keypoint logit layer and the layer whose name contains "heatmaps" as the reliability heat map layer. The original size, input size and maximum keypoint count are read from the head metadata keys original_size, input_size and max_keypoints; missing keys keep the current values.
Parameters
function
void setOutputLayerFeats(const std::string & outputLayerFeats)
Sets the name of the output layer containing the feature map.
Parameters
  • outputLayerFeats: Name of the output layer containing the feature map
function
std::string getOutputLayerFeats()
Returns the name of the output layer containing the feature map.
function
void setOutputLayerKeypoints(const std::string & outputLayerKeypoints)
Sets the name of the output layer containing the keypoint logits.
Parameters
  • outputLayerKeypoints: Name of the output layer containing the keypoint logits
function
std::string getOutputLayerKeypoints()
Returns the name of the output layer containing the keypoint logits.
function
void setOutputLayerHeatmaps(const std::string & outputLayerHeatmaps)
Sets the name of the output layer containing the reliability heat map.
Parameters
  • outputLayerHeatmaps: Name of the output layer containing the reliability heat map
function
std::string getOutputLayerHeatmaps()
Returns the name of the output layer containing the reliability heat map.
function
void setOriginalSize(std::uint32_t width, std::uint32_t height)
Sets the original image size the emitted keypoint positions are scaled to.Must be configured before the pipeline starts, either explicitly or through head metadata.
Parameters
  • width: Original image width, must be greater than 0
  • height: Original image height, must be greater than 0
function
std::optional< std::pair< std::uint32_t, std::uint32_t > > getOriginalSize()
Returns the original image size as (width, height), or std::nullopt when not configured.
function
void setInputSize(std::uint32_t width, std::uint32_t height)
Sets the model input image size the keypoint positions are decoded in.Defaults to 640x352 like the source parser. Configuring from a full NNArchive takes it from the head metadata or derives it from the model input's declared shape and layout; the most recent configuration wins.
Parameters
  • width: Input image width, must be greater than 0
  • height: Input image height, must be greater than 0
function
std::pair< std::uint32_t, std::uint32_t > getInputSize()
Returns the model input image size as (width, height).
function
void setMaxKeypoints(int maxKeypoints)
Sets the maximum number of keypoints to keep per frame.
Parameters
  • maxKeypoints: Maximum number of keypoints
Note
Configures startup behavior. Send XFeatMonoParserConfig to inputConfig after the pipeline starts.
function
int getMaxKeypoints()
Returns the maximum number of keypoints to keep per frame.
function
void setTrigger()
Requests the reference frame update: after the next decoded frame's message is emitted, that frame's keypoints become the reference the following frames are matched against. May be called at any time while the pipeline runs.
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device. By default, the node runs on the device.
function
bool runOnHost()
Check if the node is set to run on host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::XFeatStereoParser

#include XFeatStereoParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
std::shared_ptr< XFeatStereoParserConfig > initialConfig
Configuration used until a message is received on inputConfig.
variable
Input inputConfig
Runtime parser configuration. When synchronized, one configuration is consumed per frame pair; otherwise all queued configurations are drained and the newest valid one is used.
variable
Input referenceInput
Input NN results of the reference source (e.g. the left camera) with XFeat data to parse.
variable
Input targetInput
Input NN results of the target source (e.g. the right camera) with XFeat data to parse.
variable
Output out
Outputs TrackedFeatures message with the matched keypoint pairs.
function
XFeatStereoParser()
function
XFeatStereoParser(std::unique_ptr< Properties > props)
function
std::shared_ptr< XFeatStereoParser > build(Node::Output & reference, Node::Output & target, const Model & model)
Build XFeatStereoParser node. Links the supplied reference output to this node's referenceInput and the supplied target output to this node's targetInput, and configures the parser from the model's XFeatStereoParser head; when the head metadata carries no input size, the input size is derived from the model input's declared shape and layout.
Parameters
  • reference: Output with the reference source's NN results to link to referenceInput
  • target: Output with the target source's NN results to link to targetInput
  • model: Neural network model
function
std::shared_ptr< XFeatStereoParser > build(Node::Output & reference, Node::Output & target, const dai::nn_archive::v1::Head & head)
Build XFeatStereoParser node with the specific head from an NNArchive. Useful when the model has multiple heads. Links the supplied reference output to this node's referenceInput and the supplied target output to this node's targetInput.
Parameters
  • reference: Output with the reference source's NN results to link to referenceInput
  • target: Output with the target source's NN results to link to targetInput
  • head: Specific head from NNArchive to use for this parser
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one XFeatStereoParser head; use setNNArchiveHead() to select a specific head from a multi-head archive. When the head metadata carries no input size, the input size is derived from the model input's declared shape and layout (NHWC or NCHW).
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be an XFeatStereoParser head with exactly three output layers; the layer whose name contains "feats" is used as the feature map layer, the layer whose name contains "keypoints" as the keypoint logit layer and the layer whose name contains "heatmaps" as the reliability heat map layer. The original size, input size and maximum keypoint count are read from the head metadata keys original_size, input_size and max_keypoints; missing keys keep the current values.
Parameters
function
void setOutputLayerFeats(const std::string & outputLayerFeats)
Sets the name of the output layer containing the feature map.
Parameters
  • outputLayerFeats: Name of the output layer containing the feature map
function
std::string getOutputLayerFeats()
Returns the name of the output layer containing the feature map.
function
void setOutputLayerKeypoints(const std::string & outputLayerKeypoints)
Sets the name of the output layer containing the keypoint logits.
Parameters
  • outputLayerKeypoints: Name of the output layer containing the keypoint logits
function
std::string getOutputLayerKeypoints()
Returns the name of the output layer containing the keypoint logits.
function
void setOutputLayerHeatmaps(const std::string & outputLayerHeatmaps)
Sets the name of the output layer containing the reliability heat map.
Parameters
  • outputLayerHeatmaps: Name of the output layer containing the reliability heat map
function
std::string getOutputLayerHeatmaps()
Returns the name of the output layer containing the reliability heat map.
function
void setOriginalSize(std::uint32_t width, std::uint32_t height)
Sets the original image size the emitted keypoint positions are scaled to.Must be configured before the pipeline starts, either explicitly or through head metadata.
Parameters
  • width: Original image width, must be greater than 0
  • height: Original image height, must be greater than 0
function
std::optional< std::pair< std::uint32_t, std::uint32_t > > getOriginalSize()
Returns the original image size as (width, height), or std::nullopt when not configured.
function
void setInputSize(std::uint32_t width, std::uint32_t height)
Sets the model input image size the keypoint positions are decoded in.Defaults to 640x352 like the source parser. Configuring from a full NNArchive takes it from the head metadata or derives it from the model input's declared shape and layout; the most recent configuration wins.
Parameters
  • width: Input image width, must be greater than 0
  • height: Input image height, must be greater than 0
function
std::pair< std::uint32_t, std::uint32_t > getInputSize()
Returns the model input image size as (width, height).
function
void setMaxKeypoints(int maxKeypoints)
Sets the maximum number of keypoints to keep per frame.
Parameters
  • maxKeypoints: Maximum number of keypoints
Note
Configures startup behavior. Send XFeatStereoParserConfig to inputConfig after the pipeline starts.
function
int getMaxKeypoints()
Returns the maximum number of keypoints to keep per frame.
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device. By default, the node runs on the device.
function
bool runOnHost()
Check if the node is set to run on host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::beta::node::YuNetParser

#include YuNetParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
std::shared_ptr< YuNetParserConfig > initialConfig
Configuration used when the parser starts.
variable
Input inputConfig
Runtime parser configuration. In synchronized mode one configuration is consumed per input frame; otherwise all queued configurations are drained and the newest valid one is retained.
variable
Input input
Input NN results with YuNet detection data to parse.
variable
Output out
Outputs ImgDetections message with the bounding boxes, labels, confidence scores and keypoints of the detected faces.
function
YuNetParser()
function
YuNetParser(std::unique_ptr< Properties > props)
function
std::shared_ptr< YuNetParser > build(Node::Output & nnInput, const Model & model)
Build YuNetParser node. Links the supplied output to this node's input and configures the parser from the model's YuNetParser head and the model input's declared shape and layout.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< YuNetParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build YuNetParser node with the specific head from an NNArchive. Useful when the model has multiple heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
Note
A head carries no model input metadata, so the input size keeps its current value; configure it with setInputSize() when it is not set yet.
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. The archive must contain exactly one YuNetParser head and exactly one model input; use setNNArchiveHead() to select a specific head from a multi-head archive. The input size is derived from the model input's declared shape and layout (NHWC or NCHW).
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node. The head must be a YuNetParser head; every head output layer name must contain "loc", "conf" or "iou" and is routed to the matching output layer name setting.
Parameters
Note
A head carries no model input metadata, so the input size keeps its current value; configure it with setInputSize() when it is not set yet.
function
void setOutputLayerLoc(const std::string & locOutputLayerName)
Sets the name of the output layer containing the location predictions. When left empty, the name is auto-detected from the incoming NNData as the single layer name starting with "loc".
Parameters
  • locOutputLayerName: Output layer name for the loc tensor
function
std::string getOutputLayerLoc()
Returns the name of the output layer containing the location predictions.
function
void setOutputLayerConf(const std::string & confOutputLayerName)
Sets the name of the output layer containing the confidence predictions. When left empty, the name is auto-detected from the incoming NNData as the single layer name starting with "conf".
Parameters
  • confOutputLayerName: Output layer name for the conf tensor
function
std::string getOutputLayerConf()
Returns the name of the output layer containing the confidence predictions.
function
void setOutputLayerIou(const std::string & iouOutputLayerName)
Sets the name of the output layer containing the IoU predictions. When left empty, the name is auto-detected from the incoming NNData as the single layer name starting with "iou".
Parameters
  • iouOutputLayerName: Output layer name for the IoU tensor
function
std::string getOutputLayerIou()
Returns the name of the output layer containing the IoU predictions.
function
void setConfidenceThreshold(float threshold)
Sets the confidence score threshold for detected faces. Detections with a score strictly greater than the threshold are kept.
Parameters
  • threshold: Confidence score threshold
Note
Configures startup behavior. Send YuNetParserConfig to inputConfig after the pipeline starts.
function
float getConfidenceThreshold()
Returns the confidence score threshold for detected faces.
function
void setIouThreshold(float threshold)
Sets the non-maximum suppression (IoU) threshold. Candidates whose overlap with a kept detection is at most the threshold (inclusive) survive suppression.
Parameters
  • threshold: Non-maximum suppression threshold
Note
Configures startup behavior. Send YuNetParserConfig to inputConfig after the pipeline starts.
function
float getIouThreshold()
Returns the non-maximum suppression (IoU) threshold.
function
void setMaxDetections(int maxDetections)
Sets the maximum number of detections to keep, applied as the non-maximum suppression top-k limit (no limit when 0 or negative).
Parameters
  • maxDetections: Maximum number of detections to keep
Note
Configures startup behavior. Send YuNetParserConfig to inputConfig after the pipeline starts.
function
int getMaxDetections()
Returns the maximum number of detections to keep.
function
void setInputSize(std::uint32_t width, std::uint32_t height)
Sets the model input image size the anchors are computed against and the emitted coordinates are normalized by. Unset by default; it must be configured from an NNArchive or with this setter before the parser processes messages.Configuring from a full NNArchive derives it from the model input's declared shape and layout; the most recent configuration wins.
Parameters
  • width: Input image width, must be greater than 0
  • height: Input image height, must be greater than 0
function
std::optional< std::pair< std::uint32_t, std::uint32_t > > getInputSize()
Returns the model input image size as (width, height), or std::nullopt when it is not set.
function
void setLabelNames(const std::vector< std::string > & labelNames)
Sets the label names for the detected faces. The first label name is assigned to every detection (all detections carry label 0). When empty, no label name is assigned. Defaults to ("Face").
Parameters
  • labelNames: List of label names
function
std::vector< std::string > getLabelNames()
Returns the label names for the detected faces.
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device. By default, the node runs on the device.
function
bool runOnHost()
Check if the node is set to run on host.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
namespace

dai::bootloader

static constant
constexpr static const char * XLINK_CHANNEL_BOOTLOADER
static constant
constexpr static const char * XLINK_CHANNEL_WATCHDOG
static constant
constexpr static std::uint32_t XLINK_STREAM_MAX_SIZE
static constant
constexpr static const std::chrono::milliseconds XLINK_WATCHDOG_TIMEOUT
function
DEPTHAI_BOOTLOADER_NLOHMANN_DEFINE_TYPE_OPTIONAL_NON_INTRUSIVE(NetworkConfig, timeoutMs, ipv4, ipv4Mask, ipv4Gateway, ipv4Dns, ipv4DnsAlt, staticIpv4, ipv6, ipv6Prefix, ipv6Gateway, ipv6Dns, ipv6DnsAlt, staticIpv6, mac)
function
DEPTHAI_BOOTLOADER_NLOHMANN_DEFINE_TYPE_OPTIONAL_NON_INTRUSIVE(UsbConfig, timeoutMs, maxUsbSpeed, vid, pid)
function
DEPTHAI_BOOTLOADER_NLOHMANN_DEFINE_TYPE_OPTIONAL_NON_INTRUSIVE(Config, appMem, usb, network, userBlSize, userBlChecksum)
inline function
const Structure getStructure(Type type)
enum

std::int32_t Memory

enumerator
AUTO
enumerator
FLASH
enumerator
EMMC
enum

std::int32_t Section

enumerator
AUTO
enumerator
HEADER
enumerator
BOOTLOADER
enumerator
BOOTLOADER_CONFIG
enumerator
APPLICATION
enumerator
USER_BOOTLOADER
enum

std::int32_t Type

enumerator
AUTO
enumerator
USB
enumerator
NETWORK
struct

dai::bootloader::NetworkConfig

variable
int timeoutMs
If timeout < 0 - waits forever if timeout == 0 - no timeout if timeout > 0 - waits timeout milliseconds
variable
std::uint32_t ipv4
variable
std::uint32_t ipv4Mask
variable
std::uint32_t ipv4Gateway
variable
std::uint32_t ipv4Dns
variable
std::uint32_t ipv4DnsAlt
variable
bool staticIpv4
variable
std::array< uint32_t, 4 > ipv6
variable
std::uint32_t ipv6Prefix
variable
std::array< uint32_t, 4 > ipv6Gateway
variable
std::array< uint32_t, 4 > ipv6Dns
variable
std::array< uint32_t, 4 > ipv6DnsAlt
variable
bool staticIpv6
variable
std::array< uint8_t, 6 > mac
struct

dai::bootloader::UsbConfig

variable
int timeoutMs
If timeout < 0 - waits forever if timeout == 0 - no timeout if timeout > 0 - waits timeout milliseconds
variable
int maxUsbSpeed
UNKNOWN = 0, LOW, FULL, HIGH, SUPER, SUPER_PLUS
variable
uint16_t vid
VID/PID pair used by bootloader.
variable
uint16_t pid
struct

dai::bootloader::Config

Derived by dai::DeviceBootloader::Config
variable
Memory appMem
variable
variable
variable
uint32_t userBlSize
variable
uint32_t userBlChecksum
struct

dai::bootloader::Structure

Derived by dai::bootloader::NetworkBootloaderStructure, dai::bootloader::UsbBootloaderStructure
variable
std::map< Section, long > offset
variable
std::map< Section, long > size
function
Structure()
struct

dai::bootloader::NetworkBootloaderStructure

inline function
NetworkBootloaderStructure()
struct

dai::bootloader::UsbBootloaderStructure

inline function
UsbBootloaderStructure()
namespace

dai::bootloader::request

enum

uint32_t Command

enumerator
USB_ROM_BOOT
enumerator
BOOT_APPLICATION
enumerator
UPDATE_FLASH
enumerator
GET_BOOTLOADER_VERSION
enumerator
BOOT_MEMORY
enumerator
UPDATE_FLASH_EX
enumerator
UPDATE_FLASH_EX_2
enumerator
NO_OP
enumerator
GET_BOOTLOADER_TYPE
enumerator
SET_BOOTLOADER_CONFIG
enumerator
GET_BOOTLOADER_CONFIG
enumerator
BOOTLOADER_MEMORY
enumerator
GET_BOOTLOADER_COMMIT
enumerator
UPDATE_FLASH_BOOT_HEADER
enumerator
READ_FLASH
enumerator
GET_APPLICATION_DETAILS
enumerator
GET_MEMORY_DETAILS
enumerator
IS_USER_BOOTLOADER
struct

dai::bootloader::request::UsbRomBoot

inline function
UsbRomBoot()
struct

dai::bootloader::request::BootApplication

inline function
BootApplication()
struct

dai::bootloader::request::UpdateFlash

variable
Storage storage
variable
uint32_t totalSize
variable
uint32_t numPackets
inline function
UpdateFlash()
enum

uint32_t Storage

enumerator
SBR
enumerator
BOOTLOADER
struct

dai::bootloader::request::GetBootloaderVersion

inline function
GetBootloaderVersion()
struct

dai::bootloader::request::BootMemory

variable
uint32_t totalSize
variable
uint32_t numPackets
inline function
BootMemory()
struct

dai::bootloader::request::UpdateFlashEx

variable
Memory memory
variable
Section section
variable
uint32_t totalSize
variable
uint32_t numPackets
inline function
UpdateFlashEx()
struct

dai::bootloader::request::UpdateFlashEx2

variable
Memory memory
variable
uint32_t offset
variable
uint32_t totalSize
variable
uint32_t numPackets
inline function
UpdateFlashEx2()
struct

dai::bootloader::request::GetBootloaderType

inline function
GetBootloaderType()
struct

dai::bootloader::request::SetBootloaderConfig

variable
Memory memory
variable
int64_t offset
variable
uint32_t clearConfig
variable
uint32_t totalSize
variable
uint32_t numPackets
inline function
SetBootloaderConfig()
struct

dai::bootloader::request::GetBootloaderConfig

variable
Memory memory
variable
int64_t offset
variable
uint32_t maxSize
inline function
GetBootloaderConfig()
struct

dai::bootloader::request::BootloaderMemory

inline function
BootloaderMemory()
struct

dai::bootloader::request::GetBootloaderCommit

inline function
GetBootloaderCommit()
struct

dai::bootloader::request::UpdateFlashBootHeader

variable
Type type
variable
int64_t offset
variable
int64_t location
variable
int32_t dummyCycles
variable
int32_t frequency
variable
int32_t gpioMode
inline function
UpdateFlashBootHeader()
enum

int32_t Type

enumerator
GPIO_MODE
enumerator
USB_RECOVERY
enumerator
NORMAL
enumerator
FAST
struct

dai::bootloader::request::ReadFlash

variable
Memory memory
variable
uint32_t offset
variable
uint32_t totalSize
inline function
ReadFlash()
struct

dai::bootloader::request::GetApplicationDetails

variable
Memory memory
inline function
GetApplicationDetails()
struct

dai::bootloader::request::GetMemoryDetails

variable
Memory memory
inline function
GetMemoryDetails()
struct

dai::bootloader::request::IsUserBootloader

inline function
IsUserBootloader()
namespace

dai::bootloader::response

enum

uint32_t Command

enumerator
FLASH_COMPLETE
enumerator
FLASH_STATUS_UPDATE
enumerator
BOOTLOADER_VERSION
enumerator
BOOTLOADER_TYPE
enumerator
GET_BOOTLOADER_CONFIG
enumerator
BOOTLOADER_MEMORY
enumerator
BOOT_APPLICATION
enumerator
BOOTLOADER_COMMIT
enumerator
READ_FLASH
enumerator
APPLICATION_DETAILS
enumerator
MEMORY_DETAILS
enumerator
IS_USER_BOOTLOADER
enumerator
NO_OP
struct

dai::bootloader::response::FlashComplete

variable
uint32_t success
variable
char errorMsg
inline function
FlashComplete()
struct

dai::bootloader::response::FlashStatusUpdate

variable
float progress
inline function
FlashStatusUpdate()
struct

dai::bootloader::response::BootloaderVersion

variable
uint32_t major
variable
uint32_t minor
variable
uint32_t patch
inline function
BootloaderVersion()
struct

dai::bootloader::response::BootloaderType

variable
Type type
inline function
BootloaderType()
struct

dai::bootloader::response::GetBootloaderConfig

variable
uint32_t success
variable
char errorMsg
variable
uint32_t totalSize
variable
uint32_t numPackets
inline function
GetBootloaderConfig()
struct

dai::bootloader::response::BootloaderMemory

variable
Memory memory
inline function
BootloaderMemory()
struct

dai::bootloader::response::BootApplication

variable
uint32_t success
variable
char errorMsg
inline function
BootApplication()
struct

dai::bootloader::response::BootloaderCommit

variable
char commitStr
inline function
BootloaderCommit()
struct

dai::bootloader::response::ReadFlash

variable
uint32_t success
variable
char errorMsg
variable
uint32_t totalSize
variable
uint32_t numPackets
inline function
ReadFlash()
struct

dai::bootloader::response::ApplicationDetails

variable
uint32_t success
variable
char errorMsg
variable
uint32_t hasApplication
variable
uint32_t hasFirmwareVersion
variable
uint32_t hasApplicationName
variable
char firmwareVersionStr
variable
char applicationNameStr
inline function
ApplicationDetails()
struct

dai::bootloader::response::MemoryDetails

variable
uint32_t hasMemory
variable
Memory memory
variable
int64_t memorySize
variable
char memoryInfo
inline function
MemoryDetails()
struct

dai::bootloader::response::IsUserBootloader

variable
uint32_t isUserBootloader
inline function
IsUserBootloader()
struct

dai::bootloader::response::NoOp

variable
uint32_t invalidOp
inline function
NoOp()
namespace

dai::build

static constant
constexpr static bool HAVE_OPENCV_SUPPORT
static constant
constexpr static bool HAVE_LIBUSB_SUPPORT
namespace

dai::detail

namespace

dai::device

static constant
static constant
static constant
static constant
static constant
static constant
static constant
static constant
static constant
static constant
namespace

dai::filters

namespace

dai::filters::params

enum

int32_t MedianFilter

enumerator
MEDIAN_OFF
enumerator
KERNEL_3x3
enumerator
KERNEL_5x5
enumerator
KERNEL_7x7
struct

dai::filters::params::SpatialFilter

#include FilterParams.hpp
variable
bool enable
Whether to enable or disable the filter.
variable
std::uint8_t holeFillingRadius
An in-place heuristic symmetric hole-filling mode applied horizontally during the filter passes. Intended to rectify minor artefacts with minimal performance impact. Search radius for hole filling.
variable
float alpha
The Alpha factor in an exponential moving average with Alpha=1 - no filter. Alpha = 0 - infinite filter. Determines the amount of smoothing.
variable
std::int32_t delta
Step-size boundary. Establishes the threshold used to preserve "edges". If the disparity value between neighboring pixels exceed the disparity threshold set by this delta parameter, then filtering will be temporarily disabled. Default value 0 means auto: 3 disparity integer levels. In case of subpixel mode it's 3*number of subpixel levels.
variable
std::int32_t numIterations
Number of iterations over the image in both horizontal and vertical direction.
function
struct

dai::filters::params::TemporalFilter

#include FilterParams.hpp
variable
bool enable
Whether to enable or disable the filter.
variable
PersistencyMode persistencyMode
Persistency mode. If the current disparity/depth value is invalid, it will be replaced by an older value, based on persistency mode.
variable
float alpha
The Alpha factor in an exponential moving average with Alpha=1 - no filter. Alpha = 0 - infinite filter. Determines the extent of the temporal history that should be averaged.
variable
std::int32_t delta
Step-size boundary. Establishes the threshold used to preserve surfaces (edges). If the disparity value between neighboring pixels exceed the disparity threshold set by this delta parameter, then filtering will be temporarily disabled. Default value 0 means auto: 3 disparity integer levels. In case of subpixel mode it's 3*number of subpixel levels.
function
enum

int32_t PersistencyMode

Persistency algorithm type.
enumerator
PERSISTENCY_OFF
enumerator
VALID_8_OUT_OF_8
enumerator
VALID_2_IN_LAST_3
enumerator
VALID_2_IN_LAST_4
enumerator
VALID_2_OUT_OF_8
enumerator
VALID_1_IN_LAST_2
enumerator
VALID_1_IN_LAST_5
enumerator
VALID_1_IN_LAST_8
enumerator
PERSISTENCY_INDEFINITELY
struct

dai::filters::params::ThresholdFilter

#include FilterParams.hpp
variable
std::int32_t minRange
Minimum range in depth units. Depth values under this value are invalidated.
variable
std::int32_t maxRange
Maximum range in depth units. Depth values over this value are invalidated.
function
DEPTHAI_SERIALIZE(ThresholdFilter, minRange, maxRange)
struct

dai::filters::params::SpeckleFilter

#include FilterParams.hpp
variable
bool enable
Whether to enable or disable the filter.
variable
std::uint32_t speckleRange
Speckle search range.
variable
std::uint32_t differenceThreshold
Maximum difference between neighbor disparity pixels to put them into the same blob. Units in disparity integer levels.
function
namespace

dai::impl

constant
constexpr ImgFrame::Type VALID_TYPE_COLOR
constant
constexpr ImgFrame::Type VALID_TYPE_GRAY
function
void loop(N & node, const ImageManipConfig & initialConfig, std::shared_ptr< spdlog::async_logger > logger, const std::function< void(std::chrono::steady_clock::time_point, std::chrono::steady_clock::time_point, std::chrono::steady_clock::time_point, std::chrono::steady_clock::time_point)> & logTiming, const std::function< size_t(const ImageManipConfig &, const ImgFrame &)> & build, const std::function< std::shared_ptr< ImgFrame >(size_t)> & getFrame, const std::function< bool(const std::shared_ptr< OffsetMemory > &, std::shared_ptr< OffsetMemory >)> & apply, const std::function< void(const ImgFrame &, ImgFrame &)> & setFrame)
function
FrameSpecs getSrcFrameSpecs(dai::ImgFrame::Specs srcSpecs)
function
FrameSpecs getCcDstFrameSpecs(const FrameSpecs & srcSpecs, dai::ImgFrame::Type from, dai::ImgFrame::Type to)
function
FrameSpecs getDstFrameSpecs(size_t width, size_t height, dai::ImgFrame::Type type)
function
size_t getAlignedOutputFrameSize(ImgFrame::Type type, size_t width, size_t height)
function
void printSpecs(spdlog::async_logger & logger, FrameSpecs specs)
function
size_t getFrameSize(const ImgFrame::Type type, const FrameSpecs & specs)
function
bool getFrameTypeInfo(dai::ImgFrame::Type outFrameType, int & outNumPlanes, float & outBpp)
function
bool isTypeSupported(dai::ImgFrame::Type type)
function
bool colorConvertToRGB888p(const ColorChangeArgs & args)
function
bool colorConvertToBGR888p(const ColorChangeArgs & args)
function
bool colorConvertToRGB888i(const ColorChangeArgs & args)
function
bool colorConvertToBGR888i(const ColorChangeArgs & args)
function
bool colorConvertToNV12(const ColorChangeArgs & args)
function
bool colorConvertToYUV420p(const ColorChangeArgs & args)
function
bool colorConvertToGRAY8(const ColorChangeArgs & args)
function
std::tuple< float, float, float, float > getOuterRect(const std::vector< std::array< float, 2 >> & points)
function
dai::RotatedRect getOuterRotatedRect(const std::vector< std::array< float, 2 >> & points)
function
std::array< std::array< float, 3 >, 3 > getResizeMat(Resize o, float width, float height, uint32_t outputWidth, uint32_t outputHeight)
function
void getOutputSizeFromCorners(const std::array< std::array< float, 2 >, 4 > & corners, const bool center, const std::array< std::array< float, 3 >, 3 > & transformInv, const uint32_t srcWidth, const uint32_t srcHeight, uint32_t & outputWidth, uint32_t & outputHeight)
function
void getTransformImpl(const ManipOp & op, std::array< std::array< float, 3 >, 3 > & transform, std::array< std::array< float, 2 >, 4 > & imageCorners, std::vector< std::array< std::array< float, 2 >, 4 >> & srcCorners, uint32_t & outputWidth, uint32_t & outputHeight)
constant function
constexpr T ALIGN_UP(T value, std::size_t alignment)
inline function
bool isSingleChannelu8(const std::shared_ptr< dai::ImgFrame > img)
inline function
bool isSingleChannelu8(const dai::ImgFrame::Type type)
inline function
std::string getOpStr(const T & op)
function
std::string getConfigString(const dai::ImageManipOpsBase< C > & ops)
inline function
std::array< std::array< float, 3 >, 3 > matmul(std::array< std::array< float, 3 >, 3 > A, std::array< std::array< float, 3 >, 3 > B)
inline function
std::array< float, 2 > matvecmul(std::array< std::array< float, 3 >, 3 > M, std::array< float, 2 > vec)
inline function
std::array< float, 2 > matvecmul(std::array< std::array< float, 2 >, 2 > M, std::array< float, 2 > vec)
function
std::tuple< std::array< std::array< float, 3 >, 3 >, std::array< std::array< float, 2 >, 4 >, std::vector< std::array< std::array< float, 2 >, 4 > > > getTransform(const C & ops, uint32_t inputWidth, uint32_t inputHeight, uint32_t outputWidth, uint32_t outputHeight)
function
std::tuple< std::array< std::array< float, 3 >, 3 >, std::array< std::array< float, 2 >, 4 >, std::vector< std::array< std::array< float, 2 >, 4 > > > getFullTransform(dai::ImageManipOpsBase< C > & base, size_t inputWidth, size_t inputHeight, dai::ImgFrame::Type type, dai::ImgFrame::Type outputFrameType, C & outputOps)
inline function
dai::ImgFrame::Type getValidType(dai::ImgFrame::Type type)
class

dai::impl::_ImageManipMemory

function
_ImageManipMemory()
inline function
_ImageManipMemory(size_t size)
inline function
_ImageManipMemory(span< uint8_t > data)
inline function
span< uint8_t > getData()
inline function
span< const uint8_t > getData()
inline function
span< uint8_t > getOffsetData()
Gets a mutable view of the data starting at the current offset.
Returns
Span over the remaining bytes after the offset.
inline function
span< const uint8_t > getOffsetData()
Gets a read-only view of the data starting at the current offset.
Returns
Span over the remaining bytes after the offset.
inline function
size_t getMaxSize()
inline function
size_t getOffset()
inline function
void setSize(size_t size)
inline function
void setOffset(size_t offset)
inline function
void shallowCopyFrom(_ImageManipMemory & other)
inline function
std::shared_ptr< OffsetMemory > offset(size_t offset)
class

dai::impl::_ImageManipBuffer

function
_ImageManipBuffer()
inline function
_ImageManipBuffer(size_t size)
inline function
T * data()
inline function
const T * data()
inline function
size_t size()
inline function
span< T > getData()
inline function
span< const T > getData()
struct

dai::impl::FrameSpecs

variable
uint32_t width
variable
uint32_t height
variable
uint32_t p1Offset
variable
uint32_t p2Offset
variable
uint32_t p3Offset
variable
uint32_t p1Stride
variable
uint32_t p2Stride
variable
uint32_t p3Stride
struct

dai::impl::UndistortInput

variable
size_t width
variable
size_t height
variable
size_t stride
variable
uint32_t bpp
variable
uint32_t channels
variable
std::shared_ptr< OffsetMemory > data
class

dai::impl::Undistort

Derived by dai::impl::UndistortOpenCvImpl
inline function
Undistort(std::shared_ptr< spdlog::async_logger > logger)
function
~Undistort()
function
BuildStatus build(std::array< float, 9 > cameraMatrix, std::array< float, 9 > newCameraMatrix, std::vector< float > distCoeffs, dai::ImgFrame::Type type, uint32_t srcWidth, uint32_t srcHeight, uint32_t dstWidth, uint32_t dstHeight)
function
void undistort(const UndistortInput & srcI, const UndistortInput & dstI, uint32_t planeIndex)
inline function
void finish()
enum

BuildStatus

enumerator
ONE_SHOT
enumerator
TWO_SHOT
enumerator
NOT_USED
enumerator
NOT_BUILT
enumerator
ERROR
class

dai::impl::UndistortOpenCvImpl

function
BuildStatus build(std::array< float, 9 > cameraMatrix, std::array< float, 9 > newCameraMatrix, std::vector< float > distCoeffs, dai::ImgFrame::Type type, uint32_t srcWidth, uint32_t srcHeight, uint32_t dstWidth, uint32_t dstHeight)
function
void undistort(const UndistortInput & srcI, const UndistortInput & dstI, uint32_t planeIndex)
class

dai::impl::Warp

Derived by dai::impl::WarpH
variable
std::array< std::array< float, 3 >, 3 > matrix
variable
ImageManipOpsBase< Container >::Background background
variable
uint32_t backgroundColor
variable
bool enableUndistort
variable
bool undistortOneShot
variable
std::optional< float > alphaScaling
variable
ImgFrame::Type type
variable
FrameSpecs srcSpecs
variable
FrameSpecs dstSpecs
variable
size_t sourceMinX
variable
size_t sourceMinY
variable
size_t sourceMaxX
variable
size_t sourceMaxY
function
Warp()
inline function
Warp(std::shared_ptr< spdlog::async_logger > logger)
function
~Warp()
inline function
function
void build(const FrameSpecs srcFrameSpecs, const FrameSpecs dstFrameSpecs, const ImgFrame::Type type, const std::array< std::array< float, 3 >, 3 > matrix, std::vector< std::array< std::array< float, 2 >, 4 >> srcCorners)
function
void buildUndistort(bool enable, const std::array< float, 9 > & cameraMatrix, const std::array< float, 9 > & newCameraMatrix, const std::vector< float > & distCoeffs, const std::optional< float > alpha, const ImgFrame::Type type, const uint32_t srcWidth, const uint32_t srcHeight, const uint32_t dstWidth, const uint32_t dstHeight)
function
void apply(const std::shared_ptr< OffsetMemory > & src, std::shared_ptr< OffsetMemory > dst)
inline function
void setLogger(std::shared_ptr< spdlog::async_logger > logger)
function
Warp & setBackgroundColor(uint32_t r, uint32_t g, uint32_t b)
class

dai::impl::WarpH

function
void build(const FrameSpecs srcFrameSpecs, const FrameSpecs dstFrameSpecs, const ImgFrame::Type type, const std::array< std::array< float, 3 >, 3 > matrix, std::vector< std::array< std::array< float, 2 >, 4 >> srcCorners)
function
void buildUndistort(bool enable, const std::array< float, 9 > & cameraMatrix, const std::array< float, 9 > & newCameraMatrix, const std::vector< float > & distCoeffs, const std::optional< float > alpha, const ImgFrame::Type type, const uint32_t srcWidth, const uint32_t srcHeight, const uint32_t dstWidth, const uint32_t dstHeight)
function
void apply(const std::shared_ptr< OffsetMemory > & src, std::shared_ptr< OffsetMemory > dst)
class

dai::impl::ColorChange

Derived by dai::impl::ColorChangeH
function
ColorChange()
inline function
ColorChange(std::shared_ptr< spdlog::async_logger > logger)
function
~ColorChange()
inline function
void setLogger(std::shared_ptr< spdlog::async_logger > logger)
function
void build(const FrameSpecs srcFrameSpecs, const FrameSpecs dstFrameSpecs, const ImgFrame::Type typeFrom, const ImgFrame::Type typeTo)
function
void apply(const std::shared_ptr< OffsetMemory > & src, std::shared_ptr< OffsetMemory > dst)
class

dai::impl::ColorChangeH

function
void build(const FrameSpecs srcFrameSpecs, const FrameSpecs dstFrameSpecs, const ImgFrame::Type typeFrom, const ImgFrame::Type typeTo)
function
void apply(const std::shared_ptr< OffsetMemory > & src, std::shared_ptr< OffsetMemory > dst)
class

dai::impl::ImageManipOperations

inline function
ImageManipOperations(ImageManipProperties props, std::shared_ptr< spdlog::async_logger > logger)
function
ImageManipOperations & build(const ImageManipOpsBase< Container > & base, ImgFrame::Type outputFrameType, FrameSpecs srcFrameSpecs, ImgFrame::Type type)
function
ImageManipOperations & buildUndistort(bool enable, const std::array< float, 9 > & cameraMatrix, const std::array< float, 9 > & newCameraMatrix, const std::vector< float > & distCoeffs, const std::optional< float > alpha, const ImgFrame::Type type, const uint32_t srcWidth, const uint32_t srcHeight, const uint32_t dstWidth, const uint32_t dstHeight)
function
bool apply(const std::shared_ptr< OffsetMemory > & src, std::shared_ptr< OffsetMemory > dst)
function
size_t getOutputPlaneSize(uint8_t plane)
function
size_t getOutputSize()
function
size_t getOutputWidth()
function
size_t getOutputHeight()
function
size_t getOutputStride(uint8_t plane)
function
FrameSpecs getOutputFrameSpecs(ImgFrame::Type type)
inline function
ImgFrame::Type getOutputFrameType()
function
std::vector< RotatedRect > getSrcCrops()
function
std::array< std::array< float, 3 >, 3 > getMatrix()
inline function
bool undistortEnabled()
inline function
std::optional< float > getUndistortAlpha()
function
std::string toString()
struct

dai::impl::ColorChangeArgs

variable
const std::shared_ptr< OffsetMemory > & inputFrame
variable
std::shared_ptr< OffsetMemory > outputFrame
variable
FrameSpecs srcSpecs
variable
FrameSpecs dstSpecs
variable
ImgFrame::Type from
variable
std::shared_ptr< OffsetMemory > auxFrame
namespace

dai::internal

function
DEPTHAI_SERIALIZE_EXT(XLinkInProperties, streamName, maxDataSize, numFrames)
function
DEPTHAI_SERIALIZE_EXT(XLinkOutProperties, maxFpsLimit, streamName, metadataOnly, packetSize, bytesPerSecondLimit)
struct

dai::internal::VariantSwitch

inline function
void operator()(int index, json const & value, Variant & v)
struct

dai::internal::VariantSwitch< 0 >

inline function
void operator()(int index, json const & value, Variant & v)
struct

dai::internal::VariantReadNop

inline function
void operator()(int index, Reader * reader, Variant & v)
struct

dai::internal::VariantReadNop< 0 >

inline function
void operator()(int index, Reader * reader, Variant & v)
struct

dai::internal::XLinkInProperties

#include XLinkInProperties.hpp
variable
std::string streamName
Name of stream
variable
std::uint32_t maxDataSize
Maximum input data size: NV12 --> 1.5 = (3/2) bytes per pixel, roughly 17.6MB for a 4032x3056 frame
variable
std::uint32_t numFrames
Number of frames in pool
function
~XLinkInProperties()
struct

dai::internal::XLinkOutProperties

#include XLinkOutProperties.hpp
variable
float maxFpsLimit
Set a limit to how many packets will be sent further to host
variable
std::string streamName
Name of stream
variable
bool metadataOnly
Whether to transfer data or only object attributes
variable
int packetSize
Max bytes per packet (-1 = unlimited)
variable
int bytesPerSecondLimit
Maximal bytes per second (-1 = unlimited)
function
~XLinkOutProperties()
namespace

dai::matrix

constant
constexpr float MATRIX_EQ_EPSILON
function
std::array< std::array< float, 3 >, 3 > matMul(const std::array< std::array< float, 3 >, 3 > & A, const std::array< std::array< float, 3 >, 3 > & B)
function
std::vector< std::vector< float > > matMul(const std::vector< std::vector< float >> & A, const std::vector< std::vector< float >> & B)
function
std::array< std::array< float, 4 >, 4 > matMul(const std::array< std::array< float, 4 >, 4 > & A, const std::array< std::array< float, 4 >, 4 > & B)
function
std::vector< float > matVecMul(const std::vector< std::vector< float >> & matrix, const std::vector< float > & vec)
function
std::array< float, 3 > matVecMul(const std::array< std::array< float, 3 >, 3 > & matrix, const std::array< float, 3 > & vec)
function
bool mateq(const std::vector< std::vector< float >> & A, const std::vector< std::vector< float >> & B, float epsilon)
function
bool mateq(const std::array< std::array< float, 3 >, 3 > & A, const std::array< std::array< float, 3 >, 3 > & B, float epsilon)
function
bool matInv(std::vector< std::vector< float >> & A, std::vector< std::vector< float >> & inverse)
function
std::array< std::array< float, 2 >, 2 > getMatrixInverse(const std::array< std::array< float, 2 >, 2 > & matrix)
function
std::array< std::array< float, 3 >, 3 > getMatrixInverse(const std::array< std::array< float, 3 >, 3 > & matrix)
function
std::array< std::array< float, 3 >, 3 > getHomographyMatrix(const std::array< dai::Point2f, 4 > & srcPoints, const std::array< dai::Point2f, 4 > & dstPoints)
function
std::vector< std::vector< float > > createRotationMatrix(float theta)
function
std::vector< std::vector< float > > createScalingMatrix(float scaleX, float scaleY)
function
std::vector< std::vector< float > > createTranslationMatrix(float dx, float dy)
function
std::array< std::array< float, 4 >, 4 > createTransformationMatrix(const std::vector< std::vector< float >> & rotation, const dai::Point3f & translation)
function
std::array< std::array< float, 4 >, 4 > createTransformationMatrix(const std::array< std::array< float, 3 >, 3 > & rotation, const dai::Point3f & translation)
function
dai::Point3f transformPoint3f(const std::array< std::array< float, 4 >, 4 > & matrix, const dai::Point3f & point)
function
bool isFinitePoint3f(const dai::Point3f & point)
True when every component of the point is finite (no NaN or infinity).
function
std::array< float, 4 > dehomogenizePoint4(const std::array< float, 4 > & point)
function
std::array< float, 3 > dehomogenizePoint3(const std::array< float, 3 > & point)
function
std::vector< float > matrixToVector(const std::vector< std::vector< float >> & R)
function
std::vector< float > matrix3x3ToVector(const std::array< std::array< float, 3 >, 3 > & R)
function
std::vector< float > rotationMatrixToVector(const std::vector< std::vector< float >> & R)
function
std::vector< std::vector< float > > matrix3x3ToVectorMatrix(const std::array< std::array< float, 3 >, 3 > & R)
function
std::array< std::array< float, 3 >, 3 > vectorMatrixToMatrix3x3(const std::vector< std::vector< float >> & R)
function
bool isValidIntrinsicsMatrix(const std::vector< std::vector< float >> & intrinsics)
function
void validateRotationMatrix3x3(const std::vector< std::vector< float >> & rotationMatrix)
Validate that a matrix is a finite, proper 3x3 rotation matrix.
Parameters
  • std::runtime_error: when the matrix is not a valid rotation matrix.
function
std::vector< std::vector< float > > extractRotationMatrix(const std::vector< std::vector< float >> & transform)
function
std::vector< float > extractTranslationVector(const std::vector< std::vector< float >> & transform)
function
std::array< std::array< float, 3 >, 3 > getRotationMatrixFromProjection4x4(const std::array< std::array< float, 4 >, 4 > & projection)
function
std::vector< std::vector< float > > rvecToRotationMatrix(const double rvec)
function
std::pair< std::vector< std::vector< float > >, std::vector< float > > invertSe3(const std::vector< std::vector< float >> & rotation, const std::vector< float > & translation)
function
void invertSe3Matrix4x4InPlace(std::vector< std::vector< float >> & mat)
function
std::array< std::array< float, 4 >, 4 > invertSe3Matrix4x4(const std::array< std::array< float, 4 >, 4 > & matrix)
function
void printMatrix(std::vector< std::vector< float >> & matrix)
function
std::vector< std::vector< float > > toVecMatrix4x4(const std::array< std::array< float, 4 >, 4 > & m)
function
bool isIdentity4x4(const std::vector< std::vector< float >> & m, float epsilon)
function
std::array< std::array< float, 3 >, 3 > cvMatToMatrix3x3(const cv::Mat & cvMat)
function
std::array< std::array< float, 4 >, 4 > cvMatToMatrix4x4(const cv::Mat & cvMat)
function
cv::Mat matrix3x3ToCvMat(const std::array< std::array< float, 3 >, 3 > & matrix)
function
cv::Mat matrix4x4ToCvMat(const std::array< std::array< float, 4 >, 4 > & matrix)
namespace

dai::model

function
ModelType readModelType(const std::filesystem::path & modelPath)
Read model type from model path.
Parameters
  • modelPath: Path to model
Returns
ModelType
enum

ModelType

Neural network model type.
enumerator
BLOB
enumerator
SUPERBLOB
enumerator
DLC
enumerator
NNARCHIVE
enumerator
OTHER
namespace

dai::modelzoo

function
void setHealthEndpoint(const std::string & endpoint)
Set the health endpoint (for internet check)
Parameters
  • endpoint:
function
void setDownloadEndpoint(const std::string & endpoint)
Set the download endpoint (for model querying)
Parameters
  • endpoint:
function
void setDefaultCachePath(const fs::path & path)
Set the default cache path (where models are cached)
Parameters
  • path:
function
void setDefaultModelsPath(const fs::path & path)
Set the default models path (where yaml files are stored)
Parameters
  • path:
function
std::string getHealthEndpoint()
Get the health endpoint (for internet check)
function
std::string getDownloadEndpoint()
Get the download endpoint (for model querying)
function
fs::path getDefaultCachePath()
Get the default cache path (where models are cached)
function
fs::path getDefaultModelsPath()
Get the default models path (where yaml files are stored)
namespace

dai::nn_archive

namespace

dai::nn_archive::v1

enum

int DataType

Data type of the input data (e.g., 'float32').Represents all existing data types used in i/o streams of the model.Precision of the model weights.Data type of the output data (e.g., 'float32'). Data type of the input data (e.g., 'float32').Represents all existing data types used in i/o streams of the model.Precision of the model weights.Data type of the output data (e.g., 'float32').
enumerator
BOOLEAN
enumerator
FLOAT16
enumerator
FLOAT32
enumerator
FLOAT64
enumerator
INT16
enumerator
INT32
enumerator
INT4
enumerator
INT64
enumerator
INT8
enumerator
STRING
enumerator
UINT16
enumerator
UINT32
enumerator
UINT4
enumerator
UINT64
enumerator
UINT8
enum

int InputType

Type of input data (e.g., 'image').Represents a type of input the model is expecting. Type of input data (e.g., 'image').Represents a type of input the model is expecting.
enumerator
IMAGE
enumerator
RAW
struct

dai::nn_archive::v1::Config

#include Config.hpp
variable
std::optional< std::string > configVersion
String representing config schema version in format 'x.y' where x is major version and y is minor version.
variable
Model model
A Model object representing the neural network used in the archive.
struct

dai::nn_archive::v1::Head

#include Head.hpp
variable
Metadata metadata
Metadata of the parser.
variable
std::optional< std::string > name
Optional name of the head.
variable
std::optional< std::vector< std::string > > outputs
Specify which outputs are fed into the parser. If None, all outputs are fed.
variable
std::string parser
Name of the parser responsible for processing the models output.
struct

dai::nn_archive::v1::Input

#include Input.hpp
variable
DataType dtype
Data type of the input data (e.g., 'float32').
variable
InputType inputType
Type of input data (e.g., 'image').
variable
std::optional< std::string > layout
Lettercode interpretation of the input data dimensions (e.g., 'NCHW')
variable
std::string name
Name of the input layer.
variable
PreprocessingBlock preprocessing
Preprocessing steps applied to the input data.
variable
std::vector< int64_t > shape
Shape of the input data as a list of integers (e.g. [H,W], [H,W,C], [N,H,W,C], ...).
struct

dai::nn_archive::v1::Metadata

#include Metadata.hpp
variable
std::optional< std::vector< std::vector< std::vector< double > > > > anchors
Predefined bounding boxes of different sizes and aspect ratios. The innermost lists are length 2 tuples of box sizes. The middle lists are anchors for each output. The outmost lists go from smallest to largest output.
variable
std::optional< std::vector< std::string > > classes
Names of object classes recognized by the model.
variable
std::optional< double > confThreshold
Confidence score threshold above which a detected object is considered valid.
variable
std::optional< double > iouThreshold
Non-max supression threshold limiting boxes intersection.
variable
std::optional< int64_t > maxDet
Maximum detections per image.
variable
std::optional< int64_t > nClasses
Number of object classes recognized by the model.
variable
std::optional< std::string > postprocessorPath
Path to the postprocessor.
variable
std::optional< bool > isSoftmax
True, if output is already softmaxed.True, if output is already softmaxed in YOLO instance segmentation.
variable
std::optional< bool > backgroundClass
True, if class index 0 is treated as background.
variable
std::optional< std::string > boxesOutputs
Output name corresponding to predicted bounding box coordinates.
variable
std::optional< std::string > scoresOutputs
Output name corresponding to predicted bounding box confidence scores.
variable
std::optional< std::vector< std::string > > anglesOutputs
A list of output names for the angles.
variable
std::optional< std::vector< std::string > > keypointsOutputs
A list of output names for the keypoints.
variable
std::optional< std::vector< std::string > > maskOutputs
A list of output names for each mask output.
variable
std::optional< int64_t > nKeypoints
Number of keypoints per bbox in YOLO keypoint detection.
variable
std::optional< int64_t > nPrototypes
Number of prototypes per bbox in YOLO instance segmnetation.
variable
std::optional< std::string > protosOutputs
Output name for the protos.
variable
std::optional< std::string > subtype
YOLO family decoding subtype (e.g. yolov5, yolov6, yolov7 etc.).
variable
std::optional< std::vector< std::string > > yoloOutputs
A list of output names for each of the different YOLO grid sizes.
variable
std::optional< std::vector< int64_t > > strides
Strides for each YOLO output.
variable
nlohmann::json extraParams
Additional parameters
struct

dai::nn_archive::v1::MetadataClass

#include MetadataClass.hpp
variable
std::string name
Name of the model.
variable
std::string path
Relative path to the model executable.
variable
std::optional< DataType > precision
Precision of the model weights.
struct

dai::nn_archive::v1::Model

#include Model.hpp
variable
std::optional< std::vector< Head > > heads
List of Head objects defining the model heads. If not defined, we assume a raw output.
variable
std::vector< Input > inputs
List of Input objects defining the model inputs.
variable
MetadataClass metadata
Metadata object defining the model metadata.
variable
std::vector< Output > outputs
List of Output objects defining the model outputs.
struct

dai::nn_archive::v1::Output

#include Output.hpp
variable
DataType dtype
Data type of the output data (e.g., 'float32').
variable
std::optional< std::string > layout
List of letters describing the output layout (e.g. 'NC').
variable
std::string name
Name of the output layer.
variable
std::optional< std::vector< int64_t > > shape
Shape of the output as a list of integers (e.g. [1, 1000]).
struct

dai::nn_archive::v1::PreprocessingBlock

#include PreprocessingBlock.hpp
variable
std::optional< std::string > daiType
DepthAI input type which is read by DepthAI to automatically setup the pipeline.
variable
std::optional< bool > interleavedToPlanar
If True input to the model is interleaved (NHWC) else planar (NCHW).
variable
std::optional< std::vector< double > > mean
Mean values in channel order. Order depends on the order in which the model was trained on.
variable
std::optional< bool > reverseChannels
If True input to the model is RGB else BGR.
variable
std::optional< std::vector< double > > scale
Standardization values in channel order. Order depends on the order in which the model was trained on.
namespace

dai::node

using
CustomThreadedNode = NodeCRTP< ThreadedHostNode, T, false >
Custom node for host node. When creating a custom host node, inherit from this class!
Parameters
  • T: Node type (same as the class you are creating)
class MyNode : public CustomThreadedNode<MyNode> { public: void run() override { // ... } };
using
DepthSource = std::variant< std::shared_ptr< Depth >, std::shared_ptr< StereoDepth >, std::shared_ptr< NeuralDepth >, std::shared_ptr< ToF > >
Variant type representing different depth sources. Supported depth sources: StereoDepth, NeuralDepth, ToF, Depth. Variant type representing different depth sources. Supported depth sources: Depth, StereoDepth, NeuralDepth, ToF.
using
CustomNode = NodeCRTP< HostNode, T, false >
Custom node for host node. When creating a custom host node, inherit from this class!
Parameters
  • T: Node type (same as the class you are creating)
class MyNode : public CustomNode<MyNode> { std::shared_ptr<Buffer> processGroup(std::shared_ptr<dai::MessageGroup> in) override { auto frame = in->get<dai::ImgFrame>("data"); // process frame // ... return nullptr; // Don't return anything, just process } };
using
XLinkOutProperties = ::dai::internal::XLinkOutProperties
using
RecordMessage = RecordMetadataOnly
using
ReplayMessage = ReplayMetadataOnly
class

dai::node::BasaltVIO

#include BasaltVIO.hpp
variable
variable
InputMap & inputs
variable
std::string leftInputName
variable
std::string rightInputName
variable
Input & left
Input left image on which VIO is performed.
variable
Input & right
Input right image on which VIO is performed.
variable
Input imu
Input IMU data.
variable
Output transform
Output odometry data.
variable
Output passthrough
Output passthrough of left image.
function
BasaltVIO()
function
~BasaltVIO()
function
void buildInternal()
inline function
void setImuUpdateRate(int rate)
inline function
void setConfigPath(const std::string & path)
function
void setConfig(const VioConfig & config)
inline function
void setUseSpecTranslation(bool use)
function
void setLocalTransform(const std::shared_ptr< TransformData > & transform)
function
void setImuExtrinsics(const std::shared_ptr< TransformData > & imuExtr)
function
void setAccelBias(const std::vector< double > & accelBias)
function
void setAccelNoiseStd(const std::vector< double > & accelNoiseStd)
function
void setGyroBias(const std::vector< double > & gyroBias)
function
void setGyroNoiseStd(const std::vector< double > & gyroNoiseStd)
function
void setDefaultVIOConfig()
function
void runSyncOnHost(bool runOnHost)
struct

dai::node::BasaltVIO::VioConfig

variable
std::string optical_flow_type
variable
int optical_flow_detection_grid_size
variable
int optical_flow_detection_num_points_cell
variable
int optical_flow_detection_min_threshold
variable
int optical_flow_detection_max_threshold
variable
bool optical_flow_detection_nonoverlap
variable
float optical_flow_max_recovered_dist2
variable
int optical_flow_pattern
variable
int optical_flow_max_iterations
variable
int optical_flow_levels
variable
float optical_flow_epipolar_error
variable
int optical_flow_skip_frames
variable
MatchingGuessType optical_flow_matching_guess_type
variable
float optical_flow_matching_default_depth
variable
float optical_flow_image_safe_radius
variable
bool optical_flow_recall_enable
variable
bool optical_flow_recall_all_cams
variable
bool optical_flow_recall_num_points_cell
variable
bool optical_flow_recall_over_tracking
variable
bool optical_flow_recall_update_patch_viewpoint
variable
float optical_flow_recall_max_patch_dist
variable
std::vector< float > optical_flow_recall_max_patch_norms
variable
LinearizationType vio_linearization_type
variable
bool vio_sqrt_marg
variable
int vio_max_states
variable
int vio_max_kfs
variable
int vio_min_frames_after_kf
variable
float vio_new_kf_keypoints_thresh
variable
bool vio_debug
variable
bool vio_extended_logging
variable
int vio_max_iterations
variable
double vio_obs_std_dev
variable
double vio_obs_huber_thresh
variable
double vio_min_triangulation_dist
variable
bool vio_enforce_realtime
variable
bool vio_use_lm
variable
double vio_lm_lambda_initial
variable
double vio_lm_lambda_min
variable
double vio_lm_lambda_max
variable
bool vio_scale_jacobian
variable
double vio_init_pose_weight
variable
double vio_init_ba_weight
variable
double vio_init_bg_weight
variable
bool vio_marg_lost_landmarks
variable
bool vio_fix_long_term_keyframes
variable
double vio_kf_marg_feature_ratio
variable
KeyframeMargCriteria vio_kf_marg_criteria
variable
double mapper_obs_std_dev
variable
double mapper_obs_huber_thresh
variable
int mapper_detection_num_points
variable
double mapper_num_frames_to_match
variable
double mapper_frames_to_match_threshold
variable
double mapper_min_matches
variable
double mapper_ransac_threshold
variable
double mapper_min_track_length
variable
double mapper_max_hamming_distance
variable
double mapper_second_best_test_ratio
variable
int mapper_bow_num_bits
variable
double mapper_min_triangulation_dist
variable
bool mapper_no_factor_weights
variable
bool mapper_use_factors
variable
bool mapper_use_lm
variable
double mapper_lm_lambda_min
variable
double mapper_lm_lambda_max
enum

LinearizationType

enumerator
ABS_QR
enumerator
ABS_SC
enumerator
REL_SC
enum

MatchingGuessType

enumerator
SAME_PIXEL
enumerator
REPROJ_FIX_DEPTH
enumerator
REPROJ_AVG_DEPTH
enum

KeyframeMargCriteria

enumerator
KF_MARG_DEFAULT
enumerator
KF_MARG_FORWARD_VECTOR
class

dai::node::ThreadedHostNode

Derived by dai::NodeCRTP< dai::node::ThreadedHostNode, RTABMapSLAM >, dai::NodeCRTP< dai::node::ThreadedHostNode, MultiDeviceCalibration, false >, dai::node::HostNode
function
~ThreadedHostNode()
inline function
bool runOnHost()
Returns true or false whether the node should be run on host or not.
function
ThreadedNode()
class

dai::node::Align

#include Align.hpp
variable
std::shared_ptr< AlignConfig > initialConfig
Initial config to use when aligning messages.
variable
Input inputConfig
Input message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
variable
Input input
Input message to be aligned. Can be either ImgFrame or any message that implements Transformable interface. Default queue is non-blocking with size 4.
variable
Input inputAlignTo
Input align to message. Default queue is non-blocking with size 1.
variable
Output outputAligned
Outputs the input message aligned to the inputAlignTo message. Output message will be of the same type as input message.
variable
Output passthroughInput
Passthrough message on which the calculation was performed. Suitable for when input queue is set to non-blocking behavior.
function
Align & setNumFramesPool(int numFramesPool)
Specify number of frames in the pool
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on device.
function
bool runOnHost()
Check if the node is set to run on host
function
void run()
function
void buildStage1()
Build stages;.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::AprilTag

#include AprilTag.hpp
variable
std::shared_ptr< AprilTagConfig > initialConfig
Initial config to use when calculating spatial location data.
variable
Input inputConfig
Input AprilTagConfig message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
variable
Input inputImage
Input message with depth data used to retrieve spatial information about detected object. Default queue is non-blocking with size 4.
variable
Output out
Outputs AprilTags message that carries spatial location results.
variable
Output outConfig
Outputs AprilTagConfig message that contains current configuration.
variable
Output passthroughInputImage
Passthrough message on which the calculation was performed. Suitable for when input queue is set to non-blocking behavior.
function
AprilTag()
function
AprilTag(std::unique_ptr< Properties > props)
function
void setWaitForConfigInput(bool wait)
Specify whether or not wait until configuration message arrives to inputConfig Input.
Parameters
  • wait: True to wait for configuration message, false otherwise.
function
bool getWaitForConfigInput()
Get whether or not wait until configuration message arrives to inputConfig Input.
function
void setNumThreads(int numThreads)
Set number of threads to use for AprilTag detection.
Parameters
  • numThreads: Number of threads to use.
function
int getNumThreads()
Get number of threads to use for AprilTag detection.
Returns
Number of threads to use.
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on device.
function
bool runOnHost()
Check if the node is set to run on host
function
void run()
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::AutoCalibration

using
variable
std::shared_ptr< AutoCalibrationConfig > initialConfig
variable
Output output
function
std::shared_ptr< AutoCalibration > build(const std::shared_ptr< Camera > & cameraLeft, const std::shared_ptr< Camera > & cameraRight)
function
~AutoCalibration()
function
void run()
function
void setRunOnHost(bool runOnHost)
function
bool runOnHost()
Returns true or false whether the node should be run on host or not.
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::BenchmarkIn

variable
Input input
Receive messages as fast as possible
variable
Output passthrough
Passthrough for input messages (so the node can be placed between other nodes)
variable
Output report
Send a benchmark report when the set number of messages are received
function
void sendReportEveryNMessages(uint32_t n)
Specify how many messages to measure for each report
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on device.
function
bool runOnHost()
Check if the node is set to run on host
function
void logReportsAsWarnings(bool logReportsAsWarnings)
Log the reports as warnings
function
void measureIndividualLatencies(bool attachLatencies)
Attach latencies to the report
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::BenchmarkOut

variable
Output out
Send messages out as fast as possible
variable
Input input
Message that will be sent repeatedly
function
void setNumMessagesToSend(int num)
Sets number of messages to send, by default send messages indefinitely
Parameters
  • num: number of messages to send
function
void setFps(float fps)
Set FPS at which the node is sending out messages. 0 means as fast as possible
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on device.
function
bool runOnHost()
Check if the node is set to run on host
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::Camera

variable
CameraControl initialControl
Initial control options to apply to sensor
variable
Input inputControl
Input for CameraControl message, which can modify camera parameters in runtime
variable
Input mockIsp
Input for mocking 'isp' functionality on RVC2. Default queue is blocking with size 8
variable
Output raw
Outputs ImgFrame message that carries RAW10-packed (MIPI CSI-2 format) frame data.Captured directly from the camera sensor, and the source for the 'isp' output.
variable
OutputMap dynamicOutputs
function
Node::Output * requestOutput(const std::pair< uint32_t, uint32_t > & size, std::optional< ImgFrame::Type > type, ImgResizeMode resizeMode, std::optional< float > fps, std::optional< bool > enableUndistortion, std::optional< float > alphaScaling)
Get video output with specified size.
function
Node::Output * requestOutput(const Capability & capability, bool onHost)
Request output with advanced controls. Mainly to be used by custom node writers.
function
Node::Output * requestFullResolutionOutput(std::optional< ImgFrame::Type > type, std::optional< float > fps, bool useHighestResolution)
Get a high resolution output with full FOV on the sensor. By default the function will not use the resolutions higher than 5000x4000, as those often need a lot of resources, making them hard to use in combination with other nodes.
Parameters
  • type: Type of the output (NV12, BGR, ...) - by default it's auto-selected for best performance
  • fps: FPS of the output - by default it's auto-selected to highest possible that a sensor config support or 30, whichever is lower
  • useHighestResolution: If true, the function will use the highest resolution available on the sensor, even if it's higher than 5000x4000
function
Node::Output * requestIspOutput(std::optional< float > fps)
Request output with isp resolution. The fps does not vote.
function
std::shared_ptr< Camera > build(dai::CameraBoardSocket boardSocket, const std::optional< std::pair< uint32_t, uint32_t >> & sensorResolution, std::optional< float > sensorFps)
Build with a specific board socket
Parameters
  • boardSocket: Board socket to use
  • sensorResolution: Sensor resolution to use - by default it's auto-detected from the requested outputs
  • sensorFps: Sensor FPS to use - by default it's auto-detected from the requested outputs (maximum is used)
inline function
std::shared_ptr< Camera > setSensorType(CameraSensorType sensorType)
Set the sensor type to use
Parameters
  • sensorType: Sensor type to use
inline function
CameraSensorType getSensorType()
Get the sensor type
Returns
Sensor type
function
std::shared_ptr< Camera > setImageOrientation(CameraImageOrientation imageOrientation)
Set camera image orientation
Parameters
  • imageOrientation: Image orientation to set
Returns
Shared pointer to the camera node
function
CameraImageOrientation getImageOrientation()
Get camera image orientation
Returns
Image orientation
function
std::shared_ptr< Camera > build(dai::CameraBoardSocket boardSocket, ReplayVideo & replay)
Build with a specific board socket and mock input
function
std::shared_ptr< Camera > build(ReplayVideo & replay)
Build with mock input
function
uint32_t getMaxWidth()
Get max width of the camera (can only be called after build)
function
uint32_t getMaxHeight()
Get max height of the camera (can only be called after build)
function
CameraBoardSocket getBoardSocket()
Retrieves which board socket to use
Returns
Board socket to use
function
std::shared_ptr< Camera > setRawNumFramesPool(int num)
Set number of frames in raw pool (will be automatically reduced if the maximum pool memory size is exceeded)
Parameters
  • num: Number of frames
Returns
Shared pointer to the camera node
function
std::shared_ptr< Camera > setMaxSizePoolRaw(int size)
Set maximum size of raw pool
Parameters
  • size: Maximum size in bytes of raw pool
Returns
Shared pointer to the camera node
function
std::shared_ptr< Camera > setIspNumFramesPool(int num)
Set number of frames in isp pool (will be automatically reduced if the maximum pool memory size is exceeded)
Parameters
  • num: Number of frames
Returns
Shared pointer to the camera node
function
std::shared_ptr< Camera > setMaxSizePoolIsp(int size)
Set maximum size of isp pool
Parameters
  • size: Maximum size in bytes of isp pool
Returns
Shared pointer to the camera node
function
std::shared_ptr< Camera > setNumFramesPools(int raw, int isp, int outputs)
Set number of frames in all pools (will be automatically reduced if the maximum pool memory size is exceeded)
Parameters
  • raw: Number of frames in raw pool
  • isp: Number of frames in isp pool
  • outputs: Number of frames in outputs pools
Returns
Shared pointer to the camera node
function
std::shared_ptr< Camera > setMaxSizePools(int raw, int isp, int outputs)
Set maximum memory size of all pools
Parameters
  • raw: Maximum size in bytes of raw pool
  • isp: Maximum size in bytes of isp pool
  • outputs: Maximum size in bytes of outputs pools
Returns
Shared pointer to the camera node
function
std::shared_ptr< Camera > setOutputsNumFramesPool(int num)
Set number of frames in pools for all outputs
Parameters
  • num: Number of frames in pools for all outputs
Returns
Shared pointer to the camera node
function
std::shared_ptr< Camera > setOutputsMaxSizePool(int size)
Set maximum size of pools for all outputs
Parameters
  • size: Maximum size in bytes of pools for all outputs
Returns
Shared pointer to the camera node
function
int getRawNumFramesPool()
Get number of frames in raw pool
Returns
Number of frames
function
int getMaxSizePoolRaw()
Get maximum size of raw pool
Returns
Maximum size in bytes of raw pool
function
int getIspNumFramesPool()
Get number of frames in isp pool
Returns
Number of frames
function
int getMaxSizePoolIsp()
Get maximum size of isp pool
Returns
Maximum size in bytes of isp pool
function
std::optional< int > getOutputsNumFramesPool()
Get number of frames in outputs pool for all outputs
Returns
Number of frames
function
std::optional< size_t > getOutputsMaxSizePool()
Get maximum size of outputs pool for all outputs
Returns
Maximum size in bytes of image manip pool
function
Camera & setMockIsp(ReplayVideo & replay)
Set mock ISP for Camera node. Automatically sets mockIsp size.
Parameters
function
Camera()
explicit function
Camera(std::shared_ptr< Device > & defaultDevice)
explicit function
Camera(std::unique_ptr< Properties > props)
function
void buildStage1()
Build stages;.
function
float getMaxRequestedFps()
function
uint32_t getMaxRequestedWidth()
function
uint32_t getMaxRequestedHeight()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::ColorCamera

#include ColorCamera.hpp
variable
CameraControl initialControl
Initial control options to apply to sensor
variable
Input inputControl
Input for CameraControl message, which can modify camera parameters in runtime
variable
Input mockIsp
Input for mocking 'isp' functionality. Default queue is blocking with size 8
variable
Output video
Outputs ImgFrame message that carries NV12 encoded (YUV420, UV plane interleaved) frame data.Suitable for use with VideoEncoder node
variable
Output preview
Outputs ImgFrame message that carries BGR/RGB planar/interleaved encoded frame data.Suitable for use with NeuralNetwork node
variable
Output still
Outputs ImgFrame message that carries NV12 encoded (YUV420, UV plane interleaved) frame data.The message is sent only when a CameraControl message arrives to inputControl with captureStill command set.
variable
Output isp
Outputs ImgFrame message that carries YUV420 planar (I420/IYUV) frame data.Generated by the ISP engine, and the source for the 'video', 'preview' and 'still' outputs
variable
Output raw
Outputs ImgFrame message that carries RAW10-packed (MIPI CSI-2 format) frame data.Captured directly from the camera sensor, and the source for the 'isp' output.
variable
Output frameEvent
Outputs metadata-only ImgFrame message as an early indicator of an incoming frame.It's sent on the MIPI SoF (start-of-frame) event, just after the exposure of the current frame has finished and before the exposure for next frame starts. Could be used to synchronize various processes with camera capture. Fields populated: camera id, sequence number, timestamp
function
ColorCamera()
function
ColorCamera(std::unique_ptr< Properties > props)
function
int getScaledSize(int input, int num, int denom)
Computes the scaled size given numerator and denominator
function
void setBoardSocket(CameraBoardSocket boardSocket)
Specify which board socket to use
Parameters
  • boardSocket: Board socket to use
function
CameraBoardSocket getBoardSocket()
Retrieves which board socket to use
Returns
Board socket to use
function
void setCamera(const std::string & name)
Specify which camera to use by name
Parameters
  • name: Name of the camera to use
function
std::string getCamera()
Retrieves which camera to use by name
Returns
Name of the camera to use
function
void setCamId(int64_t id)
Set which color camera to use.
function
int64_t getCamId()
Get which color camera to use.
function
void setImageOrientation(CameraImageOrientation imageOrientation)
Set camera image orientation.
function
CameraImageOrientation getImageOrientation()
Get camera image orientation.
function
void setColorOrder(ColorCameraProperties::ColorOrder colorOrder)
Set color order of preview output images. RGB or BGR.
function
ColorCameraProperties::ColorOrder getColorOrder()
Get color order of preview output frames. RGB or BGR.
function
void setInterleaved(bool interleaved)
Set planar or interleaved data of preview output frames.
function
bool getInterleaved()
Get planar or interleaved data of preview output frames.
function
void setPreviewType(ImgFrame::Type type)
Set type of preview output images.
function
ImgFrame::Type getPreviewType()
Get the preview type.
function
void setFp16(bool fp16)
Set fp16 (0..255) data type of preview output frames.
function
bool getFp16()
Get fp16 (0..255) data of preview output frames.
function
void setPreviewSize(int width, int height)
Set preview output size.
function
void setPreviewSize(const std::tuple< int, int > & size)
Set preview output size, as a tuple <width, height>
function
void setPreviewNumFramesPool(int num)
Set number of frames in preview pool.
function
void setVideoSize(int width, int height)
Set video output size.
function
void setVideoSize(const std::tuple< int, int > & size)
Set video output size, as a tuple <width, height>
function
void setVideoNumFramesPool(int num)
Set number of frames in preview pool.
function
void setStillSize(int width, int height)
Set still output size.
function
void setStillSize(const std::tuple< int, int > & size)
Set still output size, as a tuple <width, height>
function
void setMockIspSize(int width, int height)
function
void setStillNumFramesPool(int num)
Set number of frames in preview pool.
function
void setResolution(Properties::SensorResolution resolution)
Set sensor resolution.
function
Properties::SensorResolution getResolution()
Get sensor resolution.
function
void setRawNumFramesPool(int num)
Set number of frames in raw pool.
function
void setIspNumFramesPool(int num)
Set number of frames in isp pool.
function
void setNumFramesPool(int raw, int isp, int preview, int video, int still)
Set number of frames in all pools.
function
void setIspScale(int numerator, int denominator)
Set 'isp' output scaling (numerator/denominator), preserving the aspect ratio. The fraction numerator/denominator is simplified first to a irreducible form, then a set of hardware scaler constraints applies: max numerator = 16, max denominator = 63
function
void setIspScale(const std::tuple< int, int > & scale)
Set 'isp' output scaling, as a tuple <numerator, denominator>
function
void setIspScale(int horizNum, int horizDenom, int vertNum, int vertDenom)
Set 'isp' output scaling, per each direction. If the horizontal scaling factor (horizNum/horizDen) is different than the vertical scaling factor (vertNum/vertDen), a distorted (stretched or squished) image is generated
function
void setIspScale(const std::tuple< int, int > & horizScale, const std::tuple< int, int > & vertScale)
Set 'isp' output scaling, per each direction, as <numerator, denominator> tuples.
function
void setFps(float fps)
Set rate at which camera should produce frames
Parameters
  • fps: Rate in frames per second
function
void setIsp3aFps(int isp3aFps)
Isp 3A rate (auto focus, auto exposure, auto white balance, camera controls etc.). Default (0) matches the camera FPS, meaning that 3A is running on each frame. Reducing the rate of 3A reduces the CPU usage on CSS, but also increases the convergence rate of 3A. Note that camera controls will be processed at this rate. E.g. if camera is running at 30 fps, and camera control is sent at every frame, but 3A fps is set to 15, the camera control messages will be processed at 15 fps rate, which will lead to queueing.
function
void setFrameEventFilter(const std::vector< dai::FrameEvent > & events)
function
std::vector< dai::FrameEvent > getFrameEventFilter()
function
float getFps()
Get rate at which camera should produce frames
Returns
Rate in frames per second
function
std::tuple< int, int > getPreviewSize()
Get preview size as tuple.
function
int getPreviewWidth()
Get preview width.
function
int getPreviewHeight()
Get preview height.
function
std::tuple< int, int > getVideoSize()
Get video size as tuple.
function
int getVideoWidth()
Get video width.
function
int getVideoHeight()
Get video height.
function
std::tuple< int, int > getStillSize()
Get still size as tuple.
function
int getStillWidth()
Get still width.
function
int getStillHeight()
Get still height.
function
std::tuple< int, int > getResolutionSize()
Get sensor resolution as size.
function
int getResolutionWidth()
Get sensor resolution width.
function
int getResolutionHeight()
Get sensor resolution height.
function
std::tuple< int, int > getIspSize()
Get 'isp' output resolution as size, after scaling.
function
int getIspWidth()
Get 'isp' output width.
function
int getIspHeight()
Get 'isp' output height.
function
void sensorCenterCrop()
Specify sensor center crop. Resolution size / video size
function
void setSensorCrop(float x, float y)
Specifies the cropping that happens when converting ISP to video output. By default, video will be center cropped from the ISP output. Note that this doesn't actually do on-sensor cropping (and MIPI-stream only that region), but it does postprocessing on the ISP (on RVC).
Parameters
  • x: Top left X coordinate
  • y: Top left Y coordinate
function
std::tuple< float, float > getSensorCrop()
Returns
Sensor top left crop coordinates
function
float getSensorCropX()
Get sensor top left x crop coordinate.
function
float getSensorCropY()
Get sensor top left y crop coordinate.
function
void setPreviewKeepAspectRatio(bool keep)
Specifies whether preview output should preserve aspect ratio, after downscaling from video size or not.
Parameters
  • keep: If true, a larger crop region will be considered to still be able to create the final image in the specified aspect ratio. Otherwise video size is resized to fit preview size
function
bool getPreviewKeepAspectRatio()
Returns
Preview keep aspect ratio option
function
int getPreviewNumFramesPool()
Get number of frames in preview pool.
function
int getVideoNumFramesPool()
Get number of frames in video pool.
function
int getStillNumFramesPool()
Get number of frames in still pool.
function
int getRawNumFramesPool()
Get number of frames in raw pool.
function
int getIspNumFramesPool()
Get number of frames in isp pool.
function
void setRawOutputPacked(bool packed)
Configures whether the camera raw frames are saved as MIPI-packed to memory. The packed format is more efficient, consuming less memory on device, and less data to send to host: RAW10: 4 pixels saved on 5 bytes, RAW12: 2 pixels saved on 3 bytes. When packing is disabled (false), data is saved lsb-aligned, e.g. a RAW10 pixel will be stored as uint16, on bits 9..0: 0b0000'00pp'pppp'pppp. Default is auto: enabled for standard color/monochrome cameras where ISP can work with both packed/unpacked, but disabled for other cameras like ToF.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::Depth

#include Depth.hpp
using
Config = std::variant< std::monostate, DeviceModelZoo, StereoDepth::PresetMode >
Algorithm-specific configuration (DeviceModelZoo for NEURAL, StereoDepth::PresetMode for STEREO, or std::monostate for backends without a selectable profile).
function
Depth(const Depth &)
function
Depth & operator=(const Depth &)
function
Depth(Depth &&)
function
Depth & operator=(Depth &&)
function
~Depth()
function
Depth()
function
std::shared_ptr< Depth > build(std::optional< float > fps)
Set stereo camera FPS for stereo-based backends. Must be called before first depth() or confidence() access.
Parameters
  • fps: Requested FPS; uses Camera default if not set
function
std::shared_ptr< Depth > build(Algorithm algorithm, std::optional< float > fps)
Set algorithm and optional FPS before wiring.
Parameters
  • algorithm: Backend to use
  • fps: Requested stereo camera FPS
function
std::shared_ptr< Depth > build(Algorithm algorithm, std::optional< float > fps, std::optional< std::pair< uint32_t, uint32_t >> size)
Set algorithm, optional FPS, and preferred depth output size before wiring.
Parameters
  • algorithm: Backend to use
  • fps: Requested stereo camera FPS
  • size: preferred depth output size. Used when no upstream Camera is present
function
std::shared_ptr< Depth > build(Algorithm algorithm, Config config, std::optional< float > fps, std::optional< std::pair< uint32_t, uint32_t >> size)
Set algorithm and config before wiring. algorithm must not be AUTO.
Parameters
  • algorithm: Backend to use
  • config: Algorithm-specific configuration
  • fps: Requested stereo camera FPS
  • size: preferred depth output size. Used when no upstream Camera is present
function
Node::Output & depth()
Output depth map from the active backend.
function
Node::Output & confidence()
Output confidence map from the active backend. When ToF is active, this forwards the actual ToF confidence output.
function
std::shared_ptr< Depth > setAlignTo(Node::Output & alignTo)
Align depth output to another image source. Must be called before first depth() or confidence() access. Only depth() is aligned; confidence() stays in the backend frame.
Parameters
  • alignTo: Output to align depth to
inline function
Algorithm getRequestedAlgorithm()
Get the requested algorithm selection.
function
std::shared_ptr< Depth > setAlgorithm(Algorithm algorithm)
Set the requested algorithm before wiring.
Parameters
  • algorithm: Backend to use; AUTO re-enables auto-selection
inline function
const std::optional< Config > & getRequestedConfig()
Get the requested config override, if any.
Returns
Config override, or std::nullopt when config is auto-picked
function
std::shared_ptr< Depth > setConfig(Config config)
Pin the algorithm-specific config. Only takes effect together with a concrete (non-AUTO) algorithm.
Parameters
  • config: Algorithm-specific configuration
inline function
Algorithm getResolvedAlgorithm()
Get the algorithm actually wired (AUTO resolved). Valid after first depth() access.
inline function
const Config & getResolvedConfig()
Get the resolved algorithm-specific config.
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
enum

std::uint32_t Algorithm

Backend selection for the Depth node.
enumerator
AUTO
enumerator
STEREO
enumerator
NEURAL
enumerator
NEURAL_ASSISTED_STEREO
enumerator
TOF
enumerator
GPU_STEREO
enumerator
TOF_STEREO_FUSION
class

dai::node::DetectionNetwork

#include DetectionNetwork.hpp
using
Model = NeuralNetwork::Model
variable
Subnode< NeuralNetwork > neuralNetwork
variable
Subnode< DetectionParser > detectionParser
variable
Output & out
Outputs ImgDetections message that carries parsed detection results. Overrides NeuralNetwork 'out' with ImgDetections output message type.
variable
Output & outNetwork
Outputs unparsed inference results.
variable
Input & input
Input message with data to be inferred upon Default queue is blocking with size 5
variable
Output & passthrough
Passthrough message on which the inference was performed.Suitable for when input queue is set to non-blocking behavior.
function
DetectionNetwork(const std::shared_ptr< Device > & device)
function
std::shared_ptr< DetectionNetwork > build(Node::Output & input, const NNArchive & nnArchive)
Build DetectionNetwork node. Connect output to this node's input. Also call setNNArchive() with provided NNArchive.
Parameters
  • output: Output to link
  • nnArchive: Neural network archive
Returns
Shared pointer to DetectionNetwork node
function
std::shared_ptr< DetectionNetwork > build(const std::shared_ptr< Camera > & input, const Model & model, std::optional< float > fps, std::optional< dai::ImgResizeMode > resizeMode)
Build DetectionNetwork node. Connect Camera output to this node's input and configure the inference model.
Parameters
  • input: Camera node
  • model: Neural network model description, NNArchive or HubAI model id string
  • fps: Desired frames per second
  • resizeMode: Resize mode for input frames
Returns
Shared pointer to DetectionNetwork node
function
std::shared_ptr< DetectionNetwork > build(const std::shared_ptr< Camera > & input, const Model & model, const ImgFrameCapability & capability)
Build DetectionNetwork node. Connect Camera output to this node's input and configure the inference model.
Parameters
  • input: Camera node
  • model: Neural network model description, NNArchive or HubAI model id string
  • capability: Camera capabilities
Returns
Shared pointer to DetectionNetwork node
function
std::shared_ptr< DetectionNetwork > build(const std::shared_ptr< ReplayVideo > & input, const Model & model, std::optional< float > fps)
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. If the archive's type is SUPERBLOB, use default number of shaves.
Parameters
function
void setNNArchive(const NNArchive & nnArchive, int numShaves)
Set NNArchive for this Node, throws if the archive's type is not SUPERBLOB.
Parameters
  • nnArchive: NNArchive to set
  • numShaves: Number of shaves to use
function
void setFromModelZoo(NNModelDescription description, bool useCached)
Download model from zoo and set it for this Node.
Parameters
  • description: Model description to download
  • useCached: Use cached model if available
function
void setFromModelZoo(NNModelDescription description, int numShaves, bool useCached)
Download model from zoo and set it for this node.
Parameters
  • description: Model description to download
  • numShaves: Number of shaves to use
  • useCached: Use cached model if available
function
void setBlobPath(const std::filesystem::path & path)
Load network blob into assets and use once pipeline is started.
Parameters
  • Error: if file doesn't exist or isn't a valid network blob.
Parameters
  • path: Path to network blob
function
void setBlob(const OpenVINO::Blob & blob)
Load network blob into assets and use once pipeline is started.
Parameters
  • blob: Network blob
function
void setBlob(const std::filesystem::path & path)
Same functionality as the setBlobPath(). Load network blob into assets and use once pipeline is started.
Parameters
  • Error: if file doesn't exist or isn't a valid network blob.
Parameters
  • path: Path to network blob
function
void setModelPath(const std::filesystem::path & modelPath)
Load a network model into assets. DLC and other custom model files are loaded lazily and must remain available and unchanged until the pipeline has been built.
Parameters
  • modelPath: Path to the model file.
function
void setNumPoolFrames(int numFrames)
Specifies how many frames will be available in the pool
Parameters
  • numFrames: How many frames will pool have
function
void setNumInferenceThreads(int numThreads)
How many threads should the node use to run the network.
Parameters
  • numThreads: Number of threads to dedicate to this node
function
void setNumNCEPerInferenceThread(int numNCEPerThread)
How many Neural Compute Engines should a single thread use for inference
Parameters
  • numNCEPerThread: Number of NCE per thread
function
void setNumShavesPerInferenceThread(int numShavesPerThread)
How many Shaves should a single thread use for inference
Parameters
  • numShavesPerThread: Number of shaves per thread
function
void setBackend(const std::string & backend)
Specifies backend to use
Parameters
  • backend: String specifying backend to use
function
void setBackendProperties(const std::map< std::string, std::string > & properties)
Set backend properties
Parameters
  • backendProperties: backend properties map
function
int getNumInferenceThreads()
How many inference threads will be used to run the network
Returns
Number of threads, 0, 1 or 2. Zero means AUTO
function
void setConfidenceThreshold(float thresh)
Specifies confidence threshold at which to filter the rest of the detections.
Parameters
  • thresh: Detection confidence must be greater than specified threshold to be added to the list
function
float getConfidenceThreshold()
Retrieves threshold at which to filter the rest of the detections.
Returns
Detection confidence
function
std::vector< std::pair< Input &, std::shared_ptr< Capability > > > getRequiredInputs()
function
std::optional< std::vector< std::string > > getClasses()
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
class

dai::node::DetectionParser

#include DetectionParser.hpp
variable
std::shared_ptr< DetectionParserConfig > initialConfig
Initial runtime thresholds. Send a config to inputConfig to change them after startup.
variable
Input inputConfig
Runtime threshold configuration. Non-blocking queue of size 4; does not wait by default.
variable
Input input
Input NN results with detection data to parse Default queue is blocking with size 5
variable
Output out
Outputs image frame with detected edges
function
~DetectionParser()
function
std::shared_ptr< DetectionParser > build(Node::Output & nnInput, const NNArchive & nnArchive)
Build DetectionParser node. Connect output to this node's input. Also call setNNArchive() with provided NNArchive.
Parameters
  • nnInput: Output to link
  • nnArchive: Neural network archive
function
std::shared_ptr< DetectionParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build DetectionParser node with a specific NNArchive head.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
function
void setNumFramesPool(int numFramesPool)
Specify number of frames in pool.
Parameters
  • numFramesPool: How many frames should the pool have
function
int getNumFramesPool()
Returns number of frames in pool
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. If the archive's type is SUPERBLOB, use default number of shaves.
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node.
Parameters
function
void setModelPath(const std::filesystem::path & modelPath)
Load network xml and bin files into assets.
Parameters
  • xmlModelPath: Path to the neural network model file.
function
void setBlobPath(const std::filesystem::path & path)
Load network blob into assets and use once pipeline is started.
Parameters
  • Error: if file doesn't exist or isn't a valid network blob.
Parameters
  • path: Path to network blob
function
void setBlob(const OpenVINO::Blob & blob)
Retrieves some input tensor information from the blob
Parameters
  • blob: OpenVINO blob to retrieve the information from
function
void setBlob(const std::filesystem::path & path)
Same functionality as the setBlobPath(). Load network blob into assets and use once pipeline is started.
Parameters
  • Error: if file doesn't exist or isn't a valid network blob.
Parameters
  • path: Path to network blob
function
void setInputImageSize(int width, int height)
Set input image sizeThis should only be used instead of setBlob, not besides it
function
void setInputImageSize(const std::tuple< int, int > & size)
Set preview output size, as a tuple<width, height>
function
void setNNFamily(DetectionNetworkType type)
Sets NN Family to parse. Possible values are:DetectionNetworkType::YOLO - 0 DetectionNetworkType::MOBILENET - 1
Warning
If NN Family is set manually, user must ensure that it matches the actual model being used.
function
DetectionNetworkType getNNFamily()
Gets NN Family to parse
function
void setConfidenceThreshold(float thresh)
Specifies confidence threshold at which to filter the rest of the detections.
Parameters
  • thresh: Detection confidence must be greater than specified threshold to be added to the list
Note
Sets startup configuration. Send DetectionParserConfig to inputConfig for runtime updates.
function
float getConfidenceThreshold()
Retrieves threshold at which to filter the rest of the detections.
Returns
Detection confidence
function
void setNumClasses(int numClasses)
Set number of classes. This will clear any previously set class names.
Parameters
  • numClasses: Number of classes
function
void setClasses(const std::vector< std::string > & classes)
Set class names. This will clear any previously set number of classes.
Parameters
  • classes: Vector of class names
function
void setCoordinateSize(int coordinates)
Sets the number of coordinates per bounding box.
Parameters
  • coordinates: Number of coordinates. Default is 4
function
void setAnchors(const std::vector< float > & anchors)
Set anchors for anchor-based yolo models
Parameters
  • anchors: Flattened vector of anchors
Warning
This method is deprecated, use setAnchorsV2 instead.
function
void setAnchorMasks(const std::map< std::string, std::vector< int >> & anchorMasks)
Set anchor masks for anchor-based yolo models
Parameters
  • anchorMasks: Map of anchor masks
function
void setAnchors(const std::vector< std::vector< std::vector< float >>> & anchors)
Set anchors for anchor-based yolo models (v2)
Parameters
  • anchors: 3D vector of anchors [layer][anchor][dim]
function
void setIouThreshold(float thresh)
Set IOU threshold for non-maxima suppression
Parameters
  • thresh: IOU threshold
Note
Sets startup configuration. Send DetectionParserConfig to inputConfig for runtime updates.
function
void setSubtype(const std::string & subtype)
Set subtype for the parser.
Parameters
  • subtype: Subtype string, currently supported subtypes are: yolov6r1, yolov6r2 yolov8n, yolov6, yolov8, yolov10, yolov11, yolov3, yolov3-tiny, yolov5, yolov7, yolo-p, yolov5-u
function
void setDecodeKeypoints(bool decode)
Enable/disable keypoints decoding. If enabled, number of keypoints must also be set.
function
void setDecodeSegmentation(bool decode)
Enable/disable segmentation mask decoding.
function
void setNumKeypoints(int numKeypoints)
Set number of keypoints to decode. Automatically enables keypoints decoding.
function
void setStrides(const std::vector< int > & strides)
Set strides for yolo models
function
void setKeypointEdges(const std::vector< dai::Edge > & edges)
Set edges connections between keypoints.
Parameters
  • edges: Vector edges connections represented as pairs of keypoint indices.
Note
This is only applicable if keypoints decoding is enabled.
function
int getNumClasses()
Get number of classes to decode.
function
std::optional< std::vector< std::string > > getClasses()
Get class names to decode.
function
int getCoordinateSize()
Get number of coordinates per bounding box.
function
std::vector< float > getAnchors()
Get anchors for anchor-based yolo models
function
std::map< std::string, std::vector< int > > getAnchorMasks()
Get anchor masks for anchor-based yolo models
function
float getIouThreshold()
Get IOU threshold for non-maxima suppression
function
std::string getSubtype()
Get subtype for the parser.
function
bool getDecodeKeypoints()
Get whether keypoints decoding is enabled.
function
bool getDecodeSegmentation()
Get whether segmentation mask decoding is enabled.
function
int getNKeypoints()
Get number of keypoints to decode.
function
std::vector< int > getStrides()
Get strides for yolo models
function
const NNArchiveVersionedConfig & getNNArchiveVersionedConfig()
Get NNArchive set for this node
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on device.
function
bool runOnHost()
Check if the node is set to run on host
function
void run()
function
Properties & getProperties()
Get serialized startup properties, including initialConfig thresholds.
function
void decodeMobilenet(dai::NNData & nnData, dai::ImgDetections & outDetections, float confidenceThr)
Decode Mobilenet-SSD detections from NNData.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::DynamicCalibration

variable
Input inputControl
Input DynamicCalibrationControl message with ability to modify parameters in runtime.
variable
Output calibrationOutput
Output calibration quality result
variable
Output qualityOutput
variable
Output metricsOutput
variable
Output coverageOutput
variable
Input syncInput
variable
variable
InputMap & inputs
variable
std::string leftInputName
variable
std::string rightInputName
variable
std::string rgbInputName
variable
std::vector< std::string > names
variable
Input & left
Input left image
variable
Input & right
Input right image
variable
Input & rgb
Input rgb image
function
~DynamicCalibration()
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on host on RVC2 and on device on RVC4.
function
bool runOnHost()
Returns true or false whether the node should be run on host or not.
function
void postBuildStage()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::EdgeDetector

#include EdgeDetector.hpp
variable
std::shared_ptr< EdgeDetectorConfig > initialConfig
Initial config to use for edge detection.
variable
Input inputConfig
Input EdgeDetectorConfig message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
variable
Input inputImage
Input image on which edge detection is performed. Default queue is non-blocking with size 4.
variable
Output outputImage
Outputs image frame with detected edges
variable
Output passthroughInputImage
Passthrough message on which the calculation was performed.
function
EdgeDetector()
function
EdgeDetector(std::unique_ptr< Properties > props)
function
void setNumFramesPool(int numFramesPool)
Specify number of frames in pool.
Parameters
  • numFramesPool: How many frames should the pool have
function
void setMaxOutputFrameSize(int maxFrameSize)
Specify maximum size of output image.
Parameters
  • maxFrameSize: Maximum frame size in bytes
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::FeatureTracker

#include FeatureTracker.hpp
variable
std::shared_ptr< FeatureTrackerConfig > initialConfig
Initial config to use for feature tracking.
variable
Input inputConfig
Input FeatureTrackerConfig message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
variable
Input inputImage
Input message with frame data on which feature tracking is performed. Default queue is non-blocking with size 4.
variable
Output outputFeatures
Outputs TrackedFeatures message that carries tracked features results.
variable
Output passthroughInputImage
Passthrough message on which the calculation was performed. Suitable for when input queue is set to non-blocking behavior.
function
FeatureTracker()
function
FeatureTracker(std::unique_ptr< Properties > props)
function
void setHardwareResources(int numShaves, int numMemorySlices)
Specify allocated hardware resources for feature tracking. 2 shaves/memory slices are required for optical flow, 1 for corner detection only.
Parameters
  • numShaves: Number of shaves. Maximum 2.
  • numMemorySlices: Number of memory slices. Maximum 2.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::GPUStereo

#include GPUStereo.hpp
variable
Subnode< Sync > sync
variable
Subnode< MessageDemux > messageDemux
variable
std::unique_ptr< Subnode< Rectification > > rectification
variable
Input & left
variable
Input & right
variable
Input leftInternal
variable
Input rightInternal
variable
Output disparity
Outputs ImgFrame message that carries RAW16 encoded disparity data.
variable
Output depth
Outputs ImgFrame message that carries RAW16 encoded (0..65535) depth data in depth units (millimeter by default).Non-determined / invalid depth values are set to 0
variable
Output confidenceMap
Outputs ImgFrame message that carries RAW8 confidence map. Lower values mean lower confidence of the calculated disparity value. Note: postprocessing steps like LR-check/median filter are not applied to confidence map.
variable
std::shared_ptr< GPUStereoConfig > initialConfig
Initial config to use for GPUStereo.Use this to configure startup parameters before the pipeline starts. Note: Only confidenceThreshold is supported/exposed for this node.
function
GPUStereo()
function
std::shared_ptr< GPUStereo > build(Output & left, Output & right)
Build the node by linking left and right camera outputs.
function
GPUStereo & setRectification(bool enable)
Enable or disable built-in stereo rectification. When enabled, the node rectifies the input images internally using calibration data. When disabled, inputs are expected to be already rectified.
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
class

dai::node::Gate

#include Gate.hpp
variable
std::shared_ptr< GateControl > initialConfig
variable
Input input
Main data input.
  • Accepts arbitrary Buffer messages (e.g., ImgFrame, NNData). If the Gate is Open, messages received here are forwarded to 'output'. If the Gate is Closed, messages received here are discarded/dropped.
  • Default queue size: 1 Blocking: False
variable
Output output
Main data output.
  • Forwards messages that were allowed through the Gate. The data type matches the input message.
variable
Input inputControl
Control input.
  • Accepts 'GateControl' messages to dynamically change the Gate's state. Use this to Open/Close the gate or set it to pass a specific number of frames at runtime.
  • Default queue size: 4
function
Gate(std::unique_ptr< Properties > props)
function
Gate()
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on device.
function
bool runOnHost()
Check if the node is configured to run on the host.
Returns
true if running on host, false otherwise.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::IMU

#include IMU.hpp
variable
Output out
Outputs IMUData message that carries IMU packets.
variable
Input mockIn
Mock IMU data for replaying recorded data
function
void enableIMUSensor(IMUSensorConfig sensorConfig)
Enable a new IMU sensor with explicit configuration
function
void enableIMUSensor(const std::vector< IMUSensorConfig > & sensorConfigs)
Enable a list of IMU sensors with explicit configuration
function
void enableIMUSensor(IMUSensor sensor, uint32_t reportRate)
Enable a new IMU sensor with default configuration
function
void enableIMUSensor(const std::vector< IMUSensor > & sensors, uint32_t reportRate)
Enable a list of IMU sensors with default configuration
function
void setBatchReportThreshold(std::int32_t batchReportThreshold)
Above this packet threshold data will be sent to host, if queue is not blocked
function
std::int32_t getBatchReportThreshold()
Above this packet threshold data will be sent to host, if queue is not blocked
function
void setMaxBatchReports(std::int32_t maxBatchReports)
Maximum number of IMU packets in a batch report
function
std::int32_t getMaxBatchReports()
Maximum number of IMU packets in a batch report
function
void enableFirmwareUpdate(bool enable)
Whether to perform firmware update or not. Default value: false.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::ImageAlign

#include ImageAlign.hpp
variable
std::shared_ptr< ImageAlignConfig > initialConfig
Initial config to use when calculating spatial location data.
variable
Input inputConfig
Input message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
variable
Input input
Input message. Default queue is non-blocking with size 4.
variable
Input inputAlignTo
Input align to message. Default queue is non-blocking with size 1.
variable
Output outputAligned
Outputs ImgFrame message that is aligned to inputAlignTo.
variable
Output passthroughInput
Passthrough message on which the calculation was performed. Suitable for when input queue is set to non-blocking behavior.
function
ImageAlign & setOutputSize(int alignWidth, int alignHeight)
Specify the output size of the aligned image
function
ImageAlign & setOutKeepAspectRatio(bool keep)
Specify whether to keep aspect ratio when resizing
function
ImageAlign & setInterpolation(Interpolation interp)
Specify interpolation method to use when resizing
function
ImageAlign & setNumShaves(int numShaves)
Specify number of shaves to use for this node
function
ImageAlign & setNumFramesPool(int numFramesPool)
Specify number of frames in the pool
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on device.
function
bool runOnHost()
Check if the node is set to run on host
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::ImageFilters

variable
std::shared_ptr< ImageFiltersConfig > initialConfig
Initial config for image filters.
variable
Node::Input input
Input for image frames to be filtered
variable
Node::Output output
Filtered frame
variable
Node::Input inputConfig
Config to be set for a specific filter
function
std::shared_ptr< ImageFilters > build(Node::Output & input, ImageFiltersPresetMode presetMode)
Build the node.
Parameters
  • input: Input for image frames to be filtered
  • presetMode: Preset mode for image filters
Returns
Shared pointer to the node
function
std::shared_ptr< ImageFilters > build(ImageFiltersPresetMode presetMode)
Build the node.
Parameters
  • presetMode: Preset mode for image filters
Returns
Shared pointer to the node
function
void run()
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on device.
function
bool runOnHost()
Check if the node is set to run on host
function
void setDefaultProfilePreset(ImageFiltersPresetMode mode)
Set default profile preset for ImageFilters.
Parameters
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::ToFDepthConfidenceFilter

#include ImageFilters.hpp
variable
std::shared_ptr< ToFDepthConfidenceFilterConfig > initialConfig
Initial config for ToF depth confidence filter.
variable
Node::Input depth
Depth frame image, expected ImgFrame type is RAW8 or RAW16.
variable
Node::Input amplitude
Amplitude frame image, expected ImgFrame type is RAW8 or RAW16.
variable
Node::Output filteredDepth
RAW16 encoded filtered depth frame
variable
Node::Output confidence
RAW16 encoded confidence frame
variable
Node::Input inputConfig
Config message for runtime filter configuration
function
std::shared_ptr< ToFDepthConfidenceFilter > build(Node::Output & depth, Node::Output & amplitude, ImageFiltersPresetMode presetMode)
Build the node.
Parameters
  • depth: Depth frame image, expected ImgFrame type is RAW8 or RAW16.
  • amplitude: Amplitude frame image, expected ImgFrame type is RAW8 or RAW16.
  • presetMode: Preset mode for ToF depth confidence filter
Returns
Shared pointer to the node
function
std::shared_ptr< ToFDepthConfidenceFilter > build(ImageFiltersPresetMode presetMode)
Build the node.
Parameters
  • presetMode: Preset mode for ToF depth confidence filter
Returns
Shared pointer to the node
function
void run()
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on device.
function
bool runOnHost()
Check if the node is set to run on host
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::ImageManip

#include ImageManip.hpp
variable
std::shared_ptr< ImageManipConfig > initialConfig
Initial config to use when manipulating frames
variable
Input inputConfig
Input ImageManipConfig message with ability to modify parameters in runtime
variable
Input inputImage
Input image to be modified
variable
Output out
Outputs ImgFrame message that carries modified image.
function
ImageManip()
function
ImageManip(std::unique_ptr< Properties > props)
inline function
std::shared_ptr< ImageManip > build()
function
void setNumFramesPool(int numFramesPool)
Specify number of frames in pool.
Parameters
  • numFramesPool: How many frames should the pool have
function
void setMaxOutputFrameSize(int maxFrameSize)
Specify maximum size of output image.
Parameters
  • maxFrameSize: Maximum frame size in bytes
function
void setMaxPoolSize(unsigned int maxPoolSize)
Specify maximum size of output image pool.
Parameters
  • maxPoolSize: Maximum pool size in bytes
function
ImageManip & setRunOnHost(bool runOnHost)
Specify whether to run on host or device
Parameters
  • runOnHost: Run node on host
function
ImageManip & setBackend(Backend backend)
Set backend preference:
  • CPU: Run ImageManip on the CPU.
  • HW: Prefer the dedicated hardware image manipulation backend.
  • GPU: Prefer the GPU backend.
  • AUTO: Let the runtime select the backend automatically (GPU with CPU fallback).
Hardware-accelerated backends can cause some unexpected behavior when using multiple ImageManip nodes in series. Currently, the only operation affected is downscaling.
Parameters
  • backend: Backend preference
function
ImageManip & setPerformanceMode(PerformanceMode performanceMode)
Set performance mode
Parameters
  • performanceMode: Performance mode
function
bool runOnHost()
Check if the node is set to run on host
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
Backend preference for ImageManip on RVC4.
  • CPU: Run ImageManip on the CPU.
  • HW: Prefer the dedicated hardware image manipulation backend.
  • GPU: Prefer the GPU backend.
  • AUTO: Let the runtime select the backend automatically (GPU with CPU fallback).
Hardware-accelerated backends can cause some unexpected behavior when using multiple ImageManip nodes in series. Currently, the only operation affected is downscaling.
enumerator
CPU
enumerator
HW
enumerator
GPU
enumerator
AUTO
Set performance mode for ImageManip with a tradeoff between performance and power consumption. Only applied on RVC4. This only affects scaling NV12 and GRAY images.
  • PERFORMANCE: High performance, high power consumption. Uses the OpenCV backend.
  • BALANCED: Balanced performance and power consumption. Uses the FastCV backend configured for high performance where possible with a fallback to OpenCV.
  • LOW_POWER: Low performance, low power consumption. Uses the FastCV backend configured for low power where possible with a fallback to OpenCV.
enumerator
PERFORMANCE
enumerator
BALANCED
enumerator
LOW_POWER
class

dai::node::MessageDemux

variable
Input input
Input message of type MessageGroup
variable
OutputMap outputs
A map of outputs, where keys are same as in the input MessageGroup
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on device.
function
bool runOnHost()
Check if the node is set to run on host
function
void run()
function
void setProcessor(ProcessorType type)
Specify on which processor the node should run. RVC2 only.
Parameters
  • type: Processor type - Leon CSS or Leon MSS
function
ProcessorType getProcessor()
Get on which processor the node should run
Returns
Processor type - Leon CSS or Leon MSS
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::MonoCamera

#include MonoCamera.hpp
variable
CameraControl initialControl
Initial control options to apply to sensor
variable
Input inputControl
Input for CameraControl message, which can modify camera parameters in runtime Default queue is blocking with size 8
variable
Input mockIsp
Input for mocking 'isp' functionality. Default queue is blocking with size 8
variable
Output out
Outputs ImgFrame message that carries RAW8 encoded (grayscale) frame data.Suitable for use StereoDepth node. Processed by ISP
variable
Output raw
Outputs ImgFrame message that carries RAW10-packed (MIPI CSI-2 format) frame data.Captured directly from the camera sensor
variable
Output frameEvent
Outputs metadata-only ImgFrame message as an early indicator of an incoming frame.It's sent on the MIPI SoF (start-of-frame) event, just after the exposure of the current frame has finished and before the exposure for next frame starts. Could be used to synchronize various processes with camera capture. Fields populated: camera id, sequence number, timestamp
function
MonoCamera()
function
MonoCamera(std::unique_ptr< Properties > props)
function
void setBoardSocket(CameraBoardSocket boardSocket)
Specify which board socket to use
Parameters
  • boardSocket: Board socket to use
function
CameraBoardSocket getBoardSocket()
Retrieves which board socket to use
Returns
Board socket to use
function
void setCamera(const std::string & name)
Specify which camera to use by name
Parameters
  • name: Name of the camera to use
function
std::string getCamera()
Retrieves which camera to use by name
Returns
Name of the camera to use
function
void setCamId(int64_t id)
function
int64_t getCamId()
function
void setImageOrientation(CameraImageOrientation imageOrientation)
Set camera image orientation.
function
CameraImageOrientation getImageOrientation()
Get camera image orientation.
function
void setMockIspSize(int width, int height)
function
void setResolution(Properties::SensorResolution resolution)
Set sensor resolution.
function
Properties::SensorResolution getResolution()
Get sensor resolution.
function
void setFrameEventFilter(const std::vector< dai::FrameEvent > & events)
function
std::vector< dai::FrameEvent > getFrameEventFilter()
function
void setFps(float fps)
Set rate at which camera should produce frames
Parameters
  • fps: Rate in frames per second
function
void setIsp3aFps(int isp3aFps)
Isp 3A rate (auto focus, auto exposure, auto white balance, camera controls etc.). Default (0) matches the camera FPS, meaning that 3A is running on each frame. Reducing the rate of 3A reduces the CPU usage on CSS, but also increases the convergence rate of 3A. Note that camera controls will be processed at this rate. E.g. if camera is running at 30 fps, and camera control is sent at every frame, but 3A fps is set to 15, the camera control messages will be processed at 15 fps rate, which will lead to queueing.
function
float getFps()
Get rate at which camera should produce frames
Returns
Rate in frames per second
function
std::tuple< int, int > getResolutionSize()
Get sensor resolution as size.
function
int getResolutionWidth()
Get sensor resolution width.
function
int getResolutionHeight()
Get sensor resolution height.
function
void setNumFramesPool(int num)
Set number of frames in main (ISP output) pool.
function
void setRawNumFramesPool(int num)
Set number of frames in raw pool.
function
int getNumFramesPool()
Get number of frames in main (ISP output) pool.
function
int getRawNumFramesPool()
Get number of frames in raw pool.
function
void setRawOutputPacked(bool packed)
Configures whether the camera raw frames are saved as MIPI-packed to memory. The packed format is more efficient, consuming less memory on device, and less data to send to host: RAW10: 4 pixels saved on 5 bytes, RAW12: 2 pixels saved on 3 bytes. When packing is disabled (false), data is saved lsb-aligned, e.g. a RAW10 pixel will be stored as uint16, on bits 9..0: 0b0000'00pp'pppp'pppp. Default is auto: enabled for standard color/monochrome cameras where ISP can work with both packed/unpacked, but disabled for other cameras like ToF.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::NeuralAssistedStereo

#include NeuralAssistedStereo.hpp
using
Input = Node::Input
using
Output = Node::Output
variable
Subnode< node::Rectification > rectification
variable
Subnode< node::NeuralDepth > neuralDepth
variable
variable
Subnode< node::StereoDepth > stereoDepth
variable
Input & left
variable
Input & right
variable
Output & rectifiedLeft
variable
Output & rectifiedRight
variable
Output & vppLeft
variable
Output & vppRight
variable
Output & neuralDisparity
variable
Output & neuralConfidence
variable
Input & inputVppConfig
variable
Input & inputStereoConfig
variable
Input & inputNeuralConfig
variable
Output & depth
variable
Output & disparity
function
~NeuralAssistedStereo()
function
NeuralAssistedStereo(const std::shared_ptr< Device > & device)
function
std::shared_ptr< NeuralAssistedStereo > build(Output & leftInput, Output & rightInput, DeviceModelZoo neuralModel, bool rectifyImages)
class

dai::node::NeuralDepth

#include NeuralDepth.hpp
variable
std::shared_ptr< NeuralDepthConfig > initialConfig
Initial config to use for NeuralDepth.
variable
Subnode< Sync > sync
variable
Subnode< MessageDemux > messageDemux
variable
Subnode< Rectification > rectification
variable
Subnode< NeuralNetwork > neuralNetwork
variable
Input & left
Input for left ImgFrame of left-right pair
variable
Input & right
Input for right ImgFrame of left-right pair
variable
Output & rectifiedLeft
Output for rectified left ImgFrame
variable
Output & rectifiedRight
Output for rectified right ImgFrame
variable
Input inputConfig
Input config to modify parameters in runtime.
variable
Input nnDataInput
Input NNData to parse
variable
Input leftInternal
Input left frame internal, used to extract frame info
variable
Input rightInternal
Input right frame internal, used to extract frame info
variable
Output disparity
Output disparity ImgFrame
variable
Output depth
Output depth ImgFrame
variable
Output edge
Output edge ImgFrame
variable
Output confidence
Output confidence ImgFrame
function
NeuralDepth()
function
NeuralDepth & setRectification(bool enable)
Enable or disable rectification (useful for prerectified inputs)
function
std::shared_ptr< NeuralDepth > build(Output & left, Output & right, DeviceModelZoo model)
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
class

dai::node::NeuralNetwork

#include NeuralNetwork.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
Input input
Input message with data to be inferred upon
variable
Output out
Outputs NNData message that carries inference results
variable
Output passthrough
Passthrough message on which the inference was performed.Suitable for when input queue is set to non-blocking behavior.
variable
InputMap inputs
Inputs mapped to network inputs. Useful for inferring from separate data sources Default input is non-blocking with queue size 1 and waits for messages
variable
OutputMap passthroughs
Passthroughs which correspond to specified input
function
~NeuralNetwork()
function
std::shared_ptr< NeuralNetwork > build(Node::Output & input, const NNArchive & nnArchive)
Build NeuralNetwork node. Connect output to this node's input and sets up the NNArchive.
Parameters
  • output: Output to link
  • nnArchive: Neural network archive
Returns
Shared pointer to NeuralNetwork node
function
std::shared_ptr< NeuralNetwork > build(const std::shared_ptr< Camera > & input, const Model & model, std::optional< float > fps, std::optional< dai::ImgResizeMode > resizeMode)
Build NeuralNetwork node. Connect Camera output to this node's input and configure the inference model.
Parameters
  • input: Camera node
  • model: Neural network model description, NNArchive or HubAI model id string
  • fps: Desired frames per second
  • resizeMode: Resize mode for input frames
Returns
Shared pointer to NeuralNetwork node
function
std::shared_ptr< NeuralNetwork > build(const std::shared_ptr< Camera > & input, const Model & model, const ImgFrameCapability & capability)
Build NeuralNetwork node. Connect Camera output to this node's input and configure the inference model.
Parameters
  • input: Camera node
  • model: Neural network model description, NNArchive or HubAI model id string
  • capability: Camera capabilities
Returns
Shared pointer to NeuralNetwork node
function
std::shared_ptr< NeuralNetwork > build(const std::shared_ptr< ReplayVideo > & input, const Model & model, std::optional< float > fps)
Build NeuralNetwork node. Connect ReplayVideo output to this node's input and configure the inference model.
Parameters
  • input: ReplayVideo node
  • model: Neural network model description, NNArchive or HubAI model id string
  • fps: Desired frames per second
Returns
Shared pointer to NeuralNetwork node
function
std::optional< std::reference_wrapper< const NNArchive > > getNNArchive()
Get the archive owned by this Node.
Returns
constant reference to this Nodes archive
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. If the archive's type is SUPERBLOB, use default number of shaves.
Parameters
function
void setNNArchive(const NNArchive & nnArchive, int numShaves)
Set NNArchive for this Node, throws if the archive's type is not SUPERBLOB.
Parameters
  • nnArchive: NNArchive to set
  • numShaves: Number of shaves to use
function
void setFromModelZoo(NNModelDescription description, bool useCached)
Download model from zoo and set it for this Node.
Parameters
  • description: Model description to download
  • useCached: Use cached model if available
function
void setBlobPath(const std::filesystem::path & path)
Load network blob into assets and use once pipeline is started.
Parameters
  • Error: if file doesn't exist or isn't a valid network blob.
Parameters
  • path: Path to network blob
function
void setBlob(OpenVINO::Blob blob)
Load network blob into assets and use once pipeline is started.
Parameters
  • blob: Network blob
function
void setBlob(const std::filesystem::path & path)
Same functionality as the setBlobPath(). Load network blob into assets and use once pipeline is started.
Parameters
  • Error: if file doesn't exist or isn't a valid network blob.
Parameters
  • path: Path to network blob
function
void setOtherModelFormat(std::vector< uint8_t > model)
Load network model into assets and use once pipeline is started.
Parameters
  • model: Network model
function
void setOtherModelFormat(const std::filesystem::path & path)
Register a network model for lazy asset loading and use it once the pipeline is started. The file must remain available and unchanged until the pipeline has been built.
Parameters
  • Error: if file doesn't exist or isn't a valid network model.
Parameters
  • path: Path to the network model
function
void setModelPath(const std::filesystem::path & modelPath)
Load a network model into assets. DLC and other custom model files are loaded lazily and must remain available and unchanged until the pipeline has been built.
Parameters
  • modelPath: Path to the neural network model file.
function
void setNumPoolFrames(int numFrames)
Specifies how many frames will be available in the pool
Parameters
  • numFrames: How many frames will pool have
function
void setNumInferenceThreads(int numThreads)
How many threads should the node use to run the network.
Parameters
  • numThreads: Number of threads to dedicate to this node
function
void setNumNCEPerInferenceThread(int numNCEPerThread)
How many Neural Compute Engines should a single thread use for inference
Parameters
  • numNCEPerThread: Number of NCE per thread
function
void setNumShavesPerInferenceThread(int numShavesPerThread)
How many Shaves should a single thread use for inference
Parameters
  • numShavesPerThread: Number of shaves per thread
function
void setBackend(const std::string & backend)
Specifies backend to use
Parameters
  • backend: String specifying backend to use
function
void setBackendProperties(const std::map< std::string, std::string > & properties)
Set backend properties
Parameters
  • backendProperties: backend properties map
function
int getNumInferenceThreads()
How many inference threads will be used to run the network
Returns
Number of threads, 0, 1 or 2. Zero means AUTO
function
void setModelFromDeviceZoo(DeviceModelZoo model)
Set model from Device Model Zoo
Parameters
  • model: DeviceModelZoo model enum
Note
Only applicable for RVC4 devices with OS 1.20.5 or higher
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::ObjectTracker

#include ObjectTracker.hpp
variable
Input inputTrackerFrame
Input ImgFrame message on which tracking will be performed. RGBp, BGRp, NV12, YUV420p types are supported. Default queue is non-blocking with size 4.
variable
Input inputDetectionFrame
Input ImgFrame message on which object detection was performed. Default queue is non-blocking with size 4.
variable
Input inputDetections
Input message with image detection from neural network. Default queue is non-blocking with size 4.
variable
Input inputConfig
Input ObjectTrackerConfig message with ability to modify parameters at runtime. Default queue is non-blocking with size 4.
variable
Output out
Outputs Tracklets message that carries object tracking results.
variable
Output passthroughTrackerFrame
Passthrough ImgFrame message on which tracking was performed. Suitable for when input queue is set to non-blocking behavior.
variable
Output passthroughDetectionFrame
Passthrough ImgFrame message on which object detection was performed. Suitable for when input queue is set to non-blocking behavior.
variable
Output passthroughDetections
Passthrough image detections message from neural network output. Suitable for when input queue is set to non-blocking behavior.
function
void setTrackerThreshold(float threshold)
Specify tracker threshold.
Parameters
  • threshold: Above this threshold the detected objects will be tracked. Default 0, all image detections are tracked.
function
void setMaxObjectsToTrack(std::int32_t maxObjectsToTrack)
Specify maximum number of object to track.
Parameters
  • maxObjectsToTrack: Maximum number of object to track. Maximum 60 in case of SHORT_TERM_KCF, otherwise 1000.
function
void setDetectionLabelsToTrack(const std::vector< std::uint32_t > & labels)
Specify detection labels to track.
Parameters
  • labels: Detection labels to track. Default every label is tracked from image detection network output.
function
void setTrackerType(TrackerType type)
Specify tracker type algorithm.
Parameters
  • type: Tracker type.
function
void setTrackerIdAssignmentPolicy(TrackerIdAssignmentPolicy type)
Specify tracker ID assignment policy.
Parameters
  • type: Tracker ID assignment policy.
function
void setTrackingPerClass(bool trackingPerClass)
Whether tracker should take into consideration class label for tracking.
function
void setOcclusionRatioThreshold(float theshold)
Set the occlusion ratio threshold. Used to filter out overlapping tracklets.
Parameters
  • theshold: Occlusion ratio threshold. Default 0.3.
function
void setTrackletMaxLifespan(uint32_t trackletMaxLifespan)
Set the tracklet lifespan in number of frames. Number of frames after which a LOST tracklet is removed.
Parameters
  • trackletMaxLifespan: Tracklet lifespan in number of frames. Default 120.
function
void setTrackletBirthThreshold(uint32_t trackletBirthThreshold)
Set the tracklet birth threshold. Minimum consecutive tracked frames required to consider a tracklet as a new (TRACKED) instance.
Parameters
  • trackletBirthThreshold: Tracklet birth threshold. Default 3.
function
void setSpatialAssociation(bool enabled)
Enable or disable spatially-aware association. If disabled, only 2D association is used.
Parameters
  • enabled: true enables spatially-aware association, false uses 2D-only association. Default is false.
function
void setSpatialAssociationWeight(float weight)
Set spatial association weight in [0,1].
Parameters
  • weight: Spatial association weight in [0,1] used to blend 2D and spatial association scores (0 = 2D-only scoring, 1 = spatial-only scoring). This weight affects candidate scoring only; final acceptance still requires passing the 2D IoU threshold gate. Default is 0.5.
function
void setSpatialDistanceThreshold(float thresholdMeters)
Set base 3D gating threshold in meters for spatial association.
Parameters
  • thresholdMeters: Base spatial gating distance in meters. Default is 1.5m.
function
void setSpatialDepthAwareScale(float scale)
Set depth-aware gating scale used for spatial association. Increases gating threshold with increased depth.
Parameters
  • scale: Depth-aware gating scale factor. Default is 0.35
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on device.
function
bool runOnHost()
Check if the node is set to run on host
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::PointCloud

#include PointCloud.hpp
variable
std::shared_ptr< PointCloudConfig > initialConfig
Initial config to use when computing the point cloud.
variable
Input inputConfig
Input PointCloudConfig message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
variable
Subnode< node::Sync > sync
Sync subnode for synchronized depth + color input. When only depth is connected, Sync passes through single-item MessageGroups. When both depth and color are connected, Sync pairs them by timestamp.
variable
InputMap & syncInputs
variable
Input & inputDepth
Input message with depth data used to create the point cloud. Routed through the internal Sync subnode.
variable
Output outputPointCloud
Outputs PointCloudData message
variable
Output passthroughDepth
Passthrough depth from which the point cloud was calculated. Suitable for when input queue is set to non-blocking behavior.
function
PointCloud()
function
PointCloud(std::unique_ptr< Properties > props)
function
~PointCloud()
function
Input & getColorInput()
Get the optional color input for colorized point clouds. Lazily creates the Sync entry so that depth-only mode works without Sync waiting for a color frame that never arrives.Link an aligned color image (RGB888i, same dimensions as depth) to this input to enable colored point cloud output.
function
void setNumFramesPool(int numFramesPool)
Specify number of frames in pool.
Parameters
  • numFramesPool: How many frames should the pool have
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on host.
function
void useCPU()
Use single-threaded CPU for processing
function
void useCPUMT(uint32_t numThreads)
Use multi-threaded CPU for processing
function
void useGPU(uint32_t device)
Use GPU for point cloud computation
Parameters
  • device: GPU device index (default 0)
function
void setTargetCoordinateSystem(CameraBoardSocket targetCamera)
Set target coordinate system to transform point cloud
Parameters
  • targetCamera: Target camera socket
function
void setTargetCoordinateSystem(HousingCoordinateSystem housingCS)
Set target coordinate system to housing coordinate system Point cloud will be transformed to this housing coordinate system
Parameters
  • housingCS: Target housing coordinate system
function
void setTargetCoordinateSystem(CameraBoardSocket targetCamera, bool useSpecTranslation)
Deprecated: use setTargetCoordinateSystem(targetCamera) instead.
function
void setTargetCoordinateSystem(HousingCoordinateSystem housingCS, bool useSpecTranslation)
Deprecated: use setTargetCoordinateSystem(housingCS) instead.
function
bool runOnHost()
Returns true or false whether the node should be run on host or not.
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
class

dai::node::PointCloud::Impl

variable
LengthUnit targetLengthUnit
function
Impl()
function
void setLogger(const std::shared_ptr<::spdlog::logger > & log)
function
void computePointCloudDense(const uint8_t * depthData, std::vector< Point3f > & points)
function
void computePointCloudDenseColored(const uint8_t * depthData, const uint8_t * colorData, std::vector< Point3fRGBA > & points)
function
void applyTransformation(std::vector< PointT > & points)
function
std::vector< PointT > filterValidPoints(const std::vector< PointT > & densePoints)
function
void setLengthUnit(dai::LengthUnit lengthUnit)
function
void useCPU()
function
void useCPUMT(uint32_t numThreads)
function
void useGPU(uint32_t device)
function
void setIntrinsics(float fx, float fy, float cx, float cy, unsigned int width, unsigned int height)
function
void setDistortion(CameraModel model, std::vector< float > coefficients)
function
void setExtrinsics(const std::vector< std::vector< float >> & transformMatrix)
function
void clearExtrinsics()
class

dai::node::Rectification

variable
Input input1
Input images to be rectified
variable
Input input2
variable
Output passthrough1
Passthrough for input messages (so the node can be placed between other nodes)
variable
Output passthrough2
variable
Output output1
Send outputs
variable
Output output2
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on device.
function
Rectification & setOutputSize(uint32_t width, uint32_t height)
Set output size
inline function
Rectification & setOutputSize(std::pair< uint32_t, uint32_t > size)
Set output size
inline function
Rectification & enableRectification(bool enable)
Enable or disable rectification (useful for minimal changes during debugging)
function
bool runOnHost()
Check if the node is set to run on host
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::SPIIn

#include SPIIn.hpp
variable
Output out
Outputs message of same type as send from host.
function
void setStreamName(const std::string & name)
Specifies stream name over which the node will receive data
Parameters
  • name: Stream name
function
void setBusId(int id)
Specifies SPI Bus number to use
Parameters
  • id: SPI Bus id
function
void setMaxDataSize(std::uint32_t maxDataSize)
Set maximum message size it can receive
Parameters
  • maxDataSize: Maximum size in bytes
function
void setNumFrames(std::uint32_t numFrames)
Set number of frames in pool for sending messages forward
Parameters
  • numFrames: Maximum number of frames in pool
function
std::string getStreamName()
Get stream name.
function
int getBusId()
Get bus id.
function
std::uint32_t getMaxDataSize()
Get maximum messages size in bytes.
function
std::uint32_t getNumFrames()
Get number of frames in pool.
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::SPIOut

#include SPIOut.hpp
variable
Input input
Input for any type of messages to be transferred over SPI stream Default queue is blocking with size 8
inline function
void setStreamName(std::string name)
Specifies stream name over which the node will send data
Parameters
  • name: Stream name
inline function
void setBusId(int busId)
Specifies SPI Bus number to use
Parameters
  • id: SPI Bus id
inline function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::Script

variable
InputMap inputs
Inputs to Script node. Can be accessed using subscript operator (Eg: inputs['in1']) By default inputs are set to blocking with queue size 8
variable
OutputMap outputs
Outputs from Script node. Can be accessed subscript operator (Eg: outputs['out1'])
function
void setScriptPath(const std::filesystem::path & path, const std::string & name)
Specify local filesystem path to load the script
Parameters
  • path: Filesystem path to load the script
  • name: Optionally set a name of this script, otherwise the name defaults to the path
function
void setScript(const std::string & script, const std::string & name)
Sets script data to be interpreted
Parameters
  • script: Script string to be interpreted
  • name: Optionally set a name of this script
function
void setScript(const std::vector< std::uint8_t > & data, const std::string & name)
Sets script data to be interpreted
Parameters
  • data: Binary data that represents the script to be interpreted
  • name: Optionally set a name of this script
function
std::filesystem::path getScriptPath()
Get filesystem path from where script was loaded.
Returns
std::filesystem::path from where script was loaded, otherwise returns empty path
function
std::string getScriptName()
Get the script name in utf-8. When name set with setScript() or setScriptPath(), returns that name. When script loaded with setScriptPath() with name not provided, returns the utf-8 string of that path. Otherwise, returns "<script>"
Returns
std::string of script name in utf-8
function
void setProcessor(ProcessorType type)
Set on which processor the script should run
Parameters
  • type: Processor type - Leon CSS or Leon MSS
function
ProcessorType getProcessor()
Get on which processor the script should run
Returns
Processor type - Leon CSS or Leon MSS
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
function
void buildStage1()
Build stages;.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::SegmentationParser

#include SegmentationParser.hpp
using
Model = std::variant< NNModelDescription, NNArchive, std::string >
variable
std::shared_ptr< SegmentationParserConfig > initialConfig
Initial config to use when parsing segmentation masks.
variable
Input input
Input NN results with segmentation data to parser
variable
Input inputConfig
Input SegmentationParserConfig message with ability to modify parameters in runtime.
variable
Output out
Outputs segmentation mask
function
~SegmentationParser()
function
SegmentationParser()
inline function
SegmentationParser(std::unique_ptr< Properties > props)
function
std::shared_ptr< SegmentationParser > build(Node::Output & nnInput, const Model & model)
Build SegmentationParser node.
Parameters
  • nnInput: Output to link
  • model: Neural network model
function
std::shared_ptr< SegmentationParser > build(Node::Output & nnInput, const dai::nn_archive::v1::Head & head)
Build SegmentationParser node with the specific head from NNArchive. Useful when model outputs multiple segmentation heads.
Parameters
  • nnInput: Output to link
  • head: Specific head from NNArchive to use for this parser
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node.
Parameters
function
void setNNArchiveHead(const dai::nn_archive::v1::Head & head)
Set NNArchive head for this Node.
Parameters
function
void setLabels(const std::vector< std::string > & labels)
Sets the class labels associated with the segmentation mask. The label at index $i$ in the labels vector corresponds to the value $i$ in the segmentation mask data array.
Parameters
  • labels: Vector of class labels
function
std::vector< std::string > getLabels()
Returns the class labels associated with the segmentation mask.
function
void setBackgroundClass(bool backgroundClass)
Sets whether the first class (index 0) is considered the background class. If true, the pixels classified as index 0 will be treated as background.
Parameters
  • backgroundClass: Boolean indicating if the first class is the background class
Note
Only applicable if the number of classes is greater than 1 and the output classes are not in a single layer (eg. classesInOneLayer = false).
function
bool getBackgroundClass()
Gets whether the first class (index 0) is considered the background class.
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on device.
function
bool runOnHost()
Check if the node is set to run on host
function
void run()
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::SpatialDetectionNetwork

#include SpatialDetectionNetwork.hpp
using
using
Model = NeuralNetwork::Model
variable
Properties & properties
variable
Subnode< NeuralNetwork > neuralNetwork
variable
Subnode< DetectionParser > detectionParser
variable
Subnode< SpatialLocationCalculator > spatialLocationCalculator
variable
std::unique_ptr< Subnode< ImageAlign > > depthAlign
variable
Input & input
Input message with data to be inferred upon Default queue is blocking with size 5
variable
Output & outNetwork
Outputs unparsed inference results.
variable
Output & passthrough
Passthrough message on which the inference was performed.Suitable for when input queue is set to non-blocking behavior.
variable
Input & inputDepth
Input message with depth data used to retrieve spatial information about detected object Default queue is non-blocking with size 4
variable
Output & out
Outputs ImgDetections message that carries parsed detection results.
variable
Output & passthroughDepth
Passthrough message for depth frame on which the spatial location calculation was performed. Suitable for when input queue is set to non-blocking behavior.
explicit function
SpatialDetectionNetwork(const std::shared_ptr< Device > & device)
explicit function
SpatialDetectionNetwork(std::unique_ptr< Properties > props)
function
SpatialDetectionNetwork(std::unique_ptr< Properties > props, bool confMode)
function
SpatialDetectionNetwork(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
function
std::shared_ptr< SpatialDetectionNetwork > build(const std::shared_ptr< Camera > & inputRgb, const DepthSource & depthSource, const Model & model, std::optional< float > fps, std::optional< dai::ImgResizeMode > resizeMode)
Build SpatialDetectionNetwork node with specified depth source. Connect Camera and depth source outputs to this node's inputs and configure the inference model.
Parameters
Returns
Shared pointer to SpatialDetectionNetwork node
function
std::shared_ptr< SpatialDetectionNetwork > build(const std::shared_ptr< Camera > & inputRgb, const DepthSource & depthSource, const Model & model, const ImgFrameCapability & capability)
Build SpatialDetectionNetwork node with specified depth source. Connect Camera and depth source outputs to this node's inputs and configure the inference model.
Parameters
Returns
Shared pointer to SpatialDetectionNetwork node
function
void setNNArchive(const NNArchive & nnArchive)
Set NNArchive for this Node. If the archive's type is SUPERBLOB, use default number of shaves.
Parameters
function
void setFromModelZoo(NNModelDescription description, bool useCached)
Download model from zoo and set it for this Node.
Parameters
  • description: Model description to download
  • useCached: Use cached model if available
function
void setNNArchive(const NNArchive & nnArchive, int numShaves)
Set NNArchive for this Node, throws if the archive's type is not SUPERBLOB.
Parameters
  • nnArchive: NNArchive to set
  • numShaves: Number of shaves to use
function
void setBlobPath(const std::filesystem::path & path)
Backwards compatibility interface Load network blob into assets and use once pipeline is started.
Parameters
  • Error: if file doesn't exist or isn't a valid network blob.
Parameters
  • path: Path to network blob
function
void setBlob(const OpenVINO::Blob & blob)
Load network blob into assets and use once pipeline is started.
Parameters
  • blob: Network blob
function
void setBlob(const std::filesystem::path & path)
Same functionality as the setBlobPath(). Load network blob into assets and use once pipeline is started.
Parameters
  • Error: if file doesn't exist or isn't a valid network blob.
Parameters
  • path: Path to network blob
function
void setModelPath(const std::filesystem::path & modelPath)
Load a network model into assets. DLC and other custom model files are loaded lazily and must remain available and unchanged until the pipeline has been built.
Parameters
  • modelPath: Path to the model file.
function
void setNumPoolFrames(int numFrames)
Specifies how many frames will be available in the pool
Parameters
  • numFrames: How many frames will pool have
function
void setNumInferenceThreads(int numThreads)
How many threads should the node use to run the network.
Parameters
  • numThreads: Number of threads to dedicate to this node
function
void setNumNCEPerInferenceThread(int numNCEPerThread)
How many Neural Compute Engines should a single thread use for inference
Parameters
  • numNCEPerThread: Number of NCE per thread
function
void setNumShavesPerInferenceThread(int numShavesPerThread)
How many Shaves should a single thread use for inference
Parameters
  • numShavesPerThread: Number of shaves per thread
function
void setBackend(const std::string & backend)
Specifies backend to use
Parameters
  • backend: String specifying backend to use
function
void setBackendProperties(const std::map< std::string, std::string > & properties)
Set backend properties
Parameters
  • backendProperties: backend properties map
function
int getNumInferenceThreads()
How many inference threads will be used to run the network
Returns
Number of threads, 0, 1 or 2. Zero means AUTO
function
void setConfidenceThreshold(float thresh)
Specifies confidence threshold at which to filter the rest of the detections.
Parameters
  • thresh: Detection confidence must be greater than specified threshold to be added to the list
function
float getConfidenceThreshold()
Retrieves threshold at which to filter the rest of the detections.
Returns
Detection confidence
function
void setBoundingBoxScaleFactor(float scaleFactor)
Custom interface Specifies scale factor for detected bounding boxes.
Parameters
  • scaleFactor: Scale factor must be in the interval (0,1].
function
void setDepthLowerThreshold(uint32_t lowerThreshold)
Specifies lower threshold in depth units (millimeter by default) for depth values which will used to calculate spatial data
Parameters
  • lowerThreshold: LowerThreshold must be in the interval [0,upperThreshold] and less than upperThreshold.
function
void setDepthUpperThreshold(uint32_t upperThreshold)
Specifies upper threshold in depth units (millimeter by default) for depth values which will used to calculate spatial data
Parameters
  • upperThreshold: UpperThreshold must be in the interval (lowerThreshold,65535].
function
void setSpatialCalculationAlgorithm(dai::SpatialLocationCalculatorAlgorithm calculationAlgorithm)
Specifies spatial location calculator algorithm: Average/Min/Max
Parameters
  • calculationAlgorithm: Calculation algorithm.
function
void setSpatialCalculationStepSize(int stepSize)
Specifies spatial location calculator step size for depth calculation. Step size 1 means that every pixel is taken into calculation, size 2 means every second etc.
Parameters
  • stepSize: Step size.
function
std::optional< std::vector< std::string > > getClasses()
Get classes labels.
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
class

dai::node::SpatialLocationCalculator

#include SpatialLocationCalculator.hpp
variable
std::shared_ptr< SpatialLocationCalculatorConfig > initialConfig
Initial config to use when calculating spatial location data.
variable
Input inputConfig
Input SpatialLocationCalculatorConfig message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
variable
Input inputDetections
Input messages on which spatial location will be calculated. Possible datatypes are ImgDetections or Keypoints.
variable
Input inputDepth
Input message with depth data used to retrieve spatial information about detected object. Default queue is non-blocking with size 4.
variable
Output out
Outputs SpatialLocationCalculatorData message that carries spatial locations for each additional ROI that is specified in the config.
variable
Output outputDetections
Outputs SpatialImgDetections message that carries spatial locations along with original input data.
variable
Output passthroughDepth
Passthrough message on which the calculation was performed. Suitable for when input queue is set to non-blocking behavior.
function
SpatialLocationCalculator()
inline function
SpatialLocationCalculator(std::unique_ptr< Properties > props)
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on device.
function
bool runOnHost()
Check if the node is set to run on host
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::StereoDepth

#include StereoDepth.hpp
using
MedianFilter = dai::StereoDepthConfig::MedianFilter
variable
std::shared_ptr< StereoDepthConfig > initialConfig
Initial config to use for StereoDepth.
variable
Input inputConfig
Input StereoDepthConfig message with ability to modify parameters in runtime.
variable
Input inputAlignTo
Input align to message. Default queue is non-blocking with size 1.
variable
Input left
Input for left ImgFrame of left-right pair
variable
Input right
Input for right ImgFrame of left-right pair
variable
Output depth
Outputs ImgFrame message that carries RAW16 encoded (0..65535) depth data in depth units (millimeter by default).Non-determined / invalid depth values are set to 0
variable
Output disparity
Outputs ImgFrame message that carries RAW8 / RAW16 encoded disparity data: RAW8 encoded (0..95) for standard mode; RAW8 encoded (0..190) for extended disparity mode; RAW16 encoded for subpixel disparity mode:
  • 0..760 for 3 fractional bits (by default)
  • 0..1520 for 4 fractional bits
  • 0..3040 for 5 fractional bits
variable
Output syncedLeft
Passthrough ImgFrame message from 'left' Input.
variable
Output syncedRight
Passthrough ImgFrame message from 'right' Input.
variable
Output rectifiedLeft
Outputs ImgFrame message that carries RAW8 encoded (grayscale) rectified frame data.
variable
Output rectifiedRight
Outputs ImgFrame message that carries RAW8 encoded (grayscale) rectified frame data.
variable
Output outConfig
Outputs StereoDepthConfig message that contains current stereo configuration.
variable
Output debugDispLrCheckIt1
Outputs ImgFrame message that carries left-right check first iteration (before combining with second iteration) disparity map. Useful for debugging/fine tuning.
variable
Output debugDispLrCheckIt2
Outputs ImgFrame message that carries left-right check second iteration (before combining with first iteration) disparity map. Useful for debugging/fine tuning.
variable
Output debugExtDispLrCheckIt1
Outputs ImgFrame message that carries extended left-right check first iteration (downscaled frame, before combining with second iteration) disparity map. Useful for debugging/fine tuning.
variable
Output debugExtDispLrCheckIt2
Outputs ImgFrame message that carries extended left-right check second iteration (downscaled frame, before combining with first iteration) disparity map. Useful for debugging/fine tuning.
variable
Output debugDispCostDump
Outputs ImgFrame message that carries cost dump of disparity map. Useful for debugging/fine tuning.
variable
Output confidenceMap
Outputs ImgFrame message that carries RAW8 confidence map. Lower values mean lower confidence of the calculated disparity value. RGB alignment, left-right check or any postprocessing (e.g., median filter) is not performed on confidence map.
function
StereoDepth()
inline function
std::shared_ptr< StereoDepth > build(Node::Output & left, Node::Output & right, PresetMode presetMode)
function
std::shared_ptr< StereoDepth > build(bool autoCreateCameras, PresetMode presetMode, const std::pair< int, int > & size, std::optional< float > fps)
Create StereoDepth node. Note that this API is global and if used autocreated cameras can't be reused.
Parameters
  • autoCreateCameras: If true, will create left and right nodes if they don't exist
  • presetMode: Preset mode for stereo depth
function
void loadMeshFiles(const std::filesystem::path & pathLeft, const std::filesystem::path & pathRight)
Specify local filesystem paths to the mesh calibration files for 'left' and 'right' inputs.When a mesh calibration is set, it overrides the camera intrinsics/extrinsics matrices. Overrides useHomographyRectification behavior. Mesh format: a sequence of (y,x) points as 'float' with coordinates from the input image to be mapped in the output. The mesh can be subsampled, configured by setMeshStep.With a 1280x800 resolution and the default (16,16) step, the required mesh size is:width: 1280 / 16 + 1 = 81height: 800 / 16 + 1 = 51
function
void loadMeshData(const std::vector< std::uint8_t > & dataLeft, const std::vector< std::uint8_t > & dataRight)
Specify mesh calibration data for 'left' and 'right' inputs, as vectors of bytes. Overrides useHomographyRectification behavior. See loadMeshFiles for the expected data format
function
void setMeshStep(int width, int height)
Set the distance between mesh points. Default: (16, 16)
function
void setInputResolution(int width, int height)
Specify input resolution sizeOptional if MonoCamera exists, otherwise necessary
function
void setInputResolution(const std::tuple< int, int > & resolution)
Specify input resolution sizeOptional if MonoCamera exists, otherwise necessary
function
void setOutputSize(int width, int height)
Specify disparity/depth output resolution size, implemented by scaling.Currently only applicable when aligning to RGB camera
function
void setOutputKeepAspectRatio(bool keep)
Specifies whether the frames resized by setOutputSize should preserve aspect ratio, with potential cropping when enabled. Default true
function
void setDepthAlign(Properties::DepthAlign align)
Parameters
  • align: Set the disparity/depth alignment: centered (between the 'left' and 'right' inputs), or from the perspective of a rectified output stream
function
void setDepthAlign(CameraBoardSocket camera)
Parameters
  • camera: Set the camera from whose perspective the disparity/depth will be aligned
function
void setRectification(bool enable)
Rectify input images or not.
function
void setLeftRightCheck(bool enable)
Computes and combines disparities in both L-R and R-L directions, and combine them.For better occlusion handling, discarding invalid disparity values
function
void setSubpixel(bool enable)
Computes disparity with sub-pixel interpolation (3 fractional bits by default).Suitable for long range. Currently incompatible with extended disparity
function
void setSubpixelFractionalBits(int subpixelFractionalBits)
Number of fractional bits for subpixel mode. Default value: 3. Valid values: 3,4,5. Defines the number of fractional disparities: 2^x. Median filter postprocessing is supported only for 3 fractional bits.
function
void setExtendedDisparity(bool enable)
Disparity range increased from 0-95 to 0-190, combined from full resolution and downscaled images.Suitable for short range objects. Currently incompatible with sub-pixel disparity
function
void setRectifyEdgeFillColor(int color)
Fill color for missing data at frame edges
Parameters
  • color: Grayscale 0..255, or -1 to replicate pixels
function
void setRuntimeModeSwitch(bool enable)
Enable runtime stereo mode switch, e.g. from standard to LR-check. Note: when enabled resources allocated for worst case to enable switching to any mode.
function
void setNumFramesPool(int numFramesPool)
Specify number of frames in pool.
Parameters
  • numFramesPool: How many frames should the pool have
function
void setPostProcessingHardwareResources(int numShaves, int numMemorySlices)
Specify allocated hardware resources for stereo depth. Suitable only to increase post processing runtime.
Parameters
  • numShaves: Number of shaves.
  • numMemorySlices: Number of memory slices.
function
void setDefaultProfilePreset(PresetMode mode)
Sets a default preset based on specified option.
Parameters
  • mode: Stereo depth preset mode
Warning
If using alpha scaling on RVC4 the DEFAULT, DENSITY, and FAST_DENSITY presets can produce inaccurate depth in black padded regions, as they prioritize coverage.
function
void useHomographyRectification(bool useHomographyRectification)
Use 3x3 homography matrix for stereo rectification instead of sparse mesh generated on device. Default behaviour is AUTO, for lenses with FOV over 85 degrees sparse mesh is used, otherwise 3x3 homography. If custom mesh data is provided through loadMeshData or loadMeshFiles this option is ignored.
Parameters
  • useHomographyRectification: true: 3x3 homography matrix generated from calibration data is used for stereo rectification, can't correct lens distortion. false: sparse mesh is generated on-device from calibration data with mesh step specified with setMeshStep (Default: (16, 16)), can correct lens distortion. Implementation for generating the mesh is same as opencv's initUndistortRectifyMap function. Only the first 8 distortion coefficients are used from calibration data.
function
void enableDistortionCorrection(bool enableDistortionCorrection)
Equivalent to useHomographyRectification(!enableDistortionCorrection)
function
void setFrameSync(bool enableFrameSync)
Whether to enable frame syncing inside stereo node or not. Suitable if inputs are known to be synced.
function
void setBaseline(float baseline)
Override baseline from calibration. Used only in disparity to depth conversion. Units are centimeters.
function
void setFocalLength(float focalLength)
Override focal length from calibration. Used only in disparity to depth conversion. Units are pixels.
function
void setDisparityToDepthUseSpecTranslation(bool specTranslation)
Use baseline information for disparity to depth conversion from specs (design data) or from calibration. Default: true
function
void setRectificationUseSpecTranslation(bool specTranslation)
Obtain rectification matrices using spec translation (design data) or from calibration in calculations. Should be used only for debugging. Default: false
function
void setDepthAlignmentUseSpecTranslation(bool specTranslation)
Use baseline information for depth alignment from specs (design data) or from calibration. Default: true
function
void setAlphaScaling(float alpha)
Free scaling parameter between 0 (when all the pixels in the undistorted image are valid) and 1 (when all the source image pixels are retained in the undistorted image). On some high distortion lenses, and/or due to rectification (image rotated) invalid areas may appear even with alpha=0, in these cases alpha < 0.0 helps removing invalid areas. See getOptimalNewCameraMatrix from opencv for more details.
enum

std::uint32_t PresetMode

Preset modes for stereo depth.
enumerator
FAST_ACCURACY
DeprecatedThis mode is deprecated and will be removed in a future release. Prefers accuracy over density. More invalid depth values, but less outliers. This mode does not turn on any post-processing and is light on resources.
enumerator
FAST_DENSITY
DeprecatedThis mode is deprecated and will be removed in a future release. Prefers density over accuracy. Less invalid depth values, but more outliers. This mode does not turn on any post-processing and is light on resources.
enumerator
DEFAULT
enumerator
FACE
enumerator
HIGH_DETAIL
enumerator
ROBOTICS
enumerator
DENSITY
enumerator
ACCURACY
class

dai::node::Sync

#include Sync.hpp
using
TimestampSource = SyncProperties::TimestampSource
variable
InputMap inputs
A map of inputs
variable
Output out
Output message of type MessageGroup
function
void setSyncThreshold(std::chrono::nanoseconds syncThreshold)
Set the maximal interval between messages in the group
Parameters
  • syncThreshold: Maximal interval between messages in the group
function
void setSyncAttempts(int syncAttempts)
Set the number of attempts to get the specified max interval between messages in the group
Parameters
  • syncAttempts: Number of attempts to get the specified max interval between messages in the group:
    • if syncAttempts = 0 then the node sends a message as soon at the group is filled
    • if syncAttempts > 0 then the node will make syncAttemts attempts to synchronize before sending out a message
    • if syncAttempts = -1 (default) then the node will only send a message if successfully synchronized
function
void setProcessor(ProcessorType type)
Specify on which processor the node should run. RVC2 only.
Parameters
  • type: Processor type - Leon CSS or Leon MSS
function
ProcessorType getProcessor()
Get on which processor the node should run
Returns
Processor type - Leon CSS or Leon MSS
function
void setTimestampSource(TimestampSource source)
Specify the timestamp source
function
TimestampSource getTimestampSource()
Get the timestamp source
function
std::chrono::nanoseconds getSyncThreshold()
Gets the maximal interval between messages in the group in milliseconds
function
int getSyncAttempts()
Gets the number of sync attempts
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on device.
function
bool runOnHost()
Check if the node is set to run on host
function
void buildStage1()
Validates the timestamp source when inputs come from more than one device.
function
void run()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::SystemLogger

#include SystemLogger.hpp
variable
Output out
Outputs SystemInformation[RVC4] message that carries various system information like memory and CPU usage, temperatures, ... For series 2 devices output SystemInformation message, for series 4 devices output SystemInformationRVC4 message
function
void setRate(float hz)
Specify logging rate, at which messages will be sent out
Parameters
  • hz: Sending rate in hertz (messages per second)
function
float getRate()
Gets logging rate, at which messages will be sent out
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::Thermal

#include Thermal.hpp
variable
std::shared_ptr< ThermalConfig > initialConfig
Initial config to use for thermal sensor.
variable
Input inputConfig
Input ThermalConfig message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
variable
Output temperature
Outputs FP16 (degC) thermal image.
variable
Output color
Outputs YUV422i grayscale thermal image.
function
Thermal()
function
Thermal(std::unique_ptr< Properties > props)
function
std::shared_ptr< Thermal > build(dai::CameraBoardSocket boardSocket, float fps)
Build with a specific board socket and fps.
function
CameraBoardSocket getBoardSocket()
Retrieves which board socket to use
Returns
Board socket to use
function
void setFps(float fps)
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::ToFBase

#include ToF.hpp
variable
std::shared_ptr< ToFConfig > initialConfig
Initial config to use for feature tracking.
variable
Input inputConfig
Input ToFConfig message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
variable
Output depth
variable
Output amplitude
variable
Output intensity
variable
Output confidence
variable
Output phase
variable
Output raw
function
ToFBase()
function
ToFBase(std::unique_ptr< Properties > props)
function
std::shared_ptr< ToFBase > build(dai::CameraBoardSocket boardSocket, ToFConfig::Profile profile, std::optional< float > fps)
Build with a specific board socket
function
CameraBoardSocket getBoardSocket()
Retrieves which board socket to use
Returns
Board socket to use
function
std::shared_ptr< ToFBase > setOutputUndistortion(bool enable)
Enable or disable undistortion for depth and auxiliary outputs.
Parameters
  • enable: Whether to undistort the outputs.
Note
Undistortion is supported on RVC4. RVC2 logs a warning and leaves outputs unchanged.
Returns
This ToF base node.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::ToF

variable
Subnode< ToFBase > tofBase
variable
Output & rawDepth
Raw depth output from ToF sensor. On RVC2 this is connected to the unfiltered base depth output. On RVC4 this is an unconnected placeholder output.
variable
Output & depth
Filtered depth output
variable
Output & amplitude
Amplitude output
variable
Output & intensity
Intensity output
variable
Output & confidence
Confidence output
variable
Output & phase
Phase output
variable
Output & raw
Raw data coming from the sensor
variable
Input & inputConfig
Runtime ToFConfig input for the ToF base node (decoder on RVC2, IPP on RVC4).RVC4: directly reconfigures the IPP that produces depth. RVC2: reconfigures the decoder that feeds the host ImageFilters. The host-filter stage that actually produces depth is NOT controlled here — to retune the host filters at runtime send an ImageFiltersConfig to imageFiltersInputConfig.
variable
Input & tofBaseInputConfig
Input config for ToF base node
variable
Input * imageFiltersInputConfig
Input config for image filters
variable
ToFBase & tofBaseNode
ToF base node
variable
ImageFilters * imageFiltersNode
Image filters node
inline function
ToF()
function
ToF(const std::shared_ptr< Device > & device)
function
~ToF()
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
function
std::shared_ptr< ToF > build(dai::CameraBoardSocket boardSocket, dai::ImageFiltersPresetMode presetMode, std::optional< float > fps)
Build the ToF node with a specific board socket, legacy preset mode, and optional FPS.
Parameters
  • boardSocket: Board socket to use, or AUTO to select an available ToF socket automatically
  • presetMode: Legacy ToF image filter preset mode
  • fps: Requested ToF camera FPS
function
std::shared_ptr< ToF > build(dai::CameraBoardSocket boardSocket, dai::ToFConfig::Profile presetMode, std::optional< float > fps)
Build the ToF node with a specific board socket, profile, and optional FPS.
Parameters
  • boardSocket: Board socket to use, or AUTO to select an available ToF socket automatically
  • presetMode: ToF processing profile to apply
  • fps: Requested ToF camera FPS
function
std::shared_ptr< ToF > setOutputUndistortion(bool enable)
Enable or disable undistortion for depth and auxiliary outputs.
Parameters
  • enable: Whether to undistort the outputs.
Note
Undistortion is supported on RVC4. RVC2 logs a warning and leaves outputs unchanged.
Returns
This ToF node.
function
void postBuildStage()
class

dai::node::UVC

#include UVC.hpp
variable
Input input
Input for image frames to be streamed over UVC Default queue is blocking with size 8
function
UVC()
function
UVC(std::unique_ptr< Properties > props)
function
~UVC()
function
void setGpiosOnInit(const std::unordered_map< int, int > & list)
Set GPIO list <gpio_number, value> for GPIOs to set (on/off) at init.
function
void setGpiosOnStreamOn(const std::unordered_map< int, int > & list)
Set GPIO list <gpio_number, value> for GPIOs to set when streaming is enabled.
function
void setGpiosOnStreamOff(const std::unordered_map< int, int > & list)
Set GPIO list <gpio_number, value> for GPIOs to set when streaming is disabled.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::VideoEncoder

#include VideoEncoder.hpp
variable
Input input
Input for NV12 ImgFrame to be encoded
variable
Output bitstream
Outputs ImgFrame message that carries BITSTREAM encoded (MJPEG, H264 or H265) frame data. Mutually exclusive with out.
variable
Output out
Outputs EncodedFrame message that carries encoded (MJPEG, H264 or H265) frame data. Mutually exclusive with bitstream.
function
std::shared_ptr< VideoEncoder > build(Node::Output & input)
function
void setDefaultProfilePreset(float fps, Properties::Profile profile)
Sets a default preset based on specified frame rate and profile
Parameters
  • fps: Frame rate in frames per second
  • profile: Encoding profile
function
void setNumFramesPool(int frames)
Set number of frames in pool
Parameters
  • frames: Number of pool frames
function
int getNumFramesPool()
Get number of frames in pool
Returns
Number of pool frames
function
void setRateControlMode(Properties::RateControlMode mode)
Set rate control mode.
function
void setProfile(Properties::Profile profile)
Set encoding profile.
function
void setBitrate(int bitrate)
Set output bitrate in bps, for CBR rate control mode. 0 for auto (based on frame size and FPS)
function
void setBitrateKbps(int bitrateKbps)
Set output bitrate in kbps, for CBR rate control mode. 0 for auto (based on frame size and FPS)
function
void setKeyframeFrequency(int freq)
Set keyframe frequency. Every Nth frame a keyframe is inserted.Applicable only to H264 and H265 profilesExamples:
  • 30 FPS video, keyframe frequency: 30. Every 1s a keyframe will be inserted
  • 60 FPS video, keyframe frequency: 180. Every 3s a keyframe will be inserted
function
void setNumBFrames(int numBFrames)
Set number of B frames to be inserted.
function
void setQuality(int quality)
Set quality
Parameters
  • quality: Value between 0-100%. Approximates quality
function
void setLossless(bool lossless)
Set lossless mode. Applies only to [M]JPEG profile
Parameters
  • lossless: True to enable lossless jpeg encoding, false otherwise
function
void setFrameRate(float frameRate)
Sets expected frame rate
Parameters
  • frameRate: Frame rate in frames per second
function
void setMaxOutputFrameSize(int maxFrameSize)
Specifies maximum output encoded frame size
function
Properties::RateControlMode getRateControlMode()
Get rate control mode.
function
Properties::Profile getProfile()
Get profile.
function
int getBitrate()
Get bitrate in bps.
function
int getBitrateKbps()
Get bitrate in kbps.
function
int getKeyframeFrequency()
Get keyframe frequency.
function
int getNumBFrames()
Get number of B frames.
function
int getQuality()
Get quality.
function
float getFrameRate()
Get frame rate.
function
bool getLossless()
Get lossless mode. Applies only when using [M]JPEG profile.
function
int getMaxOutputFrameSize()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::Vpp

#include Vpp.hpp
variable
std::shared_ptr< VppConfig > initialConfig
Initial config to use for VPP.
variable
variable
Input syncedInputs
Synchronised left and right images with either disparity or depth, and optional confidence.
variable
const std::string leftInputName
variable
const std::string rightInputName
variable
const std::string disparityName
variable
const std::string depthName
variable
const std::string confidenceName
variable
Input & left
Input for left rectified ImgFrame
variable
Input & right
Input for right rectified ImgFrame
variable
Input & disparity
Low resolution disparity in pixels (in integers - 16 times bigger)
variable
Input & depth
Depth input, used instead of disparity. Expects RAW16 millimetres aligned to the full rectified left image, with stereo intrinsics and extrinsics on the image frames. Requires RVC4 firmware with VPP depth-input support.
variable
Input & confidence
Confidence of the dispatiry (in integers - 16 times bigger).
variable
Input inputConfig
variable
Output leftOut
Output ImgFrame message that carries the processed left image with virtual projection pattern applied.
variable
Output rightOut
Output ImgFrame message that carries the processed right image with virtual projection pattern applied.
function
Vpp()
function
Vpp(std::unique_ptr< Properties > props)
function
~Vpp()
function
std::shared_ptr< Vpp > build(Output & leftInput, Output & rightInput, Output & disparityInput, Output & confidenceInput)
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
function
void buildStage1()
Detect direct MessageGroup producers before pipeline transport bridges are inserted.
function
void postBuildStage()
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::Warp

#include Warp.hpp
variable
Input inputImage
Input image to be modified Default queue is blocking with size 8
variable
Output out
Outputs ImgFrame message that carries warped image.
function
void setOutputSize(const std::tuple< int, int > & size)
Sets output frame size in pixels
Parameters
  • size: width and height in pixels
function
void setOutputSize(int width, int height)
function
void setWarpMesh(const std::vector< Point2f > & meshData, int width, int height)
Set a custom warp mesh
Parameters
  • meshData: 2D plane of mesh points, starting from top left to bottom right
  • width: Width of mesh
  • height: Height of mesh
function
void setWarpMesh(const std::vector< std::pair< float, float >> & meshData, int width, int height)
function
void setNumFramesPool(int numFramesPool)
Specify number of frames in pool.
Parameters
  • numFramesPool: How many frames should the pool have
function
void setMaxOutputFrameSize(int maxFrameSize)
Specify maximum size of output image.
Parameters
  • maxFrameSize: Maximum frame size in bytes
function
void setHwIds(const std::vector< int > & ids)
Specify which hardware warp engines to use
Parameters
  • ids: Which warp engines to use (0, 1, 2)
function
std::vector< int > getHwIds()
Retrieve which hardware warp engines to use.
function
void setInterpolation(dai::Interpolation interpolation)
Specify which interpolation method to use
Parameters
  • interpolation: type of interpolation
function
dai::Interpolation getInterpolation()
Retrieve which interpolation method to use.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::Display

variable
Input input
explicit function
Display(std::string name)
function
void run()
class

dai::node::HostCamera

variable
Output out
function
void run()
class

dai::node::HostNode

variable
InputMap & inputs
variable
Output out
function
std::shared_ptr< Buffer > processGroup(std::shared_ptr< dai::MessageGroup > in)
inline function
void sendProcessingToPipeline(bool send)
Send processing to pipeline. If set to true, it's important to call pipeline.run() in the main thread or pipeline.processTasks() in the main thread. Otherwise, if set to false, such action is not needed.
inline function
void runSyncingOnHost()
inline function
void runSyncingOnDevice()
class

dai::node::RGBD

#include RGBD.hpp
variable
variable
InputMap & inputs
variable
std::string colorInputName
variable
std::string depthInputName
variable
Input & inColor
variable
Input & inDepth
variable
Output pcl
Output point cloud.
variable
Output rgbd
Output RGBD frames.
function
RGBD()
function
~RGBD()
function
std::shared_ptr< RGBD > build()
function
std::shared_ptr< RGBD > build(bool autocreate, StereoDepth::PresetMode mode, const std::pair< int, int > & frameSize, std::optional< float > fps)
Build RGBD node with specified size. Note that this API is global and if used autocreated cameras can't be reused.
Parameters
  • autocreate: If true, will create color and depth nodes if they don't exist.
  • frameSize: Size of the frames
function
std::shared_ptr< RGBD > build(const std::shared_ptr< Camera > & camera, const DepthSource & depthSource, const std::pair< int, int > & frameSize, std::optional< float > fps)
Build RGBD node with camera and depth source node.
Parameters
function
void setDepthUnit(StereoDepthConfig::AlgorithmControl::DepthUnit depthUnit)
function
void useCPU()
Use single-threaded CPU for processing.
function
void useCPUMT(uint32_t numThreads)
Use multi-threaded CPU for processing.
Parameters
  • numThreads: Number of threads to use
function
void useGPU(uint32_t device)
Use GPU for processing (needs to be compiled with Kompute support)
Parameters
  • device: GPU device index
function
void printDevices()
Print available GPU devices.
function
void buildInternal()
class

dai::node::RecordVideo

#include Record.hpp
using
CompressionLevel = dai::RecordConfig::CompressionLevel
variable
Input input
Input for ImgFrame or EncodedFrame messages to be recordedDefault queue is blocking with size 15
function
void run()
function
std::filesystem::path getRecordMetadataFile()
function
std::filesystem::path getRecordVideoFile()
function
CompressionLevel getCompressionLevel()
function
RecordVideo & setRecordMetadataFile(const std::filesystem::path & recordFile)
function
RecordVideo & setRecordVideoFile(const std::filesystem::path & recordFile)
function
RecordVideo & setCompressionLevel(CompressionLevel compressionLevel)
function
RecordVideo & setFps(unsigned int fps)
class

dai::node::RecordMetadataOnly

#include Record.hpp
using
CompressionLevel = dai::RecordConfig::CompressionLevel
variable
Input input
Input IMU messages to be recorded (will support other types in the future)Default queue is blocking with size 8
function
void run()
function
std::filesystem::path getRecordFile()
function
CompressionLevel getCompressionLevel()
function
RecordMetadataOnly & setRecordFile(const std::filesystem::path & recordFile)
function
RecordMetadataOnly & setCompressionLevel(CompressionLevel compressionLevel)
class

dai::node::ReplayVideo

#include Replay.hpp
variable
Output out
Output for any type of messages to be transferred over XLink streamDefault queue is blocking with size 8
function
void run()
function
std::filesystem::path getReplayMetadataFile()
function
std::filesystem::path getReplayVideoFile()
function
ImgFrame::Type getOutFrameType()
function
std::tuple< int, int > getSize()
function
float getFps()
function
bool getLoop()
function
ReplayVideo & setReplayMetadataFile(const std::filesystem::path & replayFile)
function
ReplayVideo & setReplayVideoFile(const std::filesystem::path & replayVideo)
function
ReplayVideo & setOutFrameType(ImgFrame::Type outFrameType)
function
ReplayVideo & setSize(std::tuple< int, int > size)
function
ReplayVideo & setSize(int width, int height)
function
ReplayVideo & setFps(float fps)
function
ReplayVideo & setLoop(bool loop)
class

dai::node::ReplayMetadataOnly

#include Replay.hpp
variable
Output out
Output for any type of messages to be transferred over XLink streamDefault queue is blocking with size 8
function
void run()
function
std::filesystem::path getReplayFile()
function
float getFps()
function
bool getLoop()
function
ReplayMetadataOnly & setReplayFile(const std::filesystem::path & replayFile)
function
ReplayMetadataOnly & setFps(float fps)
function
ReplayMetadataOnly & setLoop(bool loop)
class

dai::node::PipelineStateMerge

#include PipelineStateMerge.hpp
variable
Input inputDevice
variable
Input inputHost
variable
Input request
Input PipelineEventAggregationConfig message with state request parameters
variable
Output outRequest
Output PipelineEventAggregationConfig message with state request parameters
variable
Output out
Output message of type
function
std::shared_ptr< PipelineStateMerge > build(bool hasDeviceNodes, bool hasHostNodes)
function
PipelineStateMerge & setAllowConfiguration(bool allow)
True by default. Set to false when the node should only wait for states and not for configuration inputs. Used for merging trace outputs.
function
void run()
class

dai::node::RTABMapSLAM

#include RTABMapSLAM.hpp
variable
variable
InputMap & inputs
variable
std::string rectInputName
variable
std::string depthInputName
variable
std::string featuresInputName
variable
Input & rect
Input rectified image on which SLAM is performed.
variable
Input & depth
Input depth image on which SLAM is performed.
variable
Input features
Input tracked features on which SLAM is performed (optional).
variable
Input odom
Input odometry pose.
variable
Output transform
Output transform.
variable
Output odomCorrection
Output odometry correction (map to odom).
variable
Output obstaclePCL
Output obstacle point cloud.
variable
Output groundPCL
Output ground point cloud.
variable
Output occupancyGridMap
Output occupancy grid map.
variable
Output passthroughRect
Output passthrough rectified image.
variable
Output passthroughDepth
Output passthrough depth image.
variable
Output passthroughFeatures
Output passthrough features.
variable
Output passthroughOdom
Output passthrough odometry pose.
function
RTABMapSLAM()
function
~RTABMapSLAM()
function
void setParams(const std::map< std::string, std::string > & params)
Set RTABMap parameters. For the list of all parameters visithttps://github.com/introlab/rtabmap/blob/master/corelib/include/rtabmap/core/Parameters.h
inline function
void setDatabasePath(const std::string & path)
Set RTABMap database path. "/tmp/rtabmap.tmp.db" by default.
inline function
void setLoadDatabaseOnStart(bool load)
Whether to load the database on start. False by default.
inline function
void setSaveDatabaseOnClose(bool save)
Whether to save the database on close. False by default.
function
void saveDatabase()
inline function
void setSaveDatabasePeriodically(bool save)
Whether to save the database periodically. False by default.
inline function
void setSaveDatabasePeriod(double interval)
Set the interval at which the database is saved. 30.0s by default.
function
void setPublishObstacleCloud(bool publish)
Whether to publish the obstacle point cloud. True by default.
function
void setPublishGroundCloud(bool publish)
Whether to publish the ground point cloud. True by default.
function
void setPublishGrid(bool publish)
Whether to publish the ground point cloud. True by default.
inline function
void setFreq(float f)
Set the frequency at which the node processes data. 1Hz by default.
inline function
void setAlphaScaling(float alpha)
Set the alpha scaling factor for the camera model.
function
void setUseFeatures(bool use)
Whether to use input features for SLAM. False by default.
function
void setLocalTransform(std::shared_ptr< TransformData > transform)
function
std::shared_ptr< TransformData > getLocalTransform()
function
void triggerNewMap()
Trigger a new map.
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
class

dai::node::RTABMapVIO

#include RTABMapVIO.hpp
variable
std::string rectInputName
variable
std::string depthInputName
variable
std::string featuresInputName
variable
variable
InputMap & inputs
variable
Input & rect
Input rectified image on which VIO is performed.
variable
Input & depth
Input depth image on which VIO is performed.
variable
Input features
Input tracked features on which VIO is performed (optional).
variable
Input imu
Input IMU data.
variable
Output transform
Output odometry.
variable
Output passthroughRect
Passthrough rectified frame.
variable
Output passthroughDepth
Passthrough depth frame.
variable
Output passthroughFeatures
Passthrough features.
function
RTABMapVIO()
function
~RTABMapVIO()
function
void setParams(const std::map< std::string, std::string > & params)
Set RTABMap parameters.
function
void setUseFeatures(bool use)
Whether to use input features or calculate them internally.
function
void setLocalTransform(std::shared_ptr< TransformData > transform)
function
void reset(std::shared_ptr< TransformData > transform)
Reset Odometry.
function
void buildInternal()
namespace

dai::node::internal

using
XLinkInProperties = ::dai::internal::XLinkInProperties
using
XLinkOutProperties = ::dai::internal::XLinkOutProperties
struct

dai::node::internal::XLinkInBridge

#include Node.hpp
variable
std::shared_ptr< dai::node::internal::XLinkOutHost > xLinkOutHost
variable
std::shared_ptr< dai::node::internal::XLinkIn > xLinkIn
struct

dai::node::internal::XLinkOutBridge

#include Node.hpp
variable
std::shared_ptr< dai::node::internal::XLinkOut > xLinkOut
variable
std::shared_ptr< dai::node::internal::XLinkInHost > xLinkInHost
class

dai::node::internal::PipelineEventAggregation

#include PipelineEventAggregation.hpp
variable
InputMap inputs
A map of inputs
variable
Input request
Input PipelineEventAggregationConfig message with state request parameters
variable
Output out
Output message of type PipelineState
variable
Output outTrace
Continuous output message of type PipelineState
function
void setRunOnHost(bool runOnHost)
Specify whether to run on host or device By default, the node will run on device.
function
bool runOnHost()
Check if the node is set to run on host
function
void run()
function
PipelineEventAggregation & setTraceOutput(bool enable)
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::internal::XLinkIn

#include XLinkIn.hpp
variable
Output out
Outputs message of same type as send from host.
function
~XLinkIn()
function
void setStreamName(const std::string & name)
Specifies XLink stream name to use.The name should not start with double underscores '__', as those are reserved for internal use.
Parameters
  • name: Stream name
function
void setMaxDataSize(std::uint32_t maxDataSize)
Set maximum message size it can receive
Parameters
  • maxDataSize: Maximum size in bytes
function
void setNumFrames(std::uint32_t numFrames)
Set number of frames in pool for sending messages forward
Parameters
  • numFrames: Maximum number of frames in pool
function
std::string getStreamName()
Get stream name.
function
std::uint32_t getMaxDataSize()
Get maximum messages size in bytes.
function
std::uint32_t getNumFrames()
Get number of frames in pool.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::internal::XLinkInHost

variable
Output out
function
void setStreamName(const std::string & name)
function
void setConnection(std::shared_ptr< XLinkConnection > conn)
function
void disconnect()
function
void run()
class

dai::node::internal::XLinkOut

#include XLinkOut.hpp
variable
Input input
Input for any type of messages to be transferred over XLink streamDefault queue is blocking with size 8
function
void setStreamName(const std::string & name)
Specifies XLink stream name to use.The name should not start with double underscores '__', as those are reserved for internal use.
Parameters
  • name: Stream name
function
void setFpsLimit(float fps)
Specifies a message sending limit. It's approximated from specified rate.
Parameters
  • fps: Approximate rate limit in messages per second
function
void setMetadataOnly(bool metadataOnly)
Specify whether to transfer only messages attributes and not buffer data
function
void setPacketSize(int packetSize)
function
void setBytesPerSecondLimit(int bytesPerSecondLimit)
function
std::string getStreamName()
Get stream name.
function
float getFpsLimit()
Get rate limit in messages per second.
function
bool getMetadataOnly()
Get whether to transfer only messages attributes and not buffer data.
function
int getPacketSize()
function
int getBytesPerSecondLimit()
function
void buildInternal()
Function called from within the create function to build the node. This function is useful for initialization, setting up inputs and outputs = stuff that cannot be perform in the constuctor.
inline function
DeviceNodeCRTP()
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props)
inline function
DeviceNodeCRTP(std::unique_ptr< Properties > props, bool confMode)
inline function
DeviceNodeCRTP(const std::shared_ptr< Device > & device, std::unique_ptr< Properties > props, bool confMode)
class

dai::node::internal::XLinkOutHost

variable
Input in
function
void setStreamName(const std::string & name)
function
void setConnection(std::shared_ptr< XLinkConnection > conn)
function
void allowStreamResize(bool allow)
function
void disconnect()
function
void run()
namespace

dai::node::test

class

dai::node::test::MyConsumer

#include MyConsumer.hpp
variable
Input input
Input for any type of messages to be transferred over XLink stream Default queue is blocking with size 8
inline function
void run()
class

dai::node::test::MyProducer

#include MyProducer.hpp
variable
Output out
Outputs message of same type as sent from host.
function
void run()
namespace

dai::proto

namespace

dai::proto::event

namespace

dai::utility

function
std::uint32_t checksum(const void * buffer, std::size_t size, uint32_t prevChecksum)
Simple hash function - djb2
Parameters
  • buffer: Pointer to buffer of data to hash
  • size: Size of buffer in bytes
  • prevChecksum: Previous checksum - useful for doing hash on blocks of data
function
std::uint32_t checksum(const void * buffer, std::size_t size)
Simple hash function - djb2
Parameters
  • buffer: Pointer to buffer of data to hash
  • size: Size of buffer in bytes
function
ImgFrame colorizeDepthFrame(const ImgFrame & frame, float minDepth, float maxDepth, cv::ColormapTypes colormap, bool useLog)
Colorize a single-channel depth frame into a BGR888i ImgFrame.If maxDepth is less than or equal to minDepth (e.g. both set to 0), the effective bounds are auto-computed from the 3rd and 95th percentiles of the finite positive (valid) depth values.
Parameters
  • frame: Input depth frame (single channel, e.g. RAW16/GRAYF16/GRAY8). Depth values are usually in millimeters.
  • minDepth: Lower depth bound in millimeters of the range to map to 0 (default: 300 mm).
  • maxDepth: Upper depth bound in millimeters of the range to map to 255 (default: 12000 mm).
  • colormap: OpenCV colormap to apply (default: COLORMAP_JET).
  • useLog: If true, apply logarithmic scaling before mapping to [0, 255].
Returns
New BGR888i ImgFrame containing the colorized depth image. Invalid (non-positive or non-finite) pixels are set to black.
function
cv::Mat colorizeDepthFrame(const cv::Mat & frame, float minDepth, float maxDepth, cv::ColormapTypes colormap, bool useLog)
Colorize a single-channel depth cv::Mat.If maxDepth is less than or equal to minDepth (e.g. both set to 0), the effective bounds are auto-computed from the 3rd and 95th percentiles of the finite positive (valid) depth values.
Parameters
  • frame: Input depth frame (single channel, e.g. CV_16U/CV_32F/CV_8U). Depth values are usually in millimeters.
  • minDepth: Lower depth bound in millimeters of the range to map to 0 (default: 300 mm).
  • maxDepth: Upper depth bound in millimeters of the range to map to 255 (default: 12000 mm).
  • colormap: OpenCV colormap to apply (default: COLORMAP_JET).
  • useLog: If true, apply logarithmic scaling before mapping to [0, 255].
Returns
BGR cv::Mat colorized depth image. Invalid (non-positive or non-finite) pixels are set to black.
function
std::vector< std::string > filenamesInArchive(const std::filesystem::path & archivePath)
Gets a list of filenames contained within an archive.
Parameters
  • archivePath: Path to the archive file to read
Returns
Vector of paths for the files within the archive
function
std::vector< uint8_t > readFileInArchive(const std::filesystem::path & archivePath, const std::string & fileInArchive)
Reads a single file from an archive into memory.
Parameters
  • archivePath: Path to the archive file to read
  • fileInArchive: Path of the file inside the archive
Returns
File contents as a byte vector
function
void archiveFiles(const std::filesystem::path & archivePath, const std::vector< std::filesystem::path > & filesOnDisk, const std::vector< std::string > & filesInArchive)
Creates a tar archive containing the specified files.
Parameters
  • archivePath: Path where the archive file will be created
  • filesOnDisk: Vector of paths to file on the host filesystem to include in the archive
  • filesInArchive: Vector of paths for the files within the archive
function
void archiveFilesCompressed(const std::filesystem::path & archivePath, const std::vector< std::filesystem::path > & filesOnDisk, const std::vector< std::string > & filesInArchive)
Creates a gzip-compressed tar archive containing the specified files.
Parameters
  • archivePath: Path where the archive file will be created
  • filesOnDisk: Vector of paths to file on the host filesystem to include in the archive
  • filesInArchive: Vector of paths for the files within the archive
function
void extractFiles(const std::filesystem::path & archivePath, const std::vector< std::string > & filesInArchive, const std::vector< std::filesystem::path > & filesOnDisk)
Extracts files from an archive, supports both compressed (e.g. tar.gz) and uncompressed (e.g. tar) archives.
Parameters
  • archivePath: Path to the archive file to extract from
  • filesInArchive: Vector of paths for the files within the archive to extract
  • filesOnDisk: Vector of paths where the extracted files should be written
function
RotatedRect getOuterRotatedRect(const std::vector< std::array< float, 2 >> & points)
inline function
bool serialize(const T & obj, std::vector< std::uint8_t > & data)
inline function
bool deserialize(const std::uint8_t * data, std::size_t size, T & obj)
inline function
bool serialize(const T & obj, std::vector< std::uint8_t > & data, SerializationType type)
inline function
std::vector< std::uint8_t > serialize(const T & obj, SerializationType type)
inline function
bool deserialize(const std::uint8_t * data, std::size_t size, T & obj, SerializationType type)
inline function
bool deserialize(const std::vector< std::uint8_t > & data, T & obj, SerializationType type)
inline function
std::vector< std::uint8_t > serialize(const T & obj)
inline function
bool deserialize(const std::vector< std::uint8_t > & data, T & obj)
inline function
bool serialize(const T & obj, std::vector< std::uint8_t > & data)
inline function
std::vector< std::uint8_t > serialize(const T & obj)
inline function
bool deserialize(const std::uint8_t * data, std::size_t size, T & obj)
inline function
bool deserialize(const std::vector< std::uint8_t > & data, T & obj)
function
std::string jsonDisplay(const nlohmann::json & json, int level, int indent)
enum

SendSnapCallbackStatus

enumerator
SUCCESS
enumerator
FILE_BATCH_PREPARATION_FAILED
enumerator
GROUP_CONTAINS_REJECTED_FILES
enumerator
FILE_UPLOAD_FAILED
enumerator
SEND_EVENT_FAILED
enumerator
EVENT_REJECTED
class

dai::utility::BinarySemaphore

#include BinarySemaphore.hpp
function
BinarySemaphore()
inline explicit function
BinarySemaphore(bool initiallyAvailable)
inline function
void release()
inline function
void acquire()
inline function
bool tryAcquire()
inline function
bool tryAcquireFor(const std::chrono::duration< Rep, Period > & timeout)
inline function
bool tryAcquireUntil(const std::chrono::time_point< Clock, Duration > & deadline)
class

dai::utility::CircularBuffer

#include CircularBuffer.hppDerived by dai::utility::WindowedAverageBuffer< T >
inline function
CircularBuffer(size_t size)
function
~CircularBuffer()
inline function
T & add(T value)
inline function
std::vector< T > getBuffer()
inline function
T first()
inline function
T last()
inline function
size_t size()
inline function
void clear()
inline function
T & at(size_t pos)
inline function
const T & at(size_t pos)
inline function
iterator begin()
inline function
iterator end()
inline function
inline function
class

dai::utility::CircularBuffer::iterator

using
iterator_category = std::forward_iterator_tag
using
value_type = T
using
difference_type = std::ptrdiff_t
using
pointer = T *
using
reference = T &
inline function
iterator(CircularBuffer * parent, size_t pos)
inline function
reference operator*()
inline function
pointer operator->()
inline function
iterator & operator++()
inline function
iterator operator++(int)
inline function
bool operator==(const iterator & other)
inline function
bool operator!=(const iterator & other)
class

dai::utility::CircularBuffer::reverse_iterator

using
iterator_category = std::bidirectional_iterator_tag
using
value_type = T
using
difference_type = std::ptrdiff_t
using
pointer = T *
using
reference = T &
inline function
reverse_iterator(CircularBuffer * parent, size_t pos)
inline function
reference operator*()
inline function
pointer operator->()
inline function
reverse_iterator & operator++()
inline function
reverse_iterator operator++(int)
inline function
bool operator==(const reverse_iterator & other)
inline function
bool operator!=(const reverse_iterator & other)
class

dai::utility::WindowedAverageBuffer

#include CircularBuffer.hpp
inline function
WindowedAverageBuffer(size_t size, T initialValue)
inline function
void onSwap(T & oldValue, T & newValue)
inline function
void onAdd(T & newValue)
inline function
T getAverage()
class

dai::utility::FileData

function
FileData(std::string data, std::string fileTag, std::string mimeType)
explicit function
FileData(std::filesystem::path filePath, std::string fileTag)
explicit function
FileData(const std::shared_ptr< ImgFrame > & imgFrame, std::string fileTag)
explicit function
FileData(const std::shared_ptr< EncodedFrame > & encodedFrame, std::string fileTag)
explicit function
FileData(const std::shared_ptr< ImgDetections > & imgDetections, std::string fileTag)
function
bool toFile(const std::filesystem::path & inputPath)
class

dai::utility::FileGroup

function
void addFile(std::string fileTag, std::string data, std::string mimeType)
function
void addFile(std::string fileTag, std::filesystem::path filePath)
function
void addFile(const std::optional< std::string > & fileTag, const std::shared_ptr< ImgFrame > & imgFrame)
function
void addFile(const std::optional< std::string > & fileTag, const std::shared_ptr< EncodedFrame > & encodedFrame)
function
void addFile(const std::optional< std::string > & fileTag, const std::shared_ptr< ImgDetections > & imgDetections)
function
void addImageDetectionsPair(const std::optional< std::string > & fileTag, const std::shared_ptr< ImgFrame > & imgFrame, const std::shared_ptr< ImgDetections > & imgDetections)
function
void addImageDetectionsPair(const std::optional< std::string > & fileTag, const std::shared_ptr< EncodedFrame > & encodedFrame, const std::shared_ptr< ImgDetections > & imgDetections)
struct

dai::utility::SendSnapCallbackResult

variable
std::string snapName
variable
int64_t snapTimestamp
variable
std::string snapLocalID
variable
std::optional< std::string > snapHubID
variable
std::string snapPayload
variable
SendSnapCallbackStatus uploadStatus
class

dai::utility::EventsManager

explicit function
EventsManager(std::string apiKey, bool uploadCachedOnStart)
inline explicit function
EventsManager(bool uploadCachedOnStart)
function
~EventsManager()
function
std::optional< std::string > sendEvent(const std::string & name, const std::vector< std::string > & tags, const std::unordered_map< std::string, std::string > & extras, const std::vector< std::string > & associateFiles)
Send an event to the events service
Parameters
  • name: Name of the event
  • tags: List of tags to send
  • extras: Extra data to send
  • associateFiles: List of associate files with ids
Returns
LocalID of the sent Event
function
std::optional< std::string > sendSnap(const std::string & name, const std::shared_ptr< FileGroup > fileGroup, const std::vector< std::string > & tags, const std::unordered_map< std::string, std::string > & extras, const std::function< void(SendSnapCallbackResult)> successCallback, const std::function< void(SendSnapCallbackResult)> failureCallback)
Send a snap to the events service. Snaps should be used for sending images and other files.
Parameters
  • name: Name of the snap
  • fileGroup: FileGroup containing FileData objects to send
  • tags: List of tags to send
  • extras: Extra data to send
  • successCallback: Callback to be called when the snap is successfully uploaded to the hub
  • failureCallback: Callback to be called if the snap upload is unsuccessful
Returns
LocalID of the sent Snap
function
std::optional< std::string > sendSnap(const std::string & name, const std::optional< std::string > & fileTag, const std::shared_ptr< ImgFrame > imgFrame, const std::optional< std::shared_ptr< ImgDetections >> & imgDetections, const std::vector< std::string > & tags, const std::unordered_map< std::string, std::string > & extras, const std::function< void(SendSnapCallbackResult)> successCallback, const std::function< void(SendSnapCallbackResult)> failureCallback)
Send a snap to the events service, with an ImgFrame and ImgDetections pair as files
Parameters
  • name: Name of the snap
  • fileTag: File tag used to create FileData
  • imgFrame: ImgFrame to send
  • imgDetections: ImgDetections to sent
  • tags: List of tags to send
  • extras: Extra data to send
  • successCallback: Callback to be called when the snap is successfully uploaded to the hub
  • failureCallback: Callback to be called if the snap upload is unsuccessful
Returns
LocalID of the sent Snap
function
bool waitForPendingUploads(uint64_t timeoutMs)
Wait for pending snaps/events to be processed by the background upload thread
Parameters
  • timeoutMs: Timeout in milliseconds. 0 means wait until uploads are finished, connection is dropped, or manager is stopped
Returns
true if the pending data was uploaded before timeout, false if not - either because of timeout, dropped connection, or shutdown
function
void setLogResponse(bool logResponse)
Set whether to log the responses from the server. By default, logResponse is set to false
Parameters
  • logResponse: bool
Returns
void
function
void setVerifySsl(bool verifySsl)
Set whether to verify the SSL certificate. By default, verifySsl is set to false
Parameters
  • verifySsl: bool
Returns
void
function
void setCacheDir(const std::string & cacheDir)
Set the cache directory for storing cached data. By default, the cache directory is set to /internal/private
Parameters
  • cacheDir: Cache directory
Returns
void
function
void setCacheIfCannotSend(bool cacheIfCannotSend)
Set whether to cache data if it cannot be sent. By default, cacheIfCannotSend is set to false
Parameters
  • cacheIfCannotSend: bool
Returns
void
class

dai::utility::PipelineEventDispatcher

function
PipelineEventDispatcher()
inline function
PipelineEventDispatcher(int64_t & nodeId, Node::Output * output)
function
void startEvent(PipelineEvent::Type type, const std::string & source, std::optional< uint32_t > queueSize)
function
void startInputEvent(const std::string & source, std::optional< uint32_t > queueSize)
function
void startOutputEvent(const std::string & source)
function
void startCustomEvent(const std::string & source)
function
void endEvent(PipelineEvent::Type type, const std::string & source, std::optional< uint32_t > queueSize)
function
void endInputEvent(const std::string & source, std::optional< uint32_t > queueSize)
function
void endOutputEvent(const std::string & source)
function
void endCustomEvent(const std::string & source)
function
void startTrackedEvent(PipelineEvent event, std::optional< std::chrono::time_point< std::chrono::steady_clock >> ts)
function
void startTrackedEvent(PipelineEvent::Type type, const std::string & source, int64_t sequenceNum, std::optional< std::chrono::time_point< std::chrono::steady_clock >> ts)
function
void endTrackedEvent(PipelineEvent event, std::optional< std::chrono::time_point< std::chrono::steady_clock >> ts)
function
void endTrackedEvent(PipelineEvent::Type type, const std::string & source, int64_t sequenceNum, std::optional< std::chrono::time_point< std::chrono::steady_clock >> ts)
function
void pingEvent(PipelineEvent::Type type, const std::string & source)
function
void pingMainLoopEvent()
function
void pingCustomEvent(const std::string & source)
function
void pingInputEvent(const std::string & source, PipelineEvent::Status status, std::optional< uint32_t > queueSize)
function
BlockPipelineEvent blockEvent(PipelineEvent::Type type, const std::string & source, std::optional< std::chrono::time_point< std::chrono::steady_clock >> ts, bool startNow)
function
BlockPipelineEvent inputBlockEvent(bool startNow)
function
BlockPipelineEvent outputBlockEvent(bool startNow)
function
BlockPipelineEvent customBlockEvent(const std::string & source, bool startNow)
class

dai::utility::PipelineEventDispatcherInterface

Derived by dai::utility::PipelineEventDispatcher
variable
bool sendEvents
function
~PipelineEventDispatcherInterface()
function
void startEvent(PipelineEvent::Type type, const std::string & source, std::optional< uint32_t > queueSize)
function
void startInputEvent(const std::string & source, std::optional< uint32_t > queueSize)
function
void startOutputEvent(const std::string & source)
function
void startCustomEvent(const std::string & source)
function
void endEvent(PipelineEvent::Type type, const std::string & source, std::optional< uint32_t > queueSize)
function
void endInputEvent(const std::string & source, std::optional< uint32_t > queueSize)
function
void endOutputEvent(const std::string & source)
function
void endCustomEvent(const std::string & source)
function
void startTrackedEvent(PipelineEvent event, std::optional< std::chrono::time_point< std::chrono::steady_clock >> ts)
function
void startTrackedEvent(PipelineEvent::Type type, const std::string & source, int64_t sequenceNum, std::optional< std::chrono::time_point< std::chrono::steady_clock >> ts)
function
void endTrackedEvent(PipelineEvent event, std::optional< std::chrono::time_point< std::chrono::steady_clock >> ts)
function
void endTrackedEvent(PipelineEvent::Type type, const std::string & source, int64_t sequenceNum, std::optional< std::chrono::time_point< std::chrono::steady_clock >> ts)
function
void pingEvent(PipelineEvent::Type type, const std::string & source)
function
void pingMainLoopEvent()
function
void pingCustomEvent(const std::string & source)
function
void pingInputEvent(const std::string & source, PipelineEvent::Status status, std::optional< uint32_t > queueSize)
function
BlockPipelineEvent blockEvent(PipelineEvent::Type type, const std::string & source, std::optional< std::chrono::time_point< std::chrono::steady_clock >> ts, bool startNow)
function
BlockPipelineEvent inputBlockEvent(bool startNow)
function
BlockPipelineEvent outputBlockEvent(bool startNow)
function
BlockPipelineEvent customBlockEvent(const std::string & source, bool startNow)
class

dai::utility::PipelineEventDispatcherInterface::BlockPipelineEvent

inline function
void start(std::optional< std::chrono::time_point< std::chrono::steady_clock >> ts)
inline function
BlockPipelineEvent(PipelineEventDispatcherInterface & dispatcher, PipelineEvent::Type type, const std::string & source, std::optional< std::chrono::time_point< std::chrono::steady_clock >> ts, bool startNow)
inline function
void end()
inline function
void cancel()
inline function
void setQueueSize(uint32_t qs)
inline function
void setEndTimestamp(std::chrono::time_point< std::chrono::steady_clock > ts)
inline function
~BlockPipelineEvent()
class

dai::utility::VectorWriter

inline function
VectorWriter(Args &&... args)
function
VectorWriter(const VectorWriter &)
function
VectorWriter & operator=(const VectorWriter &)
inline function
nop::Status< void > Prepare(std::size_t)
inline function
nop::Status< void > Write(std::uint8_t byte)
inline function
nop::Status< void > Write(const void * begin, const void * end)
inline function
nop::Status< void > Skip(std::size_t padding_bytes, std::uint8_t padding_value)
inline function
const std::vector< std::uint8_t > & ref()
inline function
std::vector< std::uint8_t > & ref()
inline function
std::vector< std::uint8_t > && take()
class

dai::utility::WaitAnyNotifier

#include WaitAnyNotifier.hpp
function
WaitAnyNotifier()
inline function
void notifyOne()
Notify the waiting thread Should always be called after any state change that the waiting thread is waiting for.
inline function
void wait(Pred pred)
Wait until notified If the predicate consists of multiple conditions connected by AND, it should be ensured that the state does not change between the conditions. This can be achieved either by using a mutex or by ensuring that the condition can only be made false by the waiting thread (e.g. notifying thread fills queues and the waiting thread empties them).
  • pred Predicate to check after each notification - IMPORTANT: must be thread-safe
inline function
bool waitFor(Pred pred, std::chrono::duration< Rep, Period > timeout)
Wait until notified or timeout occurs If the predicate consists of multiple conditions connected by AND, it should be ensured that the state does not change between the conditions. This can be achieved either by using a mutex or by ensuring that the condition can only be made false by the waiting thread (e.g. notifying thread fills queues and the waiting thread empties them).
  • pred Predicate to check after each notification - IMPORTANT: must be thread-safe