tnestmeyer / reflectance-filtering

Reflectance Adaptive Filtering Improves Intrinsic Image Estimation
https://ps.is.tuebingen.mpg.de/research_projects/reflectance-filtering
MIT License
32 stars 6 forks source link

Value of d in jointBilateralFilter #2

Open avani17101 opened 2 years ago

avani17101 commented 2 years ago

Can you confirm the value of d in JointBilateralFilter. In the code it is used as -1 but is not mentioned in paper.

With self as flat image and sigmaColor=22, sigmaSpace=20 (as given in paper) and d=-1 I am getting a very blurred out result.

When doing the filtering with flat image as joint image(as obtained by using https://github.com/sai-bi/L1Flattening) I get this: image Used this as code for bilateral joint and guided

filtered = cv2.ximgproc.jointBilateralFilter(joint,
                                                 im,
                                                 d=-1,
                                                 sigmaColor=15,
                                                 sigmaSpace=28)

filtered_g = cv2.ximgproc.guidedFilter(guide=joint,
                                                 src=im,
                                                 radius=int(45),
                                                 eps=3)

Are the filtering results supposed to be this blurred?

Thanks PS: I used IIW dataset R image

avani17101 commented 2 years ago

@tnestmeyer do you have any comments over this? Thanks

tnestmeyer commented 2 years ago

yes, I can confirm I used d = -1, as the documentation says: Diameter of each pixel neighborhood that is used during filtering. If it is non-positive, it is computed from sigmaSpace.

But this bluriness definitely seems wrong as the joint bilateral and guided filter are designed to be edge-aware. Might be that the given parameters don't fit well the artificial synthetic data that you are using. To me it seems like on this specific synthetic data, the "im" is not an image that properly resembles light, there is no smooth/cast shadows or similar, so the input image "im" is already a reflectance image?