Main Page
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
b
c
d
e
h
i
l
m
n
p
r
s
u
x
Typedefs
b
c
d
e
f
g
i
m
p
r
u
v
Enumerations
Enumerator
a
b
f
g
i
m
n
r
s
u
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
h
i
m
n
p
q
r
s
t
u
v
x
Enumerations
a
c
d
e
f
k
l
m
p
r
s
t
v
w
Enumerator
a
b
d
f
g
h
i
l
m
n
o
p
r
s
u
v
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
w
Functions
b
c
d
e
f
g
m
o
p
r
s
t
u
v
w
Variables
a
b
c
d
e
f
i
k
l
m
n
o
p
r
s
t
w
Typedefs
Enumerations
Enumerator
Macros
_
d
f
i
m
n
p
s
t
u
examples
Script
script_camera_control.cpp
Go to the documentation of this file.
1
#include <iostream>
2
3
// Includes common necessary includes for development using depthai library
4
#include "
depthai/depthai.hpp
"
5
6
int
main
() {
7
using namespace
std
;
8
9
// Start defining a pipeline
10
dai::Pipeline
pipeline;
11
12
// Define a source - color camera
13
auto
colorCam = pipeline.
create
<
dai::node::ColorCamera
>();
14
15
// Script node
16
auto
script = pipeline.
create
<
dai::node::Script
>();
17
script->setScript(R
"(
18
import time
19
ctrl = CameraControl()
20
ctrl.setCaptureStill(True)
21
while True:
22
time.sleep(1)
23
node.io['out'].send(ctrl)
24
)");
25
26
// XLinkOut
27
auto
xout = pipeline.
create
<
dai::node::XLinkOut
>();
28
xout->
setStreamName
(
"still"
);
29
30
// Connections
31
script->outputs[
"out"
].link(colorCam->inputControl);
32
colorCam->
still
.
link
(xout->input);
33
34
// Connect to device with pipeline
35
dai::Device
device(pipeline);
36
while
(
true
) {
37
auto
img = device.
getOutputQueue
(
"still"
)->get<
dai::ImgFrame
>();
38
cv::imshow(
"still"
, img->getCvFrame());
39
if
(cv::waitKey(1) ==
'q'
) {
40
break
;
41
}
42
}
43
44
return
0;
45
}
dai::node::XLinkOut
XLinkOut node. Sends messages over XLink.
Definition:
XLinkOut.hpp:14
dai::Pipeline
Represents the pipeline, set of nodes and connections between them.
Definition:
Pipeline.hpp:100
dai::node::ColorCamera
ColorCamera node. For use with color sensors.
Definition:
ColorCamera.hpp:16
dai::node::ColorCamera::still
Output still
Definition:
ColorCamera.hpp:76
dai::Device::getOutputQueue
std::shared_ptr< DataOutputQueue > getOutputQueue(const std::string &name)
Definition:
Device.cpp:86
depthai.hpp
dai::Pipeline::create
std::shared_ptr< N > create()
Definition:
Pipeline.hpp:145
dai::node::Script
Definition:
Script.hpp:15
dai::ImgFrame
Definition:
ImgFrame.hpp:25
dai::Device
Definition:
Device.hpp:21
std
Definition:
Node.hpp:366
main
int main()
Definition:
script_camera_control.cpp:6
dai::Node::Output::link
void link(const Input &in)
Definition:
Node.cpp:84
dai::node::XLinkOut::setStreamName
void setStreamName(const std::string &name)
Definition:
XLinkOut.cpp:13
depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:19