Skip to content
Snippets Groups Projects
Commit 495c17af authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Merge branch 'feature/bilateralfilter' into 'master'

Feature/bilateralfilter

See merge request nicolas.pope/ftl!9
parents 8e975ddd 49fb944a
No related branches found
No related tags found
1 merge request!9Feature/bilateralfilter
Pipeline #10889 passed
......@@ -12,7 +12,9 @@ using cv::Mat;
FixstarsSGM::FixstarsSGM(nlohmann::json &config) : Disparity(config) {
ssgm_ = nullptr;
use_filter_ = config.value("use_filter", false);
filter_ = cv::cuda::createDisparityBilateralFilter(max_disp_, config.value("filter_radius", 25), config.value("filter_iter", 1));
// note: (max_disp_ << 4) libsgm subpixel accuracy.
// What is the impact in the filter? (possible artifacts)
filter_ = cv::cuda::createDisparityBilateralFilter(max_disp_ << 4, config.value("filter_radius", 25), config.value("filter_iter", 1));
}
void FixstarsSGM::compute(const cv::Mat &l, const cv::Mat &r, cv::Mat &disp) {
......@@ -20,7 +22,7 @@ void FixstarsSGM::compute(const cv::Mat &l, const cv::Mat &r, cv::Mat &disp) {
Mat right_disp;
Mat lbw, rbw;
cv::cvtColor(l, lbw, cv::COLOR_BGR2GRAY);
cv::cvtColor(l, lbw, cv::COLOR_BGR2GRAY);
cv::cvtColor(r, rbw, cv::COLOR_BGR2GRAY);
if (!ssgm_) {
......@@ -54,4 +56,4 @@ void FixstarsSGM::compute(const cv::Mat &l, const cv::Mat &r, cv::Mat &disp) {
}
disp.convertTo(disp, CV_32F, 1.0f/16.0f);
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment