Ask Your Question

Bilateral filter for Android

asked 2013-07-01 11:37:49 -0500

issey173 gravatar image

Hi I am trying to apply the bilateralFilter function in Android to an image (Mat object) and it seems that doesn't work (it just blur it a little bit). To do so I first convert my bitmap into a Mat with Utils.bitmapToMat(bitmap, mat) (mat type: CV_8UC4). BilateralFilter only accepts 1 or 3 channel Mats so I obtain another Mat without alpha channel (CV_8UC3) called interMat. Then I create an empty Mat with the same size and type than interMat called filterMat. When I make: Imgproc.bilateralFilter(interMat, filterMat, 5, 180, 150) and turn it back into a bitmap is like I made nothing. I have modified the sigmas and distance and also iterate the filtering but I just obtain an image a little blur (always the same, even if I change sigmas).

Can anybody help me with this problem? I have tried everything I know. Thanks in advance

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-07-03 16:46:52 -0500

MysticBE gravatar image

I don't see the exact problem, the blurring is what the Bilateral filter does (smoothing the images). Check for examples. What did you expect it to do?

edit flag offensive delete link more


Thank you for your answer. As you can see in the link you provided, I expect it to transform the image to a cartoon-like appearance (if the sigma values are appropiate). The main point of the bilateral filtering is that does not blur the edges (as a gaussian filter). That's the first problem, when I apply the bilateral filtering it blurs the edges. The second problem (and maybe the main one) is that even if I change the sigmas values, the output is always the same.

issey173 gravatar imageissey173 ( 2013-07-23 12:51:10 -0500 )edit

You can follow my tutorial :

Ivan Julian gravatar imageIvan Julian ( 2018-09-30 11:22:59 -0500 )edit

Question Tools

1 follower


Asked: 2013-07-01 11:37:49 -0500

Seen: 1,853 times

Last updated: Jul 03 '13