Skip to content

Commit 7893975

Browse files
authored
Renaming cast examples (#1027)
1 parent 812d565 commit 7893975

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

examples/ImageAlign/image_align.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
RGB_SOCKET = dai.CameraBoardSocket.CAM_A
99
LEFT_SOCKET = dai.CameraBoardSocket.CAM_B
10-
RIGHT_SOCKET = dai.CameraBoardSocket.CAM_C
1110
ALIGN_SOCKET = LEFT_SOCKET
1211

1312
COLOR_RESOLUTION = dai.ColorCameraProperties.SensorResolution.THE_1080_P
@@ -19,7 +18,6 @@
1918
# Define sources and outputs
2019
camRgb = pipeline.create(dai.node.ColorCamera)
2120
left = pipeline.create(dai.node.MonoCamera)
22-
right = pipeline.create(dai.node.MonoCamera)
2321
sync = pipeline.create(dai.node.Sync)
2422
out = pipeline.create(dai.node.XLinkOut)
2523
align = pipeline.create(dai.node.ImageAlign)
@@ -29,10 +27,6 @@
2927
left.setBoardSocket(LEFT_SOCKET)
3028
left.setFps(FPS)
3129

32-
right.setResolution(LEFT_RIGHT_RESOLUTION)
33-
right.setBoardSocket(RIGHT_SOCKET)
34-
right.setFps(FPS)
35-
3630
camRgb.setBoardSocket(RGB_SOCKET)
3731
camRgb.setResolution(COLOR_RESOLUTION)
3832
camRgb.setFps(FPS)
@@ -57,19 +51,19 @@
5751

5852

5953
rgbWeight = 0.4
60-
depthWeight = 0.6
54+
leftWeight = 0.6
6155

6256

6357
def updateBlendWeights(percentRgb):
6458
"""
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
6660
6761
@param[in] percent_rgb The rgb weight expressed as a percentage (0..100)
6862
"""
69-
global depthWeight
63+
global leftWeight
7064
global rgbWeight
7165
rgbWeight = float(percentRgb) / 100.0
72-
depthWeight = 1.0 - rgbWeight
66+
leftWeight = 1.0 - rgbWeight
7367

7468
def updateDepthPlane(depth):
7569
global staticDepthPlane
@@ -118,7 +112,7 @@ def updateDepthPlane(depth):
118112
if leftCv.shape != frameRgbCv.shape:
119113
leftCv = cv2.resize(leftCv, (frameRgbCv.shape[1], frameRgbCv.shape[0]))
120114

121-
blended = cv2.addWeighted(frameRgbCv, rgbWeight, leftCv, depthWeight, 0)
115+
blended = cv2.addWeighted(frameRgbCv, rgbWeight, leftCv, leftWeight, 0)
122116
cv2.imshow(windowName, blended)
123117

124118
key = cv2.waitKey(1)

0 commit comments

Comments
 (0)