0

Can anyone explain me how can I use the equation of bilateral filter in an image ,each coefficient in equation how can use it on an array and how the filter leave the edge without smoothing ? can anyone help me, please?and why(Ip - Iq) multiply in Iq enter image description here

eleen
  • 191
  • 1
  • 4
  • 11
  • Take a look at http://stackoverflow.com/questions/38768256/how-to-remove-grainy-details-from-an-image/38768984#38768984 – Amitay Nachmani Dec 01 '16 at 05:38
  • thanks a lot , but I'm yet I can not understand the benefit of normalization and (Iq) in the last of the equation ? can u help? – eleen Dec 01 '16 at 09:07
  • @AmitayNachmani ,pardon,can you answer my question – eleen Dec 01 '16 at 18:24
  • Iq is the pixel value of pixel q from the set of pixels S(which usually S just means the 8 negbrhood of a pixel) – Amitay Nachmani Dec 01 '16 at 19:24
  • The normalization is to make sure that the outcome of the pixel value will be proportional to the pixel values in the image. – Amitay Nachmani Dec 01 '16 at 19:26
  • In general you can think about that in the following way: Gmus and Gmur are weights that weigh the influence of pixel q on the calculation of the value of pixel p. You need to normalize the weights so they will sum up to 1 and because of that you use Wp. – Amitay Nachmani Dec 01 '16 at 19:37
  • thanks a lot ,if the (p-q) the distance between pixels and (Ip-Iq)the different in intensity between these pixels ,so how the filter preserving edge ,I'm sorry but I can not understand – eleen Dec 01 '16 at 20:12
  • why was the use of this( Iq) why not this(Ip ) in the last of the equation I'm sorry for bothering you – eleen Dec 01 '16 at 20:19
  • For your first question if the distance in intensity is big we can assume that the two pixels are on different sides of an edge so the weight pixel iq will get is a low weight. – Amitay Nachmani Dec 01 '16 at 21:46
  • For the second question. The purpose of the filter is to assign a new value to pixel Ip based on its neigbrhood. that means that the new value of ip will be a function of its neigbhors the iq's. – Amitay Nachmani Dec 01 '16 at 21:48

1 Answers1

3

The filter computes a weighted sum of the pixel intensities. A normalization factor is always required in a weighted average, so that a constant signal keeps the same value.

The space factor makes sure that the filter value is influenced by nearby pixels only, with a smooth decrease of the weighting. The range factor makes sure that the filter value is influenced by pixels with close gray value only, with a smooth decrease of the weighting.

The idea behind this filter is to average the pixels belonging to the same homogeneous region as the center pixel, as if performing a local segmentation. The average performs smoothing/noise reduction, while restricting to the same region avoids spoling the edges by mixing with pixels of a very different intensity.