Multilevel thresholding by fast PNN based algorithm UNIVERSITY OF JOENSUU DEPARTMENT OF COMPUTER SCIENCE FINLAND Olli Virmajoki and Pasi Fränti
Multi-level thresholding Given image with N input values, threshold the image into M values. Considered as algorithmic problem: given a minimization criterion (MSE), find optimal thresholds.
Optimal thresholding Optimal thresholding by exhaustive search in O(N M-1 ) time [Otsu 1979]. Medical images can have 16 bpp. Exhaustive search takes ~ Sub-optimal methods: Lloyd-Max quantizer with O(N) time.
Pairwise Nearest Neighbor method (PNN) New multilevel thresholding algorithm based on the pairwise nearest neighbor (PNN). PNN used in vector quantization (Equitz 1989) but considered slow: Original method takes O(N 3 ), Kurita’s method takes O(N 2 log N) Using Nearest neighbor pointers: O( N 2 ). PNN is lower limited by (N 2 ) Our contribution: To show that PNN can be implemented in O(N log N) time !!!
PNN algorithm SET m=N (N-1 thresholds) REPEAT Find threshold to be removed: O(N) Remove threshold: O(1) Update the class parameters: O(1) SET m=m-1 UNTIL m=M
PNN with heap structure
Time complexity STEP:NAIVE:WITH HEAP: 1. Find threshold O(N)O(N)O(1) 2. Remove threshold O(1) 3. Update classes O(1)O(log N) TOTALO(N2)O(N2)O(N log N)
Histograms of test images 8 bpp12 bpp16 bpp
Methods in comparison Uniform quantizer (UQ) LMQ PNN PNN + LMQ Optimal (Otsu’s method)
MSE comparison (Medical3) 2. PNN+LMQ gives near-optimal results (for small M values) 1. MSE values significantly smaller than Uniform Quantizer 3. PNN+LMQ values can be significantly smaller than LMQ alone
Time Comparison (Medical3) 1.All sub-optimal methods are fast 2. Optimal thresholding is too slow for larger M values.
Conclusions Fast PNN-based O(N log N) time algorithm for multilevel non- parametric thresholding. Considerably faster than optimal thresholding. Better quality than the Lloyd-Max quantizer alone.