CameraControl

This message is used for controlling the color camera as well as the mono camera. The message handles things like capturing still images, confifguring auto focus, anti banding, white balance, scenes, effects etc.

Reference

class depthai.CameraControl

CameraControl message. Specifies various camera control commands like:

  • Still capture

  • Auto focus

  • Anti banding

  • Auto white balance

  • Scene

  • Effect

class AntiBandingMode

Members:

OFF

MAINS_50_HZ

MAINS_60_HZ

AUTO

property name
class AutoFocusMode

Members:

OFF

AUTO

MACRO

CONTINUOUS_VIDEO

CONTINUOUS_PICTURE

EDOF

property name
class AutoWhiteBalanceMode

Members:

OFF

AUTO

INCANDESCENT

FLUORESCENT

WARM_FLUORESCENT

DAYLIGHT

CLOUDY_DAYLIGHT

TWILIGHT

SHADE

property name
class EffectMode

Members:

OFF

MONO

NEGATIVE

SOLARIZE

SEPIA

POSTERIZE

WHITEBOARD

BLACKBOARD

AQUA

property name
class SceneMode

Members:

UNSUPPORTED

FACE_PRIORITY

ACTION

PORTRAIT

LANDSCAPE

NIGHT

NIGHT_PORTRAIT

THEATRE

BEACH

SNOW

SUNSET

STEADYPHOTO

FIREWORKS

SPORTS

PARTY

CANDLELIGHT

BARCODE

property name
getCaptureStill(self: depthai.CameraControl)bool

Check whether command to capture a still is set

Returns

True if capture still command is set

getData(self: object) → numpy.ndarray[numpy.uint8]
Returns

Reference to internal buffer

getRaw(self: depthai.ADatatype)depthai.RawBuffer
setAntiBandingMode(self: depthai.CameraControl, mode: depthai.RawCameraControl.AntiBandingMode)None

Set a command to specify auto banding mode

Parameter mode:

Auto banding mode to use

setAutoExposureCompensation(self: depthai.CameraControl, compensation: int)None

Set a command to specify auto exposure compensation

Parameter compensation:

Compensation value between -9..9

setAutoExposureEnable(self: depthai.CameraControl)None

Set a command to enable auto exposure

setAutoExposureLock(self: depthai.CameraControl, lock: bool)None

Set a command to specify lock auto exposure

Parameter lock:

Auto exposure lock mode enabled or disabled

setAutoExposureRegion(self: depthai.CameraControl, startX: int, startY: int, width: int, height: int)None

Set a command to specify auto exposure region in pixels

Parameter startX:

X coordinate of top left corner of region

Parameter startY:

Y coordinate of top left corner of region

Parameter width:

Region width

Parameter height:

Region height

setAutoFocusMode(self: depthai.CameraControl, mode: depthai.RawCameraControl.AutoFocusMode)None

Set a command to specify autofocus mode

setAutoFocusRegion(self: depthai.CameraControl, startX: int, startY: int, width: int, height: int)None

Set a command to specify focus region in pixels

Parameter startX:

X coordinate of top left corner of region

Parameter startY:

Y coordinate of top left corner of region

Parameter width:

Region width

Parameter height:

Region height

setAutoFocusTrigger(self: depthai.CameraControl)None

Set a command to trigger autofocus

setAutoWhiteBalanceLock(self: depthai.CameraControl, lock: bool)None

Set a command to specify auto white balance lock

Parameter lock:

Auto white balance lock mode enabled or disabled

setAutoWhiteBalanceMode(self: depthai.CameraControl, mode: depthai.RawCameraControl.AutoWhiteBalanceMode)None

Set a command to specify auto white balance mode

Parameter mode:

Auto white balance mode to use

setBrightness(self: depthai.CameraControl, value: int)None

Set a command to adjust image brightness

Parameter value:

Brightness, range -10..10

setCaptureStill(self: depthai.CameraControl, capture: bool)None

Set a command to capture a still image

setChromaDenoise(self: depthai.CameraControl, value: int)None

Set a command to adjust chroma denoise amount

Parameter value:

Chroma denoise amount, range 0..4

setContrast(self: depthai.CameraControl, value: int)None

Set a command to adjust image contrast

Parameter value:

Contrast, range -10..10

setData(*args, **kwargs)

Overloaded function.

  1. setData(self: depthai.Buffer, arg0: List[int]) -> None

Parameter data:

Copies data to internal buffer

  1. setData(self: depthai.Buffer, arg0: numpy.ndarray[numpy.uint8]) -> None

Parameter data:

Copies data to internal buffer

setEffectMode(self: depthai.CameraControl, mode: depthai.RawCameraControl.EffectMode)None

Set a command to specify effect mode

Parameter mode:

Effect mode

setLumaDenoise(self: depthai.CameraControl, value: int)None

Set a command to adjust luma denoise amount

Parameter value:

Luma denoise amount, range 0..4

setManualExposure(self: depthai.CameraControl, exposureTimeUs: int, sensitivityIso: int)None

