diff --git a/components/operators/src/disparity/optflow_smoothing.cpp b/components/operators/src/disparity/optflow_smoothing.cpp index a3b32bf4890c017df35253da0733406e8d1a7a59..5304da7dc7fc4d7c5e0e4531c90851c3f41a37a4 100644 --- a/components/operators/src/disparity/optflow_smoothing.cpp +++ b/components/operators/src/disparity/optflow_smoothing.cpp @@ -68,14 +68,14 @@ OpticalFlowTemporalSmoothing::OpticalFlowTemporalSmoothing(ftl::Configurable* cf OpticalFlowTemporalSmoothing::~OpticalFlowTemporalSmoothing() {} -bool DisparitySmoothingOF::init() { +bool OpticalFlowTemporalSmoothing::init() { if (size_ == Size(0, 0)) { return false; } history_.create(cv::Size(size_.width * n_max_, size_.height), CV_32FC1); history_.setTo(0.0); return true; } -bool DisparitySmoothingOF::apply(Frame &in, Frame &out, Source *src, cudaStream_t stream) { +bool OpticalFlowTemporalSmoothing::apply(Frame &in, Frame &out, Source *src, cudaStream_t stream) { if (!out.hasChannel(channel_) || !in.hasChannel(Channel::Flow)) { return false; } auto cvstream = cv::cuda::StreamAccessor::wrapStream(stream); diff --git a/config/config_vision.jsonc b/config/config_vision.jsonc index b73446cefe06aaaf3663b8fe2823822878b5a1a8..cea950e0c21bde19d369ad0a4f53c255657e3724 100644 --- a/config/config_vision.jsonc +++ b/config/config_vision.jsonc @@ -9,53 +9,6 @@ } }, - "disparity": { - "libsgm": { - "algorithm": "libsgm", - "width": 1280, - "height": 720, - "use_cuda": true, - "minimum": 0, - "maximum": 256, - "tau": 0.0, - "gamma": 0.0, - "window_size": 5, - "sigma": 1.5, - "lambda": 8000.0, - "uniqueness": 0.65, - "use_filter": true, - "P1": 8, - "P2": 130, - "filter_radius": 11, - "filter_iter": 2, - "use_off": true, - "off_size": 24, - "off_threshold": 0.75, - "T": 60, - "T_add": 0, - "T_del": 25, - "T_x" : 3.0, - "alpha" : 0.6, - "beta" : 1.7, - "epsilon" : 15.0 - }, - - "rtcensus": { - "algorithm": "rtcensus", - "use_cuda": true, - "minimum": 0, - "maximum": 256, - "tau": 0.0, - "gamma": 0.0, - "window_size": 5, - "sigma": 1.5, - "lambda": 8000.0, - "use_filter": true, - "filter_radius": 3, - "filter_iter": 4 - } - }, - "sources": { "stereocam": { "uri": "device:video", @@ -71,7 +24,23 @@ }, "use_optflow" : true, "calibration": { "$ref": "#calibrations/default" }, - "disparity": { "$ref": "#disparity/libsgm" } + "disparity": { + "algorithm" : { + "P1" : 10, + "P2" : 120, + "enabled" : true + }, + "bilateral_filter" : { + "radius" : 17, + "iter" : 21, + "enabled" : true + }, + "optflow_filter" : { + "threshold" : 0.8, + "history_size" : 10, + "enabled": true + } + } }, "stereovid": {}, "localhost": {}