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_read_calibration.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
// Script node
13
auto
script = pipeline.
create
<
dai::node::Script
>();
14
script->
setProcessor
(
dai::ProcessorType::LEON_CSS
);
15
script->setScript(R
"(
16
import time
17
18
cal = Device.readCalibration2()
19
left_camera_id = cal.getStereoLeftCameraId()
20
right_camera_id = cal.getStereoRightCameraId()
21
22
extrinsics = cal.getCameraExtrinsics(left_camera_id, right_camera_id)
23
intrinsics_left = cal.getCameraIntrinsics(left_camera_id)
24
25
node.info(extrinsics.__str__())
26
node.info(intrinsics_left.__str__())
27
28
time.sleep(1)
29
node.io['end'].send(Buffer(32))
30
)");
31
32
auto
xout = pipeline.
create
<
dai::node::XLinkOut
>();
33
xout->
setStreamName
(
"end"
);
34
35
script->outputs[
"end"
].link(xout->input);
36
37
// Connect to device with pipeline
38
dai::Device
device(pipeline);
39
40
device.
getOutputQueue
(
"end"
)->get();
41
42
return
0;
43
}
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::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::ProcessorType::LEON_CSS
@ LEON_CSS
dai::node::Script
Definition:
Script.hpp:15
dai::node::Script::setProcessor
void setProcessor(ProcessorType type)
Definition:
Script.cpp:53
dai::Device
Definition:
Device.hpp:21
std
Definition:
Node.hpp:366
main
int main()
Definition:
script_read_calibration.cpp:6
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