23 xout->setStreamName(
"disparity");
27 monoLeft->setCamera(
"left");
38 auto config = depth->initialConfig.get();
39 config.postProcessing.speckleFilter.enable =
false;
40 config.postProcessing.speckleFilter.speckleRange = 50;
41 config.postProcessing.temporalFilter.enable =
true;
42 config.postProcessing.spatialFilter.enable =
true;
43 config.postProcessing.spatialFilter.holeFillingRadius = 2;
44 config.postProcessing.spatialFilter.numIterations = 1;
45 config.postProcessing.thresholdFilter.minRange = 400;
46 config.postProcessing.thresholdFilter.maxRange = 15000;
47 config.postProcessing.decimationFilter.decimationFactor = 1;
48 depth->initialConfig.set(config);
51 monoLeft->
out.
link(depth->left);
52 monoRight->
out.
link(depth->right);
53 depth->disparity.link(xout->input);
65 frame.convertTo(frame, CV_8UC1, 255 / depth->initialConfig.getMaxDisparity());
67 cv::imshow(
"disparity", frame);
70 cv::applyColorMap(frame, frame, cv::COLORMAP_JET);
71 cv::imshow(
"disparity_color", frame);
73 int key = cv::waitKey(1);
74 if(key ==
'q' || key ==
'Q') {