Module Expr Str Import alias identifier Import alias identifier ImportFrom alias ImportFrom alias Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Call AttributeLoad NameLoad attr Num Num Assign TupleStore NameStore TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Num Num keyword TupleLoad Num Num Expr Call AttributeLoad NameLoad attr NameLoad keyword Str keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Num Slice Num SubscriptLoad NameLoad Index Num keyword Num Expr Call AttributeLoad NameLoad attr Str Expr Str ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index CompareGt NameLoad Num Num Assign SubscriptStore NameLoad Index CompareLt NameLoad Num Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Num Num keyword TupleLoad Num Num keyword NameLoad keyword NameLoad Assign TupleStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad keyword Num keyword Num keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call NameLoad Num keyword Num keyword Num keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call NameLoad Num keyword Num keyword Num keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call NameLoad Num keyword Num keyword Num keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Str ImportFrom alias Assign TupleStore NameStore TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Num Num keyword ListLoad Num Num keyword NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad Call NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad keyword Num keyword Num keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad keyword Num keyword Num keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Str ImportFrom alias Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad Num keyword Num keyword Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Num Num keyword TupleLoad Num Num keyword Str keyword Str Assign TupleStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Num Num Slice Num Num keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Num Num Slice Num Num keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Str ImportFrom alias ImportFrom alias Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore BinOpMult Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Call NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Call AttributeLoad NameLoad attr Num Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Call AttributeLoad NameLoad attr Num Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Call AttributeLoad NameLoad attr Num Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Num Num keyword TupleLoad Num Num Assign TupleStore NameStore NameStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad keyword Str keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Num Slice Num SubscriptLoad NameLoad Index Num keyword Num Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad keyword Str keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Num Slice Num SubscriptLoad NameLoad Index Num keyword Num Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad keyword Str keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Num Slice Num SubscriptLoad NameLoad Index Num keyword Num Expr Call AttributeLoad NameLoad attr Str Expr Str ImportFrom alias Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad Num Assign TupleStore NameStore TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Num Num keyword ListLoad Num Num keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Str ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Num Assign NameStore Call NameLoad NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword Num keyword Num Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword Num keyword Num Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword Num keyword Num Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword Num keyword Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr keyword Num keyword Num keyword TupleLoad Num Num keyword NameLoad keyword NameLoad Assign TupleStore NameStore NameStore NameStore NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore ListLoad Str Str Str Str Str Str Assign NameStore ListLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr For NameStore Call NameLoad Num Call NameLoad NameLoad body Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr SubscriptLoad NameLoad Index NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr keyword Num keyword Num Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Str Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Str Expr Str ImportFrom alias Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Call NameLoad Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Num Num keyword ListLoad Num Num keyword Str keyword Str Assign TupleStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Num Num Slice Num Num keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Num Num Slice Num Num keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Str ImportFrom alias Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Call NameLoad Num keyword Num keyword Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Num Num keyword ListLoad Num Num keyword Str keyword Str Assign TupleStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Num Num Slice Num Num keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Num Num Slice Num Num keyword AttributeLoad AttributeLoad NameLoad attr attr For NameStore Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Str ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Num Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore CompareGtE NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore CompareGtE NameLoad NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Num Num keyword NameLoad keyword NameLoad Assign TupleStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr CompareGtE NameLoad NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad For NameStore Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Str Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr Num BinOpMult Num AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad BinOpAdd BinOpMult BinOpMult Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad Num Call AttributeLoad NameLoad attr Num Num NameLoad Num Num attr AttributeLoad NameLoad attr Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Call NameLoad NameLoad Assign TupleStore NameStore TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Num Num keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr CompareGtE NameLoad NameLoad keyword Str Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Str ImportFrom alias alias alias Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call NameLoad NameLoad Call NameLoad Num Call NameLoad Num Assign NameStore Call NameLoad Call NameLoad NameLoad Call NameLoad Num Call NameLoad Num Assign NameStore Call NameLoad NameLoad Call NameLoad Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Num Num keyword ListLoad Num Num keyword NameLoad keyword NameLoad Assign TupleStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str For NameStore Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Str ImportFrom alias ImportFrom alias ImportFrom alias Import alias identifier Import alias identifier Assign NameStore Call AttributeLoad NameLoad attr Assign TupleStore NameStore TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Num Num keyword TupleLoad Num Num keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call NameLoad Num keyword AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Str ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias FunctionDef arguments args NameParam defaults body Expr Str FunctionDef arguments args defaults vararg body Assign NameStore Call NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad Assign NameStore BinOpMult BinOpSub NameLoad NameLoad Num Return TupleLoad NameLoad NameLoad decorator_list Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad keyword NameLoad keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad keyword NameLoad keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad keyword NameLoad keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad NameLoad Num keyword BinOpSub BinOpMult NameLoad Num Num decorator_list NameLoad Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore ListLoad Assign NameStore Call NameLoad Num Num Num For NameStore NameLoad body Assign NameStore Call NameLoad BinOpAdd NameLoad Num Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str Expr Str Assign NameStore Num Assign NameStore Call NameLoad BinOpAdd NameLoad Num Assign NameStore ListLoad Assign NameStore Call NameLoad Num Num Num For NameStore NameLoad body Assign NameStore Call AttributeLoad BinOpMult Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad Num attr AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore ListLoad Assign NameStore Call NameLoad Num Num Num For NameStore NameLoad body Assign NameStore Call NameLoad BinOpAdd NameLoad Num Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Str Assign TupleStore NameStore TupleStore NameStore NameStore Call AttributeLoad NameLoad attr keyword Num keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Str Assign NameStore Num Assign NameStore Call NameLoad BinOpAdd NameLoad Num Assign NameStore ListLoad Assign NameStore ListLoad Num Num Num Num For NameStore NameLoad body Assign NameStore Call AttributeLoad BinOpMult Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad Num attr AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Str Expr Call AttributeLoad NameLoad attr
N/A N/A 
============
Rank filters
============

