Quick but not fully optimized MATLAB port of [1].
Feel free to modify and create a PR upon validating changes.
bfilter2 was taken from [2] and was made by Mahmoud Afifi. License for usage is available here.
Whenever possible I'll implement the method Yang himself used, described in [3].
-
Q. Yang, S. Wang, and N. Ahuja, “Real-Time Specular Highlight Removal Using Bilateral Filtering,” in Computer Vision – ECCV 2010, Springer Berlin Heidelberg, 2010, pp. 87–100 [Online]. Available: http://dx.doi.org/10.1007/978-3-642-15561-1_7;
-
Joint bilateral filter. Link: https://www.mathworks.com/matlabcentral/fileexchange/62455-joint-bilateral-filter;
-
Q. Yang, K.-H. Tan, and N. Ahuja, “Real-time O(1) bilateral filtering,” in 2009 IEEE Conference on Computer Vision and Pattern Recognition, 2009 [Online]. Available: http://dx.doi.org/10.1109/CVPR.2009.5206542.