Adaptive Filtering of Raster Map Images Minjie Chen*, Mantao Xu and Pasi Fränti Speech and Image Processing Unit (SIPU) School of Computing University of Eastern Finland, FINLAND Topographic or road maps Few colors Detailed spatial structures Requirement No over-smooth, remain readable Number of colors does not increase Preserve spatial structures Scanning Image: 11063 colors Original: 4 colors Noise Model Impulsive Noise Gaussian Noise Quantized Image: 4 colors Impulsive Noise Vector Median (VM, AVM) Peer Group Filtering (PGF,FPGF ) Morphological Filtering Context Tree Modelling Discrete Universal Denoiser (DUDE) Gaussian Noise Wavelet denoising using Gaussian scale mixtures (GSM) Non-local mean (NLM) Dictionary- based method (K-SVD) Blocking matching and 3D filtering (BM3D) Markov random fields/conditional random fields (FoE,ARF) Non-Local Sparse Models for Image Restoration (NLSM) Patch-based Locally Optimal Wiener Filtering for Image Denoising (PLOW) Sparsity-based Image Denoising via Dictionary Learning and Structural Clustering (CSR) Most algorithms are designed for continuous-tone(photographic) images Complicated spatial structures in the map will be destroyed Covert multi-dimension image filtering problem into a series of binary image filtering problem using layer seperating After filtering on each layer, select suitable layer ordering to reconstruct the image Step 1: Divide color image into Multi-Layer binary images Step 2: Filter binary layers separately Step 3: Layer ordering decision Step 4: Merge the filtered layers Layer separating Filter each layer Merging step with global color priority Global criterion : select colors according to their frequency Same color priority for whole image No difference for different regions Highest Priority 618416 230020 173358 22975 3458 349 Lowest priority is used as background color PRIORITY Segment the image into several regions with different background color, set different ordering criterions for these regions Merging with local color priority Process each color layer by soft morphological dilation and filling holes operations. Large blocks regions are possible background regions. Region labeling labels connected pixels After region labeling, sort segments according to their size If the size of the segments is larger than a threshold, select as background region candidate The goal is to extract large connected segments in each layer for later background filling step Segment Size 1 765241 2 662515 3 187677 4 83904 5 51170 6 21044 Six large segments are detected from different layer 2,5 from black layer, 3 from blue, 1,4 from white, 6 from brown Evaluate if those large segments detected in Step 3.2 are real background regions. First create a blank background image Evaluate those segments one by one from large segment to small segment. If it is real background, add to background image, labeling the region with the layer color Two features used for validating if it is background segment Feature 1: How many change after dilation and image filling operation Background segment’s size does not change much, have large ratio Region 2: Before 193606 After 662515 Ratio 0.2922(NOT ADDED) Region 1: Before 526337 After 765241 Ratio 0.6878(ADDED) Feature 2: Does this segment overlap with background already filled? In common condition, it should have a small value, this feature can enhance the filling accuracy If feature 1 is close to 1, this feature can also be large, it will add a background inside one background segment Blank Background Region 1: Overlap percentage 0% (ADDED) Region 2: Overlap percentage 97% (NOT ADDED) Already labeled region 1 Blank background image S1/S2 Po ADD(Y/N) 1 0.6878 0 Y 2 0.2922 0.9712 N 3 0.8373 0.0172 Y 4 0.8024 0.0149 Y 5 0.2302 0.9953 N 6 0.1567 1 N Fill block 1 Fill block 3 Fill block 4 We can set different threshold in filling step, causing different background images. Classification can be done to decide threshold for different type of images. Large unfilled regions ---- set as small background region. Small unfilled region ---- merge it to the nearest background. Set as small background region Merge to the nearest background After processing For all background region, calculate its corresponding color histogram We then get different color priority for different region The current method does not work if color number is large Priority between small structures not considered Special local patterns combined with multiple color is missed Context Template Frequency X 409 3 4 5 9 Frequency X 2 2 193 3 6 Colors with low conditional probability will be replaced by the dominated color Context Dilution 6-color, 20-pixel template has 620 = 3,656,158,440,062,976 contexts Most contexts has rare appearance, cause inaccurate conditional probability estimation. Context Tree Modeling Only appeared contexts are allocated in memory Time complexity O(N), where N is the length of a data sequence. Tree spanning is terminated once the frequency of the context on a given node is less than a predefined value(N) Root Threshold Contexts Children pointer array 1 X 1 X 2 N1=85 N2=16 N3=0 N4=10 1 X 2 N1=220 N2=110 N3=25 N4=35 N1=23 N2=67 N3=25 N4=5 1 X 1 X 2 N1=405 N2=117 N3=238 N4=6 N1=112 N2=27 N3=0 N4=20 1 X N1=46 N2=810 N3=44 N4=75 1 X N1=400 N1=58 N1=24 N1=30 N=256 23676 N=128 35847 N=64 54736 N=32 82260 Including noise pixels in the surrounding contexts makes good conditional probability estimation difficult. For contexts with rare appearance, a merging process is done to collect the statistics of all similar contexts. Time complexity is O(kNM2), where M is the number of colors, k is the depth of the context tree, N is the number of contexts with rare appearance. Most consistent sub-context Noisy pixel Example of context merging Discrete Universal Denoiser(DUDE) u0 arg max xA P (x|c) (M 1)2 (1 ) (M 1) P(x x0 |c) P(x u0 |c) 1 ((1 )M 1) ((1 )M 1) M is the number of colors, δ is the noise level, u0 is the color with highest conditional probability. DUDE has a so-called “asymptotic optimality” property for M-ary symmetric noise. Estimation of δ Estimated by the minimum conditional probability occurred for contexts with “sufficient frequency”: 1 maxx, p(c)10 p( x | c) 2 This decision rule is designed for the count statistics collected on the noisy image. For a clean image, the decision rule is P(I (x) x0 |c) / ( M 1), x0 1, 2,..., M Iterative algorithm to optimize both the estimation of the indexed image and its color palette. The distance between RGB color vector to its corresponding component in the color palette, and its conditional probability of local context are taken into account as an Definitions: information fusion. I ( x) arg min x (1..M ) ( log 2 f (y x | M x ) log 2 P( x | c)) where M x ~ N (m x , 2 I), is the mean variance (1) || y x mx ||2 f (y x | M x ) exp( ) 2 2 mi (r ) median({rx | x X, and I ( x) i}) (2) 1 M || y x m i ||2 3 | X | i 1 xX , I ( x ) i (3) X: index image, Y: corresponding image, CP=(m1,m2,…mM) color palette where mi = (mi(r), mi(g), mi(b)) , yx = (rx,gx,bx) the color intensity of x in RGB space. Input: Y X, CP ← Conduct color quantization based on Y Σ ← Estimate the quantization variance based on X, Y,CP according to (3) For T iterations DO: Given X, update P(x|c) Update X , according to (1) Update CP and σ according to (2) and (3) End-For Output: Y, X, CP. General Scheme for filtering Gaussian noise Noisy image Quantized image Filtering after 1 iteration Filtering after 5 iterations 5 δ= 0.05 AVM 8.65 4.19 11.8 6.55 9.27 PGF 1.40 1.26 3.26 1.21 6.02 CT 1.04 0.99 2.41 1.42 4.36 DUDE 0.94 0.99 2.09 1.34 2.66 4 ACS 0.65 0.78 1.59 0.82 2.02 Error Rate(%) Set#1 Set#2 Set#3 Set#4 Set#5 Error rate (%) AVM PGF CT DUDE ACS 3 2 1 0 0 5 10 15 20 Impulsive Noise Level(%) 50 σ =25 PSNR BM3D NLM GSM ARF ACS 45 Set#1 Set#2 Set#3 Set#4 Set#5 GSM 24.4 24.0 23.7 24.6 25.1 NLM 24.9 23.5 22.4 24.1 24.3 BM3D 26.2 26.5 23.7 25.5 26.1 ARF 24.2 23.3 23.0 23.8 25.1 ACS 47.1 59.2 27.0 33.4 27.7 PSNR 40 35 30 25 20 0 10 20 30 Gaussian Noise() 40 50 Impulsive noise AVM PGF CT DUDE ACS Gaussian noise BLS-GSM NLM BM3D ARF ACS Mixed noise PGF BM3D BM3D+PGF FPGA ACS Statistical filtering for raster map images Can process images distorted by impulsive noise, additive Gaussian noise and mixture Gaussianimpulsive noise Both color distribution in RGB space and the conditional probabilities of local context are considered Pruning? Merging? Reorder the context pixel-wise? Our solution: An voting-based method to optimize the context selection PX |C (x|c) P(c) F(c) log 2 ( ) k PX |C ( x|c) log( ) PE (c) P( x) x k PE (c) P( yi ) i 1 P(c) is probability of context c, P( yi ) is the probability of color yi identify good or bad context by top-down tracing from the root of tree. Original Original Noisy Noisy Noisy pixel with bad context Noisy pixel with bad context can not filter correctly. Can we use bad context for noise estimation? Bad contexts will have higher score difference after the noisy pixel is removed. Include noisy pixel may cause bad context. We can accumulated these score difference for bad context to find noisy pixel, which is the voting image R: zi c /{xi }, i 1..k R(xi ) = R(xi ) + F(zi ) - F(c) when F(zi ) - F(c) 0 xi is the pixel position of ith context element -0.39 2.29 5.41 -0.38 F(z)- F(c) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.29 0 0 0 0 2.29 0 0 0 0 0 0 0 0 5.41 0 0 0 0 5.41 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + Voting image 1.39 -1.24 -1.33 3.58 F(z)- F(c) Voting image 0 0 0 0 0 0 0 0 1.39 0 0 0 0 1.39 0 0 0 0 2.29 0 0 0 3.58 0 0 0 0 3.58 2.29 0 0 0 5.41 0 0 0 0 0 0 0 0 0 5.41 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + -0.62 5.69 1.96 -0.40 F(z)- F(c) Voting image 0 0 0 1.39 0 0 0 0 0 0 0 0 0 1.39 0 0 0 3.58 2.29 0 0 0 0 0 0 0 0 3.58 2.29 0 0 0 5.41 0 0 0 0 5.69 0 0 0 0 11.0 0 0 0 0 0 0 0 0 1.96 0 0 0 0 1.96 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 4.15 -2.86 -2.32 2.24 -0.65 F(z)- F(c) Voting image 0 0 0 1.39 0 0 0 0 0 0 0 0 0 1.39 0 0 0 3.58 2.29 0 0 0 4.15 0 0 0 0 7.73 2.29 0 0 0 11.0 0 0 0 2.24 0 0 0 0 2.24 11.0 0 0 0 1.96 0 0 0 0 0 0 0 0 0 1.96 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + -2.02 3.23 -1.40 -1.63 5.51 F(z)- F(c) Voting image 0 0 0 1.39 0 0 0 0 0 0 0 0 0 1.39 0 0 0 7.73 2.29 0 0 0 0 0 0 0 0 7.73 2.29 0 0 2.24 11.0 0 0 0 0 5.51 0 0 0 2.24 16.5 0 0 0 1.96 0 0 0 0 0 3.23 0 0 0 1.96 3.23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 1.79 1.38 -1.43 -1.16 2.35 F(z)- F(c) Voting image 0 0 0 1.39 0 0 0 0 0 0 0 0 0 1.39 0 0 0 7.73 2.29 0 0 0 0 0 0 0 0 7.73 2.29 0 0 2.24 16.5 0 0 0 0 1.79 2.35 0 0 2.24 18.3 2.35 0 0 1.96 3.23 0 0 0 0 0 1.38 0 0 1.96 3.23 1.38 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + Noisy pixel have a high voting value Bad context include black noisy pixel south east reduced context F(z)- F(c) 4.15 Voting value 7.73 3.58 Bad context include white noisy pixel north south west west south reduced context F(z)- F(c) 5.41 5.69 5.51 1.79 Voting value 18.30 Original Noisy voting image noisy image voting image If contexts are not good context, pixels with low voting value are selected to construct new adaptive context. Original Iteration 1 Noisy DUDE Proposed Iteration 2 Noisy pixels with contaminated contexts are filtered correctly by optimal context selection Adaptive context selection via a voting-based noise estimation scheme Can process raster map images distorted by impulsive noise, additive Gaussian noise or mixture Gaussian-impulsive noise Extension for optimizing the context selection for denoising gray-scale image, e.g. voting-based method to optimize the weighting coefficient in NLM, PLOW, K-SVD. M. Chen, M. Xu and P. Fränti, "Multi-layer filtering approach for map images", IEEE Int. Conf. on Image Processing (ICIP'09), Cairo, Egypt, 3953-3956, 2009. M. Chen, M. Xu and P. Fränti, "Statistical filtering of raster map images", IEEE Int. Conf. on Multimedia & Expo (ICME'10), Singapore, 394-399, 2010. (oral) M. Chen, M. Xu, P. Fränti, "Adaptive Context-tree based Statistical Filtering of Raster Map Images Denoising", IEEE Trans. on Multimedia, 16(3), 1195-1207, 2011. M. Chen, M. Xu, P. Fränti, "Adaptive Filtering of Raster Map Images Using Optimal Context Selection", IEEE Int. Conf. on Image Processing (ICIP’11), 77-80, Brussels, Belgium, 2011.(oral)