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
host_side
device_queue_event.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
// Create pipeline
8
dai::Pipeline
pipeline;
9
10
// Define sources and outputs
11
auto
camRgb = pipeline.
create
<
dai::node::ColorCamera
>();
12
auto
camMono = pipeline.
create
<
dai::node::MonoCamera
>();
13
auto
xoutRgb = pipeline.
create
<
dai::node::XLinkOut
>();
14
auto
xoutMono = pipeline.
create
<
dai::node::XLinkOut
>();
15
16
xoutRgb->setStreamName(
"rgb"
);
17
xoutMono->
setStreamName
(
"mono"
);
18
19
// Properties
20
camRgb->setInterleaved(
true
);
21
camRgb->setPreviewSize(300, 300);
22
23
// Linking
24
camRgb->preview.link(xoutRgb->input);
25
camMono->out.link(xoutMono->
input
);
26
27
// Connect to device and start pipeline
28
dai::Device
device(pipeline);
29
30
// Clear queue events
31
device.
getQueueEvents
();
32
33
while
(
true
) {
34
auto
ev = device.
getQueueEvent
();
35
36
if
(ev ==
"rgb"
) {
37
auto
rgb = device.
getOutputQueue
(ev)->get<
dai::ImgFrame
>();
38
cv::imshow(
"rgb"
, rgb->getFrame());
39
}
else
if
(ev ==
"mono"
) {
40
auto
mono = device.
getOutputQueue
(ev)->get<
dai::ImgFrame
>();
41
cv::imshow(
"mono"
, mono->getFrame());
42
}
43
44
int
key = cv::waitKey(1);
45
if
(key ==
'q'
|| key ==
'Q'
) {
46
return
0;
47
}
48
}
49
return
0;
50
}
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::MonoCamera
MonoCamera node. For use with grayscale sensors.
Definition:
MonoCamera.hpp:17
dai::node::ColorCamera
ColorCamera node. For use with color sensors.
Definition:
ColorCamera.hpp:16
dai::Device::getOutputQueue
std::shared_ptr< DataOutputQueue > getOutputQueue(const std::string &name)
Definition:
Device.cpp:86
dai::node::XLinkOut::input
Input input
Definition:
XLinkOut.hpp:27
depthai.hpp
dai::Pipeline::create
std::shared_ptr< N > create()
Definition:
Pipeline.hpp:145
main
int main()
Definition:
device_queue_event.cpp:6
dai::ImgFrame
Definition:
ImgFrame.hpp:25
dai::Device
Definition:
Device.hpp:21
dai::Device::getQueueEvent
std::string getQueueEvent(const std::vector< std::string > &queueNames, std::chrono::microseconds timeout=std::chrono::microseconds(-1))
Definition:
Device.cpp:238
dai::Device::getQueueEvents
std::vector< std::string > getQueueEvents(const std::vector< std::string > &queueNames, std::size_t maxNumEvents=std::numeric_limits< std::size_t >::max(), std::chrono::microseconds timeout=std::chrono::microseconds(-1))
Definition:
Device.cpp:164
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