Rank filters are non-linear filters using the local gray-level ordering to
compute the filtered value. This ensemble of filters share a common base: the
local gray-level histogram is computed on the neighborhood of a pixel (defined
by a 2-D structuring element). If the filtered value is taken as the middle
value of the histogram, we get the classical median filter.

Rank filters can be used for several purposes such as:

* image quality enhancement
  e.g. image smoothing, sharpening

* image pre-processing
  e.g. noise reduction, contrast enhancement

* feature extraction
  e.g. border detection, isolated point detection

* post-processing
  e.g. small object removal, object grouping, contour smoothing

Some well known filters are specific cases of rank filters [1]_ e.g.
morphological dilation, morphological erosion, median filters.

In this example, we will see how to filter a gray-level image using some of the
linear and non-linear filters available in skimage. We use the `camera` image
from `skimage.data` for all comparisons.

.. [1] Pierre Soille, On morphological operators based on rank filters, Pattern
       Recognition 35 (2002) 527-535.

 N/A numpy np N/A matplotlib.pyplot plt skimage img_as_ubyte skimage data N/A noisy_image N/A img_as_ubyte N/A N/A data camera N/A hist N/A N/A np histogram noisy_image bins N/A N/A np arange 0 256 N/A N/A fig N/A ax1 ax2 N/A N/A plt subplots 1 2 figsize N/A 8 3 N/A N/A N/A ax1 imshow noisy_image interpolation nearest cmap N/A N/A plt cm gray N/A N/A N/A ax1 axis off N/A N/A N/A ax2 plot N/A N/A hist N/A 1 N/A -1 N/A hist N/A 0 lw 2 N/A N/A N/A ax2 set_title Histogram of grey values N/A 

.. image:: PLOT2RST.current_figure

Noise removal
=============

