MonoCamera

MonoCamera node is a source of image frames. You can control in at runtime with the inputControl. Some DepthAI modules don’t have mono camera(s). Two mono cameras are used to calculate stereo depth (with StereoDepth node).

How to place it

pipeline = dai.Pipeline()
mono = pipeline.create(dai.node.MonoCamera)
dai::Pipeline pipeline;
auto mono = pipeline.create<dai::node::MonoCamera>();

Inputs and Outputs

               ┌─────────────────┐
               │                 │         out
inputControl   │                 ├───────────►
──────────────►│    MonoCamera   |         raw
               │                 ├───────────►
               │                 │
               └─────────────────┘

Message types

Usage

pipeline = dai.Pipeline()
mono = pipeline.create(dai.node.MonoCamera)
mono.setBoardSocket(dai.CameraBoardSocket.RIGHT)
mono.setResolution(dai.MonoCameraProperties.SensorResolution.THE_720_P)
dai::Pipeline pipeline;
auto mono = pipeline.create<dai::node::MonoCamera>();
mono->setBoardSocket(dai::CameraBoardSocket::RIGHT);
mono->setResolution(dai::MonoCameraProperties::SensorResolution::THE_720_P);

Reference

class depthai.node.MonoCamera

MonoCamera node. For use with grayscale sensors.

class Connection

Connection between an Input and Output

class Id

Node identificator. Unique for every node on a single Pipeline

Properties

alias of depthai.MonoCameraProperties

property frameEvent

Outputs metadata-only ImgFrame message as an early indicator of an incoming frame.

It’s sent on the MIPI SoF (start-of-frame) event, just after the exposure of the current frame has finished and before the exposure for next frame starts. Could be used to synchronize various processes with camera capture. Fields populated: camera id, sequence number, timestamp

getAssetManager(*args, **kwargs)

Overloaded function.

  1. getAssetManager(self: depthai.Node) -> depthai.AssetManager

Get node AssetManager as a const reference

  1. getAssetManager(self: depthai.Node) -> depthai.AssetManager

Get node AssetManager as a const reference

getBoardSocket(self: depthai.node.MonoCamera)depthai.CameraBoardSocket

Retrieves which board socket to use

Returns

Board socket to use

getCamId(self: depthai.node.MonoCamera)int
getFps(self: depthai.node.MonoCamera)float

Get rate at which camera should produce frames

Returns

Rate in frames per second

getImageOrientation(self: depthai.node.MonoCamera)depthai.CameraImageOrientation

Get camera image orientation

getInputRefs(*args, **kwargs)

Overloaded function.

  1. getInputRefs(self: depthai.Node) -> List[depthai.Node.Input]

Retrieves reference to node inputs

  1. getInputRefs(self: depthai.Node) -> List[depthai.Node.Input]

Retrieves reference to node inputs

getInputs(self: depthai.Node) → List[depthai.Node.Input]

Retrieves all nodes inputs

getName(self: depthai.Node)str

Retrieves nodes name

getNumFramesPool(self: depthai.node.MonoCamera)int

Get number of frames in main (ISP output) pool

getOutputRefs(*args, **kwargs)

Overloaded function.

  1. getOutputRefs(self: depthai.Node) -> List[depthai.Node.Output]

Retrieves reference to node outputs

  1. getOutputRefs(self: depthai.Node) -> List[depthai.Node.Output]

Retrieves reference to node outputs

getOutputs(self: depthai.Node) → List[depthai.Node.Output]

Retrieves all nodes outputs

getParentPipeline(*args, **kwargs)

Overloaded function.

  1. getParentPipeline(self: depthai.Node) -> depthai.Pipeline

  2. getParentPipeline(self: depthai.Node) -> depthai.Pipeline

getRawNumFramesPool(self: depthai.node.MonoCamera)int

Get number of frames in raw pool

getResolution(self: depthai.node.MonoCamera)depthai.MonoCameraProperties.SensorResolution

Get sensor resolution

getResolutionHeight(self: depthai.node.MonoCamera)int

Get sensor resolution height

getResolutionSize(self: depthai.node.MonoCamera) → Tuple[int, int]

Get sensor resolution as size

