The invention is a method and apparatus for improving image-processing
applications. Embodiments of the invention provide methods for preserving
computation results and offer intermediary computation steps to allow the
processing of images at any location to take advantage of previously
processed image areas. The preferred embodiment offers a method for
building a median filter that significantly improves the processing speed
over basic techniques. By building a histogram hierarchy, image data
statistics are added and subtracted using a multiplicity of histograms
from the histogram hierarchy, where each histogram describes an image
area. Furthermore, a histogram hierarchy is built using multiple layers,
each layer defining a level of statistical resolution.