For this may be a X-Y question, I'm providing the full background story:

I'm trying to test for the correctness for a fixed point implementation of bilateral filter written in C.

My current approach is to compare it's output with a double-precision Matlab version.

This helps me capture issues like insufficient precision, pointer out of bound and uninitialized variables and other (stupid) bugs.

Now the C version matches Matlab version with sufficient precision and with no obvious bugs, but I'm not very confident that Matlab version is correct at all, for it is not fully tested or reviewed by anyone.

Having worked as a tester for a while, I have the feeling that be best way, if not the only way, to test for correctness of the implementation of a signal processing algorithm, is to check for it's properties.

For instance, this CDF 9/7 wavelet example uses "perfect reconstruction" property and "N vanishing moments" property as test cases, and it indeed established a fair amount of confidence that his implementation works.

The only property of bilateral filer is "edge preserving", which isn't a strong proof of correctness.

Does bilateral filter has other properties that can be used as proof of correctness of an implementation?

  • 1
    $\begingroup$ what'sa "bilateral filter"? $\endgroup$ – robert bristow-johnson Oct 9 '15 at 0:09
  • $\begingroup$ Have you validated your implementation? Could you share? $\endgroup$ – David Aug 19 '18 at 16:36
  • $\begingroup$ Do you have something missing in my answer? $\endgroup$ – Royi Aug 18 '19 at 14:25

I'm assuming implementation which is defined by two parameters - Color Range STD and Spatial STD.

Few Properties:

  1. If you set the Color Range STD to be high, the result should be very very similar to Gaussian Blur with the Spatial STD.
  2. If you set the Color Range STD to be very near zero, the output image should be with no change (No smoothing at all).
  3. Good image to test things on is Black White rectangles (Like Checkers).
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.