The Despeckle filter smoothes areas in which noise is noticeable
while leaving complex areas untouched. The effect is that grain or
other noise is reduced without severely affecting edges.
The standard deviation of each pixel and its neighbors is
calculated to determine if the area is one of high complexity or
low complexity. If the complexity is lower than the threshold then
the area is smoothed using a simple mean filter.