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

Visualise confidence

parent 774e5a68
No related branches found
No related tags found
1 merge request!347Feature buckets experiment
Pipeline #26732 failed
...@@ -84,8 +84,11 @@ void StereoCSF::compute(cv::InputArray l, cv::InputArray r, cv::OutputArray disp ...@@ -84,8 +84,11 @@ void StereoCSF::compute(cv::InputArray l, cv::InputArray r, cv::OutputArray disp
disp_array.toGpuMat().download(disparity); disp_array.toGpuMat().download(disparity);
cv::Mat gradtmp; cv::Mat gradtmp;
impl_->gl.toGpuMat().download(gradtmp); conf_array.toGpuMat().download(gradtmp);
cv::imshow("Gradient Left", gradtmp); gradtmp.convertTo(gradtmp, CV_8UC1, 255.0);
cv::applyColorMap(gradtmp, gradtmp, cv::COLORMAP_INFERNO);
cv::resize(gradtmp,gradtmp, cv::Size(gradtmp.cols/2, gradtmp.rows/2));
cv::imshow("Confidence", gradtmp);
cv::Mat tmp; cv::Mat tmp;
impl_->focal.toGpuMat().download(tmp); impl_->focal.toGpuMat().download(tmp);
......
...@@ -75,7 +75,8 @@ struct FocalSelector { ...@@ -75,7 +75,8 @@ struct FocalSelector {
} }
if (max_v > 0) { if (max_v > 0) {
float conf = 1.0f - (float(abs(best_disp-focal_disp)) / float(max_disparity)); //float conf = 1.0f - min(1.0f, float(abs(best_disp-focal_disp)) / 10.0f);
float conf = 1.0f - min(1.0f, float(abs(distx)) / 500.0f);
if (conf > confidence(y,feature.x)) { if (conf > confidence(y,feature.x)) {
disparity(y,feature.x) = float(best_disp); disparity(y,feature.x) = float(best_disp);
confidence(y,feature.x) = conf; confidence(y,feature.x) = conf;
......
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