Some noise is added to the image, 1% of pixels are randomly set to 255, 1% are
randomly set to 0. The **median** filter is applied to remove the noise.

 skimage.filters.rank median skimage.morphology disk N/A noise N/A N/A N/A np random random N/A noisy_image shape N/A noisy_image N/A img_as_ubyte N/A N/A data camera N/A N/A noisy_image N/A N/A noise 0.99 255 N/A N/A noisy_image N/A N/A noise 0.01 0 N/A N/A fig ax N/A N/A plt subplots 2 2 figsize N/A 10 7 sharex True sharey True N/A N/A ax1 ax2 ax3 ax4 N/A N/A ax ravel N/A N/A N/A ax1 imshow noisy_image vmin 0 vmax 255 cmap N/A N/A plt cm gray N/A N/A N/A ax1 set_title Noisy image N/A N/A N/A ax1 axis off N/A N/A N/A ax1 set_adjustable box-forced N/A N/A N/A ax2 imshow N/A median noisy_image N/A disk 1 vmin 0 vmax 255 cmap N/A N/A plt cm gray N/A N/A N/A ax2 set_title Median $r=1$ N/A N/A N/A ax2 axis off N/A N/A N/A ax2 set_adjustable box-forced N/A N/A N/A ax3 imshow N/A median noisy_image N/A disk 5 vmin 0 vmax 255 cmap N/A N/A plt cm gray N/A N/A N/A ax3 set_title Median $r=5$ N/A N/A N/A ax3 axis off N/A N/A N/A ax3 set_adjustable box-forced N/A N/A N/A ax4 imshow N/A median noisy_image N/A disk 20 vmin 0 vmax 255 cmap N/A N/A plt cm gray N/A N/A N/A ax4 set_title Median $r=20$ N/A N/A N/A ax4 axis off N/A N/A N/A ax4 set_adjustable box-forced N/A 

.. image:: PLOT2RST.current_figure

The added noise is efficiently removed, as the image defaults are small (1
pixel wide), a small filter radius is sufficient. As the radius is increasing,
objects with bigger sizes are filtered as well, such as the camera tripod. The
median filter is often used for noise removal because borders are preserved and
e.g. salt and pepper noise typically does not distort the gray-level.

Image smoothing
================

The example hereunder shows how a local **mean** filter smooths the camera man
image.

 skimage.filters.rank mean N/A N/A fig N/A ax1 ax2 N/A N/A plt subplots 1 2 figsize N/A 10 7 sharex True sharey True N/A loc_mean N/A mean noisy_image N/A disk 10 N/A N/A N/A ax1 imshow noisy_image vmin 0 vmax 255 cmap N/A N/A plt cm gray N/A N/A N/A ax1 set_title Original N/A N/A N/A ax1 axis off N/A N/A N/A ax1 set_adjustable box-forced N/A N/A N/A ax2 imshow loc_mean vmin 0 vmax 255 cmap N/A N/A plt cm gray N/A N/A N/A ax2 set_title Local mean $r=10$ N/A N/A N/A ax2 axis off N/A N/A N/A ax2 set_adjustable box-forced N/A 

.. image:: PLOT2RST.current_figure

One may be interested in smoothing an image while preserving important borders
(median filters already achieved this), here we use the **bilateral** filter
that restricts the local neighborhood to pixel having a gray-level similar to
the central one.

.. note::

    A different implementation is available for color images in
    `skimage.filters.denoise_bilateral`.

 skimage.filters.rank mean_bilateral N/A noisy_image N/A img_as_ubyte N/A N/A data camera N/A bilat N/A mean_bilateral N/A N/A noisy_image astype N/A np uint16 N/A disk 20 s0 10 s1 10 N/A N/A fig ax N/A N/A plt subplots 2 2 figsize N/A 10 7 sharex row sharey row N/A N/A ax1 ax2 ax3 ax4 N/A N/A ax ravel N/A N/A N/A ax1 imshow noisy_image cmap N/A N/A plt cm gray N/A N/A N/A ax1 set_title Original N/A N/A N/A ax1 axis off N/A N/A N/A ax1 set_adjustable box-forced N/A N/A N/A ax2 imshow bilat cmap N/A N/A plt cm gray N/A N/A N/A ax2 set_title Bilateral mean N/A N/A N/A ax2 axis off N/A N/A N/A ax2 set_adjustable box-forced N/A N/A N/A ax3 imshow N/A noisy_image N/A N/A 200 350 N/A 350 450 cmap N/A N/A plt cm gray N/A N/A N/A ax3 axis off N/A N/A N/A ax3 set_adjustable box-forced N/A N/A N/A ax4 imshow N/A bilat N/A N/A 200 350 N/A 350 450 cmap N/A N/A plt cm gray N/A N/A N/A ax4 axis off N/A N/A N/A ax4 set_adjustable box-forced N/A 

.. image:: PLOT2RST.current_figure

One can see that the large continuous part of the image (e.g. sky) is smoothed
whereas other details are preserved.


Contrast enhancement
====================

We compare here how the global histogram equalization is applied locally.

The equalized image [2]_ has a roughly linear cumulative distribution function
for each pixel neighborhood. The local version [3]_ of the histogram
equalization emphasizes every local gray-level variations.

.. [2] http://en.wikipedia.org/wiki/Histogram_equalization
.. [3] http://en.wikipedia.org/wiki/Adaptive_histogram_equalization

 skimage exposure skimage.filters rank N/A noisy_image N/A img_as_ubyte N/A N/A data camera N/A glob N/A N/A N/A exposure equalize_hist noisy_image 255 N/A loc N/A N/A rank equalize noisy_image N/A disk 20 N/A hist N/A N/A np histogram noisy_image bins N/A N/A np arange 0 256 N/A glob_hist N/A N/A np histogram glob bins N/A N/A np arange 0 256 N/A loc_hist N/A N/A np histogram loc bins N/A N/A np arange 0 256 N/A N/A fig ax N/A N/A plt subplots 3 2 figsize N/A 10 10 N/A N/A ax1 ax2 ax3 ax4 ax5 ax6 N/A N/A ax ravel N/A N/A N/A ax1 imshow noisy_image interpolation nearest cmap N/A N/A plt cm gray N/A N/A N/A ax1 axis off N/A N/A N/A ax2 plot N/A N/A hist N/A 1 N/A -1 N/A hist N/A 0 lw 2 N/A N/A N/A ax2 set_title Histogram of gray values N/A N/A N/A ax3 imshow glob interpolation nearest cmap N/A N/A plt cm gray N/A N/A N/A ax3 axis off N/A N/A N/A ax4 plot N/A N/A glob_hist N/A 1 N/A -1 N/A glob_hist N/A 0 lw 2 N/A N/A N/A ax4 set_title Histogram of gray values N/A N/A N/A ax5 imshow loc interpolation nearest cmap N/A N/A plt cm gray N/A N/A N/A ax5 axis off N/A N/A N/A ax6 plot N/A N/A loc_hist N/A 1 N/A -1 N/A loc_hist N/A 0 lw 2 N/A N/A N/A ax6 set_title Histogram of gray values N/A 

.. image:: PLOT2RST.current_figure

Another way to maximize the number of gray-levels used for an image is to apply
a local auto-leveling, i.e. the gray-value of a pixel is proportionally
remapped between local minimum and local maximum.

The following example shows how local auto-level enhances the camara man
picture.

 skimage.filters.rank autolevel N/A noisy_image N/A img_as_ubyte N/A N/A data camera N/A auto N/A autolevel N/A N/A noisy_image astype N/A np uint16 N/A disk 20 N/A N/A fig N/A ax1 ax2 N/A N/A plt subplots 1 2 figsize N/A 10 7 sharex True sharey True N/A N/A N/A ax1 imshow noisy_image cmap N/A N/A plt cm gray N/A N/A N/A ax1 set_title Original N/A N/A N/A ax1 axis off N/A N/A N/A ax1 set_adjustable box-forced N/A N/A N/A ax2 imshow auto cmap N/A N/A plt cm gray N/A N/A N/A ax2 set_title Local autolevel N/A N/A N/A ax2 axis off N/A N/A N/A ax2 set_adjustable box-forced N/A 

.. image:: PLOT2RST.current_figure

This filter is very sensitive to local outliers, see the little white spot in
the left part of the sky. This is due to a local maximum which is very high
comparing to the rest of the neighborhood. One can moderate this using the
percentile version of the auto-level filter which uses given percentiles (one
inferior, one superior) in place of local minimum and maximum. The example
below illustrates how the percentile parameters influence the local auto-level
result.

 skimage.filters.rank autolevel_percentile N/A image N/A N/A data camera N/A selem N/A disk 20 N/A loc_autolevel N/A autolevel image selem selem N/A loc_perc_autolevel0 N/A autolevel_percentile image selem selem p0 0.0 p1 1.0 N/A loc_perc_autolevel1 N/A autolevel_percentile image selem selem p0 0.01 p1 0.99 N/A loc_perc_autolevel2 N/A autolevel_percentile image selem selem p0 0.05 p1 0.95 N/A loc_perc_autolevel3 N/A autolevel_percentile image selem selem p0 0.1 p1 0.9 N/A N/A fig axes N/A N/A plt subplots nrows 3 ncols 2 figsize N/A 7 8 sharex True sharey True N/A N/A ax0 ax1 ax2 axes N/A N/A N/A plt gray N/A title_list N/A Original auto_level auto-level 0% auto-level 1% auto-level 5% auto-level 10% N/A image_list N/A image loc_autolevel loc_perc_autolevel0 loc_perc_autolevel1 loc_perc_autolevel2 loc_perc_autolevel3 N/A axes_list N/A N/A N/A N/A axes ravel tolist N/A i N/A range 0 N/A len image_list N/A N/A N/A N/A N/A axes_list N/A i imshow N/A image_list N/A i cmap N/A N/A plt cm gray vmin 0 vmax 255 N/A N/A N/A N/A axes_list N/A i set_title N/A title_list N/A i N/A N/A N/A N/A axes_list N/A i axis off N/A N/A N/A N/A axes_list N/A i set_adjustable box-forced N/A 

.. image:: PLOT2RST.current_figure

The morphological contrast enhancement filter replaces the central pixel by the
local maximum if the original pixel value is closest to local maximum,
otherwise by the minimum local.

 skimage.filters.rank enhance_contrast N/A noisy_image N/A img_as_ubyte N/A N/A data camera N/A enh N/A enhance_contrast noisy_image N/A disk 5 N/A N/A fig ax N/A N/A plt subplots 2 2 figsize N/A 10 7 sharex row sharey row N/A N/A ax1 ax2 ax3 ax4 N/A N/A ax ravel N/A N/A N/A ax1 imshow noisy_image cmap N/A N/A plt cm gray N/A N/A N/A ax1 set_title Original N/A N/A N/A ax1 axis off N/A N/A N/A ax1 set_adjustable box-forced N/A N/A N/A ax2 imshow enh cmap N/A N/A plt cm gray N/A N/A N/A ax2 set_title Local morphological contrast enhancement N/A N/A N/A ax2 axis off N/A N/A N/A ax2 set_adjustable box-forced N/A N/A N/A ax3 imshow N/A noisy_image N/A N/A 200 350 N/A 350 450 cmap N/A N/A plt cm gray N/A N/A N/A ax3 axis off N/A N/A N/A ax3 set_adjustable box-forced N/A N/A N/A ax4 imshow N/A enh N/A N/A 200 350 N/A 350 450 cmap N/A N/A plt cm gray N/A N/A N/A ax4 axis off N/A N/A N/A ax4 set_adjustable box-forced N/A 

.. image:: PLOT2RST.current_figure

The percentile version of the local morphological contrast enhancement uses
percentile *p0* and *p1* instead of the local minimum and maximum.

 skimage.filters.rank enhance_contrast_percentile N/A noisy_image N/A img_as_ubyte N/A N/A data camera N/A penh N/A enhance_contrast_percentile noisy_image N/A disk 5 p0 0.1 p1 0.9 N/A N/A fig ax N/A N/A plt subplots 2 2 figsize N/A 10 7 sharex row sharey row N/A N/A ax1 ax2 ax3 ax4 N/A N/A ax ravel N/A N/A N/A ax1 imshow noisy_image cmap N/A N/A plt cm gray N/A N/A N/A ax1 set_title Original N/A N/A N/A ax2 imshow penh cmap N/A N/A plt cm gray N/A N/A N/A ax2 set_title Local percentile morphological
 contrast enhancement N/A N/A N/A ax3 imshow N/A noisy_image N/A N/A 200 350 N/A 350 450 cmap N/A N/A plt cm gray N/A N/A N/A ax4 imshow N/A penh N/A N/A 200 350 N/A 350 450 cmap N/A N/A plt cm gray N/A ax N/A N/A ax ravel N/A N/A N/A N/A ax axis off N/A N/A N/A ax set_adjustable box-forced N/A 

.. image:: PLOT2RST.current_figure

Image threshold
===============

The Otsu threshold [1]_ method can be applied locally using the local gray-
level distribution. In the example below, for each pixel, an "optimal"
threshold is determined by maximizing the variance between two classes of
pixels of the local neighborhood defined by a structuring element.

The example compares the local threshold with the global threshold
`skimage.filters.threshold_otsu`.

.. note::

    Local is much slower than global thresholding. A function for global Otsu
    thresholding can be found in : `skimage.filters.threshold_otsu`.

.. [4] http://en.wikipedia.org/wiki/Otsu's_method

 skimage.filters.rank otsu skimage.filters threshold_otsu N/A p8 N/A N/A data page N/A radius 10 N/A selem N/A disk radius N/A t_loc_otsu N/A otsu p8 selem N/A loc_otsu N/A p8 t_loc_otsu N/A t_glob_otsu N/A threshold_otsu p8 N/A glob_otsu N/A p8 t_glob_otsu N/A N/A fig ax N/A N/A plt subplots 2 2 sharex True sharey True N/A N/A ax1 ax2 ax3 ax4 N/A N/A ax ravel N/A N/A N/A fig colorbar N/A N/A ax1 imshow p8 cmap N/A N/A plt cm gray ax ax1 N/A N/A N/A ax1 set_title Original N/A N/A N/A fig colorbar N/A N/A ax2 imshow t_loc_otsu cmap N/A N/A plt cm gray ax ax2 N/A N/A N/A ax2 set_title N/A Local Otsu ($r=%d$) radius N/A N/A N/A ax3 imshow N/A p8 t_loc_otsu cmap N/A N/A plt cm gray N/A N/A N/A ax3 set_title N/A Original >= local Otsu t_glob_otsu N/A N/A N/A ax4 imshow glob_otsu cmap N/A N/A plt cm gray N/A N/A N/A ax4 set_title N/A Global Otsu ($t=%d$) t_glob_otsu N/A ax N/A N/A ax ravel N/A N/A N/A N/A ax axis off N/A N/A N/A ax set_adjustable box-forced N/A 

.. image:: PLOT2RST.current_figure

The following example shows how local Otsu thresholding handles a global level
shift applied to a synthetic image.

 N/A n 100 N/A theta N/A N/A np linspace 0 N/A 10 N/A np pi n N/A x N/A N/A np sin theta N/A m N/A N/A N/A N/A N/A N/A N/A np tile x N/A n 1 N/A N/A np linspace 0.1 1 n 128 128 astype N/A np uint8 N/A radius 10 N/A t N/A N/A rank otsu m N/A disk radius N/A N/A fig N/A ax1 ax2 N/A N/A plt subplots 1 2 sharex True sharey True N/A N/A N/A ax1 imshow m N/A N/A N/A ax1 set_title Original N/A N/A N/A ax1 axis off N/A N/A N/A ax1 set_adjustable box-forced N/A N/A N/A ax2 imshow N/A m t interpolation nearest N/A N/A N/A ax2 set_title N/A Local Otsu ($r=%d$) radius N/A N/A N/A ax2 axis off N/A N/A N/A ax2 set_adjustable box-forced N/A 

.. image:: PLOT2RST.current_figure

Image morphology
================

Local maximum and local minimum are the base operators for gray-level
morphology.

.. note::

    `skimage.dilate` and `skimage.erode` are equivalent filters (see below for
    comparison).

Here is an example of the classical morphological gray-level filters: opening,
closing and morphological gradient.

 skimage.filters.rank maximum minimum gradient N/A noisy_image N/A img_as_ubyte N/A N/A data camera N/A closing N/A maximum N/A minimum noisy_image N/A disk 5 N/A disk 5 N/A opening N/A minimum N/A maximum noisy_image N/A disk 5 N/A disk 5 N/A grad N/A gradient noisy_image N/A disk 5 N/A N/A fig ax N/A N/A plt subplots 2 2 figsize N/A 10 7 sharex True sharey True N/A N/A ax1 ax2 ax3 ax4 N/A N/A ax ravel N/A N/A N/A ax1 imshow noisy_image cmap N/A N/A plt cm gray N/A N/A N/A ax1 set_title Original N/A N/A N/A ax2 imshow closing cmap N/A N/A plt cm gray N/A N/A N/A ax2 set_title Gray-level closing N/A N/A N/A ax3 imshow opening cmap N/A N/A plt cm gray N/A N/A N/A ax3 set_title Gray-level opening N/A N/A N/A ax4 imshow grad cmap N/A N/A plt cm gray N/A N/A N/A ax4 set_title Morphological gradient N/A ax N/A N/A ax ravel N/A N/A N/A N/A ax axis off N/A N/A N/A ax set_adjustable box-forced N/A 

.. image:: PLOT2RST.current_figure

Feature extraction
===================

Local histograms can be exploited to compute local entropy, which is related to
the local image complexity. Entropy is computed using base 2 logarithm i.e. the
filter returns the minimum number of bits needed to encode local gray-level
distribution.

`skimage.rank.entropy` returns the local entropy on a given structuring
element. The following example shows applies this filter on 8- and 16-bit
images.

.. note::

    to better use the available image bit, the function returns 10x entropy for
    8-bit images and 1000x entropy for 16-bit images.

 skimage data skimage.filters.rank entropy skimage.morphology disk N/A numpy np N/A matplotlib.pyplot plt N/A image N/A N/A data camera N/A N/A fig N/A ax1 ax2 N/A N/A plt subplots 1 2 figsize N/A 10 4 sharex True sharey True N/A N/A N/A fig colorbar N/A N/A ax1 imshow image cmap N/A N/A plt cm gray ax ax1 N/A N/A N/A ax1 set_title Image N/A N/A N/A ax1 axis off N/A N/A N/A ax1 set_adjustable box-forced N/A N/A N/A fig colorbar N/A N/A ax2 imshow N/A entropy image N/A disk 5 cmap N/A N/A plt cm gray ax ax2 N/A N/A N/A ax2 set_title Entropy N/A N/A N/A ax2 axis off N/A N/A N/A ax2 set_adjustable box-forced N/A 

.. image:: PLOT2RST.current_figure

Implementation
==============

The central part of the `skimage.rank` filters is build on a sliding window
that updates the local gray-level histogram. This approach limits the algorithm
complexity to O(n) where n is the number of image pixels. The complexity is
also limited with respect to the structuring element size.

In the following we compare the performance of different implementations
available in `skimage`.

 time time scipy.ndimage percentile_filter skimage.morphology dilation skimage.filters.rank median maximum exec_and_timeit N/A N/A func N/A N/A N/A Decorator that returns both function results and execution time. wrapper N/A N/A N/A arg N/A N/A t1 N/A time N/A res N/A func arg N/A t2 N/A time N/A ms N/A N/A t2 t1 1000.0 N/A N/A res ms N/A N/A wrapper N/A cr_med N/A N/A image selem N/A N/A N/A N/A median image image selem selem N/A exec_and_timeit cr_max N/A N/A image selem N/A N/A N/A N/A maximum image image selem selem N/A exec_and_timeit cm_dil N/A N/A image selem N/A N/A N/A N/A dilation image image selem selem N/A exec_and_timeit ndi_med N/A N/A image n N/A N/A N/A N/A percentile_filter image 50 size N/A N/A n 2 1 N/A exec_and_timeit N/A 

Comparison between

* `filters.rank.maximum`
* `morphology.dilate`

