Class Camera

Inheritance Relationships

Base Types

Class Documentation

class Camera : public dai::DeviceNodeCRTP<DeviceNode, Camera, CameraProperties>, public dai::SourceNode

Public Functions

Node::Output *requestOutput(std::pair<uint32_t, uint32_t> size, std::optional<ImgFrame::Type> type = std::nullopt, ImgResizeMode resizeMode = ImgResizeMode::CROP, std::optional<float> fps = std::nullopt, std::optional<bool> enableUndistortion = std::nullopt)

Get video output with specified size.

virtual Node::Output *requestOutput(const Capability &capability, bool onHost) override

Request output with advanced controls. Mainly to be used by custom node writers.

Node::Output *requestFullResolutionOutput(std::optional<ImgFrame::Type> type = std::nullopt, std::optional<float> fps = std::nullopt, bool useHighestResolution = false)

Get a high resolution output with full FOV on the sensor. By default the function will not use the resolutions higher than 5000x4000, as those often need a lot of resources, making them hard to use in combination with other nodes.

Parameters:
  • type – Type of the output (NV12, BGR, …) - by default it’s auto-selected for best performance

  • fps – FPS of the output - by default it’s auto-selected to highest possible that a sensor config support or 30, whichever is lower

  • useHighestResolution – If true, the function will use the highest resolution available on the sensor, even if it’s higher than 5000x4000

std::shared_ptr<Camera> build(dai::CameraBoardSocket boardSocket = dai::CameraBoardSocket::AUTO, std::optional<std::pair<uint32_t, uint32_t>> sensorResolution = std::nullopt, std::optional<float> sensorFps = std::nullopt)

Build with a specific board socket

Parameters:
  • boardSocket – Board socket to use

  • sensorResolution – Sensor resolution to use - by default it’s auto-detected from the requested outputs

  • sensorFps – Sensor FPS to use - by default it’s auto-detected from the requested outputs (maximum is used)

inline std::shared_ptr<Camera> setSensorType(CameraSensorType sensorType)

Set the sensor type to use

Parameters:

sensorType – Sensor type to use

inline CameraSensorType getSensorType()

Get the sensor type

Returns:

Sensor type

uint32_t getMaxWidth() const

Get max width of the camera (can only be called after build)

uint32_t getMaxHeight() const

Get max height of the camera (can only be called after build)

CameraBoardSocket getBoardSocket() const

Retrieves which board socket to use

Returns:

Board socket to use

std::shared_ptr<Camera> setRawNumFramesPool(int num)

Set number of frames in raw pool (will be automatically reduced if the maximum pool memory size is exceeded)

Parameters:

num – Number of frames

Returns:

Shared pointer to the camera node

std::shared_ptr<Camera> setMaxSizePoolRaw(int size)

Set maximum size of raw pool

Parameters:

size – Maximum size in bytes of raw pool

Returns:

Shared pointer to the camera node

std::shared_ptr<Camera> setIspNumFramesPool(int num)

Set number of frames in isp pool (will be automatically reduced if the maximum pool memory size is exceeded)

Parameters:

num – Number of frames

Returns:

Shared pointer to the camera node

std::shared_ptr<Camera> setMaxSizePoolIsp(int size)

Set maximum size of isp pool

Parameters:

size – Maximum size in bytes of isp pool

Returns:

Shared pointer to the camera node

std::shared_ptr<Camera> setNumFramesPools(int raw, int isp, int outputs)

Set number of frames in all pools (will be automatically reduced if the maximum pool memory size is exceeded)

Parameters:
  • raw – Number of frames in raw pool

  • isp – Number of frames in isp pool

  • outputs – Number of frames in outputs pools

Returns:

Shared pointer to the camera node

std::shared_ptr<Camera> setMaxSizePools(int raw, int isp, int outputs)

Set maximum memory size of all pools

Parameters:
  • raw – Maximum size in bytes of raw pool

  • isp – Maximum size in bytes of isp pool

  • outputs – Maximum size in bytes of outputs pools

Returns:

Shared pointer to the camera node

std::shared_ptr<Camera> setOutputsNumFramesPool(int num)

Set number of frames in pools for all outputs

Parameters:

num – Number of frames in pools for all outputs

Returns:

Shared pointer to the camera node

std::shared_ptr<Camera> setOutputsMaxSizePool(int size)

Set maximum size of pools for all outputs

Parameters:

size – Maximum size in bytes of pools for all outputs

Returns:

Shared pointer to the camera node

int getRawNumFramesPool() const

Get number of frames in raw pool

Returns:

Number of frames

int getMaxSizePoolRaw() const

Get maximum size of raw pool

Returns:

Maximum size in bytes of raw pool

int getIspNumFramesPool() const

Get number of frames in isp pool

Returns:

Number of frames

int getMaxSizePoolIsp() const

Get maximum size of isp pool

Returns:

Maximum size in bytes of isp pool

int getOutputsNumFramesPool() const

Get number of frames in outputs pool for all outputs

Returns:

Number of frames

int getOutputsMaxSizePool() const

Get maximum size of outputs pool for all outputs

Returns:

Maximum size in bytes of image manip pool

Camera()
explicit Camera(std::shared_ptr<Device> &defaultDevice)
explicit Camera(std::unique_ptr<Properties> props)
virtual void buildStage1() override

Build stages;.

float getMaxRequestedFps() const
uint32_t getMaxRequestedWidth() const
uint32_t getMaxRequestedHeight() const
inline DeviceNodeCRTP()
inline DeviceNodeCRTP(const std::shared_ptr<Device> &device)
inline DeviceNodeCRTP(std::unique_ptr<Properties> props)
inline DeviceNodeCRTP(std::unique_ptr<Properties> props, bool confMode)
inline DeviceNodeCRTP(const std::shared_ptr<Device> &device, std::unique_ptr<Properties> props, bool confMode)

Public Members

CameraControl initialControl

Initial control options to apply to sensor

Input inputControl{*this, {"inputControl", DEFAULT_GROUP, DEFAULT_BLOCKING, DEFAULT_QUEUE_SIZE, {{{DatatypeEnum::CameraControl, false}}}, DEFAULT_WAIT_FOR_MESSAGE}}

Input for CameraControl message, which can modify camera parameters in runtime

Input mockIsp = {*this, {"mockIsp", DEFAULT_GROUP, true, 8, {{{DatatypeEnum::ImgFrame, false}}}, DEFAULT_WAIT_FOR_MESSAGE}}

Input for mocking ‘isp’ functionality on RVC2. Default queue is blocking with size 8

Output raw = {*this, {"raw", DEFAULT_GROUP, {{{DatatypeEnum::ImgFrame, false}}}}}

Outputs ImgFrame message that carries RAW10-packed (MIPI CSI-2 format) frame data.

Captured directly from the camera sensor, and the source for the ‘isp’ output.

OutputMap dynamicOutputs = {*this, "dynamicOutputs", {"", "", {{DatatypeEnum::ImgFrame, false}}}}

Public Static Functions

static inline std::shared_ptr<Camera> create()
static inline std::shared_ptr<Camera> create(std::shared_ptr<Device> &defaultDevice)

Public Static Attributes

static constexpr const char *NAME = "Camera"

Protected Functions

virtual Properties &getProperties() override
virtual bool isSourceNode() const override
virtual NodeRecordParams getNodeRecordParams() const override
virtual Input &getReplayInput() override