ON THIS PAGE

  • DepthAI C++ API

DepthAI C++ API

DepthAI C++ API can be found on Github luxonis/depthai-core. Below is the reference documentation for the C++ API.
namespace

dai

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
using
using
using
FilterParams = std::variant< MedianFilterParams, SpatialFilterParams, SpeckleFilterParams, TemporalFilterParams >
using
Clock = std::chrono::steady_clock
static constant
constexpr static uint32_t BOARD_CONFIG_MAGIC1
static constant
constexpr static uint32_t BOARD_CONFIG_MAGIC2
static constant
constexpr const char * LOG_DEFAULT_PATTERN
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)
inline function
std::string toString(CameraSensorType type)
function
DEPTHAI_SERIALIZE_EXT(ChipTemperature, css, mss, upa, dss, average)
function
DEPTHAI_SERIALIZE_EXT(ChipTemperatureS3, css, mss, nce, soc, average)
function
DEPTHAI_SERIALIZE_EXT(Color, r, g, b, a)
function
DEPTHAI_SERIALIZE_EXT(CpuUsage, average, msTime)
function
DEPTHAI_SERIALIZE_EXT(DetectionParserOptions, nnFamily, subtype, confidenceThreshold, classes, classNames, coordinates, anchors, anchorMasks, anchorsV2, iouThreshold)
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)
function
std::array< std::array< float, 3 >, 3 > getMatrixInverse(const std::array< std::array< float, 3 >, 3 > & matrix)
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
DEPTHAI_SERIALIZE_EXT(CrashDump, crashReports, depthaiCommitHash, deviceId)
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, properties, logLevel, ioInfo)
function
DEPTHAI_SERIALIZE_EXT(PipelineSchema, connections, globalProperties, nodes)
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(ImgDetection, label, labelName, confidence, xmin, ymin, xmax, ymax)
function
DEPTHAI_SERIALIZE_EXT(SpatialImgDetection, label, labelName, confidence, xmin, ymin, xmax, ymax, spatialCoordinates, boundingBoxMapping)
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(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, 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(GlobalProperties, leonCssFrequencyHz, leonMssFrequencyHz, pipelineName, pipelineVersion, cameraTuningBlobSize, cameraTuningBlobUri, 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, dummy)
function
DEPTHAI_SERIALIZE_EXT(MonoCameraProperties, initialControl, boardSocket, cameraName, imageOrientation, mockIspWidth, mockIspHeight, resolution, fps, isp3aFps, numFramesPool, numFramesPoolRaw, rawPacked)
function
DEPTHAI_SERIALIZE_EXT(NeuralNetworkProperties, modelSource, blobSize, blobUri, modelUri, numFrames, numThreads, numNCEPerThread, numShavesPerThread, backend, backendProperties)
function
DEPTHAI_SERIALIZE_EXT(ObjectTrackerProperties, trackerThreshold, maxObjectsToTrack, detectionLabelsToTrack, trackerType, trackerIdAssignmentPolicy, trackingPerClass, occlusionRatioThreshold, trackletMaxLifespan, trackletBirthThreshold)
function
DEPTHAI_SERIALIZE_EXT(PointCloudProperties, initialConfig, numFramesPool)
function
DEPTHAI_SERIALIZE_EXT(PoolProperties, numMessages, maxMessageSize, datatype, processor)
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(SpatialDetectionNetworkProperties, detectedBBScaleFactor, depthThresholds, calculationAlgorithm)
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)
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(WarpProperties, outputWidth, outputHeight, outputFrameSize, numFramesPool, meshWidth, meshHeight, meshUri, warpHwIds, interpolation)
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 FrameEvent

enumerator
NONE
enumerator
READOUT_START
enumerator
READOUT_END
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

std::int32_t DatatypeEnum

enumerator
ADatatype
enumerator
Buffer
enumerator
ImgFrame
enumerator
EncodedFrame
enumerator
NNData
enumerator
ImageManipConfig
enumerator
CameraControl
enumerator
ImgDetections
enumerator
SpatialImgDetections
enumerator
SystemInformation
enumerator
SystemInformationS3
enumerator
SpatialLocationCalculatorConfig
enumerator
SpatialLocationCalculatorData
enumerator
EdgeDetectorConfig
enumerator
AprilTagConfig
enumerator
AprilTags
enumerator
Tracklets
enumerator
IMUData
enumerator
StereoDepthConfig
enumerator
FeatureTrackerConfig
enumerator
ThermalConfig
enumerator
ToFConfig
enumerator
TrackedFeatures
enumerator
BenchmarkReport
enumerator
MessageGroup
enumerator
TransformData
enumerator
PointCloudConfig
enumerator
PointCloudData
enumerator
RGBDData
enumerator
ImageAlignConfig
enumerator
ImgAnnotations
enumerator
ImageFiltersConfig
enumerator
ToFDepthConfidenceFilterConfig
enumerator
ObjectTrackerConfig
enumerator
DynamicCalibrationControl
enumerator
DynamicCalibrationResult
enumerator
CalibrationQuality
enumerator
CoverageData
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.1Acceleration of the device without any postprocessing, straight from the sensor. Units are [m/s^2]
enumerator
ACCELEROMETER
Section 2.1.1Acceleration of the device including gravity. Units are [m/s^2]
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.2The angular velocity of the device without any postprocessing, straight from the sensor. Units are [rad/s]
enumerator
GYROSCOPE_CALIBRATED
Section 2.1.2The angular velocity of the device. Units are [rad/s]
enumerator
GYROSCOPE_UNCALIBRATED
Section 2.1.2Angular velocity without bias compensation. Units are [rad/s]
enumerator
MAGNETOMETER_RAW
Section 2.1.3Magnetic field measurement without any postprocessing, straight from the sensor. Units are [uTesla]
enumerator
MAGNETOMETER_CALIBRATED
Section 2.1.3The fully calibrated magnetic field measurement. Units are [uTesla]
enumerator
MAGNETOMETER_UNCALIBRATED
Section 2.1.3The magnetic field measurement 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

