The Median Filter Problem
Image processing is a very important field within industrial automation, and more concretely, in the automated visual inspection. For example, automatically analyzing predetermined features of manufactured parts on an assembly line to look for defects and process variations . In these applications, the main challenge normally is the requirement of real-time results.
On the other hand, in many of these applications, the acquired images must pass through a stage of image preprocessing in order to remove distracting and useless information from the images. For example, the existence of impulsive noise in the images is one of the most habitual problems.
is the nonlinear filter more used to remove the impulsive noise from an
image , , . Furthermore, it is a more robust method than the traditional
linear filtering, because it preserves the sharp edges.
The median value
is determined by placing the brightnesses in ascending order and selecting
the centre value . The obtained median value will
be the value for that pixel in the output image. Figure shows an example of
the median filter application, as in this case, habitually a 3x3 median filter
The optimization problem:
The main problem
of the median filter is its high computational cost (for sorting N pixels,
the temporal complexity is O(N·log N), even with the most efficient
sorting algorithms). When the median filter must be carried out in real time,
the software implementation in general-purpose processors does not usually
give good results. ASICs  have been required traditionally.
However, they imply a limited functionality due to their predefined architecture.
Also, the price for application as well as the production time are usually
computing architectures  are sufficiently flexible
so that new operations can be implemented in the existent hardware, and they
are quite quick for real-time execution. Moreover, the price/performance
ratio of these systems makes them a broadly competitive alternative to ASICs.
FPGAs  have been identified as the natural platform
for CCMs  due to their reprogrammability .
For these reasons,
we believe that FPGAs are a good alternative to achieve the solution of this
problem: the real-time implementation of median filter. This implementation
will allow us to use this operation within automated visual inspection systems,
maintaining the requirements of real-time operation and reduced cost so that
these systems can be introduced into an industrial environment.
 G.A. Baxes. “Digital Image
Processing. Principles & Applications”, Wiley & Sons (1994).