 This preserves sharp edges.The bilateral filter is defined as

and normalization term, formula_2, is defined as

where

The weight formula_12 is assigned using the spatial closeness (using the spatial kernel formula_11) and the intensity difference (using the range kernel formula_10).Consider a pixel located at formula_15 that needs to be denoised in image using its neighbouring pixels and one of its neighbouring pixels is located at formula_16.