File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+
3+ import cv2
4+ import depthai as dai
5+
6+ with dai .Device () as device :
7+ pipeline = dai .Pipeline ()
8+ cams = device .getConnectedCameraFeatures ()
9+ sync = pipeline .create (dai .node .Sync )
10+ for cam in cams :
11+ print (str (cam ), str (cam .socket ), cam .socket )
12+ cam_node = pipeline .create (dai .node .Camera )
13+ cam_node .setBoardSocket (cam .socket )
14+ cam_node .isp .link (sync .inputs [str (cam .socket )])
15+
16+ xout = pipeline .create (dai .node .XLinkOut )
17+ xout .setStreamName ('sync' )
18+ sync .out .link (xout .input )
19+
20+ # Start pipeline
21+ device .startPipeline (pipeline )
22+ q = device .getOutputQueue ('sync' , maxSize = 10 , blocking = False )
23+ while not device .isClosed ():
24+ msgs = q .get ()
25+ for (name , imgFrame ) in msgs :
26+ print (f'Cam { name } , seq { imgFrame .getSequenceNum ()} , tiemstamp { imgFrame .getTimestamp ()} ' )
27+ cv2 .imshow (name , imgFrame .getCvFrame ())
28+ print ('----' )
29+
30+ if cv2 .waitKey (1 ) == ord ('q' ):
31+ break
You can’t perform that action at this time.
0 commit comments