Class ImgFrame

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Class Documentation

class ImgFrame : public dai::Buffer

ImgFrame message. Carries image data and metadata.

Public Types

using Type = RawImgFrame::Type
using Specs = RawImgFrame::Specs
using CameraSettings = RawImgFrame::CameraSettings

Public Functions

ImgFrame()

Construct ImgFrame message. Timestamp is set to now

explicit ImgFrame(std::shared_ptr<RawImgFrame> ptr)
virtual ~ImgFrame() = default
std::chrono::time_point<std::chrono::steady_clock, std::chrono::steady_clock::duration> getTimestamp(CameraExposureOffset offset) const

Retrieves image timestamp (at the specified offset of exposure) related to dai::Clock::now()

std::chrono::time_point<std::chrono::steady_clock, std::chrono::steady_clock::duration> getTimestampDevice(CameraExposureOffset offset) const

Retrieves image timestamp (at the specified offset of exposure) directly captured from device’s monotonic clock, not synchronized to host time. Used when monotonicity is required.

unsigned int getInstanceNum() const

Retrieves instance number

unsigned int getCategory() const

Retrieves image category

unsigned int getWidth() const

Retrieves image width in pixels

unsigned int getHeight() const

Retrieves image height in pixels

Type getType() const

Retrieves image type

std::chrono::microseconds getExposureTime() const

Retrieves exposure time

int getSensitivity() const

Retrieves sensitivity, as an ISO value

int getColorTemperature() const

Retrieves white-balance color temperature of the light source, in kelvins

int getLensPosition() const

Retrieves lens position, range 0..255. Returns -1 if not available

float getLensPositionRaw() const

Retrieves lens position, range 0.0f..1.0f. Returns -1 if not available

ImgFrame &setTimestamp(std::chrono::time_point<std::chrono::steady_clock, std::chrono::steady_clock::duration> timestamp)

Retrieves image timestamp related to dai::Clock::now()

ImgFrame &setTimestampDevice(std::chrono::time_point<std::chrono::steady_clock, std::chrono::steady_clock::duration> timestamp)

Sets image timestamp related to dai::Clock::now()

ImgFrame &setInstanceNum(unsigned int instance)

Instance number relates to the origin of the frame (which camera)

Parameters:

instance – Instance number

ImgFrame &setCategory(unsigned int category)
Parameters:

category – Image category

ImgFrame &setSequenceNum(int64_t seq)

Specifies sequence number

Parameters:

seq – Sequence number

ImgFrame &setWidth(unsigned int width)

Specifies frame width

Parameters:

width – frame width

ImgFrame &setHeight(unsigned int height)

Specifies frame height

Parameters:

height – frame height

ImgFrame &setSize(unsigned int width, unsigned int height)

Specifies frame size

Parameters:
  • height – frame height

  • width – frame width

ImgFrame &setSize(std::tuple<unsigned int, unsigned int> size)

Specifies frame size

Parameters:

size – frame size

ImgFrame &setType(Type type)

Specifies frame type, RGB, BGR, …

Parameters:

typeType of image

template<typename ...T>
inline ImgFrame &setFrame(T...)
template<typename ...T>
inline void getFrame(T...)
template<typename ...T>
inline void getCvFrame(T...)
std::chrono::time_point<std::chrono::steady_clock, std::chrono::steady_clock::duration> getTimestamp() const

Retrieves timestamp related to dai::Clock::now()

std::chrono::time_point<std::chrono::steady_clock, std::chrono::steady_clock::duration> getTimestampDevice() const

Retrieves timestamp directly captured from device’s monotonic clock, not synchronized to host time. Used mostly for debugging

template<typename ...T>
struct dependent_false

Public Static Attributes

static constexpr bool value = false