ImgDetections
detections, which contains label, confidence, and the bounding box information (xmin, ymin, xmax, ymax).Examples of functionality
Reference
class
dai::ImgDetections
variable
std::vector< DetectionT > detections
variable
size_t segmentationMaskHeight
variable
size_t segmentationMaskWidth
variable
std::optional< ImgTransformation > transformation
function
~ImgDetections()function
void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)inline function
DatatypeEnum getDatatype()function
DEPTHAI_SERIALIZE(ImgDetections, Base::Buffer::sequenceNum, Base::Buffer::ts, Base::Buffer::tsDevice, detections, transformation, segmentationMaskWidth, segmentationMaskHeight)enum
ImgDetectionsT< dai::ImgDetection > Base
class
dai::ImgDetectionsT
variable
std::vector< DetectionT > detections
variable
std::optional< ImgTransformation > transformation
function
ImgDetectionsT()function
~ImgDetectionsT()function
std::size_t getSegmentationMaskWidth()function
std::size_t getSegmentationMaskHeight()function
void setSegmentationMask(const std::vector< std::uint8_t > & mask, size_t width, size_t height)function
void setSegmentationMask(dai::ImgFrame & frame)function
std::optional< std::vector< std::uint8_t > > getMaskData()function
std::optional< dai::ImgFrame > getSegmentationMask()function
void setCvSegmentationMask(cv::Mat mask)Parameters
This API only available if OpenCV support is enabled Copies cv::Mat data to Segmentation Mask buffer
Parameters
- frame: Input cv::Mat frame from which to copy the data
Parameters
Throws if mask is not a single channel INT8 type.
function
std::optional< cv::Mat > getCvSegmentationMask(cv::MatAllocator * allocator)Retrieves mask data as a cv::Mat copy with specified width and height. If mask data is not set, returns std::nullopt.
Parameters
- allocator: Allows callers to supply a custom cv::MatAllocator for zero-copy/custom memory management; nullptr uses OpenCV’s default.
function
std::optional< cv::Mat > getCvSegmentationMaskByIndex(uint8_t index, cv::MatAllocator * allocator)Returns a binary mask where pixels belonging to the instance index are set to 1, others to 0. If mask data is not set, returns std::nullopt.
Parameters
- index: Instance index
- allocator: Allows callers to supply a custom cv::MatAllocator for zero-copy/custom memory management; nullptr uses OpenCV’s default.
function
std::optional< cv::Mat > getCvSegmentationMaskByClass(uint8_t semanticClass, cv::MatAllocator * allocator)Retrieves data by the semantic class. If no mask data is not set, returns std::nullopt.
Parameters
- semanticClass: Semantic class index
- allocator: Allows callers to supply a custom cv::MatAllocator for zero-copy/custom memory management; nullptr uses OpenCV’s default.
Need assistance?
Head over to Discussion Forum for technical support or any other questions you might have.