Go to the documentation of this file.
22 static int clamp(
int num,
int v0,
int v1) {
23 return std::max(v0, std::min(num, v1));
43 controlIn->setStreamName(
"control");
53 monoRight->setCamera(
"right");
57 manipRight->initialConfig.setCropRect(topLeft.
x, topLeft.
y, bottomRight.
x, bottomRight.
y);
61 monoRight->out.link(manipRight->inputImage);
63 controlIn->
out.link(monoRight->inputControl);
65 configIn->
out.
link(manipRight->inputConfig);
67 manipRight->
out.
link(manipOutRight->input);
68 manipLeft->
out.link(manipOutLeft->
input);
76 auto controlQueue = device.
getInputQueue(controlIn->getStreamName());
91 cv::imshow(
"right", inRight->getCvFrame());
95 int key = cv::waitKey(1);
98 }
else if(key ==
'e') {
99 printf(
"Autoexposure enable\n");
102 controlQueue->send(ctrl);
103 }
else if(key ==
'i' || key ==
'o' || key ==
'k' || key ==
'l') {
104 if(key ==
'i') exp_time -=
EXP_STEP;
105 if(key ==
'o') exp_time +=
EXP_STEP;
106 if(key ==
'k') sens_iso -=
ISO_STEP;
107 if(key ==
'l') sens_iso +=
ISO_STEP;
108 exp_time =
clamp(exp_time, exp_min, exp_max);
109 sens_iso =
clamp(sens_iso, sens_min, sens_max);
110 printf(
"Setting manual exposure, time: %d, iso: %d\n", exp_time, sens_iso);
113 controlQueue->send(ctrl);
114 }
else if(key ==
'w') {
120 }
else if(key ==
'a') {
126 }
else if(key ==
's') {
132 }
else if(key ==
'd') {
144 configQueue->send(cfg);
XLinkOut node. Sends messages over XLink.
static constexpr int EXP_STEP
std::string getStreamName() const
Get stream name.
void setCamera(std::string name)
Represents the pipeline, set of nodes and connections between them.
static int clamp(int num, int v0, int v1)
ImageManipConfig & setCropRect(float xmin, float ymin, float xmax, float ymax)
static std::atomic< bool > sendCamConfig
CameraControl & setManualExposure(uint32_t exposureTimeUs, uint32_t sensitivityIso)
MonoCamera node. For use with grayscale sensors.
std::shared_ptr< DataOutputQueue > getOutputQueue(const std::string &name)
std::shared_ptr< N > create()
void setStreamName(const std::string &name)
void setResolution(Properties::SensorResolution resolution)
Set sensor resolution.
ImageManip node. Capability to crop, resize, warp, ... incoming image frames.
static constexpr float stepSize
ImageManipConfig initialConfig
std::string getStreamName() const
Get stream name.
CameraControl & setAutoExposureEnable()
XLinkIn node. Receives messages over XLink.
std::shared_ptr< DataInputQueue > getInputQueue(const std::string &name)
void link(const Input &in)
void setStreamName(const std::string &name)
static constexpr int ISO_STEP
depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:19