Skip to content

Commit 84daffe

Browse files
authored
Merge pull request #1083 from luxonis/release_v2.29.0.0
Release v2.29.0.0
2 parents 50f509b + a0b1842 commit 84daffe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+290
-26
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ jobs:
188188
runs-on: windows-latest
189189
strategy:
190190
matrix:
191-
python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12']
191+
python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12', '3.13']
192192
python-architecture: [x64, x86]
193193
fail-fast: false
194194
steps:
@@ -244,7 +244,7 @@ jobs:
244244
needs: build-docstrings
245245
strategy:
246246
matrix:
247-
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
247+
python-version: [3.8, 3.9, '3.10', '3.11', '3.12', '3.13']
248248
os: [macos-13, macos-14] # macos-13 is x64, macos-14 is arm64
249249
runs-on: ${{ matrix.os }}
250250
steps:
@@ -352,7 +352,7 @@ jobs:
352352
/opt/python/cp38-cp38/bin/python3.8 setup.py sdist --formats=gztar
353353
mv dist/* wheelhouse/audited/
354354
- name: Build wheels
355-
run: for PYBIN in /opt/python/cp3{7..12}*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
355+
run: for PYBIN in /opt/python/cp3{7..13}*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
356356
- name: Audit wheels
357357
run: for whl in wheelhouse/*.whl; do auditwheel repair "$whl" --plat $PLAT -w wheelhouse/audited/; done
358358
- name: Archive wheel artifacts
@@ -413,7 +413,7 @@ jobs:
413413
if: startsWith(github.ref, 'refs/tags/v') != true
414414
run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV
415415
- name: Building wheels
416-
run: for PYBIN in /opt/python/cp3{7..12}*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
416+
run: for PYBIN in /opt/python/cp3{7..13}*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
417417
- name: Auditing wheels
418418
run: for whl in wheelhouse/*.whl; do auditwheel repair "$whl" --plat $PLAT -w wheelhouse/audited/; done
419419
- name: Archive wheel artifacts

.github/workflows/test-install-dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
container_image: ["fedora:34", "fedora:35", "fedora:36", "ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:rolling"]
19+
container_image: ["fedora:34", "fedora:35", "fedora:36", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "ubuntu:rolling"]
2020
container:
2121
image: ${{ matrix.container_image }}
2222
steps:

examples/Camera/camera_undistort.py

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import depthai as dai
24
import cv2
35

examples/Camera/thermal_cam.py

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import depthai as dai
24
import cv2
35
import numpy as np

examples/Cast/cast_blur.py

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import depthai as dai
24
import cv2
35
from pathlib import Path

examples/Cast/cast_concat.py

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import numpy as np
24
import cv2
35
import depthai as dai

examples/Cast/cast_diff.py

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import cv2
24
import depthai as dai
35
from pathlib import Path

examples/ColorCamera/rgb_scene.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import cv2
24
import depthai as dai
35
from itertools import cycle

examples/ColorCamera/rgb_undistort.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import cv2
24
import depthai as dai
35
import numpy as np

examples/CrashReport/capture_diagnostic.py

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import depthai as dai
24
import zipfile
35
from json import dump, JSONEncoder

examples/FeatureTracker/feature_motion_estimation.py

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import numpy as np
24
import cv2
35
from collections import deque

examples/ImageAlign/depth_align.py

100644100755
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import numpy as np
24
import cv2
35
import depthai as dai
@@ -32,7 +34,6 @@ def getFps(self):
3234
device = dai.Device()
3335

3436
calibrationHandler = device.readCalibration()
35-
rgbIntrinsics = calibrationHandler.getCameraIntrinsics(RGB_SOCKET, int(1920 / ISP_SCALE), int(1080 / ISP_SCALE))
3637
rgbDistortion = calibrationHandler.getDistortionCoefficients(RGB_SOCKET)
3738
distortionModel = calibrationHandler.getDistortionModel(RGB_SOCKET)
3839
if distortionModel != dai.CameraModel.Perspective:
@@ -158,6 +159,8 @@ def updateBlendWeights(percentRgb):
158159
if frameDepth is not None:
159160
cvFrame = frameRgb.getCvFrame()
160161

162+
rgbIntrinsics = calibrationHandler.getCameraIntrinsics(RGB_SOCKET, int(cvFrame.shape[1]), int(cvFrame.shape[0]))
163+
161164
# Undistort the rgb frame
162165
cvFrameUndistorted = cv2.undistort(
163166
cvFrame,
@@ -170,7 +173,7 @@ def updateBlendWeights(percentRgb):
170173
cv2.imshow("Depth aligned", alignedDepthColorized)
171174

172175
blended = cv2.addWeighted(
173-
cvFrame, rgbWeight, alignedDepthColorized, depthWeight, 0
176+
cvFrameUndistorted, rgbWeight, alignedDepthColorized, depthWeight, 0
174177
)
175178
cv2.putText(
176179
blended,

examples/ImageAlign/image_align.py

100644100755
Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
#!/usr/bin/env python3
2+
13
import cv2
24
import depthai as dai
35
from datetime import timedelta
6+
import numpy as np
47

58
# This is an interactive example that shows how two frame sources without depth information.
69
FPS = 30.0
@@ -12,7 +15,16 @@
1215
COLOR_RESOLUTION = dai.ColorCameraProperties.SensorResolution.THE_1080_P
1316
LEFT_RIGHT_RESOLUTION = dai.MonoCameraProperties.SensorResolution.THE_720_P
1417

18+
ISP_SCALE = 3
19+
1520
device = dai.Device()
21+
22+
calibrationHandler = device.readCalibration()
23+
rgbDistortion = calibrationHandler.getDistortionCoefficients(RGB_SOCKET)
24+
distortionModel = calibrationHandler.getDistortionModel(RGB_SOCKET)
25+
if distortionModel != dai.CameraModel.Perspective:
26+
raise RuntimeError("Unsupported distortion model for RGB camera. This example supports only Perspective model.")
27+
1628
pipeline = dai.Pipeline()
1729

1830
# Define sources and outputs
@@ -30,7 +42,7 @@
3042
camRgb.setBoardSocket(RGB_SOCKET)
3143
camRgb.setResolution(COLOR_RESOLUTION)
3244
camRgb.setFps(FPS)
33-
camRgb.setIspScale(1, 3)
45+
camRgb.setIspScale(1, ISP_SCALE)
3446

3547
out.setStreamName("out")
3648

@@ -107,12 +119,20 @@ def updateDepthPlane(depth):
107119
# Colorize the aligned depth
108120
leftCv = leftAligned.getCvFrame()
109121

122+
rgbIntrinsics = calibrationHandler.getCameraIntrinsics(RGB_SOCKET, int(frameRgbCv.shape[1]), int(frameRgbCv.shape[0]))
123+
124+
cvFrameUndistorted = cv2.undistort(
125+
frameRgbCv,
126+
np.array(rgbIntrinsics),
127+
np.array(rgbDistortion),
128+
)
129+
110130
if len(leftCv.shape) == 2:
111131
leftCv = cv2.cvtColor(leftCv, cv2.COLOR_GRAY2BGR)
112-
if leftCv.shape != frameRgbCv.shape:
113-
leftCv = cv2.resize(leftCv, (frameRgbCv.shape[1], frameRgbCv.shape[0]))
132+
if leftCv.shape != cvFrameUndistorted.shape:
133+
leftCv = cv2.resize(leftCv, (cvFrameUndistorted.shape[1], cvFrameUndistorted.shape[0]))
114134

115-
blended = cv2.addWeighted(frameRgbCv, rgbWeight, leftCv, leftWeight, 0)
135+
blended = cv2.addWeighted(cvFrameUndistorted, rgbWeight, leftCv, leftWeight, 0)
116136
cv2.imshow(windowName, blended)
117137

118138
key = cv2.waitKey(1)

examples/ImageAlign/thermal_align.py

100644100755
Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import cv2
24
import depthai as dai
35
import numpy as np
@@ -38,6 +40,14 @@ def getFps(self):
3840
raise RuntimeError("No thermal camera found!")
3941

4042

43+
ISP_SCALE = 3
44+
45+
calibrationHandler = device.readCalibration()
46+
rgbDistortion = calibrationHandler.getDistortionCoefficients(RGB_SOCKET)
47+
distortionModel = calibrationHandler.getDistortionModel(RGB_SOCKET)
48+
if distortionModel != dai.CameraModel.Perspective:
49+
raise RuntimeError("Unsupported distortion model for RGB camera. This example supports only Perspective model.")
50+
4151
pipeline = dai.Pipeline()
4252

4353
# Define sources and outputs
@@ -55,7 +65,7 @@ def getFps(self):
5565
camRgb.setBoardSocket(RGB_SOCKET)
5666
camRgb.setResolution(COLOR_RESOLUTION)
5767
camRgb.setFps(FPS)
58-
camRgb.setIspScale(1,3)
68+
camRgb.setIspScale(1,ISP_SCALE)
5969

6070
out.setStreamName("out")
6171

@@ -130,6 +140,14 @@ def updateDepthPlane(depth):
130140
frameRgbCv = frameRgb.getCvFrame()
131141
fpsCounter.tick()
132142

143+
rgbIntrinsics = calibrationHandler.getCameraIntrinsics(RGB_SOCKET, int(frameRgbCv.shape[1]), int(frameRgbCv.shape[0]))
144+
145+
cvFrameUndistorted = cv2.undistort(
146+
frameRgbCv,
147+
np.array(rgbIntrinsics),
148+
np.array(rgbDistortion),
149+
)
150+
133151
# Colorize the aligned depth
134152
thermalFrame = thermalAligned.getCvFrame().astype(np.float32)
135153
# Create a mask for nan values
@@ -141,7 +159,7 @@ def updateDepthPlane(depth):
141159
# Apply the mask back with black pixels (0)
142160
colormappedFrame[mask] = 0
143161

144-
blended = cv2.addWeighted(frameRgbCv, rgbWeight, colormappedFrame, thermalWeight, 0)
162+
blended = cv2.addWeighted(cvFrameUndistorted, rgbWeight, colormappedFrame, thermalWeight, 0)
145163

146164
cv2.putText(
147165
blended,

examples/ImageAlign/tof_align.py

100644100755
Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import numpy as np
24
import cv2
35
import depthai as dai
@@ -27,8 +29,18 @@ def getFps(self):
2729
return (len(self.frameTimes) - 1) / (self.frameTimes[-1] - self.frameTimes[0])
2830

2931

32+
ISP_SCALE = 2
33+
34+
device = dai.Device()
35+
36+
calibrationHandler = device.readCalibration()
37+
rgbDistortion = calibrationHandler.getDistortionCoefficients(RGB_SOCKET)
38+
distortionModel = calibrationHandler.getDistortionModel(RGB_SOCKET)
39+
if distortionModel != dai.CameraModel.Perspective:
40+
raise RuntimeError("Unsupported distortion model for RGB camera. This example supports only Perspective model.")
3041

3142
pipeline = dai.Pipeline()
43+
3244
# Define sources and outputs
3345
camRgb = pipeline.create(dai.node.ColorCamera)
3446
tof = pipeline.create(dai.node.ToF)
@@ -46,7 +58,7 @@ def getFps(self):
4658
camRgb.setBoardSocket(RGB_SOCKET)
4759
camRgb.setResolution(dai.ColorCameraProperties.SensorResolution.THE_800_P)
4860
camRgb.setFps(FPS)
49-
camRgb.setIspScale(1, 2)
61+
camRgb.setIspScale(1, ISP_SCALE)
5062

5163
out.setStreamName("out")
5264

@@ -107,7 +119,8 @@ def updateBlendWeights(percentRgb):
107119

108120

109121
# Connect to device and start pipeline
110-
with dai.Device(pipeline) as device:
122+
with device:
123+
device.startPipeline(pipeline)
111124
queue = device.getOutputQueue("out", 8, False)
112125

113126
# Configure windows; trackbar adjusts blending ratio of rgb/depth
@@ -136,6 +149,12 @@ def updateBlendWeights(percentRgb):
136149
# Blend when both received
137150
if frameDepth is not None:
138151
cvFrame = frameRgb.getCvFrame()
152+
rgbIntrinsics = calibrationHandler.getCameraIntrinsics(RGB_SOCKET, int(cvFrame.shape[1]), int(cvFrame.shape[0]))
153+
cvFrameUndistorted = cv2.undistort(
154+
cvFrame,
155+
np.array(rgbIntrinsics),
156+
np.array(rgbDistortion),
157+
)
139158
# Colorize the aligned depth
140159
alignedDepthColorized = colorizeDepth(frameDepth.getFrame())
141160
# Resize depth to match the rgb frame
@@ -151,7 +170,7 @@ def updateBlendWeights(percentRgb):
151170
cv2.imshow("depth", alignedDepthColorized)
152171

153172
blended = cv2.addWeighted(
154-
cvFrame, rgbWeight, alignedDepthColorized, depthWeight, 0
173+
cvFrameUndistorted, rgbWeight, alignedDepthColorized, depthWeight, 0
155174
)
156175
cv2.imshow(rgbDepthWindowName, blended)
157176

examples/NeuralNetwork/thermal_nnet.py

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import depthai as dai
24
import cv2
35
from pathlib import Path

examples/PointCloud/pointcloud_control.py

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import depthai as dai
24
import numpy as np
35
import cv2

examples/PointCloud/visualize_pointcloud.py

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import depthai as dai
24
from time import sleep
35
import numpy as np

examples/Script/script_emmc_access.py

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import depthai as dai
24
import cv2
35

examples/Script/script_read_calibration.py

100644100755
File mode changed.

examples/Script/script_uart.py

100644100755
File mode changed.

examples/StereoDepth/stereo_depth_custom_mesh.py

100644100755
File mode changed.

0 commit comments

Comments
 (0)