SerializationType

enumerator
LIBNOP
enumerator
JSON
enumerator
JSON_MSGPACK
class

dai::Capability

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

dai::CapabilityCRTP

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

dai::CapabilityRange

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

dai::ImgFrameCapability

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

dai::CameraSensorConfig

#include CameraFeatures.hpp
variable
std::int32_t width
variable
std::int32_t height
variable
float minFps
variable
float maxFps
variable
Rect fov
variable
CameraSensorType type
struct

dai::CameraFeatures

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

dai::CameraInfo

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

dai::ChipTemperature

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

dai::ChipTemperatureS3

#include ChipTemperatureS3.hpp
variable
float css
CPU Subsystem
variable
float mss
Media Subsystem
variable
float nce
TODO: What does nce stand for?
variable
float soc
SoC
variable
float average
Average of measurements
struct

dai::Color

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

dai::CpuUsage

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

dai::DetectionParserOptions

#include DetectionParserOptions.hpp
variable
DetectionNetworkType nnFamily
variable
std::string subtype
variable
float confidenceThreshold
variable
int classes
variable
std::optional< std::vector< std::string > > classNames
variable
int coordinates
variable
std::vector< float > anchors
variable
std::map< std::string, std::vector< int > > anchorMasks
variable
std::vector< std::vector< std::vector< float > > > anchorsV2
variable
float iouThreshold
struct

dai::EepromData

#include EepromData.hpp
variable
uint32_t version
variable
std::string productName
variable
std::string boardCustom
variable
std::string boardName
variable
std::string boardRev
variable
std::string boardConf
variable
std::string hardwareConf
variable
std::string deviceName
variable
std::string batchName
variable
uint64_t batchTime
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
struct

dai::Extrinsics

#include Extrinsics.hpp
variable
std::vector< std::vector< float > > rotationMatrix
variable
Point3f translation
(x, y, z) pose of destCameraSocket w.r.t currentCameraSocket obtained through calibration
variable
Point3f specTranslation
(x, y, z) pose of destCameraSocket w.r.t currentCameraSocket measured through CAD design
variable
CameraBoardSocket toCameraSocket
function
DEPTHAI_SERIALIZE(Extrinsics, rotationMatrix, translation, specTranslation, toCameraSocket)
struct

dai::ImgTransformation

#include ImgTransformations.hpp
function
ImgTransformation()
inline function
ImgTransformation(size_t width, size_t height)
inline function
ImgTransformation(size_t srcWidth, size_t srcHeight, size_t width, size_t height)
inline function
ImgTransformation(size_t width, size_t height, std::array< std::array< float, 3 >, 3 > sourceIntrinsicMatrix)
inline function
ImgTransformation(size_t width, size_t height, std::array< std::array< float, 3 >, 3 > sourceIntrinsicMatrix, CameraModel distortionModel, std::vector< float > distortionCoefficients)
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
std::array< std::array< float, 3 >, 3 > getIntrinsicMatrix()
Retrieve the total intrinsic matrix calculated from intrinsic * transform.
Returns
total intrinsic matrix
function
std::array< std::array< float, 3 >, 3 > getIntrinsicMatrixInv()
Retrieve the inverse of the total intrinsic matrix calculated from intrinsic * transform.
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 & 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
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
  • point: RotatedRect to remap
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, transformationMatrix, transformationMatrixInv, sourceIntrinsicMatrix, sourceIntrinsicMatrixInv, distortionModel, distortionCoefficients, srcWidth, srcHeight, width, height, srcCrops)
struct

dai::MemoryInfo

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

dai::Point2f

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

dai::Point3d

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

dai::Point3f

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

dai::Point3fRGBA

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

dai::Quaterniond

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

dai::Rect

#include Rect.hpp
variable
float x
variable
float y
variable
float width
variable
float height
variable
bool normalized
variable
bool hasNormalized
function
Rect()
inline function
Rect(float x, float y, float width, float height)
inline function
Rect(float x, float y, float width, float height, bool normalized)
inline function
Rect(const Rect & r)
inline function
Rect(const Point2f & org, const Size2f & sz)
inline function
Rect(const Point2f & org, const Size2f & sz, bool normalized)
inline function
Rect(const Point2f & pt1, const Point2f & pt2)
inline function
Rect(const Point2f & pt1, const Point2f & pt2, bool normalized)
function
Rect & operator=(const Rect & r)
function
Rect & operator=(Rect && r)
inline function
Point2f topLeft()
The top-left corner.
inline function
Point2f bottomRight()
The bottom-right corner
inline function
Size2f size()
Size (width, height) of the rectangle
inline function
float area()
Area (width*height) of the rectangle
inline function
bool empty()
True if rectangle is empty.
inline function
bool contains(const Point2f & pt)
Checks whether the rectangle contains the point.
inline function
bool isNormalized()
Whether rectangle is normalized (coordinates in [0,1] range) or not.
inline function
Rect denormalize(int destWidth, int destHeight)
Denormalize rectangle.
Parameters
  • destWidth: Destination frame width.
  • destHeight: Destination frame height.
inline function
Rect normalize(int srcWidth, int srcHeight)
Normalize rectangle.
Parameters
  • srcWidth: Source frame width.
  • srcHeight: Source frame height.
struct

dai::RotatedRect

#include RotatedRect.hpp
variable
Point2f center
variable
Size2f size
variable
float angle
function
RotatedRect()
inline function
RotatedRect(const Point2f & center, const Size2f & size, float angle)
inline function
RotatedRect(const Rect & rect, float angle)
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]
struct

dai::Size2f

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

dai::StereoPair

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

dai::StereoRectification

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

dai::TensorInfo

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

#include Timestamp.hpp
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

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

dai::BoardConfig::GPIO

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

std::int8_t Mode

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

std::int8_t Direction

enumerator
INPUT
enumerator
OUTPUT
enum

std::int8_t Level

enumerator
LOW
enumerator
HIGH
enum

std::int8_t Pull

enumerator
NO_PULL
enumerator
PULL_UP
enumerator
PULL_DOWN
enumerator
BUS_KEEPER
enum

std::int8_t Drive

enumerator
MA_2
enumerator
MA_4
enumerator
MA_8
enumerator
MA_12
struct

dai::BoardConfig::IMU

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

dai::BoardConfig::Network

#include BoardConfig.hpp
variable
uint16_t mtu
Network MTU, 0 is auto (usually 1500 for Ethernet) or forwarded from bootloader (not yet implemented there). Note: not advised to increase past 1500 for now
variable
bool xlinkTcpNoDelay
Sets the
struct

dai::BoardConfig::UART

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

dai::BoardConfig::USB

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

dai::BoardConfig::UVC

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

dai::CalibrationHandler

#include CalibrationHandler.hpp
function
CalibrationHandler()
explicit function
CalibrationHandler(std::filesystem::path eepromDataPath)
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.
function
CalibrationHandler(std::filesystem::path calibrationDataPath, std::filesystem::path boardConfigPath)
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.
explicit function
CalibrationHandler(EepromData eepromData)
Construct a new Calibration Handler object from EepromData object.
Parameters
  • eepromData: EepromData data structure containing the calibration data.
function
dai::EepromData getEepromData()
Get the Eeprom Data object
Returns
EepromData object which contains the raw calibration data
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
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)
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 (in centimeters) 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
Returns
a transformationMatrix which is 4x4 in homogeneous coordinate system
function
std::vector< float > getCameraTranslationVector(CameraBoardSocket srcCamera, CameraBoardSocket dstCamera, bool useSpecTranslation)
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)
Returns
a translation vector like [x, y, z] in centimeters
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)
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)
Returns
baseline distance in centimeters
function
std::vector< std::vector< float > > getCameraToImuExtrinsics(CameraBoardSocket cameraId, bool useSpecTranslation)
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
Returns
Returns a transformationMatrix which is 4x4 in homogeneous coordinate system
function
std::vector< std::vector< float > > getImuToCameraExtrinsics(CameraBoardSocket cameraId, bool useSpecTranslation)
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
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
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.
inline function
void getRTABMapCameraModel(T...)
struct

dai::CalibrationHandler::dependent_false

class

dai::CallbackHandler

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

dai::CrashDump

variable
std::vector< CrashReport > crashReports
variable
std::string depthaiCommitHash
variable
std::string deviceId
inline function
nlohmann::json serializeToJson()
struct

dai::CrashDump::CrashReport

variable
ProcessorType processor
variable
std::string errorSource
variable
uint32_t crashedThreadId
variable
ErrorSourceInfo errorSourceInfo
variable
std::vector< ThreadCallstack > threadCallstack
function
DEPTHAI_SERIALIZE(CrashReport, processor, errorSource, crashedThreadId, errorSourceInfo, threadCallstack)
struct

dai::CrashDump::CrashReport::ErrorSourceInfo

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

dai::CrashDump::CrashReport::ErrorSourceInfo::AssertContext

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

dai::CrashDump::CrashReport::ErrorSourceInfo::TrapContext

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

dai::CrashDump::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::CrashDump::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)
class

dai::Device

#include Device.hpp
function
Device()
Connects to any available device with a DEFAULT_SEARCH_TIME timeout. Uses OpenVINO version OpenVINO::VERSION_UNIVERSAL
function
~Device()
function
Platform getPlatform()
function
std::string getPlatformAsString()
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

#include DeviceBase.hppDerived by dai::Device
function
DeviceBase()
Connects to any available device with a DEFAULT_SEARCH_TIME timeout. Uses OpenVINO version OpenVINO::VERSION_UNIVERSAL
function
DeviceBase(UsbSpeed maxUsbSpeed)
Connects to device
Parameters
  • maxUsbSpeed: Maximum allowed USB speed
function
DeviceBase(const DeviceInfo & devInfo, UsbSpeed maxUsbSpeed)
Connects to device specified by devInfo.
Parameters
  • devInfo: DeviceInfo which specifies which device to connect to
  • maxUsbSpeed: Maximum allowed USB speed
function
DeviceBase(const DeviceInfo & devInfo, const std::filesystem::path & pathToCmd)
Connects to device specified by devInfo.
Parameters
  • devInfo: DeviceInfo which specifies which device to connect to
  • pathToCmd: Path to custom device firmware
explicit function
DeviceBase(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()
Device destructor
Parameters
In the destructor of the derived class, remember to call close()
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
Returns
Logging severity level
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
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
dai::CrashDump getCrashDump(bool clearCrashDump)
Retrieves crash dump for debugging.
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
bool isEepromAvailable()
Check if EEPROM is available
Returns
True if EEPROM is present on board, false otherwise
function
bool tryFlashCalibration(CalibrationHandler calibrationDataHandler)
Stores the Calibration and Device information to the Device EEPROM
Parameters
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_exception: if failed to flash the calibration
Parameters
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
function
CalibrationHandler getCalibration()
Retrieves the CalibrationHandler object containing the non-persistent calibration
Parameters
  • std::runtime_exception: if failed to get the calibration
Returns
The CalibrationHandler object containing the non-persistent calibration
function
CalibrationHandler readCalibration()
Fetches the EEPROM data from the device and loads it into CalibrationHandler object If no calibration is flashed, it returns default
Returns
The CalibrationHandler object containing the calibration currently flashed on device EEPROM
function
CalibrationHandler readCalibration2()
Fetches the EEPROM data from the device and loads it into CalibrationHandler object
Parameters
  • std::runtime_exception: if no calibration is flashed
Returns
The CalibrationHandler object containing the calibration currently flashed on device EEPROM
function
CalibrationHandler readCalibrationOrDefault()
Fetches the EEPROM data from the device and loads it into CalibrationHandler object If no calibration is flashed, it returns default
Returns
The CalibrationHandler object containing the calibration currently flashed on device EEPROM
function
void factoryResetCalibration()
Factory reset EEPROM data if factory backup is available.
Parameters
  • std::runtime_exception: If factory reset was unsuccessful
function
void flashFactoryCalibration(CalibrationHandler calibrationHandler)
Stores the Calibration and Device information to the Device EEPROM in Factory area To perform this action, correct env variable must be set
Parameters
  • std::runtime_exception: if failed to flash the calibration
Returns
True on successful flash, false on failure
function
void flashEepromClear()
Destructive action, deletes User area EEPROM contents Requires PROTECTED permissions
Parameters
  • std::runtime_exception: 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_exception: 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_exception: 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_exception: 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_exception: 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
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 crashDevice()
Crashes the device
Parameters
ONLY FOR TESTING PURPOSES, it causes an unrecoverable crash on the device
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
struct

dai::DeviceBase::Config

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

ReconnectionStatus

enumerator
RECONNECTED
enumerator
RECONNECTING
enumerator
RECONNECT_FAILED
class

dai::DeviceBootloader

#include DeviceBootloader.hpp
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
Version getVersion()
Returns
Version of current running bootloader
function
bool isEmbeddedVersion()
Returns
True when bootloader was booted using latest bootloader integrated in the library. False when bootloader is already running on the device and just connected to.
function
Type getType()
Returns
Type of currently connected bootloader
function
bool isAllowedFlashingBootloader()
Returns
True if allowed to flash bootloader
function
void close()
Explicitly closes connection to device.
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::Version Version

class

dai::DeviceGate

#include DeviceGate.hpp
function
DeviceGate(const DeviceInfo & deviceInfo)
Connects to DepthAI Gate
Parameters
  • deviceInfo: Device to connect to
function
~DeviceGate()
function
bool isOkay()
function
bool createSession(bool exclusive)
function
bool startSession()
function
bool stopSession()
function
bool deleteSession()
function
bool destroySession()
function
SessionState getState()
function
std::optional< CrashDump > waitForSessionEnd()
function
std::optional< CrashDump > getCrashDump()
function
Version getVersion()
function
VersionInfo getAllVersion()
function
bool isBootedNonExclusive()
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

#include Version.hpp
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
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
NNArchiveOptions()
function
function
DEPTAHI_ARG_DEFAULT(std::filesystem::path, extractFolder, std::filesystem::path())
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::filesystem::path > getModelPath()
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
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)
@path Should point to: 1) if compression is set to RAW_FS: to just the config.json file. 2) if compression is set to AUTO: to whole compressed NNArchive or just the config.json file which must end in .json . 3) else: to whole compressed NNArchive. see NNArchive class for parameter explanation
function
NNArchiveVersionedConfig(const std::function< int()> & openCallback, const std::function< std::shared_ptr< std::vector< uint8_t >>()> & readCallback, const std::function< int64_t(int64_t offset, NNArchiveEntry::Seek whence)> & seekCallback, const std::function< int64_t(int64_t request)> & skipCallback, const std::function< int()> & closeCallback, NNArchiveEntry::Compression compression)
Returned data should be just the config.json if compression == RAW_FS or the whole NNArchive otherwise see NNArchive class for parameter explanation
inline function
NNArchiveVersionedConfig(const NNArchiveConfig & config)
inline function
NNArchiveConfigVersion getVersion()
inline function
const T & getConfig()
inline function
const NNArchiveConfig & getConfig()
class

dai::OpenVINO

#include OpenVINO.hpp
struct

dai::OpenVINO::Blob

#include OpenVINO.hpp
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

#include OpenVINO.hpp
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

#include AssetManager.hpp
variable
const std::string key
variable
std::vector< std::uint8_t > data
variable
std::uint32_t alignment
function
Asset()
inline explicit function
Asset(std::string k)
function
std::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

#include AssetManager.hpp
function
AssetManager()
function
AssetManager(std::string rootPath)
function
void addExisting(std::vector< std::shared_ptr< Asset >> assets)
Adds all assets in an array to the AssetManager
Parameters
  • assets: Vector of assets to add
function
std::string getRootPath()
Get root path of the asset manager
Returns
Root path
function
void setRootPath(const std::string & rootPath)
Set root path of the asset manager
Parameters
  • rootPath: Root path
