Skip to content

Commit 4adc1df

Browse files
authored
Merge pull request #1405 from luxonis/release/3.0.0-rc.4
Release/3.0.0 rc.4
2 parents efcb676 + cf7f4be commit 4adc1df

File tree

104 files changed

+6259
-564
lines changed

Some content is hidden

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

104 files changed

+6259
-564
lines changed

.github/workflows/python-main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ jobs:
228228
with:
229229
python-version: ${{ matrix.python-version }}
230230
architecture: ${{ matrix.python-architecture }}
231+
- name: Set UTF-8 encoding
232+
run: |
233+
echo "PYTHONIOENCODING=utf-8" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
234+
echo "PYTHONUTF8=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
231235
- name: Append build hash if not a tagged commit
232236
if: startsWith(github.ref, 'refs/tags/v') != true
233237
run: echo "BUILD_COMMIT_HASH=${{github.sha}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

.github/workflows/test.workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ jobs:
2323
uses: ./.github/workflows/test_child.yml
2424
with:
2525
flavor: "vanilla"
26-
luxonis_os_versions_to_test: "['r851.1.2', 'debug-1.6.0', '1.14.1']"
26+
luxonis_os_versions_to_test: "['debug-1.6.0', '1.14.1', '1.15.0']"
2727
secrets:
2828
CONTAINER_REGISTRY: ${{ secrets.CONTAINER_REGISTRY }}
2929

3030
run_tsan_tests:
3131
uses: ./.github/workflows/test_child.yml
3232
with:
3333
flavor: "tsan"
34-
luxonis_os_versions_to_test: "['1.14.1']"
34+
luxonis_os_versions_to_test: "['1.15.0']"
3535
secrets:
3636
CONTAINER_REGISTRY: ${{ secrets.CONTAINER_REGISTRY }}
3737

3838
run_asan-ubsan_tests:
3939
uses: ./.github/workflows/test_child.yml
4040
with:
4141
flavor: "asan-ubsan"
42-
luxonis_os_versions_to_test: "['1.14.1']"
42+
luxonis_os_versions_to_test: "['1.15.0']"
4343
secrets:
4444
CONTAINER_REGISTRY: ${{ secrets.CONTAINER_REGISTRY }}
4545

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ endif()
6767
# Create depthai project
6868
project(depthai VERSION "3.0.0" LANGUAGES CXX C)
6969
set(DEPTHAI_PRE_RELEASE_TYPE "rc") # Valid options are "alpha", "beta", "rc", ""
70-
set(DEPTHAI_PRE_RELEASE_VERSION "3")
70+
set(DEPTHAI_PRE_RELEASE_VERSION "4")
7171

7272
# Set DEPTHAI_VERSION universally, not conditionally
7373
set(DEPTHAI_VERSION ${PROJECT_VERSION}-${DEPTHAI_PRE_RELEASE_TYPE}.${DEPTHAI_PRE_RELEASE_VERSION})
@@ -193,7 +193,7 @@ set(THIRDPARTY_OPENCV_LIBRARIES "" CACHE STRING "Optional libraries to link Open
193193
set(TARGET_OPENCV_NAME ${PROJECT_NAME}-opencv)
194194
set(TARGET_OPENCV_ALIAS opencv)
195195
if(DEPTHAI_OPENCV_SUPPORT)
196-
set(REQUIRED_OPENCV_LIBRARIES "opencv_core" "opencv_imgproc" "opencv_videoio" "opencv_highgui")
196+
set(REQUIRED_OPENCV_LIBRARIES "opencv_core" "opencv_imgproc" "opencv_videoio" "opencv_highgui" "opencv_calib3d")
197197
set(OPENCV_SUPPORT_AVAILABLE ${OpenCV_FOUND})
198198
foreach(lib ${REQUIRED_OPENCV_LIBRARIES})
199199
if(NOT (lib IN_LIST OpenCV_LIBS))
@@ -292,6 +292,7 @@ set(TARGET_CORE_SOURCES
292292
src/pipeline/datatype/EncodedFrame.cpp
293293
src/pipeline/datatype/ImgAnnotations.cpp
294294
src/pipeline/datatype/ImageManipConfig.cpp
295+
src/pipeline/datatype/ImageFiltersConfig.cpp
295296
src/pipeline/datatype/CameraControl.cpp
296297
src/pipeline/datatype/NNData.cpp
297298
src/pipeline/datatype/ImgDetections.cpp
@@ -319,6 +320,7 @@ set(TARGET_CORE_SOURCES
319320
src/pipeline/datatype/TransformData.cpp
320321
src/utility/H26xParsers.cpp
321322
src/utility/ImageManipImpl.cpp
323+
src/utility/ObjectTrackerImpl.cpp
322324
src/utility/Initialization.cpp
323325
src/utility/Resources.cpp
324326
src/utility/Platform.cpp
@@ -371,6 +373,7 @@ set(TARGET_OPENCV_SOURCES
371373
src/pipeline/node/host/HostCamera.cpp
372374
src/pipeline/node/host/Record.cpp
373375
src/pipeline/node/host/Replay.cpp
376+
src/pipeline/node/ImageFilters.cpp
374377
src/opencv/RecordReplay.cpp
375378
src/opencv/HolisticRecordReplay.cpp
376379
)
@@ -699,6 +702,7 @@ target_link_libraries(${TARGET_CORE_NAME}
699702
magic_enum::magic_enum
700703
liblzma::liblzma
701704
lz4::lz4
705+
Eigen3::Eigen
702706
)
703707

704708
if(DEPTHAI_ENABLE_MP4V2)

bindings/js/bindings.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ EMSCRIPTEN_BINDINGS(depthai_js) {
7676
.value("ToFConfig", dai::DatatypeEnum::ToFConfig)
7777
.value("TrackedFeatures", dai::DatatypeEnum::TrackedFeatures)
7878
.value("BenchmarkReport", dai::DatatypeEnum::BenchmarkReport)
79-
.value("MessageGroup", dai::DatatypeEnum::MessageGroup);
79+
.value("MessageGroup", dai::DatatypeEnum::MessageGroup)
80+
.value("ImageFiltersConfig", dai::DatatypeEnum::ImageFiltersConfig);
8081

8182
// structs
8283
value_object<MessageHeader>("MessageHeader")

bindings/python/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ set(SOURCE_LIST
105105
src/pipeline/node/ReplayBindings.cpp
106106
src/pipeline/node/ImageAlignBindings.cpp
107107
src/pipeline/node/RGBDBindings.cpp
108+
src/pipeline/node/ImageFiltersBindings.cpp
109+
src/pipeline/FilterParamsBindings.cpp
108110

109111
src/pipeline/datatype/ADatatypeBindings.cpp
110112
src/pipeline/datatype/AprilTagConfigBindings.cpp

bindings/python/generate_stubs.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,12 @@ def process_init_pyi(file_path, is_depthai_root=False):
168168
process_init_pyi(os.path.join(root, '__init__.pyi'), is_depthai_root)
169169

170170
except subprocess.CalledProcessError as err:
171+
print(f"Error during stub generation: {err}")
171172
exit(err.returncode)
172173

173-
finally:
174-
exit(0)
174+
except Exception as e:
175+
print(f"An error occurred: {e}")
176+
exit(-1)
177+
178+
179+
exit(0)

bindings/python/src/DeviceBindings.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,20 @@ void DeviceBindings::bind(pybind11::module& m, void* pCallstack) {
758758
return d.flashCalibration(ch);
759759
},
760760
DOC(dai, DeviceBase, flashCalibration))
761+
.def(
762+
"setCalibration",
763+
[](DeviceBase& d, CalibrationHandler ch) {
764+
py::gil_scoped_release release;
765+
return d.setCalibration(ch);
766+
},
767+
DOC(dai, DeviceBase, setCalibration))
768+
.def(
769+
"getCalibration",
770+
[](DeviceBase& d) {
771+
py::gil_scoped_release release;
772+
return d.getCalibration();
773+
},
774+
DOC(dai, DeviceBase, getCalibration))
761775
.def(
762776
"readCalibration2",
763777
[](DeviceBase& d) {

bindings/python/src/pipeline/CommonBindings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void CommonBindings::bind(pybind11::module& m, void* pCallstack) {
100100
.def_readwrite("angle", &RotatedRect::angle)
101101
.def("isNormalized", &RotatedRect::isNormalized, DOC(dai, RotatedRect, isNormalized))
102102
.def("normalize", &RotatedRect::normalize, py::arg("width"), py::arg("height"), DOC(dai, RotatedRect, normalize))
103-
.def("denormalize", &RotatedRect::denormalize, py::arg("width"), py::arg("height"), DOC(dai, RotatedRect, denormalize))
103+
.def("denormalize", &RotatedRect::denormalize, py::arg("width"), py::arg("height"), py::arg("force") = false, DOC(dai, RotatedRect, denormalize))
104104
.def("getPoints", &RotatedRect::getPoints, DOC(dai, RotatedRect, getPoints))
105105
.def("getOuterRect", &RotatedRect::getOuterRect, DOC(dai, RotatedRect, getOuterRect));
106106

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#include "FilterParamsBindings.hpp"
2+
3+
#include "depthai/pipeline/FilterParams.hpp"
4+
5+
void FilterParamsBindings::bind(pybind11::module& m, void* pCallstack) {
6+
// dai.filters.params
7+
py::module_ filters = m.def_submodule("filters", "Parameters for filters");
8+
py::module_ params = filters.def_submodule("params", "Parameters for filters");
9+
10+
// -- Median Filter --
11+
py::enum_<dai::filters::params::MedianFilter> medianFilter(params, "MedianFilter");
12+
medianFilter.value("MEDIAN_OFF", dai::filters::params::MedianFilter::MEDIAN_OFF)
13+
.value("KERNEL_3x3", dai::filters::params::MedianFilter::KERNEL_3x3)
14+
.value("KERNEL_5x5", dai::filters::params::MedianFilter::KERNEL_5x5)
15+
.value("KERNEL_7x7", dai::filters::params::MedianFilter::KERNEL_7x7)
16+
.def("__str__", [](const dai::filters::params::MedianFilter& self) { return py::str("MedianFilter({})").format(self); });
17+
18+
// -- Spatial Filter --
19+
py::class_<dai::filters::params::SpatialFilter> spatialFilter(params, "SpatialFilter");
20+
spatialFilter.def(py::init<>())
21+
.def_readwrite("enable", &dai::filters::params::SpatialFilter::enable, DOC(dai, filters, params, SpatialFilter, enable))
22+
.def_readwrite(
23+
"holeFillingRadius", &dai::filters::params::SpatialFilter::holeFillingRadius, DOC(dai, filters, params, SpatialFilter, holeFillingRadius))
24+
.def_readwrite("alpha", &dai::filters::params::SpatialFilter::alpha, DOC(dai, filters, params, SpatialFilter, alpha))
25+
.def_readwrite("delta", &dai::filters::params::SpatialFilter::delta, DOC(dai, filters, params, SpatialFilter, delta))
26+
.def_readwrite("numIterations", &dai::filters::params::SpatialFilter::numIterations, DOC(dai, filters, params, SpatialFilter, numIterations))
27+
.def("__str__", [](const dai::filters::params::SpatialFilter& self) {
28+
return py::str("SpatialFilter(enable={}, holeFillingRadius={}, alpha={}, delta={}, numIterations={})")
29+
.format(self.enable, self.holeFillingRadius, self.alpha, self.delta, self.numIterations);
30+
});
31+
32+
// -- Temporal Filter --
33+
py::class_<dai::filters::params::TemporalFilter> temporalFilter(params, "TemporalFilter", DOC(dai, filters, params, TemporalFilter));
34+
temporalFilter.def(py::init<>())
35+
.def_readwrite("enable", &dai::filters::params::TemporalFilter::enable, DOC(dai, filters, params, TemporalFilter, enable))
36+
.def_readwrite("persistencyMode", &dai::filters::params::TemporalFilter::persistencyMode, DOC(dai, filters, params, TemporalFilter, persistencyMode))
37+
.def_readwrite("alpha", &dai::filters::params::TemporalFilter::alpha, DOC(dai, filters, params, TemporalFilter, alpha))
38+
.def_readwrite("delta", &dai::filters::params::TemporalFilter::delta, DOC(dai, filters, params, TemporalFilter, delta))
39+
.def("__str__", [](const dai::filters::params::TemporalFilter& self) {
40+
return py::str("TemporalFilter(enable={}, persistencyMode={}, alpha={}, delta={})")
41+
.format(self.enable, self.persistencyMode, self.alpha, self.delta);
42+
});
43+
44+
py::enum_<dai::filters::params::TemporalFilter::PersistencyMode> persistencyMode(
45+
temporalFilter, "PersistencyMode", DOC(dai, filters, params, TemporalFilter, PersistencyMode));
46+
persistencyMode
47+
.value("PERSISTENCY_OFF",
48+
dai::filters::params::TemporalFilter::PersistencyMode::PERSISTENCY_OFF,
49+
DOC(dai, filters, params, TemporalFilter, PersistencyMode, PERSISTENCY_OFF))
50+
.value("VALID_8_OUT_OF_8",
51+
dai::filters::params::TemporalFilter::PersistencyMode::VALID_8_OUT_OF_8,
52+
DOC(dai, filters, params, TemporalFilter, PersistencyMode, VALID_8_OUT_OF_8))
53+
.value("VALID_2_IN_LAST_3",
54+
dai::filters::params::TemporalFilter::PersistencyMode::VALID_2_IN_LAST_3,
55+
DOC(dai, filters, params, TemporalFilter, PersistencyMode, VALID_2_IN_LAST_3))
56+
.value("VALID_2_IN_LAST_4",
57+
dai::filters::params::TemporalFilter::PersistencyMode::VALID_2_IN_LAST_4,
58+
DOC(dai, filters, params, TemporalFilter, PersistencyMode, VALID_2_IN_LAST_4))
59+
.value("VALID_2_OUT_OF_8",
60+
dai::filters::params::TemporalFilter::PersistencyMode::VALID_2_OUT_OF_8,
61+
DOC(dai, filters, params, TemporalFilter, PersistencyMode, VALID_2_OUT_OF_8))
62+
.value("VALID_1_IN_LAST_2",
63+
dai::filters::params::TemporalFilter::PersistencyMode::VALID_1_IN_LAST_2,
64+
DOC(dai, filters, params, TemporalFilter, PersistencyMode, VALID_1_IN_LAST_2))
65+
.value("VALID_1_IN_LAST_5",
66+
dai::filters::params::TemporalFilter::PersistencyMode::VALID_1_IN_LAST_5,
67+
DOC(dai, filters, params, TemporalFilter, PersistencyMode, VALID_1_IN_LAST_5))
68+
.value("VALID_1_IN_LAST_8",
69+
dai::filters::params::TemporalFilter::PersistencyMode::VALID_1_IN_LAST_8,
70+
DOC(dai, filters, params, TemporalFilter, PersistencyMode, VALID_1_IN_LAST_8))
71+
.value("PERSISTENCY_INDEFINITELY",
72+
dai::filters::params::TemporalFilter::PersistencyMode::PERSISTENCY_INDEFINITELY,
73+
DOC(dai, filters, params, TemporalFilter, PersistencyMode, PERSISTENCY_INDEFINITELY));
74+
75+
// -- Speckle filter --
76+
py::class_<dai::filters::params::SpeckleFilter> speckleFilter(params, "SpeckleFilter");
77+
speckleFilter.def(py::init<>())
78+
.def_readwrite("enable", &dai::filters::params::SpeckleFilter::enable, DOC(dai, filters, params, SpeckleFilter, enable))
79+
.def_readwrite("speckleRange", &dai::filters::params::SpeckleFilter::speckleRange, DOC(dai, filters, params, SpeckleFilter, speckleRange))
80+
.def_readwrite(
81+
"differenceThreshold", &dai::filters::params::SpeckleFilter::differenceThreshold, DOC(dai, filters, params, SpeckleFilter, differenceThreshold))
82+
.def("__str__", [](const dai::filters::params::SpeckleFilter& self) {
83+
return py::str("SpeckleFilter(enable={}, speckleRange={}, differenceThreshold={})")
84+
.format(self.enable, self.speckleRange, self.differenceThreshold);
85+
});
86+
87+
// Aliases for backward compatibility
88+
m.attr("MedianFilter") = medianFilter;
89+
m.attr("StereoDepthConfig").attr("MedianFilter") = medianFilter;
90+
m.attr("StereoDepthConfig").attr("PostProcessing").attr("SpatialFilter") = spatialFilter;
91+
m.attr("StereoDepthConfig").attr("PostProcessing").attr("TemporalFilter") = temporalFilter;
92+
m.attr("StereoDepthConfig").attr("PostProcessing").attr("SpeckleFilter") = speckleFilter;
93+
94+
Callstack* callstack = (Callstack*)pCallstack;
95+
auto cb = callstack->top();
96+
callstack->pop();
97+
cb(m, pCallstack);
98+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#pragma once
2+
#include "pybind11_common.hpp"
3+
4+
struct FilterParamsBindings {
5+
static void bind(pybind11::module& m, void* pCallstack);
6+
};

0 commit comments

Comments
 (0)