Skip to Main Content
Optimal reduction of the number of grey levels present in an image is a fundamental problem in segmentation, classification, lossy compression, quantisation, inspection and computer vision. We present a new algorithm based on dynamic programming and optimal partitioning of the image data space, or its histogram representation. The algorithm allows the reduction of the number of grey levels for an image in a fine to coarse fashion, starting with the original grey levels present in the image and all the way down to two grey levels that simply create a binarised version of the original image. The algorithm can also be used to find a reduced number of grey levels in a natural way without forcing a specific number ahead of time. Application of the algorithm is demonstrated in image segmentation, multi-level thresholding and binarisation, and is shown to give very good results compared to many of the existing methods.