getResolutionWidth(self: depthai.node.MonoCamera)int

Get sensor resolution width

property id

Id of node

property initialControl

Initial control options to apply to sensor

property inputControl

Input for CameraControl message, which can modify camera parameters in runtime Default queue is blocking with size 8

property out

Outputs ImgFrame message that carries RAW8 encoded (grayscale) frame data.

Suitable for use StereoDepth node. Processed by ISP

property raw

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

Captured directly from the camera sensor

setBoardSocket(self: depthai.node.MonoCamera, boardSocket: depthai.CameraBoardSocket)None

Specify which board socket to use

Parameter boardSocket:

Board socket to use

setCamId(self: depthai.node.MonoCamera, arg0: int)None
setFps(self: depthai.node.MonoCamera, fps: float)None

Set rate at which camera should produce frames

Parameter fps:

Rate in frames per second

setImageOrientation(self: depthai.node.MonoCamera, imageOrientation: depthai.CameraImageOrientation)None

Set camera image orientation

setNumFramesPool(self: depthai.node.MonoCamera, arg0: int)None

Set number of frames in main (ISP output) pool

setRawNumFramesPool(self: depthai.node.MonoCamera, arg0: int)None

Set number of frames in raw pool

setResolution(self: depthai.node.MonoCamera, resolution: depthai.MonoCameraProperties.SensorResolution)None

Set sensor resolution

class dai::node::MonoCamera : public dai::NodeCRTP<Node, MonoCamera, MonoCameraProperties>

MonoCamera node. For use with grayscale sensors.

Public Functions

MonoCamera(const std::shared_ptr<PipelineImpl> &par, int64_t nodeId)
MonoCamera(const std::shared_ptr<PipelineImpl> &par, int64_t nodeId, std::unique_ptr<Properties> props)
void setBoardSocket(CameraBoardSocket boardSocket)

Specify which board socket to use

Parameters
  • boardSocket: Board socket to use

CameraBoardSocket getBoardSocket() const

Retrieves which board socket to use

Return

Board socket to use

void setCamId(int64_t id)
int64_t getCamId() const
void setImageOrientation(CameraImageOrientation imageOrientation)

Set camera image orientation.

CameraImageOrientation getImageOrientation() const

Get camera image orientation.

void setResolution(Properties::SensorResolution resolution)

Set sensor resolution.

Properties::SensorResolution getResolution() const

Get sensor resolution.

void setFps(float fps)

Set rate at which camera should produce frames

Parameters
  • fps: Rate in frames per second

float getFps() const

Get rate at which camera should produce frames

Return

Rate in frames per second

std::tuple<int, int> getResolutionSize() const

Get sensor resolution as size.

int getResolutionWidth() const

Get sensor resolution width.

int getResolutionHeight() const

Get sensor resolution height.

void setNumFramesPool(int num)

Set number of frames in main (ISP output) pool.

void setRawNumFramesPool(int num)

Set number of frames in raw pool.

int getNumFramesPool() const

Get number of frames in main (ISP output) pool.

int getRawNumFramesPool() const

Get number of frames in raw pool.

Public Members

CameraControl initialControl

Initial control options to apply to sensor

Input inputControl = {*this, "inputControl", Input::Type::SReceiver, true, 8, {{DatatypeEnum::CameraControl, false}}}

Input for CameraControl message, which can modify camera parameters in runtime Default queue is blocking with size 8

Output out = {*this, "out", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}}

Outputs ImgFrame message that carries RAW8 encoded (grayscale) frame data.

Suitable for use StereoDepth node. Processed by ISP

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

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

Captured directly from the camera sensor

Output frameEvent = {*this, "frameEvent", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}}

Outputs metadata-only ImgFrame message as an early indicator of an incoming frame.

It’s sent on the MIPI SoF (start-of-frame) event, just after the exposure of the current frame has finished and before the exposure for next frame starts. Could be used to synchronize various processes with camera capture. Fields populated: camera id, sequence number, timestamp

Public Static Attributes

constexpr const char *NAME = "MonoCamera"

Private Members

std::shared_ptr<RawCameraControl> rawControl

Got questions?

We’re always happy to help with code or other questions you might have.