I'm trying to implement a filter to denoise ambient occlusion data.
What kind of filter do you suggest for the purpose?
The techniques I've come across are the following:
- Gaussian filter (doesn't preserve edges)
- Bilateral/Joint Bilateral filter (the one I've tried)
- Guided filter (never tried, looks intrinsically blurrier than bilateral)
- Gaussian + Edge detection (did't find good resources about the edge detection part, do you know any?)
I choose to implement a joint bilateral filter using view-space z values as input.
However, I'm having some trouble with that, in particular, I don't know if there's a way to fix the following issues:
1. Artifacts at grazing angles:
When looking at a surface almost edge-on, Z values changes rapidly in one dimensions (image space) while remain almost constant in the other. This causes the filter to smooth the image only in one dimension.
2. "Jumps" across edges:
Samples separated by (what I'd like the filter to consider) an edge are considered similar and influence each other's final value greatly. (They have the same Z).
3. How to choose the correct parameters for the filter so that it consistently detects edges in the most scene-independent way possible?
Do you have any suggestions? Are there other techniques out there that could help me?
Thank you all in advance.