Skip to content
Snippets Groups Projects
Commit 19091852 authored by Sebastian Hahta's avatar Sebastian Hahta
Browse files

config file options

parent 7d308b71
No related branches found
No related tags found
1 merge request!96Feature/of smoothing
......@@ -37,7 +37,14 @@ FixstarsSGM::FixstarsSGM(nlohmann::json &config) : Disparity(config) {
filter_ = cv::cuda::createDisparityBilateralFilter(max_disp_ << 4, radius, iter);
}
off_ = ftl::rgbd::OFDisparityFilter(size_, 9, 0.9);
bool use_off_ = value("use_off", false);
if (use_off_)
{
int off_size = value("off_size", 9);
double off_threshold = value("off_threshold", 0.9);
off_ = ftl::rgbd::OFDisparityFilter(size_, off_size, off_threshold);
}
init(size_);
}
......@@ -97,10 +104,13 @@ void FixstarsSGM::compute(const cv::cuda::GpuMat &l, const cv::cuda::GpuMat &r,
}
dispt_full_res_.convertTo(disp, CV_32F, 1.0f / 16.0f, stream);
if (use_off_) {
Mat disp_host(disp);
off_.filter(disp_host, Mat(lbw_));
disp.upload(disp_host);
}
}
void FixstarsSGM::setMask(Mat &mask) {
return; // TODO(Nick) Not needed, but also code below does not work with new GPU pipeline
......
......@@ -44,6 +44,7 @@ namespace ftl {
int P2_;
cv::Size size_;
bool use_filter_;
bool use_off_;
cv::Ptr<cv::cuda::DisparityBilateralFilter> filter_;
sgm::StereoSGM *ssgm_;
cv::cuda::GpuMat lbw_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment