Skip to content

Commit 56249c3

Browse files
Merge remote-tracking branch 'origin/disparity_invalidation' into HEAD
2 parents f29998d + d393b77 commit 56249c3

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

examples/StereoDepth/stereo_depth_from_host.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ def destroyWindow(self):
157157
trDecimationFactor = list()
158158
trDisparityShift = list()
159159
trCenterAlignmentShift = list()
160+
trInvalidateEdgePixels = list()
160161

161162
def trackbarSigma(value):
162163
StereoConfigHandler.config.postProcessing.bilateralSigmaValue = value
@@ -289,6 +290,13 @@ def trackbarCenterAlignmentShift(value):
289290
StereoConfigHandler.newConfig = True
290291
for tr in StereoConfigHandler.trCenterAlignmentShift:
291292
tr.set(value)
293+
294+
def trackbarInvalidateEdgePixels(value):
295+
StereoConfigHandler.config.algorithmControl.numInvalidateEdgePixels = value
296+
print(f"numInvalidateEdgePixels: {StereoConfigHandler.config.algorithmControl.numInvalidateEdgePixels:.2f}")
297+
StereoConfigHandler.newConfig = True
298+
for tr in StereoConfigHandler.trInvalidateEdgePixels:
299+
tr.set(value)
292300

293301
def handleKeypress(key, stereoDepthConfigInQueue):
294302
if key == ord('m'):
@@ -428,6 +436,7 @@ def registerWindow(stream):
428436
StereoConfigHandler.trFractionalBits.append(StereoConfigHandler.Trackbar('Subpixel fractional bits', stream, 3, 5, StereoConfigHandler.config.algorithmControl.subpixelFractionalBits, StereoConfigHandler.trackbarFractionalBits))
429437
StereoConfigHandler.trDisparityShift.append(StereoConfigHandler.Trackbar('Disparity shift', stream, 0, 100, StereoConfigHandler.config.algorithmControl.disparityShift, StereoConfigHandler.trackbarDisparityShift))
430438
StereoConfigHandler.trCenterAlignmentShift.append(StereoConfigHandler.Trackbar('Center alignment shift factor', stream, 0, 100, StereoConfigHandler.config.algorithmControl.centerAlignmentShiftFactor, StereoConfigHandler.trackbarCenterAlignmentShift))
439+
StereoConfigHandler.trInvalidateEdgePixels.append(StereoConfigHandler.Trackbar('Invalidate edge pixels', stream, 0, 100, StereoConfigHandler.config.algorithmControl.numInvalidateEdgePixels, StereoConfigHandler.trackbarInvalidateEdgePixels))
431440
StereoConfigHandler.trLineqAlpha.append(StereoConfigHandler.Trackbar('Linear equation alpha', stream, 0, 15, StereoConfigHandler.config.costMatching.linearEquationParameters.alpha, StereoConfigHandler.trackbarLineqAlpha))
432441
StereoConfigHandler.trLineqBeta.append(StereoConfigHandler.Trackbar('Linear equation beta', stream, 0, 15, StereoConfigHandler.config.costMatching.linearEquationParameters.beta, StereoConfigHandler.trackbarLineqBeta))
433442
StereoConfigHandler.trLineqThreshold.append(StereoConfigHandler.Trackbar('Linear equation threshold', stream, 0, 255, StereoConfigHandler.config.costMatching.linearEquationParameters.threshold, StereoConfigHandler.trackbarLineqThreshold))

src/pipeline/datatype/StereoDepthConfigBindings.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ void bind_stereodepthconfig(pybind11::module& m, void* pCallstack){
8989
.def_readwrite("subpixelFractionalBits", &RawStereoDepthConfig::AlgorithmControl::subpixelFractionalBits, DOC(dai, RawStereoDepthConfig, AlgorithmControl, subpixelFractionalBits))
9090
.def_readwrite("disparityShift", &RawStereoDepthConfig::AlgorithmControl::disparityShift, DOC(dai, RawStereoDepthConfig, AlgorithmControl, disparityShift))
9191
.def_readwrite("centerAlignmentShiftFactor", &RawStereoDepthConfig::AlgorithmControl::centerAlignmentShiftFactor, DOC(dai, RawStereoDepthConfig, AlgorithmControl, centerAlignmentShiftFactor))
92+
.def_readwrite("numInvalidateEdgePixels", &RawStereoDepthConfig::AlgorithmControl::numInvalidateEdgePixels, DOC(dai, RawStereoDepthConfig, AlgorithmControl, numInvalidateEdgePixels))
9293
;
9394

9495
spatialFilter
@@ -241,6 +242,7 @@ void bind_stereodepthconfig(pybind11::module& m, void* pCallstack){
241242
.def("setDepthUnit", &StereoDepthConfig::setDepthUnit, DOC(dai, StereoDepthConfig, setDepthUnit))
242243
.def("getDepthUnit", &StereoDepthConfig::getDepthUnit, DOC(dai, StereoDepthConfig, getDepthUnit))
243244
.def("setDisparityShift", &StereoDepthConfig::setDisparityShift, DOC(dai, StereoDepthConfig, setDisparityShift))
245+
.def("setNumInvalidateEdgePixels", &StereoDepthConfig::setNumInvalidateEdgePixels, DOC(dai, StereoDepthConfig, setNumInvalidateEdgePixels))
244246
.def("set", &StereoDepthConfig::set, py::arg("config"), DOC(dai, StereoDepthConfig, set))
245247
.def("get", &StereoDepthConfig::get, DOC(dai, StereoDepthConfig, get))
246248
;

0 commit comments

Comments
 (0)