-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pre/Post Processing Steps for Further Disparity improvements #20
Comments
Hi, Mohanen Thank you for your contribution. 1. Pre/Post processingWe have heard about Disparity map post-filtering which we can use from OpenCV. We are going to apply this method to libSGM and evaluate it's ability. 2. Including sub-pixel accuracyWe are willing to implement sub-pixel interpolation, maybe it will lead to some performance loss however. Regards, |
Hi, @atakagi-fixstars, In your latest code, the pyramid-like noise mentioned above is almost gone but still some noise exist, I was using an older commit before. I already tried the WLS filter.
I was using WLS with Confidence off and lambda and sigma values as preferred by OpenCV documentation. Note: This same issue occurred for OpenCV SGBM (confidence on) too. |
Hi, @mohanen Thank you for your work! |
Hi @mohanen, I am having the same pyramid result as the one in your first comment. Could you please share the method for removing it? Kind regards, |
If you are upscaling the disparity map means use nearest neighbor interpolation. |
@mohanen Thank you for your reply! Could you please give me an example or a link of which code I could refer to? |
For those who are wondering how to use OpenCV The trick is that you would need the negate the right disparity when passing it to Below is an example:
|
@lingjiankong The 16 is due to the fact that its a fixed point representation fixed<16,4> and requires conversion to float to be used. fixed<16,4> denotes a 16-bit fixed-point number, of which 4 rightmost bits are fractional. To convert that, perceive the bit string as an integer and divide it with 2 power number of bits used for the fraction part. 2^4 = 16. |
@lingjiankong Thank you for your work! If we shared - rightDisparity *= -16;
+ rightDisparity *= -1;
|
@sotsuka-fixstars Great results. The WLS filter looks surprisingly promising. Can you share any pointclouds of your version of WLS filter? Does it have the same pyramid effect that @mohanen has described in this thread? |
@funmonty https://github.com/8BitCatJQW/libsgmIssueDetails I modified it, earned following outputs by using different filter.
|
@sotsuka-fixstars, Can you share the filter code snippets. |
@mohanen Is a following snippet an answer to the request? // WLS
cv::Ptr<cv::ximgproc::DisparityWLSFilter> wls_f = cv::ximgproc::createDisparityWLSFilterGeneric(true);
cv::Mat wls_filtered_disp;
wls_f->filter(disparity, I1, wls_filtered_disp, disp_right);
// Bilateral
cv::cuda::GpuMat g_disp, g_filtered_disp;
g_disp.upload(disparity);
cv::cuda::bilateralFilter(g_disp, g_filtered_disp, kernel_size, sigma_color, sigma_spatial);
cv::Mat bilateral_filtered_disp;
g_filtered_disp.download(bilateral_filtered_disp);
|
is this implementation the cuda version of opencv StereoSGBM? |
Hi, @ynma-hanvo
No. |
Does the bilateral filter work in subpixel mode? Do we need to filter off the invalid pixels first for better or accurate filtering? |
The Disparity from libSGM, when projected in a point cloud the output contains noise like a pyramid in front of the camera covering the entire scene or the edges of the of the object seem to replicate multiple times in various disparity levels.
I have some knowledge on how sgm works and for post-processing I have been looking into Nerian's post-processing Steps and Hirshmullers Disparity Refinement Steps to improve the disparity map.
I was able to remove the noise (mentioned above) using a speckle filter which retained the correct data but at the cost of making it sparse almost losing more than 50% of the data in some scenes.
And looking at the other post-processing steps like Uniqueness check, Consistency check, Filtering of untextured image areas, Noise reduction seems to make the disparity even sparser and applying an optimal hole/gap filling technique wouldn't be enough I think.
I know SGM can do it better it even won 11th place in the ROB 2018.
So do you guys have any idea on
Thanks and Regards,
Mohanen B
The text was updated successfully, but these errors were encountered: