.. _example_plot_16bitbilateral.py:


==============================
Bilateral mean
==============================
This example compares

* local mean
* percentile mean
* bilateral mean

build on the local histogram distribution
local mean uses all pixels belonging to the structuring element to compute average gray level,
percentile mean uses only values between percentiles p0 and p1 (here 10% and 90%),
whereas bilateral mean uses only pixels of the structuring element having a gray level situated inside
g-s0 and g+s1 (here g-500 and g+500).
The filters are applied on a 16 bit image (actual bitdepth is 12bit).

Percentile and usual mean give here similar results, these filters smooth the complete image (background and details).
Bilateral mean exhibits a high filtering rate for continuous area (i.e. background) while image higher frequencies
remains untouched.


.. image:: images/plot_16bitbilateral_1.png
    :align: center


.. literalinclude:: plot_16bitbilateral.py
    :lines: 23-



**Python source code:** :download:`download <plot_16bitbilateral.py>`
(generated using ``skimage`` |version|)