function
std::shared_ptr< dai::Asset > set(Asset asset)
Adds or overwrites an asset object to AssetManager.
Parameters
Returns
Shared pointer to asset
function
std::shared_ptr< dai::Asset > set(const std::string & key, Asset asset)
Adds or overwrites an asset object to AssetManager with a specified key. Key value will be assigned to an Asset as well
Parameters
  • key: Key under which the asset should be stored
  • asset: Asset to store
Returns
Shared pointer to asset
function
std::shared_ptr< dai::Asset > set(const std::string & key, const std::filesystem::path & path, int alignment)
Loads 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

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

dai::DeviceNode

Derived by dai::DeviceNodeCRTP< DeviceNode, ToFDepthConfidenceFilter, ToFDepthConfidenceFilterProperties >, dai::DeviceNodeCRTP< DeviceNode, MessageDemux, MessageDemuxProperties >, dai::DeviceNodeCRTP< DeviceNode, IMU, IMUProperties >, dai::DeviceNodeCRTP< DeviceNode, EdgeDetector, EdgeDetectorProperties >, dai::DeviceNodeCRTP< DeviceNode, SPIOut, SPIOutProperties >, dai::DeviceNodeCRTP< DeviceNode, ObjectTracker, ObjectTrackerProperties >, dai::DeviceNodeCRTP< DeviceNode, FeatureTracker, FeatureTrackerProperties >, dai::DeviceNodeCRTP< DeviceNode, BenchmarkIn, BenchmarkInProperties >, dai::DeviceNodeCRTP< DeviceNode, SystemLogger, SystemLoggerProperties >, dai::DeviceNodeCRTP< DeviceNode, Camera, CameraProperties >, dai::DeviceNodeCRTP< DeviceNode, Thermal, ThermalProperties >, dai::DeviceNodeCRTP< DeviceNode, Sync, SyncProperties >, dai::DeviceNodeCRTP< DeviceNode, StereoDepth, StereoDepthProperties >, dai::DeviceNodeCRTP< DeviceNode, VideoEncoder, VideoEncoderProperties >, dai::DeviceNodeCRTP< DeviceNode, SpatialLocationCalculator, SpatialLocationCalculatorProperties >, dai::DeviceNodeCRTP< DeviceNode, BenchmarkOut, BenchmarkOutProperties >, dai::DeviceNodeCRTP< DeviceNode, ImageFilters, ImageFiltersProperties >, dai::DeviceNodeCRTP< DeviceNode, DynamicCalibration, DynamicCalibrationProperties >, dai::DeviceNodeCRTP< DeviceNode, ImageAlign, ImageAlignProperties >, dai::DeviceNodeCRTP< DeviceNode, DetectionParser, DetectionParserProperties >, dai::DeviceNodeCRTP< DeviceNode, SpatialDetectionNetwork, SpatialDetectionNetworkProperties >, dai::DeviceNodeCRTP< DeviceNode, Warp, WarpProperties >, dai::DeviceNodeCRTP< DeviceNode, SPIIn, SPIInProperties >, dai::DeviceNodeCRTP< DeviceNode, NeuralNetwork, NeuralNetworkProperties >, dai::DeviceNodeCRTP< DeviceNode, ImageManip, ImageManipProperties >, dai::DeviceNodeCRTP< DeviceNode, AprilTag, AprilTagProperties >, dai::DeviceNodeCRTP< DeviceNode, XLinkOut, XLinkOutProperties >, dai::DeviceNodeCRTP< DeviceNode, ToFBase, ToFProperties >, dai::DeviceNodeCRTP< DeviceNode, PointCloud, PointCloudProperties >, dai::DeviceNodeCRTP< DeviceNode, MonoCamera, MonoCameraProperties >, dai::DeviceNodeCRTP< DeviceNode, ColorCamera, ColorCameraProperties >, dai::DeviceNodeCRTP< DeviceNode, XLinkIn, XLinkInProperties >, dai::DeviceNodeCRTP< DeviceNode, Script, ScriptProperties >, dai::DeviceNodeCRTP< DeviceNode, UVC, UVCProperties >, dai::DeviceNodeGroup
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::DeviceNodeGroup

Derived by dai::node::DetectionNetwork, dai::node::ToF
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

#include MessageQueue.hppDerived by dai::Node::Input
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)
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
bool removeCallback(CallbackId callbackId)
Removes a callback
Parameters
  • callbackId: Id of callback to be removed
Returns
True if callback 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

#include Node.hppDerived by dai::NodeGroup, dai::ThreadedNode
variable
Id id
variable
Id inputId
variable
Id outputId
variable
std::string alias
function
Node(const Node &)
function
Node & operator=(const Node &)
function
Node(Node &&)
function
Node & operator=(Node &&)
function
std::string createUniqueInputName()
function
std::string createUniqueOutputName()
function
Pipeline getParentPipeline()
function
const Pipeline getParentPipeline()
inline function
std::string getAlias()
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
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
std::shared_ptr< const Node > getNode(Node::Id id)
function
std::shared_ptr< Node > getNode(Node::Id id)
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

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

dai::Node::ConnectionInternal

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

dai::Node::ConnectionInternal::Hash

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

dai::Node::DatatypeHierarchy

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

dai::Node::Input

variable
std::vector< DatatypeHierarchy > possibleDatatypes
function
~Input()
inline explicit function
Input(Node & par, InputDescription desc, bool ref)
inline function
const Node & getParent()
Get the parent node
inline function
Node & getParent()
Get the parent node
inline function
Type getType()
Get type
function
std::string toString()
Input to string representation
function
void setWaitForMessage(bool waitForMessage)
Overrides default wait for message behavior. Applicable for nodes with multiple inputs. Specifies behavior whether to wait for this input when a Node processes certain data or not.
Parameters
  • waitForMessage: Whether to wait for message to arrive to this input or not
