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.createMonoCamera()
dai::Pipeline pipeline;
auto mono = pipeline.create<dai::node::MonoCamera>();

Inputs and Outputs

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

Message types

Usage

pipeline = dai.Pipeline()
mono = pipeline.createMonoCamera()
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.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

getAssets(self: depthai.Node) → List[depthai.Asset]

Retrieves all nodes assets

getBoardSocket(self: depthai.MonoCamera) → dai::CameraBoardSocket

Retrieves which board socket to use

Returns

Board socket to use

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

Get rate at which camera should produce frames

Returns

Rate in frames per second

getImageOrientation(self: depthai.MonoCamera) → dai::CameraImageOrientation

Get camera image orientation

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

Retrieves all nodes inputs

getName(self: depthai.Node)str

Retrieves nodes name

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

Retrieves all nodes outputs

getResolution(self: depthai.MonoCamera) → dai::MonoCameraProperties::SensorResolution

Get sensor resolution

getResolutionHeight(self: depthai.MonoCamera)int

Get sensor resolution height

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

Get sensor resolution as size

getResolutionWidth(self: depthai.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.MonoCamera, boardSocket: dai::CameraBoardSocket)None

Specify which board socket to use

Parameter boardSocket:

Board socket to use

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

Set rate at which camera should produce frames

Parameter fps:

Rate in frames per second

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

Set camera image orientation

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

Set sensor resolution

class dai::node::MonoCamera : public dai::Node

MonoCamera node. For use with grayscale sensors.

Public Types

using Properties = dai::MonoCameraProperties

Public Functions

MonoCamera(const std::shared_ptr<PipelineImpl> &par, int64_t nodeId)
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.

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

Private Functions

std::string getName() const override

Retrieves nodes name.

std::vector<Output> getOutputs() override

Retrieves all nodes outputs.

std::vector<Input> getInputs() override

Retrieves all nodes inputs.

nlohmann::json getProperties() override
std::shared_ptr<Node> clone() override

Private Members

Properties properties
std::shared_ptr<RawCameraControl> rawControl

Got questions?

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