Set a command to manually specify exposure

Parameter exposureTimeUs:

Exposure time in microseconds

Parameter sensitivityIso:

Sensitivity as ISO value, usual range 100..1600

setManualFocus(self: depthai.CameraControl, lensPosition: int)None

Set a command to specify manual focus position

Parameter lensPosition:

specify lens position 0..255

setSaturation(self: depthai.CameraControl, value: int)None

Set a command to adjust image saturation

Parameter value:

Saturation, range -10..10

setSceneMode(self: depthai.CameraControl, mode: depthai.RawCameraControl.SceneMode)None

Set a command to specify scene mode

Parameter mode:

Scene mode

setSharpness(self: depthai.CameraControl, value: int)None

Set a command to adjust image sharpness

Parameter value:

Sharpness, range 0..4

setStartStreaming(self: depthai.CameraControl)None

Set a command to start streaming

setStopStreaming(self: depthai.CameraControl)None

Set a command to stop streaming

class dai::CameraControl : public dai::Buffer

CameraControl message. Specifies various camera control commands like:

  • Still capture

  • Auto focus

  • Anti banding

  • Auto white balance

  • Scene

  • Effect

Public Types

using AutoFocusMode = RawCameraControl::AutoFocusMode
using AntiBandingMode = RawCameraControl::AntiBandingMode
using AutoWhiteBalanceMode = RawCameraControl::AutoWhiteBalanceMode
using SceneMode = RawCameraControl::SceneMode
using EffectMode = RawCameraControl::EffectMode

Public Functions

CameraControl()

Construct CameraControl message.

CameraControl(std::shared_ptr<RawCameraControl> ptr)
~CameraControl() = default
void setCaptureStill(bool capture)

Set a command to capture a still image

void setStartStreaming()

Set a command to start streaming

void setStopStreaming()

Set a command to stop streaming

void setAutoFocusMode(AutoFocusMode mode)

Set a command to specify autofocus mode

void setAutoFocusTrigger()

Set a command to trigger autofocus

void setAutoFocusRegion(uint16_t startX, uint16_t startY, uint16_t width, uint16_t height)

Set a command to specify focus region in pixels

Parameters
  • startX: X coordinate of top left corner of region

  • startY: Y coordinate of top left corner of region

  • width: Region width

  • height: Region height

void setManualFocus(uint8_t lensPosition)

Set a command to specify manual focus position

Parameters
  • lensPosition: specify lens position 0..255

void setAutoExposureEnable()

Set a command to enable auto exposure

void setAutoExposureLock(bool lock)

Set a command to specify lock auto exposure

Parameters
  • lock: Auto exposure lock mode enabled or disabled

void setAutoExposureRegion(uint16_t startX, uint16_t startY, uint16_t width, uint16_t height)

Set a command to specify auto exposure region in pixels

Parameters
  • startX: X coordinate of top left corner of region

  • startY: Y coordinate of top left corner of region

  • width: Region width

  • height: Region height

void setAutoExposureCompensation(int compensation)

Set a command to specify auto exposure compensation

Parameters
  • compensation: Compensation value between -9..9

void setAntiBandingMode(AntiBandingMode mode)

Set a command to specify auto banding mode

Parameters
  • mode: Auto banding mode to use

void setManualExposure(uint32_t exposureTimeUs, uint32_t sensitivityIso)

Set a command to manually specify exposure

Parameters
  • exposureTimeUs: Exposure time in microseconds

  • sensitivityIso: Sensitivity as ISO value, usual range 100..1600

void setAutoWhiteBalanceMode(AutoWhiteBalanceMode mode)

Set a command to specify auto white balance mode

Parameters
  • mode: Auto white balance mode to use

void setAutoWhiteBalanceLock(bool lock)

Set a command to specify auto white balance lock

Parameters
  • lock: Auto white balance lock mode enabled or disabled

void setBrightness(int value)

Set a command to adjust image brightness

Parameters
  • value: Brightness, range -10..10

void setContrast(int value)

Set a command to adjust image contrast

Parameters
  • value: Contrast, range -10..10

void setSaturation(int value)

Set a command to adjust image saturation

Parameters
  • value: Saturation, range -10..10

void setSharpness(int value)

Set a command to adjust image sharpness

Parameters
  • value: Sharpness, range 0..4

void setLumaDenoise(int value)

Set a command to adjust luma denoise amount

Parameters
  • value: Luma denoise amount, range 0..4

void setChromaDenoise(int value)

Set a command to adjust chroma denoise amount

Parameters
  • value: Chroma denoise amount, range 0..4

void setSceneMode(SceneMode mode)

Set a command to specify scene mode

Parameters
  • mode: Scene mode

void setEffectMode(EffectMode mode)

Set a command to specify effect mode

Parameters
  • mode: Effect mode

bool getCaptureStill() const

Check whether command to capture a still is set

Return

True if capture still command is set

Private Functions

std::shared_ptr<RawBuffer> serialize() const override

Private Members

RawCameraControl &cfg

Got questions?

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