DepthAI C++ API
DepthAI 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
MedianFilterParams = dai::filters::params::MedianFilter
using
SpatialFilterParams = dai::filters::params::SpatialFilter
using
SpeckleFilterParams = dai::filters::params::SpeckleFilter
using
TemporalFilterParams = dai::filters::params::TemporalFilter
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)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)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)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)function
Platform string2platform(const std::string & platform)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)function
bool downloadModelsFromZoo(const fs::path & path, const fs::path & cacheDirectory, const std::string & apiKey, const std::string & progressFormat)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, 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)function
DEPTHAI_SERIALIZE_EXT(IMUReport, sequence, accuracy, timestamp, tsDevice)function
DEPTHAI_SERIALIZE_EXT(IMUReportAccelerometer, x, y, z, sequence, accuracy, timestamp, tsDevice)function
DEPTHAI_SERIALIZE_EXT(IMUReportGyroscope, x, y, z, sequence, accuracy, timestamp, tsDevice)function
DEPTHAI_SERIALIZE_EXT(IMUReportMagneticField, x, y, z, sequence, accuracy, timestamp, tsDevice)function
DEPTHAI_SERIALIZE_EXT(IMUReportRotationVectorWAcc, i, j, k, real, rotationVectorAccuracy, sequence, accuracy, timestamp, tsDevice)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(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(GateProperties, initialConfig)function
DEPTHAI_BEGIN_SUPPRESS_DEPRECATION_WARNING DEPTHAI_SERIALIZE_EXT(GlobalProperties, pipelineName, pipelineVersion)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, 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)function
DEPTHAI_SERIALIZE_EXT(SystemLoggerProperties, rateHz)function
DEPTHAI_SERIALIZE_EXT(ThermalProperties, initialConfig, numFramesPool, boardSocket, fps)function
DEPTHAI_SERIALIZE_EXT(ToFProperties, initialConfig, numFramesPool, numShaves, warpHwIds, 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(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
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
Which CameraModel to initialize the calibration with.
enumerator
Perspective
enumerator
Fisheye
enumerator
Equirectangular
enumerator
RadialDivision
enum
int32_t CameraSensorType
enumerator
AUTO
enumerator
COLOR
enumerator
MONO
enumerator
TOF
enumerator
THERMAL
enum
int32_t Colormap
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
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
Platform
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
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
COUNT
enum
std::uint32_t ImageFiltersPresetMode
enumerator
TOF_LOW_RANGE
enumerator
TOF_MID_RANGE
enumerator
TOF_HIGH_RANGE
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:
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]
Parameters
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
enumerator
LINEAR_ACCELERATION
Section 2.1.1Acceleration of the device with gravity removed. Units are [m/s^2]
enumerator
GRAVITY
Section 2.1.1Gravity. Units are [m/s^2]
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
enumerator
SHORT_TERM_IMAGELESS
enumerator
ZERO_TERM_IMAGELESS
enumerator
ZERO_TERM_COLOR_HISTOGRAM
enum
std::int32_t TrackerIdAssignmentPolicy
enumerator
UNIQUE_ID
enumerator
SMALLEST_ID
enum
LockingQueueState
enumerator
SUCCESS
enumerator
BLOCKED
enumerator
CANCELLED
enum
SerializationType
enumerator
LIBNOP
enumerator
JSON
enumerator
JSON_MSGPACK
class
dai::Capability
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
bool ispOutput
function
~ImgFrameCapability()function
DEPTHAI_SERIALIZE(ImgFrameCapability, size, fps, type, resizeMode, enableUndistortion, ispOutput)struct
dai::CameraSensorConfig
variable
std::int32_t width
variable
std::int32_t height
variable
float minFps
variable
float maxFps
variable
Rect fov
variable
CameraSensorType type
variable
bool hdr
variable
bool hfr
struct
dai::CameraFeatures
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
DEPTHAI_SERIALIZE(CameraFeatures, socket, sensorName, width, height, orientation, supportedTypes, hasAutofocusIC, hasAutofocus, name, additionalNames, configs, calibrationResolution)struct
dai::CameraInfo
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
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
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
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
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
variable
DetectionNetworkType nnFamily
variable
std::string subtype
variable
float confidenceThreshold
variable
YoloDecodingFamily decodingFamily
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
variable
float iouThreshold
variable
std::vector< dai::Edge > keypointEdges
variable
std::vector< std::string > keypointLabelNames
struct
dai::EepromData
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
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
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
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(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
Parameters
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
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
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
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
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)struct
dai::ImgTransformation
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(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(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 extrinsics to the source sensor.
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
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(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(std::array< std::array< float, 3 >, 3 > intrinsicMatrix)function
ImgTransformation & setDistortionModel(CameraModel model)function
ImgTransformation & setDistortionCoefficients(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
Parameters
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, 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
Parameters
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::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)
Parameters
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
Parameters
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
Parameters
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
Parameters
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
Returns
4x4 homogeneous transformation matrix representing the extrinsics from this transformation to the target transformation
Parameters
Both transformations must have a common toCameraSocket. 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
struct
dai::GyroscopeNoiseParams
struct
dai::ImuNoiseParameters
variable
std::string name
variable
AccelerometerNoiseParams accelerometer
variable
GyroscopeNoiseParams gyroscope
function
DEPTHAI_SERIALIZE(ImuNoiseParameters, name, accelerometer, gyroscope)struct
dai::ImuCalibrationParams
variable
ImuNoiseParameters noise
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)function
DEPTHAI_SERIALIZE(dai::Keypoint, imageCoordinates, confidence, label, labelName)struct
dai::KeypointsList
inline function
void setKeypoints(const std::vector< Point3f > & kps3)Sets the keypoints list.
Parameters
- keypoints: list of Point3f objects to set.
Parameters
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.
Parameters
This will clear any existing keypoints and edges.
function
DEPTHAI_SERIALIZE(KeypointsList, keypoints, edges)enum
KeypointsListT< Keypoint > Base
struct
dai::KeypointsListT
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.
Parameters
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.
Parameters
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
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
inline function
enum
KeypointT value_type
enum
typename std::vector< KeypointT >::iterator iterator
enum
typename std::vector< KeypointT >::const_iterator const_iterator
struct
dai::MemoryInfo
variable
int64_t remaining
variable
int64_t used
variable
int64_t total
struct
dai::Point2f
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
variable
double x
variable
double y
variable
double z
function
Point3d()inline function
Point3d(double x, double y, double z)struct
dai::Point3f
variable
float x
variable
float y
variable
float z
function
Point3f()inline function
Point3f(float x, float y, float z)struct
dai::Point3fRGBA
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
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
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
inline function
Rect(const Point2f & org, const Size2f & sz, bool normalized)Construct Rectangle from top left point, size and normalization flag.
Parameters
: 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
function
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
variable
Point2f center
variable
Size2f size
variable
float angle
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
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
inline function
void setKeypoints(const std::vector< Point3f > & kps3)Sets the keypoints list.
Parameters
- keypoints: list of Point3f objects to set.
Parameters
This will clear any existing keypoints and edges.
inline function
void setSpatialCoordinates(const std::vector< Point3f > & spatialCoordinates)Sets the keypoints from a vector of 3D spatial points.
Parameters
- spatialCoordinates: vector of Point3f objects to set as spatial coordinates.
Parameters
The size of spatialCoordinates must match the number of keypoints.
inline function
std::vector< Point3f > getSpatialCoordinates()Get spatial coordinates of the keypoints.
Returns
function
DEPTHAI_SERIALIZE(SpatialKeypointsList, keypoints, edges)enum
KeypointsListT< SpatialKeypoint > Base
struct
dai::StereoPair
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
variable
std::vector< std::vector< float > > rectifiedRotationLeft
variable
std::vector< std::vector< float > > rectifiedRotationRight
variable
CameraBoardSocket leftCameraSocket
variable
CameraBoardSocket rightCameraSocket
struct
dai::TensorInfo
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
struct
dai::Timestamp
variable
int64_t sec
variable
int64_t nsec
inline function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_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
variable
std::optional< uint32_t > watchdogInitialDelayMs
variable
std::unordered_map< std::int8_t, GPIO > gpio
variable
std::unordered_map< std::int8_t, UART > uart
variable
std::optional< bool > pcieInternalClock
variable
std::optional< bool > usb3PhyInternalClock
variable
std::optional< bool > mipi4LaneRgb
variable
std::optional< bool > emmc
variable
std::optional< std::string > logPath
variable
std::optional< size_t > logSizeMax
variable
std::optional< LogLevel > logVerbosity
variable
std::optional< bool > logDevicePrints
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
variable
std::string name
variable
std::optional< CameraSensorType > sensorType
variable
std::optional< CameraImageOrientation > orientation
struct
dai::BoardConfig::GPIO
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
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
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
struct
dai::BoardConfig::UART
variable
std::int8_t tmp
struct
dai::BoardConfig::USB
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
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
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(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()function
bool hasCameraCalibration(CameraBoardSocket cameraId)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.
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.
function
std::vector< std::vector< float > > getCameraIntrinsics(CameraBoardSocket cameraId, 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.
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.
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 Perspective model (Rational Polynomial Model) see
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
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
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.
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
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
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
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(std::string boardName, 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(std::string productName, std::string boardName, std::string boardRev, std::string boardConf, std::string hardwareConf, std::string batchName, uint64_t batchTime, uint32_t boardOptions, 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(std::string deviceName, std::string productName, std::string boardName, std::string boardRev, std::string boardConf, std::string hardwareConf, std::string batchName, uint64_t batchTime, uint32_t boardOptions, 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(std::string deviceName)Set the deviceName which responses to getDeviceName of Device
Parameters
- deviceName: Sets device name.
function
void setProductName(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, 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.
function
void setCameraIntrinsics(CameraBoardSocket cameraId, 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.
function
void setCameraIntrinsics(CameraBoardSocket cameraId, std::vector< std::vector< float >> intrinsics, 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.
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, std::vector< std::vector< float >> rotationMatrix, std::vector< float > translation, std::vector< float > specTranslation)Set the Camera Extrinsics object
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.
- specTranslation: Translation between srcCameraId and destCameraId origins from the design.
function
void setImuExtrinsics(CameraBoardSocket destCameraId, std::vector< std::vector< float >> rotationMatrix, std::vector< float > translation, std::vector< float > specTranslation)Set the Imu to Camera Extrinsics object
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.
- specTranslation: Translation between IMU and destCameraId origins from the design.
function
void setStereoLeft(CameraBoardSocket cameraId, 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, 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
class
dai::CallbackHandler
function
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
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()function
std::string getCrashDumpVersion()function
nlohmann::json & operator[](const std::string & key)function
const nlohmann::json & operator[](const std::string & key)function
void toTar(const std::filesystem::path & tarPath)function
void fromTar(const std::filesystem::path & tarPath)function
std::vector< uint8_t > toBytes()class
dai::CrashDumpRVC2
variable
CrashReportCollection crashReports
function
CrashDumpRVC2()explicit function
CrashDumpRVC2(const std::filesystem::path & tarFile)inline function
Platform getPlatform()inline function
std::string getCrashDumpVersion()function
void toTar(const std::filesystem::path & tarPath)function
void fromTar(const std::filesystem::path & tarPath)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
variable
uint64_t uptimeNs
variable
uint64_t timerRaw
variable
uint64_t statusFlags
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)inline function
Platform getPlatform()inline function
std::string getCrashDumpVersion()function
void toTar(const std::filesystem::path & tarPath)function
void fromTar(const std::filesystem::path & tarPath)class
dai::Device
function
Device()Connects to any available device with a DEFAULT_SEARCH_TIME timeout. Uses OpenVINO version OpenVINO::VERSION_UNIVERSAL
function
~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(Config config)Connects to any available device with custom config.
Parameters
- config: Device custom configuration to boot with
function
DeviceBase(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(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(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(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(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
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(Config config)Connects to any available device with custom config.
Parameters
- config: Device custom configuration to boot with
function
DeviceBase(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(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(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(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(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()function
Platform getPlatform()function
std::string getPlatformAsString()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
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
- id: Node ID
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
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
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
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
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
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(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< 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.
Parameters
This method will always return a subset of
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 isCalibrationAvailable()Check if Calibration is available on the device
Returns
True if calibration is present on device, false otherwise
function
bool tryFlashCalibration(CalibrationHandler calibrationDataHandler)Stores the Calibration and Device information to the Device EEPROM
Parameters
- calibrationObj: CalibrationHandler object which is loaded with calibration information.
Returns
true on successful flash, false on failure
function
void flashCalibration(CalibrationHandler calibrationDataHandler)Stores the Calibration and Device information to the Device EEPROM
Parameters
- std::runtime_error: if failed to flash the calibration
Parameters
- calibrationObj: CalibrationHandler object which is loaded with calibration information.
function
void setCalibration(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
- calibrationObj: CalibrationHandler object which is loaded with calibration information.
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
std::shared_ptr< CalibrationHandler > tryGetCalibration()function
CalibrationHandler getCalibration()Retrieves the CalibrationHandler object containing the non-persistent calibration
Parameters
- std::runtime_error: if failed to get the calibration
Returns
function
CalibrationHandler readCalibration()Fetches the EEPROM data from the device and loads it into CalibrationHandler object If no calibration is flashed, it returns default
Returns
function
CalibrationHandler readCalibration2()Fetches the EEPROM data from the device and loads it into CalibrationHandler object
Parameters
- std::runtime_error: if no calibration is flashed
Returns
function
CalibrationHandler readCalibrationOrDefault()Fetches the EEPROM data from the device and loads it into CalibrationHandler object If no calibration is flashed, it returns default
Returns
function
void factoryResetCalibration()Factory reset EEPROM data if factory backup is available.
Parameters
- std::runtime_error: If factory reset was unsuccessful
function
void flashFactoryCalibration(CalibrationHandler calibrationHandler)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 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
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
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
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
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
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.
Parameters
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)
Parameters
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
Parameters
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 mockCameraFeatures(const std::filesystem::path & replayPath)Mock camera features from a recording. Used for holistic record and replay.
struct
dai::DeviceBase::Config
variable
OpenVINO::Version version
variable
BoardConfig board
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
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()function
std::tuple< bool, std::string > flash(std::function< void(float)> progressCallback, const Pipeline & pipeline, bool compress, std::string applicationName, Memory memory, bool checkChecksum)Flashes a given pipeline to the device.
Parameters
- progressCallback: Callback that sends back a value between 0..1 which signifies current flashing progress
- pipeline: Pipeline to flash to the board
- compress: Compresses application to reduce needed memory size
- applicationName: Name the application that is flashed
function
std::tuple< bool, std::string > flash(const Pipeline & pipeline, bool compress, std::string applicationName, Memory memory, bool checkChecksum)Flashes a given pipeline to the device.
Parameters
- pipeline: Pipeline to flash to the board
- compress: Compresses application to reduce needed memory size
- applicationName: Optional name the application that is flashed
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 > flashDepthaiApplicationPackage(std::function< void(float)> progressCallback, std::vector< uint8_t > package, Memory memory)Flashes a specific depthai application package that was generated using createDepthaiApplicationPackage or saveDepthaiApplicationPackage
Parameters
- progressCallback: Callback that sends back a value between 0..1 which signifies current flashing progress
- package: Depthai application package to flash to the board
function
std::tuple< bool, std::string > flashDepthaiApplicationPackage(std::vector< uint8_t > package, Memory memory)Flashes a specific depthai application package that was generated using createDepthaiApplicationPackage or saveDepthaiApplicationPackage
Parameters
- package: Depthai application package to flash to the board
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(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, 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, std::function< void(float)> progressCb)function
std::tuple< bool, std::string > flashCustom(Memory memory, size_t offset, std::string filename, 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, 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, std::function< void(float)> progressCb)function
std::tuple< bool, std::string > readCustom(Memory memory, size_t offset, size_t size, std::string filename, std::function< void(float)> progressCb)function
std::tuple< bool, std::string, std::vector< uint8_t > > readCustom(Memory memory, size_t offset, size_t size, 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(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
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.
Parameters
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)
Parameters
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(std::string ip, std::string mask, std::string gateway)function
void setDynamicIPv4(std::string ip, std::string mask, std::string gateway)function
bool isStaticIPV4()function
std::string getIPv4()function
std::string getIPv4Mask()function
std::string getIPv4Gateway()function
void setDnsIPv4(std::string dns, std::string dnsAlt)function
std::string getDnsIPv4()function
std::string getDnsAltIPv4()function
void setUsbTimeout(std::chrono::milliseconds ms)function
std::chrono::milliseconds getUsbTimeout()function
void setNetworkTimeout(std::chrono::milliseconds ms)function
std::chrono::milliseconds getNetworkTimeout()function
void setMacAddress(std::string mac)function
std::string getMacAddress()function
void setUsbMaxSpeed(UsbSpeed speed)function
UsbSpeed getUsbMaxSpeed()function
nlohmann::json toJson()struct
dai::DeviceBootloader::MemoryInfo
variable
bool available
variable
std::int64_t size
variable
std::string info
enum
dai::bootloader::Type Type
enum
dai::bootloader::Memory Memory
enum
dai::bootloader::Section Section
enum
dai::bootloader::UsbConfig UsbConfig
enum
dai::bootloader::NetworkConfig NetworkConfig
enum
dai::Version Version
class
dai::DeviceGate
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
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::Version
explicit function
Version(const std::string & v)function
Version(unsigned major, unsigned minor, unsigned patch, const PreReleaseType & type, const std::optional< uint16_t > & preReleaseVersion, const std::string & buildInfo)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()function
std::string toStringSemver()function
std::string getBuildInfo()enum
uint16_t PreReleaseType
enumerator
ALPHA
enumerator
BETA
enumerator
RC
enumerator
NONE
struct
dai::LogMessage
variable
std::string nodeIdName
variable
LogLevel level
variable
Timestamp time
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)function
bool check()function
std::string toString()struct
dai::NNArchiveOptions
function
DEPTAHI_ARG_DEFAULT(NNArchiveEntry::Compression, compression, NNArchiveEntry::Compression::AUTO)class
dai::NNArchive
function
NNArchive(const std::filesystem::path & archivePath, NNArchiveOptions options)function
std::optional< OpenVINO::Blob > getBlob()function
std::optional< OpenVINO::SuperBlob > getSuperBlob()function
std::optional< std::vector< uint8_t > > getOtherModelFormat()function
const NNArchiveVersionedConfig & getVersionedConfig()function
std::optional< std::pair< uint32_t, uint32_t > > getInputSize(uint32_t index)function
std::optional< uint32_t > getInputWidth(uint32_t index)function
std::optional< uint32_t > getInputHeight(uint32_t index)function
std::vector< dai::Platform > getSupportedPlatforms()inline function
const T & getConfig()function
dai::nn_archive::v1::Head getHeadConfig(uint32_t index)function
model::ModelType getModelType()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:
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)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)inline function
NNArchiveVersionedConfig(const NNArchiveConfig & config)inline function
NNArchiveConfigVersion getVersion()inline function
const T & getConfig()inline function
const NNArchiveConfig & getConfig()class
dai::OpenVINO
struct
dai::OpenVINO::Blob
variable
Version version
variable
Device device
variable
std::unordered_map< std::string, TensorInfo > networkInputs
variable
std::unordered_map< std::string, TensorInfo > networkOutputs
variable
uint32_t stageCount
variable
uint32_t numShaves
variable
uint32_t numSlices
variable
std::vector< uint8_t > data
function
Blob(std::vector< uint8_t > data)function
Blob(const std::filesystem::path & path)class
dai::OpenVINO::SuperBlob
function
SuperBlob(std::vector< uint8_t > data)function
SuperBlob(const std::filesystem::path & pathToSuperBlobFile)function
dai::OpenVINO::Blob getBlobWithNumShaves(int numShaves)enum
Version
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
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::string getRelativeUri()class
dai::AssetsMutable
function
void set(std::string, std::uint32_t offset, std::uint32_t size, std::uint32_t alignment)class
dai::AssetManager
function
AssetManager()function
AssetManager(std::string rootPath)function
void addExisting(std::vector< std::shared_ptr< Asset >> assets)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
- asset: Asset to add
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 file into asset manager under 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 > set(const std::string & key, const std::vector< std::uint8_t > & data, int alignment)Loads file into asset manager under 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)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
class
dai::DeviceNode
variable
copyable_unique_ptr< Properties > propertiesHolder
function
DeviceNode()function
~DeviceNode()function
void run()inline function
bool runOnHost()function
const std::shared_ptr< Device > getDevice()function
Properties & getProperties()function
void setLogLevel(dai::LogLevel level)function
dai::LogLevel getLogLevel()class
dai::DeviceNodeCRTP
variable
Properties & properties
function
~DeviceNodeCRTP()inline function
const char * getName()enum
Props Properties
class
dai::HostRunnable
function
HostRunnable()function
~HostRunnable()class
dai::DeviceNodeGroup
inline function
const char * getName()function
~DeviceNodeGroup()inline function
DeviceNodeGroup(const std::shared_ptr< Device > & device)function
void setLogLevel(dai::LogLevel level)function
dai::LogLevel getLogLevel()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)class
dai::MessageQueue
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()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
Parameters
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 addCondVar(std::shared_ptr< std::condition_variable > cv)Adds a condition variable to be notified on message queue destruction
Parameters
- cv: Condition variable to be notified
Returns
Condition variable 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 removeCondVar(CallbackId condVarId)Removes a condition variable
Parameters
- condVarId: Id of condition variable to be removed
Returns
True if condition variable 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()enum
int CallbackId
class
dai::Node
variable
Id id
variable
Id inputId
variable
Id outputId
variable
std::string alias
function
Node(const Node &)function
function
Node(Node &&)function
function
std::string createUniqueInputName()function
std::string createUniqueOutputName()function
Pipeline getParentPipeline()function
const Pipeline getParentPipeline()inline function
std::string getAlias()inline function
void setAlias(std::string alias)function
const char * getName()inline function
void start()inline function
void wait()inline function
void stop()function
void stopPipeline()function
void buildStage1()function
void buildStage2()function
void buildStage3()function
void postBuildStage()function
std::vector< Output > getOutputs()function
std::vector< Input > getInputs()function
std::vector< Output * > getOutputRefs()function
std::vector< const Output * > getOutputRefs()function
std::vector< Input * > getInputRefs()function
std::vector< const Input * > getInputRefs()function
std::vector< OutputMap * > getOutputMapRefs()function
std::vector< InputMap * > getInputMapRefs()function
Output * getOutputRef(std::string name)function
Output * getOutputRef(std::string group, std::string name)function
Input * getInputRef(std::string name)function
Input * getInputRef(std::string group, std::string name)function
OutputMap * getOutputMapRef(std::string group)function
InputMap * getInputMapRef(std::string group)function
bool isSourceNode()function
~Node()function
const AssetManager & getAssetManager()function
AssetManager & getAssetManager()function
std::vector< uint8_t > loadResource(std::filesystem::path uri)function
std::vector< uint8_t > moveResource(std::filesystem::path uri)inline function
std::shared_ptr< N > create()function
void add(std::shared_ptr< Node > node)function
std::vector< std::shared_ptr< Node > > getAllNodes()function
function
function
void remove(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)function
Node::Output * requestOutput(const Capability & capability, bool onHost)function
std::vector< std::pair< Input &, std::shared_ptr< Capability > > > getRequiredInputs()function
bool runOnHost()inline function
const NodeMap & getNodeMap()inline function
void buildInternal()struct
dai::Node::Connection
variable
Id outputId
variable
std::string outputName
variable
std::string outputGroup
variable
Id inputId
variable
std::string inputName
variable
std::string inputGroup
function
function
Connection(ConnectionInternal c)function
bool operator==(const Connection & rhs)struct
dai::Node::ConnectionInternal
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
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)function
std::shared_ptr< dai::node::internal::XLinkInBridge > getXLinkBridge()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
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)function
Input & operator[](std::pair< std::string, std::string > groupKey)function
bool has(const std::string & key)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()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.
Parameters
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
- in: Input to connect to
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)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
- in: Input to link to
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()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
variable
std::string name
function
OutputMap(Node & parent, std::string name, OutputDescription defaultOutput, bool ref)function
OutputMap(Node & parent, OutputDescription defaultOutput, bool ref)function
Output & operator[](const std::string & key)function
Output & operator[](std::pair< std::string, std::string > groupKey)struct
dai::Node::PairHash
inline function
std::size_t operator()(const std::pair< T1, T2 > & pair)enum
std::int64_t Id
class
dai::SourceNode
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()struct
dai::NodeConnectionSchema
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()struct
dai::NodeIoInfo
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
variable
int64_t id
variable
int64_t parentId
variable
std::string name
variable
std::string alias
variable
std::string deviceId
variable
bool deviceNode
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
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