function
bool getWaitForMessage()
Get behavior whether to wait for this input when a Node processes certain data or not
Returns
Whether to wait for message to arrive to this input or not
function
std::vector< DatatypeHierarchy > getPossibleDatatypes()
Get possible datatypes that can be received
function
void setPossibleDatatypes(std::vector< DatatypeHierarchy > types)
Set possible datatypes that can be received
function
void setReusePreviousMessage(bool reusePreviousMessage)
Equivalent to setWaitForMessage but with inverted logic.
function
bool getReusePreviousMessage()
Equivalent to getWaitForMessage but with inverted logic.
function
void setGroup(std::string group)
Set group name for this input
function
std::string getGroup()
Get group name for this input
function
bool isConnected()
Check if this input is connected
function
std::shared_ptr< InputQueue > createInputQueue(unsigned int maxSize, bool blocking)
enum

Type

enumerator
SReceiver
enumerator
MReceiver
struct

dai::Node::InputDescription

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

dai::Node::InputMap

#include Node.hpp
variable
std::string name
function
InputMap(Node & parent, InputDescription defaultInput)
function
InputMap(Node & parent, std::string name, InputDescription defaultInput)
function
Input & operator[](const std::string & key)
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
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
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
struct

dai::Node::Output::QueueConnection

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

Type

enumerator
MSender
enumerator
SSender
struct

dai::Node::OutputDescription

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

dai::Node::OutputMap

