#include <CameraControl.hpp>
Public Types | |
using | AntiBandingMode = RawCameraControl::AntiBandingMode |
using | AutoFocusMode = RawCameraControl::AutoFocusMode |
using | AutoWhiteBalanceMode = RawCameraControl::AutoWhiteBalanceMode |
using | CaptureIntent = RawCameraControl::CaptureIntent |
using | ControlMode = RawCameraControl::ControlMode |
using | EffectMode = RawCameraControl::EffectMode |
using | FrameSyncMode = RawCameraControl::FrameSyncMode |
using | SceneMode = RawCameraControl::SceneMode |
Public Member Functions | |
CameraControl () | |
Construct CameraControl message. More... | |
CameraControl (std::shared_ptr< RawCameraControl > ptr) | |
void | clearMiscControls () |
dai::RawCameraControl | get () const |
bool | getCaptureStill () const |
std::chrono::microseconds | getExposureTime () const |
int | getLensPosition () const |
float | getLensPositionRaw () const |
std::vector< std::pair< std::string, std::string > > | getMiscControls () |
int | getSensitivity () const |
CameraControl & | set (dai::RawCameraControl config) |
CameraControl & | setAntiBandingMode (AntiBandingMode mode) |
CameraControl & | setAutoExposureCompensation (int compensation) |
CameraControl & | setAutoExposureEnable () |
CameraControl & | setAutoExposureLimit (std::chrono::microseconds maxExposureTime) |
CameraControl & | setAutoExposureLimit (uint32_t maxExposureTimeUs) |
CameraControl & | setAutoExposureLock (bool lock) |
CameraControl & | setAutoExposureRegion (uint16_t startX, uint16_t startY, uint16_t width, uint16_t height) |
CameraControl & | setAutoFocusLensRange (int infinityPosition, int macroPosition) |
CameraControl & | setAutoFocusMode (AutoFocusMode mode) |
CameraControl & | setAutoFocusRegion (uint16_t startX, uint16_t startY, uint16_t width, uint16_t height) |
CameraControl & | setAutoFocusTrigger () |
CameraControl & | setAutoWhiteBalanceLock (bool lock) |
CameraControl & | setAutoWhiteBalanceMode (AutoWhiteBalanceMode mode) |
CameraControl & | setBrightness (int value) |
CameraControl & | setCaptureIntent (CaptureIntent mode) |
CameraControl & | setCaptureStill (bool capture) |
CameraControl & | setChromaDenoise (int value) |
CameraControl & | setContrast (int value) |
CameraControl & | setControlMode (ControlMode mode) |
CameraControl & | setEffectMode (EffectMode mode) |
CameraControl & | setExternalTrigger (int numFramesBurst, int numFramesDiscard) |
CameraControl & | setFrameSyncMode (FrameSyncMode mode) |
CameraControl & | setLumaDenoise (int value) |
CameraControl & | setManualExposure (std::chrono::microseconds exposureTime, uint32_t sensitivityIso) |
CameraControl & | setManualExposure (uint32_t exposureTimeUs, uint32_t sensitivityIso) |
CameraControl & | setManualFocus (uint8_t lensPosition) |
CameraControl & | setManualFocusRaw (float lensPositionRaw) |
CameraControl & | setManualWhiteBalance (int colorTemperatureK) |
CameraControl & | setMisc (std::string control, float value) |
CameraControl & | setMisc (std::string control, int value) |
CameraControl & | setMisc (std::string control, std::string value) |
CameraControl & | setSaturation (int value) |
CameraControl & | setSceneMode (SceneMode mode) |
CameraControl & | setSharpness (int value) |
CameraControl & | setStartStreaming () |
CameraControl & | setStopStreaming () |
CameraControl & | setStrobeDisable () |
CameraControl & | setStrobeExternal (int gpioNumber, int activeLevel=1) |
CameraControl & | setStrobeSensor (int activeLevel=1) |
virtual | ~CameraControl ()=default |
![]() | |
Buffer () | |
Creates Buffer message. More... | |
Buffer (std::shared_ptr< dai::RawBuffer > ptr) | |
std::vector< std::uint8_t > & | getData () const |
Get non-owning reference to internal buffer. More... | |
int64_t | getSequenceNum () const |
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > | getTimestamp () const |
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > | getTimestampDevice () const |
void | setData (const std::vector< std::uint8_t > &data) |
void | setData (std::vector< std::uint8_t > &&data) |
Buffer & | setSequenceNum (int64_t sequenceNum) |
Buffer & | setTimestamp (std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > timestamp) |
Buffer & | setTimestampDevice (std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > timestamp) |
virtual | ~Buffer ()=default |
![]() | |
ADatatype (std::shared_ptr< RawBuffer > r) | |
std::shared_ptr< RawBuffer > | getRaw () const |
virtual | ~ADatatype ()=default |
Private Member Functions | |
std::shared_ptr< RawBuffer > | serialize () const override |
Private Attributes | |
RawCameraControl & | cfg |
Additional Inherited Members | |
![]() | |
std::shared_ptr< RawBuffer > | raw |
CameraControl message. Specifies various camera control commands like:
By default the camera enables 3A, with auto-focus in CONTINUOUS_VIDEO
mode, auto-white-balance in AUTO
mode, and auto-exposure with anti-banding for 50Hz mains frequency.
Definition at line 33 of file CameraControl.hpp.
Definition at line 39 of file CameraControl.hpp.
Definition at line 38 of file CameraControl.hpp.
Definition at line 40 of file CameraControl.hpp.
Definition at line 44 of file CameraControl.hpp.
Definition at line 43 of file CameraControl.hpp.
Definition at line 42 of file CameraControl.hpp.
Definition at line 45 of file CameraControl.hpp.
Definition at line 41 of file CameraControl.hpp.
dai::CameraControl::CameraControl | ( | ) |
Construct CameraControl message.
Definition at line 9 of file CameraControl.cpp.
|
explicit |
Definition at line 10 of file CameraControl.cpp.
|
virtualdefault |
void dai::CameraControl::clearMiscControls | ( | ) |
Clear the list of miscellaneous controls set by setControl
Definition at line 228 of file CameraControl.cpp.
dai::RawCameraControl dai::CameraControl::get | ( | ) | const |
Retrieve configuration data for CameraControl.
Definition at line 255 of file CameraControl.cpp.
bool dai::CameraControl::getCaptureStill | ( | ) | const |
Check whether command to capture a still is set
Definition at line 235 of file CameraControl.cpp.
std::chrono::microseconds dai::CameraControl::getExposureTime | ( | ) | const |
Retrieves exposure time
Definition at line 239 of file CameraControl.cpp.
int dai::CameraControl::getLensPosition | ( | ) | const |
Retrieves lens position, range 0..255. Returns -1 if not available
Definition at line 247 of file CameraControl.cpp.
float dai::CameraControl::getLensPositionRaw | ( | ) | const |
Retrieves lens position, range 0.0f..1.0f.
Definition at line 251 of file CameraControl.cpp.
std::vector< std::pair< std::string, std::string > > dai::CameraControl::getMiscControls | ( | ) |
Get the list of miscellaneous controls set by setControl
Definition at line 231 of file CameraControl.cpp.
int dai::CameraControl::getSensitivity | ( | ) | const |
Retrieves sensitivity, as an ISO value
Definition at line 243 of file CameraControl.cpp.
|
overrideprivatevirtual |
Reimplemented from dai::Buffer.
Definition at line 5 of file CameraControl.cpp.
CameraControl & dai::CameraControl::set | ( | dai::RawCameraControl | config | ) |
Set explicit configuration.
config | Explicit configuration |
Definition at line 259 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setAntiBandingMode | ( | AntiBandingMode | mode | ) |
Set a command to specify anti-banding mode. Anti-banding / anti-flicker works in auto-exposure mode, by controlling the exposure time to be applied in multiples of half the mains period, for example in multiple of 10ms for 50Hz (period 20ms) AC-powered illumination sources.
If the scene would be too bright for the smallest exposure step (10ms in the example, with ISO at a minimum of 100), anti-banding is not effective.
mode | Anti-banding mode to use. Default: MAINS_50_HZ |
Definition at line 132 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setAutoExposureCompensation | ( | int | compensation | ) |
Set a command to specify auto exposure compensation
compensation | Compensation value between -9..9, default 0 |
Definition at line 119 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setAutoExposureEnable | ( | ) |
Set a command to enable auto exposure
Definition at line 101 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setAutoExposureLimit | ( | std::chrono::microseconds | maxExposureTime | ) |
Set a command to specify the maximum exposure time limit for auto-exposure. By default the AE algorithm prioritizes increasing exposure over ISO, up to around frame-time (subject to further limits imposed by anti-banding)
maxExposureTime | Maximum exposure time |
Definition at line 129 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setAutoExposureLimit | ( | uint32_t | maxExposureTimeUs | ) |
Set a command to specify the maximum exposure time limit for auto-exposure. By default the AE algorithm prioritizes increasing exposure over ISO, up to around frame-time (subject to further limits imposed by anti-banding)
maxExposureTimeUs | Maximum exposure time in microseconds |
Definition at line 124 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setAutoExposureLock | ( | bool | lock | ) |
Set a command to specify lock auto exposure
lock | Auto exposure lock mode enabled or disabled |
Definition at line 105 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setAutoExposureRegion | ( | uint16_t | startX, |
uint16_t | startY, | ||
uint16_t | width, | ||
uint16_t | height | ||
) |
Set a command to specify auto exposure region in pixels. Note: the region should be mapped to the configured sensor resolution, before ISP scaling
startX | X coordinate of top left corner of region |
startY | Y coordinate of top left corner of region |
width | Region width |
height | Region height |
Definition at line 110 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setAutoFocusLensRange | ( | int | infinityPosition, |
int | macroPosition | ||
) |
Set autofocus lens range, infinityPosition < macroPosition
, valid values 0..255
. May help to improve autofocus in case the lens adjustment is not typical/tuned
Definition at line 73 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setAutoFocusMode | ( | AutoFocusMode | mode | ) |
Set a command to specify autofocus mode. Default CONTINUOUS_VIDEO
Definition at line 64 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setAutoFocusRegion | ( | uint16_t | startX, |
uint16_t | startY, | ||
uint16_t | width, | ||
uint16_t | height | ||
) |
Set a command to specify focus region in pixels. Note: the region should be mapped to the configured sensor resolution, before ISP scaling
startX | X coordinate of top left corner of region |
startY | Y coordinate of top left corner of region |
width | Region width |
height | Region height |
Definition at line 79 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setAutoFocusTrigger | ( | ) |
Set a command to trigger autofocus
Definition at line 69 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setAutoWhiteBalanceLock | ( | bool | lock | ) |
Set a command to specify auto white balance lock
lock | Auto white balance lock mode enabled or disabled |
Definition at line 155 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setAutoWhiteBalanceMode | ( | AutoWhiteBalanceMode | mode | ) |
Set a command to specify auto white balance mode
mode | Auto white balance mode to use. Default AUTO |
Definition at line 150 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setBrightness | ( | int | value | ) |
Set a command to adjust image brightness
value | Brightness, range -10..10, default 0 |
Definition at line 167 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setCaptureIntent | ( | CaptureIntent | mode | ) |
Set a command to specify capture intent mode
mode | Capture intent mode |
Definition at line 212 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setCaptureStill | ( | bool | capture | ) |
Set a command to capture a still image
Definition at line 14 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setChromaDenoise | ( | int | value | ) |
Set a command to adjust chroma denoise amount
value | Chroma denoise amount, range 0..4, default 1 |
Definition at line 192 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setContrast | ( | int | value | ) |
Set a command to adjust image contrast
value | Contrast, range -10..10, default 0 |
Definition at line 172 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setControlMode | ( | ControlMode | mode | ) |
Set a command to specify control mode
mode | Control mode |
Definition at line 207 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setEffectMode | ( | EffectMode | mode | ) |
Set a command to specify effect mode
mode | Effect mode |
Definition at line 202 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setExternalTrigger | ( | int | numFramesBurst, |
int | numFramesDiscard | ||
) |
Set a command to enable external trigger snapshot mode
A rising edge on the sensor FSIN pin will make it capture a sequence of numFramesBurst
frames. First numFramesDiscard
will be skipped as configured (can be set to 0 as well), as they may have degraded quality
Definition at line 28 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setFrameSyncMode | ( | FrameSyncMode | mode | ) |
Set the frame sync mode for continuous streaming operation mode, translating to how the camera pin FSIN/FSYNC is used: input/output/disabled
Definition at line 35 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setLumaDenoise | ( | int | value | ) |
Set a command to adjust luma denoise amount
value | Luma denoise amount, range 0..4, default 1 |
Definition at line 187 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setManualExposure | ( | std::chrono::microseconds | exposureTime, |
uint32_t | sensitivityIso | ||
) |
Set a command to manually specify exposure
exposureTime | Exposure time |
sensitivityIso | Sensitivity as ISO value, usual range 100..1600 |
Definition at line 145 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setManualExposure | ( | uint32_t | exposureTimeUs, |
uint32_t | sensitivityIso | ||
) |
Set a command to manually specify exposure
exposureTimeUs | Exposure time in microseconds |
sensitivityIso | Sensitivity as ISO value, usual range 100..1600 |
Definition at line 137 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setManualFocus | ( | uint8_t | lensPosition | ) |
Set a command to specify manual focus position
lensPosition | specify lens position 0..255 |
Definition at line 88 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setManualFocusRaw | ( | float | lensPositionRaw | ) |
Set a command to specify manual focus position (more precise control).
lensPositionRaw | specify lens position 0.0f .. 1.0f |
Definition at line 94 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setManualWhiteBalance | ( | int | colorTemperatureK | ) |
Set a command to manually specify white-balance color correction
colorTemperatureK | Light source color temperature in kelvins, range 1000..12000 |
Definition at line 160 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setMisc | ( | std::string | control, |
float | value | ||
) |
Set a miscellaneous control. The controls set by this function get appended to a list, processed after the standard controls
control | Control name |
value | Value as a floating point number |
Definition at line 225 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setMisc | ( | std::string | control, |
int | value | ||
) |
Set a miscellaneous control. The controls set by this function get appended to a list, processed after the standard controls
control | Control name |
value | Value as an integer number |
Definition at line 222 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setMisc | ( | std::string | control, |
std::string | value | ||
) |
Set a miscellaneous control. The controls set by this function get appended to a list, processed after the standard controls
control | Control name |
value | Value as a string |
Definition at line 218 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setSaturation | ( | int | value | ) |
Set a command to adjust image saturation
value | Saturation, range -10..10, default 0 |
Definition at line 177 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setSceneMode | ( | SceneMode | mode | ) |
Set a command to specify scene mode
mode | Scene mode |
Definition at line 197 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setSharpness | ( | int | value | ) |
Set a command to adjust image sharpness
value | Sharpness, range 0..4, default 1 |
Definition at line 182 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setStartStreaming | ( | ) |
Set a command to start streaming
Definition at line 20 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setStopStreaming | ( | ) |
Set a command to stop streaming
Definition at line 24 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setStrobeDisable | ( | ) |
Disable STROBE output
Definition at line 57 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setStrobeExternal | ( | int | gpioNumber, |
int | activeLevel = 1 |
||
) |
Enable STROBE output driven by a MyriadX GPIO, optionally configuring the polarity This normally requires a FSIN/FSYNC/trigger input for MyriadX (usually GPIO 41), to generate timings
Definition at line 49 of file CameraControl.cpp.
CameraControl & dai::CameraControl::setStrobeSensor | ( | int | activeLevel = 1 | ) |
Enable STROBE output on sensor pin, optionally configuring the polarity. Note: for many sensors the polarity is high-active and not configurable
Definition at line 41 of file CameraControl.cpp.
|
private |
Definition at line 35 of file CameraControl.hpp.