on increasing structuring element size:

 N/A a N/A N/A data camera N/A rec N/A N/A e_range N/A range 1 20 2 N/A r e_range N/A N/A elem N/A disk N/A r 1 N/A N/A rc ms_rc N/A cr_max a elem N/A N/A rcm ms_rcm N/A cm_dil a elem N/A N/A N/A rec append N/A ms_rc ms_rcm N/A rec N/A N/A np asarray rec N/A N/A fig ax N/A N/A plt subplots N/A N/A N/A ax set_title Performance with respect to element size N/A N/A N/A ax set_ylabel Time (ms) N/A N/A N/A ax set_xlabel Element radius N/A N/A N/A ax plot e_range rec N/A N/A N/A ax legend N/A filters.rank.maximum morphology.dilate N/A 

.. image:: PLOT2RST.current_figure

and increasing image size:

 N/A r 9 N/A elem N/A disk N/A r 1 N/A rec N/A N/A s_range N/A range 100 1000 100 N/A s s_range N/A N/A a N/A N/A N/A N/A N/A N/A np random random N/A s s 256 astype N/A np uint8 N/A N/A rc ms_rc N/A cr_max a elem N/A N/A rcm ms_rcm N/A cm_dil a elem N/A N/A N/A rec append N/A ms_rc ms_rcm N/A rec N/A N/A np asarray rec N/A N/A fig ax N/A N/A plt subplots N/A N/A N/A ax set_title Performance with respect to image size N/A N/A N/A ax set_ylabel Time (ms) N/A N/A N/A ax set_xlabel Image size N/A N/A N/A ax plot s_range rec N/A N/A N/A ax legend N/A filters.rank.maximum morphology.dilate N/A 

.. image:: PLOT2RST.current_figure

Comparison between:

* `filters.rank.median`
* `scipy.ndimage.percentile`

on increasing structuring element size:

 N/A a N/A N/A data camera N/A rec N/A N/A e_range N/A range 2 30 4 N/A r e_range N/A N/A elem N/A disk N/A r 1 N/A N/A rc ms_rc N/A cr_med a elem N/A N/A rndi ms_ndi N/A ndi_med a r N/A N/A N/A rec append N/A ms_rc ms_ndi N/A rec N/A N/A np asarray rec N/A N/A fig ax N/A N/A plt subplots N/A N/A N/A ax set_title Performance with respect to element size N/A N/A N/A ax plot e_range rec N/A N/A N/A ax legend N/A filters.rank.median scipy.ndimage.percentile N/A N/A N/A ax set_ylabel Time (ms) N/A N/A N/A ax set_xlabel Element radius N/A 
.. image:: PLOT2RST.current_figure

Comparison of outcome of the three methods:

 N/A N/A fig N/A ax0 ax1 N/A N/A plt subplots ncols 2 sharex True sharey True N/A N/A N/A ax0 set_title filters.rank.median N/A N/A N/A ax0 imshow rc N/A N/A N/A ax0 axis off N/A N/A N/A ax0 set_adjustable box-forced N/A N/A N/A ax1 set_title scipy.ndimage.percentile N/A N/A N/A ax1 imshow rndi N/A N/A N/A ax1 axis off N/A N/A N/A ax1 set_adjustable box-forced N/A 
.. image:: PLOT2RST.current_figure

and increasing image size:

 N/A r 9 N/A elem N/A disk N/A r 1 N/A rec N/A N/A s_range N/A 100 200 500 1000 N/A s s_range N/A N/A a N/A N/A N/A N/A N/A N/A np random random N/A s s 256 astype N/A np uint8 N/A N/A rc ms_rc N/A cr_med a elem N/A N/A rndi ms_ndi N/A ndi_med a r N/A N/A N/A rec append N/A ms_rc ms_ndi N/A rec N/A N/A np asarray rec N/A N/A fig ax N/A N/A plt subplots N/A N/A N/A ax set_title Performance with respect to image size N/A N/A N/A ax plot s_range rec N/A N/A N/A ax legend N/A filters.rank.median scipy.ndimage.percentile N/A N/A N/A ax set_ylabel Time (ms) N/A N/A N/A ax set_xlabel Image size N/A 
.. image:: PLOT2RST.current_figure

 N/A N/A N/A plt show