#include Node.hpp
variable
std::string name
function
OutputMap(Node & parent, std::string name, 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

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

dai::NodeCRTP

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

dai::NodeConnectionSchema

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

dai::NodeGroup

function
NodeGroup()
function
~NodeGroup()
inline function
const char * getName()
struct

dai::NodeIoInfo

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

Type

enumerator
MSender
enumerator
SSender
enumerator
MReceiver
enumerator
SReceiver
struct

dai::NodeObjInfo

#include NodeObjInfo.hpp
variable
int64_t id
variable
int64_t parentId
variable
std::string name
variable
std::string alias
variable
std::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(Pipeline & pipeline, bool createImplicitDevice)
inline function
PipelineImpl(Pipeline & pipeline, std::shared_ptr< Device > device)
function
PipelineImpl(const PipelineImpl &)
function
PipelineImpl & operator=(const PipelineImpl &)
function
PipelineImpl(PipelineImpl &&)
function
PipelineImpl & operator=(PipelineImpl &&)
function
~PipelineImpl()
class

dai::Pipeline

#include Pipeline.hpp
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
function
PipelineSchema getPipelineSchema(SerializationType type)
Returns
Pipeline schema
inline function
void serialize(PipelineSchema & schema, Assets & assets, std::vector< std::uint8_t > & assetStorage)
inline function
nlohmann::json serializeToJson(bool includeAssests)
inline function
std::shared_ptr< N > create(Args &&... args)
Creates and adds a node to the pipeline.Node is specified by template argument N
inline function
void add(std::shared_ptr< Node > node)
Adds an existing node to the pipeline
inline function
void remove(std::shared_ptr< Node > node)
inline function
std::vector< std::shared_ptr< Node > > getAllNodes()
inline function
std::shared_ptr< const Node > getNode(Node::Id id)
inline function
std::shared_ptr< Node > getNode(Node::Id id)
inline function
std::vector< Node::Connection > getConnections()
inline function
NodeConnectionMap getConnectionMap()
inline function
const AssetManager & getAssetManager()
inline function
AssetManager & getAssetManager()
inline function
void setOpenVINOVersion(OpenVINO::Version version)
inline function
void setCalibrationData(CalibrationHandler calibrationDataHandler)
Sets the calibration in pipeline which overrides the calibration data in eeprom
Parameters
  • calibrationDataHandler: CalibrationHandler object which is loaded with calibration information.
inline function
CalibrationHandler getCalibrationData()
gets the calibration data which is set through pipeline
Returns
the calibrationHandler with calib data in the pipeline
inline function
bool isCalibrationDataAvailable()
check if calib data has been set or the default will be returned
Returns
true - calib data has been set
Returns
false - calib data has not been set - default will be returned
inline function
std::optional< EepromData > getEepromData()
gets the eeprom data from the pipeline
Returns
eepromData from the the pipeline
inline function
void setEepromData(std::optional< EepromData > eepromData)
Sets the eeprom data in pipeline
Parameters
  • eepromData: EepromData object that is loaded in the pipeline.
inline function
uint32_t getEepromId()
Gets the eeprom id from the pipeline
Returns
eeprom id from the pipeline
inline function
void setCameraTuningBlobPath(const fs::path & path)
inline function
void setXLinkChunkSize(int sizeBytes)
Set chunk size for splitting device-sent XLink packets, in bytes. A larger value could increase performance, with 0 disabling chunking. A negative value won't modify the device defaults - configured per protocol, currently 64*1024 for both USB and Ethernet.
inline function
void setSippBufferSize(int sizeBytes)
SIPP (Signal Image Processing Pipeline) internal memory pool. SIPP is a framework used to schedule HW filters, e.g. ISP, Warp, Median filter etc. Changing the size of this pool is meant for advanced use cases, pushing the limits of the HW. By default memory is allocated in high speed CMX memory. Setting to 0 will allocate in DDR 256 kilobytes. Units are bytes.
inline function
void setSippDmaBufferSize(int sizeBytes)
SIPP (Signal Image Processing Pipeline) internal DMA memory pool. SIPP is a framework used to schedule HW filters, e.g. ISP, Warp, Median filter etc. Changing the size of this pool is meant for advanced use cases, pushing the limits of the HW. Memory is allocated in high speed CMX memory Units are bytes.
inline function
void setBoardConfig(BoardConfig board)
inline function
BoardConfig getBoardConfig()
inline function
Device::Config getDeviceConfig()
inline function
bool isRunning()
inline function
bool isBuilt()
inline function
void build()
inline function
void start()
inline function
void wait()
inline function
void stop()
inline function
void processTasks(bool waitForTasks, double timeoutSeconds)
inline function
void run()
inline function
std::shared_ptr< Device > getDefaultDevice()
inline function
void addTask(std::function< void()> task)
function
void enableHolisticRecord(const RecordConfig & config)
function
void enableHolisticReplay(const std::string & pathToRecording)
enum

PipelineImpl::NodeConnectionMap NodeConnectionMap

struct

dai::PipelineSchema

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

dai::Subnode

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

dai::ThreadedNode

Derived by dai::DeviceNode, dai::node::ThreadedHostNode
variable
spimpl::impl_ptr< Impl > pimpl
function
ThreadedNode()
function
~ThreadedNode()
inline function
void onStart()
inline function
void onStop()
function
void start()
function
void wait()
function
void stop()
function
void run()
function
bool isRunning()
function
void setLogLevel(dai::LogLevel level)
function
dai::LogLevel getLogLevel()
function
Node(const Node &)
function
Node(Node &&)
function
Node()
function
Node(bool conf)
struct

dai::TraceEvent

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

std::uint8_t Event

enumerator
SEND
enumerator
RECEIVE
enum

std::uint8_t Status

enumerator
START
enumerator
END
enumerator
TIMEOUT
class

dai::ADatatype

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

dai::AprilTagConfig

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

dai::AprilTagConfig::QuadThresholds

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

std::int32_t Family

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

dai::AprilTag

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

dai::AprilTags

#include AprilTags.hpp
variable
std::vector< AprilTag > aprilTags
function
AprilTags()
Construct AprilTags message.
function
~AprilTags()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
function
DEPTHAI_SERIALIZE(AprilTags, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, aprilTags)
class

dai::BenchmarkReport

#include BenchmarkReport.hpp
variable
float fps
variable
float timeTotal
variable
float numMessagesReceived
variable
float averageLatency
variable
std::vector< float > latencies
function
BenchmarkReport()
function
~BenchmarkReport()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
function
DEPTHAI_SERIALIZE(BenchmarkReport, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice, fps, timeTotal, numMessagesReceived, averageLatency, latencies)
class

dai::Buffer

#include Buffer.hppDerived by dai::AprilTagConfig, dai::AprilTags, dai::BenchmarkReport, dai::CalibrationQuality, dai::CameraControl, dai::CoverageData, dai::DynamicCalibrationControl, dai::DynamicCalibrationResult, dai::EdgeDetectorConfig, dai::EncodedFrame, dai::FeatureTrackerConfig, dai::IMUData, dai::ImageAlignConfig, dai::ImageFiltersConfig, dai::ImageManipConfig, dai::ImgAnnotations, dai::ImgDetections, dai::ImgFrame, dai::MessageGroup, dai::NNData, dai::ObjectTrackerConfig, dai::PointCloudConfig, dai::PointCloudData, dai::RGBDData, dai::SpatialImgDetections, dai::SpatialLocationCalculatorConfig, dai::SpatialLocationCalculatorData, dai::StereoDepthConfig, dai::SystemInformation, dai::SystemInformationS3, dai::ThermalConfig, dai::ToFConfig, dai::ToFDepthConfidenceFilterConfig, dai::TrackedFeatures, dai::Tracklets, dai::TransformData
variable
int64_t sequenceNum
variable
variable
Timestamp tsDevice
function
Buffer()
function
Buffer(size_t size)
function
Buffer(long fd)
function
Buffer(long fd, size_t size)
function
~Buffer()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
function
span< uint8_t > getData()
function
span< const uint8_t > getData()
function
void setData(const std::vector< std::uint8_t > & data)
Parameters
  • data: Copies data to internal buffer
function
void setData(const long fd)
function
void setData(std::vector< std::uint8_t > && data)
Parameters
  • data: Moves data to internal buffer
function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestamp()
Retrieves timestamp related to dai::Clock::now()
function
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > getTimestampDevice()
Retrieves timestamp directly captured from device's monotonic clock, not synchronized to host time. Used mostly for debugging
function
void setTimestamp(std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > timestamp)
Sets image timestamp related to dai::Clock::now()
function
void setTimestampDevice(std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > timestamp)
Sets image timestamp related to dai::Clock::now()
function
int64_t getSequenceNum()
Retrieves image sequence number
function
void setSequenceNum(int64_t sequenceNum)
Sets image sequence number
function
span< const uint8_t > getRecordData()
function
dai::VisualizeType getVisualizationMessage()
Get visualizable message
Returns
Visualizable message, either ImgFrame, ImgAnnotations or std::monostate (None)
function
DEPTHAI_SERIALIZE(Buffer, sequenceNum, ts, tsDevice)
class

dai::CameraControl

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

dai::CameraControl::ManualExposureParams

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

dai::CameraControl::RegionParams

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

dai::CameraControl::StrobeConfig

variable
uint8_t enable
variable
uint8_t activeLevel
variable
int8_t gpioNumber
function
DEPTHAI_SERIALIZE(StrobeConfig, enable, activeLevel, gpioNumber)
struct

dai::CameraControl::StrobeTimings

variable
int32_t exposureBeginOffsetUs
variable
int32_t exposureEndOffsetUs
variable
uint32_t durationUs
function
enum

uint8_t Command

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

uint8_t AutoFocusMode

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

uint8_t AutoWhiteBalanceMode

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

uint8_t SceneMode

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

uint8_t AntiBandingMode

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

uint8_t CaptureIntent

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

uint8_t ControlMode

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

uint8_t EffectMode

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

uint8_t FrameSyncMode

enumerator
OFF
enumerator
OUTPUT
enumerator
INPUT
class

dai::DynamicCalibrationControl

variable
Command command
inline function
DynamicCalibrationControl()
inline explicit function
DynamicCalibrationControl(Command cmd)
function
~DynamicCalibrationControl()
inline function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
struct

dai::DynamicCalibrationControl::Commands

struct

dai::DynamicCalibrationControl::Commands::ApplyCalibration

variable
CalibrationHandler calibration
function
ApplyCalibration()
inline explicit function
ApplyCalibration(const CalibrationHandler & calibration)
function
DEPTHAI_SERIALIZE(ApplyCalibration, calibration)
struct

dai::DynamicCalibrationControl::Commands::Calibrate

variable
bool force
inline explicit function
Calibrate(bool force)
function
DEPTHAI_SERIALIZE(Calibrate, force)
struct

dai::DynamicCalibrationControl::Commands::CalibrationQuality

variable
bool force
inline explicit function
CalibrationQuality(bool force)
function
DEPTHAI_SERIALIZE(CalibrationQuality, force)
struct

dai::DynamicCalibrationControl::Commands::LoadImage

struct

dai::DynamicCalibrationControl::Commands::ResetData

struct

dai::DynamicCalibrationControl::Commands::SetPerformanceMode

variable
PerformanceMode performanceMode
inline function
SetPerformanceMode()
inline explicit function
SetPerformanceMode(PerformanceMode performanceMode)
function
DEPTHAI_SERIALIZE(SetPerformanceMode, performanceMode)
struct

dai::DynamicCalibrationControl::Commands::StartCalibration

variable
float loadImagePeriod
variable
float calibrationPeriod
inline explicit function
StartCalibration(float loadImagePeriod, float calibrationPeriod)
function
DEPTHAI_SERIALIZE(StartCalibration, loadImagePeriod, calibrationPeriod)
struct

dai::DynamicCalibrationControl::Commands::StopCalibration

enum

int PerformanceMode

enumerator
DEFAULT
enumerator
STATIC_SCENERY
enumerator
OPTIMIZE_SPEED
enumerator
OPTIMIZE_PERFORMANCE
enumerator
SKIP_CHECKS
struct

dai::CoverageData

#include DynamicCalibrationResults.hpp
variable
std::vector< std::vector< float > > coveragePerCellA
2D coverage matrix for input A (e.g. left image). Each cell represents how well that spatial bin is populated; range [0, 1].
variable
std::vector< std::vector< float > > coveragePerCellB
2D coverage matrix for input B (e.g. right image). Each cell represents how well that spatial bin is populated; range [0, 1].
variable
float meanCoverage
Overall quality metric summarizing 2D coverage across both inputs. Typically normalized to [0, 1].
variable
float coverageAcquired
Proportion of the desired spatial coverage achieved so far; range [0, 1].
variable
float dataAcquired
Proportion of calibration-relevant data acquired from the frame; range [0, 1].
function
CoverageData()
function
~CoverageData()
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
function
struct

dai::CalibrationQuality

#include DynamicCalibrationResults.hpp
variable
std::optional< Data > qualityData
Optional quality metrics data. May be missing if the quality check did not produce valid results.
variable
std::string info
Informational message describing the outcome of the quality check.
function
CalibrationQuality()
Construct empty CalibrationQuality message.
function
~CalibrationQuality()
inline function
CalibrationQuality(Data qualityData, std::string info)
Construct CalibrationQuality with quality metrics and info string.
inline function
CalibrationQuality(std::string info)
Construct CalibrationQuality with only info string (no quality metrics).
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
function
DEPTHAI_SERIALIZE(CalibrationQuality, qualityData, info)
struct

dai::CalibrationQuality::Data

#include DynamicCalibrationResults.hpp
variable
std::array< float, 3 > rotationChange
Difference in rotation angles (extrinsics) between current and new calibration. Units: degrees [deg].
variable
std::vector< float > depthErrorDifference
Predicted relative depth error difference between current and new calibration. Reported at reference distances [1m, 2m, 5m, 10m]. Units: percent [%].
variable
float sampsonErrorCurrent
Current calibration Sampson error.
variable
float sampsonErrorNew
Estimated new (achievable) Sampson error with calibration applied.
function
struct

dai::DynamicCalibrationResult

#include DynamicCalibrationResults.hpp
variable
std::optional< Data > calibrationData
Optional calibration result data. May be missing if calibration failed or produced no valid result.
variable
std::string info
Informational message describing the result of calibration.
function
DynamicCalibrationResult()
Construct empty DynamicCalibrationResult message.
function
~DynamicCalibrationResult()
inline function
DynamicCalibrationResult(const Data & data, std::string information)
Construct with result data and informational string.
inline function
DynamicCalibrationResult(std::string information)
Construct with informational string only (no result data).
function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)
function
struct

dai::DynamicCalibrationResult::Data

#include DynamicCalibrationResults.hpp
variable
variable
dai::CalibrationHandler currentCalibration
variable
CalibrationQuality::Data calibrationDifference
function
class

dai::EdgeDetectorConfig

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

dai::EdgeDetectorConfig::EdgeDetectorConfigData

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