diff --git a/depthai-core b/depthai-core index 4c287063d..a4a385ae9 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 4c287063d7aa5e3ffbe7636ccf4a00a6f2bf40d7 +Subproject commit a4a385ae93244cf12b28a5c698cb4997ed77a0d4 diff --git a/examples/Script/script_forward_frames.py b/examples/Script/script_forward_frames.py index 3d5dba8e1..c035353b8 100644 --- a/examples/Script/script_forward_frames.py +++ b/examples/Script/script_forward_frames.py @@ -6,7 +6,6 @@ pipeline = dai.Pipeline() cam = pipeline.create(dai.node.ColorCamera) -cam.initialControl.setManualFocus(130) # Not needed, you can display 1080P frames as well cam.setIspScale(1,2) diff --git a/examples/SpatialDetection/spatial_tiny_yolo.py b/examples/SpatialDetection/spatial_tiny_yolo.py index 094f4d087..811d9e444 100755 --- a/examples/SpatialDetection/spatial_tiny_yolo.py +++ b/examples/SpatialDetection/spatial_tiny_yolo.py @@ -116,7 +116,7 @@ stereo.depth.link(spatialDetectionNetwork.inputDepth) spatialDetectionNetwork.passthroughDepth.link(xoutDepth.input) -spatialDetectionNetwork.outNetwork.link(nnNetworkOut.input); +spatialDetectionNetwork.outNetwork.link(nnNetworkOut.input) # Connect to device and start pipeline with dai.Device(pipeline) as device: diff --git a/examples/StereoDepth/rgb_depth_aligned.py b/examples/StereoDepth/rgb_depth_aligned.py index 37fb67cde..f0457e972 100755 --- a/examples/StereoDepth/rgb_depth_aligned.py +++ b/examples/StereoDepth/rgb_depth_aligned.py @@ -30,6 +30,7 @@ def updateBlendWeights(percent_rgb): # Create pipeline pipeline = dai.Pipeline() +device = dai.Device() queueNames = [] # Define sources and outputs @@ -53,8 +54,13 @@ def updateBlendWeights(percent_rgb): if downscaleColor: camRgb.setIspScale(2, 3) # For now, RGB needs fixed focus to properly align with depth. # This value was used during calibration -camRgb.initialControl.setManualFocus(130) - +try: + calibData = device.readCalibration() + lensPosition = calibData.getLensPosition(dai.CameraBoardSocket.RGB) + if lensPosition: + camRgb.initialControl.setManualFocus(lensPosition) +except: + raise left.setResolution(monoResolution) left.setBoardSocket(dai.CameraBoardSocket.LEFT) left.setFps(fps) @@ -74,7 +80,8 @@ def updateBlendWeights(percent_rgb): stereo.disparity.link(disparityOut.input) # Connect to device and start pipeline -with dai.Device(pipeline) as device: +with device: + device.startPipeline(pipeline) frameRgb = None frameDisp = None diff --git a/examples/StereoDepth/rgb_depth_confidence_aligned.py b/examples/StereoDepth/rgb_depth_confidence_aligned.py index a6b05a8d2..9c1f6c2ab 100755 --- a/examples/StereoDepth/rgb_depth_confidence_aligned.py +++ b/examples/StereoDepth/rgb_depth_confidence_aligned.py @@ -50,6 +50,7 @@ def updateConfBlendWeights(percent): # Create pipeline pipeline = dai.Pipeline() +device = dai.Device() queueNames = [] # Define sources and outputs @@ -73,7 +74,13 @@ def updateConfBlendWeights(percent): if downscaleColor: camRgb.setIspScale(2, 3) # For now, RGB needs fixed focus to properly align with depth. # This value was used during calibration -camRgb.initialControl.setManualFocus(130) +try: + calibData = device.readCalibration() + lensPosition = calibData.getLensPosition(dai.CameraBoardSocket.RGB) + if lensPosition: + camRgb.initialControl.setManualFocus(lensPosition) +except: + raise left.setResolution(monoResolution) left.setBoardSocket(dai.CameraBoardSocket.LEFT) @@ -99,7 +106,8 @@ def updateConfBlendWeights(percent): stereo.confidenceMap.link(xoutConfMap.input) # Connect to device and start pipeline -with dai.Device(pipeline) as device: +with device: + device.startPipeline(pipeline) frameRgb = None frameDisp = None diff --git a/examples/StereoDepth/stereo_depth_video.py b/examples/StereoDepth/stereo_depth_video.py index 32d10a38e..8fcc02fec 100755 --- a/examples/StereoDepth/stereo_depth_video.py +++ b/examples/StereoDepth/stereo_depth_video.py @@ -233,7 +233,8 @@ def getDisparityFrame(frame): if depth: streams.append("depth") -calibData = dai.Device().readCalibration() +device = dai.Device() +calibData = device.readCalibration() leftMesh, rightMesh = getMesh(calibData) if generateMesh: meshLeft = list(leftMesh.tobytes()) @@ -245,7 +246,9 @@ def getDisparityFrame(frame): print("Creating DepthAI device") -with dai.Device(pipeline) as device: +with device: + device.startPipeline(pipeline) + # Create a receive queue for each stream qList = [device.getOutputQueue(stream, 8, blocking=False) for stream in streams]