Skip to content

Commit 7942c5a

Browse files
author
Andrej Susnik
committed
Add example for readCalibration2 in script node
1 parent 72cddbb commit 7942c5a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import cv2
2+
import depthai as dai
3+
4+
# Start defining a pipeline
5+
pipeline = dai.Pipeline()
6+
7+
# Script node
8+
script = pipeline.create(dai.node.Script)
9+
script.setProcessor(dai.ProcessorType.LEON_CSS)
10+
script.setScript("""
11+
12+
cal = Device.readCalibration2()
13+
left_camera_id = cal.getStereoLeftCameraId()
14+
right_camera_id = cal.getStereoRightCameraId()
15+
16+
extrinsics = cal.getCameraExtrinsics(left_camera_id, right_camera_id)
17+
intrinsics_left = cal.getCameraIntrinsics(left_camera_id)
18+
19+
print(extrinsics)
20+
print(intrinsics_left)
21+
22+
""")
23+
24+
# Connect to device with pipeline
25+
with dai.Device(pipeline) as device:
26+
while True:
27+
pass

0 commit comments

Comments
 (0)