|
7 | 7 |
|
8 | 8 | RGB_SOCKET = dai.CameraBoardSocket.CAM_A |
9 | 9 | LEFT_SOCKET = dai.CameraBoardSocket.CAM_B |
10 | | -RIGHT_SOCKET = dai.CameraBoardSocket.CAM_C |
11 | 10 | ALIGN_SOCKET = LEFT_SOCKET |
12 | 11 |
|
13 | 12 | COLOR_RESOLUTION = dai.ColorCameraProperties.SensorResolution.THE_1080_P |
|
19 | 18 | # Define sources and outputs |
20 | 19 | camRgb = pipeline.create(dai.node.ColorCamera) |
21 | 20 | left = pipeline.create(dai.node.MonoCamera) |
22 | | -right = pipeline.create(dai.node.MonoCamera) |
23 | 21 | sync = pipeline.create(dai.node.Sync) |
24 | 22 | out = pipeline.create(dai.node.XLinkOut) |
25 | 23 | align = pipeline.create(dai.node.ImageAlign) |
|
29 | 27 | left.setBoardSocket(LEFT_SOCKET) |
30 | 28 | left.setFps(FPS) |
31 | 29 |
|
32 | | -right.setResolution(LEFT_RIGHT_RESOLUTION) |
33 | | -right.setBoardSocket(RIGHT_SOCKET) |
34 | | -right.setFps(FPS) |
35 | | - |
36 | 30 | camRgb.setBoardSocket(RGB_SOCKET) |
37 | 31 | camRgb.setResolution(COLOR_RESOLUTION) |
38 | 32 | camRgb.setFps(FPS) |
|
57 | 51 |
|
58 | 52 |
|
59 | 53 | rgbWeight = 0.4 |
60 | | -depthWeight = 0.6 |
| 54 | +leftWeight = 0.6 |
61 | 55 |
|
62 | 56 |
|
63 | 57 | def updateBlendWeights(percentRgb): |
64 | 58 | """ |
65 | | - Update the rgb and depth weights used to blend depth/rgb image |
| 59 | + Update the rgb and left weights used to blend rgb/left image |
66 | 60 |
|
67 | 61 | @param[in] percent_rgb The rgb weight expressed as a percentage (0..100) |
68 | 62 | """ |
69 | | - global depthWeight |
| 63 | + global leftWeight |
70 | 64 | global rgbWeight |
71 | 65 | rgbWeight = float(percentRgb) / 100.0 |
72 | | - depthWeight = 1.0 - rgbWeight |
| 66 | + leftWeight = 1.0 - rgbWeight |
73 | 67 |
|
74 | 68 | def updateDepthPlane(depth): |
75 | 69 | global staticDepthPlane |
@@ -118,7 +112,7 @@ def updateDepthPlane(depth): |
118 | 112 | if leftCv.shape != frameRgbCv.shape: |
119 | 113 | leftCv = cv2.resize(leftCv, (frameRgbCv.shape[1], frameRgbCv.shape[0])) |
120 | 114 |
|
121 | | - blended = cv2.addWeighted(frameRgbCv, rgbWeight, leftCv, depthWeight, 0) |
| 115 | + blended = cv2.addWeighted(frameRgbCv, rgbWeight, leftCv, leftWeight, 0) |
122 | 116 | cv2.imshow(windowName, blended) |
123 | 117 |
|
124 | 118 | key = cv2.waitKey(1) |
|
0 commit comments