https://doi.org/10.31449/inf.v43i4.2461 Informatica 43 (2019) 507–513 507 An Adaptive Image Inpainting Method Based on the Weighted Mean Nguyen Hoang Hai Faculty of Information Technology, University of Science and Education, The University of Danang, Vietnam E-mail: hoanghai@ued.udn.vn Le Minh Hieu Department of Economics, University of Economics, The University of Danang, Vietnam E-mail: hieulm@due.udn.vn Dang N. H. Thanh, Department of Information Technology, Hue College of Industry, Vietnam E-mail: dnhthanh@hueic.edu.vn Nguyen Van Son Ballistic Research Laboratory, Military Weapon Institute, Vietnam E-mail: vanson.nguyen.mwi@gmail.com V. B. Surya Prasath Division of Biomedical Informatics, Cincinnati Children’s Hospital Medical Center, USA Department of Pediatrics, University of Cincinnati, USA Department of Biomedical Informatics, College of Medicine, University of Cincinnati, USA Department of Electrical Engineering and Computer Science, University of Cincinnati, USA E-mail: surya.prasath@cchmc.org, prasatsa@uc.edu Keywords: inpainting, weighted mean, weighted mean filter, image restoration, image processing Received: September 26, 2018 Imaging inpainting is the process of digitally filling-in missing pixel values in images and requires care- fully crafted image analysis tools. In this work, we propose an adaptive image inpainting method based on the weighted mean. The weighted mean is assessed to be better than the median because, for the case of the weighted mean, we can exclude the values of the corrupted pixels from evaluating values to fill those corrupted pixels. In the experiments, we implement the algorithm on an open dataset with various corrupted masks and we also compare the inpainting result by the proposed method to other similar inpainting methods – the harmonic inpainting method and the inpainting by directional median filters – to prove its own effectiveness to restore small, medium as well as fairly large corrupted regions. This comparison will be handled based on two of the most popular image quality assessment error metrics, such as the peak signal to noise ratio, and structural similarity. Further, since the proposed inpainting method is non-iterative, it is suitable for implementations to process big imagery that traditionally require higher computational costs, such as the large, high-resolution images or video sequences. Povzetek: Opisana je novo razvita metoda določanja manjkajočih točk v sliki s pomočjo uteženega povprečja. 1 Introduction Image inpainting [1, 2, 3, 4, 5, 6] is one of the interesting problems of image processing [7, 8] that has attracted a lot of attention. Image inpainting or image interpolation is a process of filling the damaged and/or missing parts. Image inpainting has a wide range of applications in practice such as watermark removal [9], image disocclusion [10, 11], restoring old images corrupted by dust, scratches, etc., image zooming, image super-resolution [8], etc. To solve the image inpainting problem, there are some intensive approaches [12, 13, 14] such as partial-differen- tial-equation-based (PDE-based) methods [1, 8, 15], cal- culus-of-variation-based methods [8], graph-based meth- ods, stochastic methods, etc. and machine-learning-based methods. In this paper, we only focus on non-learning- based methods, because the comparison of methods based on machine-learning to non-learning-based methods is not fair. In non-learning-based methods, the PDE-based and variation-based methods are highly effective to treat this problem. However, these methods are iterative and the ac- curacy, performance, execution time depends much on the tolerance. In this paper, we study an inpainting method based on the weighted mean [16]. Our method is non-iterative, hence, the computational complexity associated with tra- ditional iterative inpainting methods. This advantage is es- pecially appealing as it paves the way for us to apply 508 Informatica 43 (2019) 507–513 N.H. Hai et al. inpainting for larger images or high-resolution images, such as Full HD 1080, 2K, 4K, and higher resolution and/or video sequences data. We propose the method to fill the corrupted parts by the weighted mean because it excludes the value of the corrupted pixels from the evaluating process. The pixels of the corrupted regions are always different from the neighboring pixels' values. So, their values are not useful for evaluating the values to fill the corrupted regions. This idea is better than using the median. The proposed inpaint- ing method is effective on various corrupted masks: from a small, medium up to large area. In our experiments, we compare our inpainting results from the proposed method to the harmonic inpainting method [1, 15] (PDE-based inpainting) and the inpainting method by directional median filters [17]. Our results prove that the adaptive inpainting based on the weighted mean is a novel method and performs favorably to other state-of-the-art inpainting methods. The rest of the paper is organized as follows. Section 2 introduces the general image inpainting problem that is formulated in the form of the optimization problem, and the proposed adaptive inpainting method based on the weighted mean. Section 3 presents the experiments and the comparison of the inpainting result to another similar method. Finally, section 4 concludes. 2 The proposed inpainting method 2.1 Image inpainting problem Let 𝑢 0 ( 𝑥 , 𝑦 ) , 𝑢 ( 𝑥 , 𝑦 ) , 𝑣 ( 𝑥 , 𝑦 ) , ( 𝑥 , 𝑦 )∈ Ω ⊂ ℝ 2 , be the 2D grayscale original image, the restored image, and the cor- rupted image, respectively. In the case of image presented in the discrete form, 𝑥 = 1,2 … , 𝑚 ; 𝑦 = 1,2, … , 𝑛 , where values 𝑚 , 𝑛 are the number of pixels by the image width and image height. Let 𝒟 – the set of corrupted pixels. The popular general image inpainting model is de- fined as follows [1, 15]: 𝑢 = argmin 𝑢 ( ∑ Φ( ∇𝑢 ) 𝑥 ,𝑦 ∈Ω + 𝜆 ∑ |𝑢 − 𝑣 | 2 ( 𝑥 ,𝑦 ) ∈Ω\𝒟 ), where the norm |∙| – 𝐿 2 norm, Φ( ∙) – a gradient-based smooth function. It can be selected as Total variation [18, 19], Euler’s elastica [1] or Mumford-Shah model [1]. As can be observed from the minimization model, to solve the above inpainting model, we need some complex optimization methods. The algorithms based on this model are iterative manners that the accuracy depends much on the tolerance. 2.2 The proposed inpainting method In this paper, we propose the inpainting method based on the adaptive weighted mean filter. The adaptive weighted mean filter [16] is proposed by Zhang and Li to solve the denoising problem. Like other median-based and mean- based filters, this method evaluates the corrupted pixels values on the clipping windows by the mean value. How- ever, this method considers the weight of pixels values to evaluate the mean. So, it is called to be the weighted mean. For the inpainting problem, the corrupted regions are the connected regions with a small, medium or large area. This is quite different from the denoising problem: the cor- rupted pixels are always separated pixels or connected pixels on a small area (for the high noise levels). Like the adaptive weighted mean filter for denoising, we also evaluate the corrupted pixels values based on the pixels values of the considered clipping windows. Let 𝐼 , 𝐼 𝑐 be indices of pixels of all image domain Ω and of the corrupted regions 𝒟 , respectively. We call 𝑊 𝑖𝑗 ( 𝑑 ) a clipping window centered at the pixel ( 𝑖 , 𝑗 ) with a size of 2𝑑 + 1: 𝑊 𝑖𝑗 ( 𝑑 )= { |𝑖 − 𝑘 | ≤ 𝑑 , |𝑗 − 𝑙 | ≤ 𝑑 , ( 𝑘 , 𝑙 )∈ 𝐼 }. Figure 1 shows an example of the clipping windows centered at the pixel (3, 3) with 𝑑 = 2. Figure 1: The clipping window centered at the marked pixel (3, 3) with a 𝑑 = 2 (i.e., the window size is 5). 𝑢 22 𝑢 21 𝑢 21 𝑢 22 𝑢 23 𝑢 23 𝑢 22 𝑢 12 𝑢 11 𝑢 11 𝑢 12 𝑢 13 𝑢 13 𝑢 12 𝑢 12 𝑢 11 𝑢 11 𝑢 12 𝑢 13 𝑢 13 𝑢 12 𝑢 22 𝑢 21 𝑢 21 𝑢 22 𝑢 23 𝑢 23 𝑢 22 𝑢 22 𝑢 21 𝑢 21 𝑢 22 𝑢 23 𝑢 23 𝑢 22 𝑢 12 𝑢 11 𝑢 11 𝑢 12 𝑢 13 𝑢 13 𝑢 12 Figure 2: The extended pixels matrix with the padding is 2 of the marked 3×2 image. Our proposed inpainting method starts from the clip- ping windows of every corrupted pixel ( 𝑖 , 𝑗 )∈ 𝐼 𝑐 . If the corrupted pixels lay on the position ( 𝑖 , 𝑗 ) with 𝑖 − 𝑑 ≤ 0 or 𝑖 + 𝑑 ≥ 𝑚 or 𝑗 − 𝑑 ≤ 0 or 𝑗 + 𝑑 ≥ 𝑛 , we need to ex- tend the pixels matrix to top, bottom, left or right more 𝑑 rows or columns of pixels. The values to fill to the padding regions are taken by the symmetric method. In MATLAB, we can use the built-in function padarray. Figure 2 shows an example of the padding pixels matrix of the image 3×2 (the gray pixels area) with the padding is 2. Next step, we need to evaluate the maximum, the min- imum and the weighted mean values in every clipping window centered at the corrupted pixels: 𝐴 = max{ 𝑊 𝑖𝑗 ( 𝑑 ) } , ( 𝑖 , 𝑗 )∈ 𝐼 𝑐 , 𝐵 = min{ 𝑊 𝑖𝑗 ( 𝑑 ) } , ( 𝑖 , 𝑗 )∈ 𝐼 𝑐 , An Adaptive Image Inpainting Method Based on the Weighted Mean Informatica 43 (2019) 507–513 509 𝜇 = 𝑚𝑒𝑎𝑛 ̈ { 𝑊 𝑖𝑗 ( 𝑑 ) } = { ∑ 𝑎 𝑘 ,𝑙 𝑣 𝑘𝑙 ( 𝑘 ,𝑙 ) ∈𝑊 𝑖𝑗 ( 𝑑 ) , 𝑖𝑓 ∑ 𝑎 𝑘 ,𝑙 𝑖 ≠ 0 −1, otherwise , ( 𝑖 , 𝑗 )∈ 𝐼 𝑐 , where 𝑎 𝑘 ,𝑙 = { 1, 𝑖𝑓 min{ 𝑊 𝑖𝑗 ( 𝑑 ) } < 𝑣 𝑘 ,𝑙 < max{ 𝑊 𝑖𝑗 ( 𝑑 ) } 0, 𝑜𝑡 ℎ𝑒𝑟𝑤𝑖𝑠𝑒 . Finally, with every pixel of the corrupted regions ( 𝑖 , 𝑗 )∈ 𝐼 𝑐 , we replace the corrupted pixel value by the weighted mean value 𝜇 . The proposed image inpainting method has a smaller number of calculations than the denoising method by the adaptive weighted mean filter because we only consider the clipping windows of the corrupted pixels. The algo- rithm of the proposed image inpainting method by the adaptive weighted mean is presented in Algorithm 1. Algorithm 1. The inpainting method base on the adaptive weighted mean. Input: The corrupted image 𝑣 . Output: The restored image 𝑢 . Initialize ℎ = 1, 𝑑 0 = 1, 𝑑 𝑚𝑎𝑥 = 39. For every pixel ( 𝑖 , 𝑗 )∈ 𝐼 𝑐 Set 𝑑 = 𝑑 0 . While (𝑑 ≤ 𝑑 𝑚𝑎𝑥 ) Evaluate 𝐴 = max{ 𝑊 𝑖𝑗 ( 𝑑 ) }. Evaluate 𝐴 ′ = max{ 𝑊 𝑖𝑗 ( 𝑑 + ℎ) }. Evaluate 𝐵 = min{ 𝑊 𝑖𝑗 ( 𝑑 ) }. Evaluate 𝐵 ′ = min{ 𝑊 𝑖𝑗 ( 𝑑 + ℎ) }. Evaluate 𝜇 = 𝑚𝑒𝑎𝑛 ̈ { 𝑊 𝑖𝑗 ( 𝑑 ) }. If (𝐴 == 𝐴 ′ and 𝐵 == 𝐵 ’ and 𝜇 ≠ −1) Then Set 𝑢 𝑖𝑗 = 𝜇 . Break. Else Increase 𝑑 = 𝑑 + ℎ. If (𝑑 > 𝑑 𝑚𝑎𝑥 ) Then Set 𝑢 𝑖𝑗 = 𝜇 . Break. End. End. End. End. As can be seen in Algorithm 1, the values of the cor- rupted pixels are replaced by the weighted mean value. The weighted mean value will not contain the values of corrupted pixels in the clipping windows. We choose the weighted mean value because the values of the corrupted pixels always have no similarity with the values of other neighboring pixels in the same clipping window. 3 Experiments We implement the proposed inpainting method and the harmonic inpainting method to recover the corrupted im- age by MATLAB 2018a. The configuration of the compu- ting system is Windows 10 Pro with Intel Core i5, 1.6GHz, 4GB 2295MHz DDR3 RAM memory. For the harmonic inpainting method, we set the tolerance 𝑇𝑜𝑙 = 10 −5 . This value will balance the accuracy and execution time. 3.1 Image quality assessment metrics To compare the inpainting result of the proposed method to other similar inpainting methods, it is necessary to as- sess image quality after inpainting based on the error met- rics. The popular error metrics are PSNR and SSIM that were used in many works [20, 21, 22, 23, 24, 25, 26, 27]: 𝑃𝑆𝑁𝑅 = 10log 10 ( 𝑢 𝑚𝑎𝑥 2 𝑀𝑆𝐸 ) 𝑑𝐵 , where 𝑀𝑆𝐸 = 1 𝑚𝑛 ∑ ∑( 𝑢 ( 𝑖𝑗 ) − 𝑢 0 ( 𝑖𝑗 ) ) 2 𝑛 𝑗 =1 𝑚 𝑖 =1 is the mean squared error with 𝑢 0 is the original (latent) image, 𝑢 𝑚𝑎𝑥 denotes the maximum value, for e.g. for 8- bit images 𝑢 𝑚𝑎𝑥 = 255; 𝑢 ( 𝑖𝑗 ) and 𝑢 0 ( 𝑖𝑗 ) are pixels values of 𝑢 and 𝑢 0 at every pixel ( 𝑖 , 𝑗 ) . The difference of 0.5dB is visible. The higher PSNR (measured in decibels – dB), the better image quality. Structural similarity (SSIM) is proven to be a better error metric for comparing the image quality and it is in the range [0, 1] with a value closer to one indicating better structure preservation. This metric based on the character- istic of the human vision. The SSIM is computed between two windows and of common size 𝑁 × 𝑁 , 𝑆𝑆𝐼𝑀 = ( 2𝜇 𝜔 1 𝜇 𝜔 2 + 𝑐 1 ) ( 2𝜎 𝜔 1 𝜔 2 + 𝑐 2 ) ( 𝜇 𝜔 1 2 + 𝜇 𝜔 2 2 + 𝑐 1 ) ( 𝜎 𝜔 1 2 + 𝜎 𝜔 2 2 + 𝑐 2 ) , where 𝜇 𝜔 𝑖 – the average of 𝜔 𝑖 , 𝜎 𝜔 𝑖 2 – the variance of 𝜔 𝑖 , 𝜎 𝜔 1 𝜔 2 – the covariance, and 𝑐 1 , 𝑐 2 numerical stabiliz- ing parameters. IDs Corrupted Harmonic method Directional median Proposed 119082 16.9766 25.2881 25.5074 25.9331 126007 17.3561 30.1535 31.4514 31.6833 157055 19.248 26.962 27.4127 28.3869 170057 18.3731 31.0244 32.2728 33.1103 182053 18.5361 25.8607 28.2344 28.5674 219090 17.2918 28.1766 30.4586 30.7027 253027 18.3034 24.7708 25.3588 25.7218 295087 17.013 28.6833 32.2062 32.2184 296007 19.4597 33.2096 36.2832 36.3026 38092 19.2699 27.1973 29.597 29.7045 Table 1: The comparison of PSNR metric of the inpainting methods for the mask 1. 3.2 Image datasets and test cases We test the performance of the proposed inpainting method on a dataset of natural images with artificial cor- rupted masks. The dataset is well-known as BSDS of UC Berkeley https://www2.eecs.berkeley.edu/Research/Pro- jects/CS/vision/bsds/BSDS300/html/dataset/images.html. 510 Informatica 43 (2019) 507–513 N.H. Hai et al. All images are stored in JPEG format, grayscale and have size 481×321 pixels. Figure 3 shows the selected image of UC Berkeley for the tests. The corrupted masks are pre- sented in Figure 4. In this case, the black areas indicate the corrupted regions. Note that, we use 10 original images and 2 masks. Hence, our experiment will be handled on 20 images. This size is suitable for non-learning-based meth- ods without any trained data. IDs Corrupted Harmonic method Directional median Proposed 119082 0.90632 0.85151 0.90542 0.91662 126007 0.88987 0.89776 0.94538 0.95302 157055 0.91292 0.88074 0.92816 0.9373 170057 0.89567 0.90925 0.95351 0.95409 182053 0.90673 0.87299 0.9434 0.94673 219090 0.89305 0.86256 0.94373 0.94649 253027 0.90216 0.84878 0.93184 0.9351 295087 0.89063 0.83746 0.94324 0.94702 296007 0.89367 0.89022 0.94741 0.95609 38092 0.91695 0.83039 0.93749 0.93903 Table 2: The comparison of SSIM metric of the inpainting methods for the mask 1. IDs Corrupted Harmonic method Directional median Proposed 119082 13.1181 24.7802 24.9254 25.0446 126007 14.0723 28.5263 28.5795 28.8802 157055 17.7535 27.2226 27.9019 28.376 170057 14.5046 29.8771 30.5236 31.0405 182053 14.6563 24.9808 26.1866 26.2575 219090 13.7254 26.5841 26.9604 27.5309 253027 15.252 23.1356 23.1589 23.3926 295087 14.0301 27.7979 29.6814 29.7502 296007 15.372 32.887 35.0773 35.158 38092 14.0467 26.1847 27.4583 27.5423 Table 3: The comparison of PSNR metric of the inpainting methods for the mask 2. In the case of the mask 1, the corrupted ratio is 5%. The size of the corrupted parts (white square) is 14×14 pixels. The inpainting results are presented in Figure 5. The values of the PSNR metric are presented in table 1. The value of the SSIM metric is shown in table 2. We can see that the inpainting result by the harmonic method is good by the PSNR metric, but it fails for SSIM. The SSIM of the harmonic inpainting method is smaller than one of the corrupted images. However, in Figure 5, the quality of the inpainting result by the harmonic is really better than the corrupted image. The harmonic method changes whole the image (including the uncorrupted regions). The re- stored image gets smoother. This is the reason to make SSIM metric of the harmonic inpainting method to be lower. The inpainting result by the directional median fil- ters is better, but there are still some defects: flowers on the dress of woman (ID 157055), on leaves and branches of the tree (ID 295087). IDs Corrupted Harmonic method Directional median Proposed 119082 0.80231 0.82849 0.88415 0.88549 126007 0.78606 0.87759 0.9203 0.92621 157055 0.82274 0.87131 0.91147 0.91767 170057 0.77925 0.89494 0.93326 0.93476 182053 0.81001 0.85041 0.90769 0.91723 219090 0.78722 0.83843 0.90378 0.91129 253027 0.8193 0.81883 0.88859 0.89715 295087 0.78451 0.81901 0.90972 0.91991 296007 0.77249 0.87662 0.93102 0.93571 38092 0.80371 0.80615 0.90268 0.90704 Table 4: The comparison of SSIM metric of the inpainting methods for the mask 2. Figure 3: The input natural images from the BSDS dataset of UC Berkeley. For our proposed method, the inpainting result is very good. Our method only recovers the value of the corrupted pixels. Because the corrupted area is not large, our pro- posed method gives perfect inpainting result. By both PSNR and SSIM metrics, our proposed method is better than the harmonic method and directional median filters. Figure 4: The masks for generating the corrupted regions. In the case of the mask 2, the corrupted ratio is 10%. The lengths of some corrupted regions are very long. The corrupted areas, in this case, are bigger than one of the cases of the mask 1. The inpainting results are presented in Figure 6. The PSNR and SSIM metrics are presented in Table 3 and Table 4, respectively. The harmonic method still made the whole image to be smoother. The inpainting result by the directional median filters looks better. The inpainting result of our proposed method is best. Our pro- posed method preserves the structure of the image because it did not change the pixels' values outside the corrupted regions. Both PSNR and SSIM metrics of the proposed method, in this case, are also better than ones of the har- monic method and the directional median filters. An Adaptive Image Inpainting Method Based on the Weighted Mean Informatica 43 (2019) 507–513 511 From the above experiments, we can see that the pro- posed method can work well on various masks with small and medium corrupted regions. For the large corrupted re- gions, our proposed method also works well. However, if the corrupted area is too large, our method will work inef- fectively, because the proposed inpainting method uses the clipping windows to evaluate. If a lot of pixels in the clipping windows are corrupted, the recovery process can- not get high accuracy. Figure 7 shows the inpainting re- sults of the proposed method on the large corrupted re- gions (the corrupted ratio is 42%, the corrupted sizes are 30 pixels by width and 30 pixels by height). As can be seen, our proposed method creates a “paintbrush” effect. By human eyes, the inpainting result is good, and the val- ues of PSNR and SSIM metrics of the inpainting result for this case by the proposed inpainting method are good enough too PSNR=21.9475, SSIM=0.7029. Original (ID 157055) Original (ID 295087) Corrupted (ID 157055) Corrupted (ID 295087) By harmonic method By harmonic method By directional median By directional median By proposed method By proposed method Figure 6: The inpainting results on the corrupted images with the mask 2. We have to notice that, in real applications of image inpainting, the most important task is to detect the mask. The mask is not only the corrupted regions on images but also is objects that need to be removed. This task depends on every problem. It can be made manually or automati- cally. For example, in order to segment skin lesions of der- moscopic images [28], we need to detect hairs and remove them to improve image quality. The hairs can be detected by many methods, including machine learning methods, curvatures-based techniques, etc. As we discussed above, our proposed method is a non- iterative manner, and it only considers the clipping win- dows of the corrupted pixels, so it can work very fast. In all the tests, the execution time is under 1 second. The har- monic inpainting method spent up to 40 seconds with above tolerance 10 −5 . This is promising as the method is suitable to process large, high-resolution images or video sequences that are our future applications. Original (ID 157055) Original (ID 295087) Corrupted (ID 157055) Corrupted (ID 295087) By harmonic method By harmonic method By directional median By directional median By proposed method By proposed method Figure 5: The inpainting results on the corrupted image with the mask 1. 512 Informatica 43 (2019) 507–513 N.H. Hai et al. 4 Conclusion In this paper, we proposed an adaptive inpainting method based on the weighted mean. The proposed method can restore the images with small and medium corrupted re- gions effectively. It only recovers the corrupted pixels and do not touch other pixels. Hence, the image structure is unchanged. For the large corrupted areas, our proposed method works well, but it creates an artificial effect – the paintbrush effect. The proposed inpainting method is non-iterative man- ner, so it can work very fast. Otherwise, the proposed method only considers the clipping windows of every cor- rupted pixels, so it requires less memory. These ad- vantages are useful to process large, or high-resolution im- ages or video sequences. In future works, we would like to improve the pro- posed method to remove the paintbrush effect during re- storing the images with large corrupted areas. 5 References [1] C. B. Schönlieb, Partial Differential Equation Meth- ods for Image Inpainting, Cambridge: Cambridge University Press, 2015. [2] H. Grossauer, Digital Image Inpainting: Completion of Images with Missing Data Regions, Innsbruck: Si- mon & Schuster, 2008. [3] D. N. H. Thanh, V. B. S. Prasath, N. V. Son and L. M. Hieu, "An Adaptive Image Inpainting Method Based on the Modified Mumford-Shah Model and Multiscale parameter estimation," Computer Optics, vol. 43, no. 2, pp. 251-257, 2019. http://doi.org/10.18287/2412-6179-2019-43-2-251- 257 [4] D. N. H. Thanh, V. B. S. Prasath, L. M. Hieu and K. Hiroharu, "Image Inpainting Method Based on Mixed Median," in 2019 Joint 8th International Con- ference on Informatics, Electronics & Vision (ICIEV) and 2019 3rd International Conference on Imaging, Vision & Pattern Recognition (icIVPR), Spokane, 2019. http://doi.org/10.1109/ICIEV.2019.8858556 [5] U. Erkan, S. Enginoglu and D. N. H. Thanh, "An It- erative Image Inpainting Method Based on Similar- ity of Pixels Values," in IEEE 6th International Con- ference on Electrical and Electronics Engineering (ICEEE), Istanbul, 2019. http://doi.org/10.1109/ICEEE2019.2019.00028 [6] D. N. H. Thanh, N. V. Son and V. B. S. Prasath, "Dis- torted Image Reconstruction Method with Trimmed Median," in IEEE 3rd International Conference on Recent Advances in Signal Processing, Telecommu- nications & Computing (SigTelCom), Hanoi, 2019. http://doi.org/10.1109/SIGTELCOM.2019.8696138 [7] D. N. H. Thanh, V. B. S. Prasath, S. Dvoenko, L. M. Hieu, "An Adaptive Image Inpainting Method Based on Euler's Elastica with Adaptive Parameters Esti- mation and the Discrete Gradient Method," Signal Processing, 2020 (In press). [8] T. F. Chan and J. Shen, Image Processing and Anal- ysis: Variational, PDE, Wavelet and Stochastic Methods, SIAM, 2005. [9] L. Li, Y. Y. Ma, C. C. Chang and J. F. Lu, "Analyz- ing and removing SureSign watermark," Signal Pro- cessing, vol. 93, no. 5, pp. 1374-1378, 2013. http://doi.org/10.1016/j.sigpro.2012.10.001 [10] S. Masnou and J. M. Morel, "Level-lines based disocclusion," in 5th IEEE International conference on Image processing, 3:249-263, Chicago, 1998. http://doi.org/10.1109/ICIP.1998.999016 [11] Z. Tauber, Z. N. Li and M. S. Drew, "Review and Preview: Disocclusion by Inpainting for Image- Based Rendering," IEEE Transactions on Systems, Man, and Cybernetics, vol. 37, no. 4, pp. 527-540, 2007. http://doi.org/10.1109/TSMCC.2006.886967 [12] J. Cheng and Z. Li, "Markov random field-based im- age inpainting with direction structure distribution analysis for maintaining structure coherence," Signal Processing, vol. 154, pp. 182-197, 2019. http://doi.org/10.1016/j.sigpro.2018.09.004 [13] D. Ding, S. Ram and J. J. Rodríguez, "Image Inpaint- ing Using Nonlocal Texture Matching and Nonlinear Filtering," IEEE Transactions on Image Processing, vol. 28, no. 4, pp. 1705 - 1719, 2019. http://doi.org/10.1109/TIP.2018.2880681 [14] H. Liu, X. Bi, G. Lu and W. Wang, "Exemplar-Based Image Inpainting With Multi-Resolution Infor- mation and the Graph Cut Technique," IEEE Access, vol. 7, pp. 101641 - 101657, 2019. http://doi.org/10.1109/ACCESS.2019.2931064 [15] J. Shen and T. F. Chan, "Mathematical models for local nontexture inpaintings," SIAM Journal on Ap- plied Mathematics, vol. 62, no. 3, pp. 1019-1043, 2002. http://doi.org/10.1137/S0036139900368844 [16] P. Zhang and F. Li, "A New Adaptive Weighted Mean Filter for Removing Salt-and-Pepper Noise," IEEE Signal Processing Letters, vol. 21, no. 10, p. 1283, 2014. http://doi.org/10.1109/LSP.2014.2333012 [17] H. Noori and S. Saryazdi, "Image Inpainting Using Directional Median Filters," in IEEE International Conference on Computational Intelligence and Com- munication Networks, Bhopal, 2010. http://doi.org/10.1109/CICN.2010.20 [18] D. N. H. Thanh and S. Dvoenko, "A method of total variation to remove the mixed Poisson-Gaussian noise," Pattern Recognition and Image Analysis, vol. 26, no. 2, pp. 285-293, 2016. http://doi.org/10.1134/S1054661816020231 Figure 7: The inpainting results by the proposed method on the large corrupted regions. An Adaptive Image Inpainting Method Based on the Weighted Mean Informatica 43 (2019) 507–513 513 [19] D. N. H. Thanh and S. Dvoenko, "Image noise re- moval based on Total Variation," Computer Optics, vol. 39, no. 4, pp. 564-571, 2015. http://doi.org/10.18287/0134-2452-2015-39-4-564- 571 [20] V. B. S. Prasath, D. N. H. Thanh and N. H. Hai, "On Selecting the Appropriate Scale in Image Selective Smoothing by Nonlinear Diffusion," in IEEE 7th In- ternational Conference of Communications and Electronics, pp. 267-272, Hue, 2018. http://doi.org/10.1109/CCE.2018.8465764 [21] D. N. H. Thanh, S. Dvoenko, and D. V. Sang, "A Denoising Method Based on Total Variation," in Proceedings of the Sixth International Symposium on Information and Communication Technology (SoICT 2015), pp. 223-230, Hue, 2015. http://doi.org/10.1109/10.1145/2833258.2833281 [22] Z. Wang, A. Bovik, H. Sheikh, Simoncelli and Eero, "Image quality assessment: From error visibility to structural similarity," IEEE Transactions on Image Processing, vol. 13, no. 4, pp. 600-612, 2004. http://doi.org/10.1109/TIP.2003.819861 [23] U. Erkan, D. N. H. Thanh, L. M. Hieu and S. Engino- glu, "An Iterative Mean Filter for Image Denoising," IEEE Access, vol. 7, no. 1, pp. 167847-167859, 2019. http://doi.org/10.1109/ACCESS.2019.2953924 [24] D. N. H. Thanh, V. B. S. Prasath, L. M. Hieu and S. Dvoenko, "An Adaptive Method for Image Restora- tion Based on High Order Total Variation and In- verse Gradient," Signal, Image and Video Pro- cessing, 2020 (In press). [25] D. N. H. Thanh, L. T. Thanh, N. N. Hien and V. B. S. Prasath, "Adaptive Total Variation L1 Regulariza- tion for Salt and Pepper Image Denoising," Optik - International Journal for Light and Electron Optics, 2019 (In press). http://doi.org/10.1016/j.ijleo.2019.163677 [26] P. Jidesh and H. K. Shivarama, "Non-local total var- iation regularization models for image restoration," Computers & Electrical Engineering, vol. 67, pp. 114-133, 2018. http://doi.org/10.1016/j.compeleceng.2018.03.014 [27] V. B. S. Prasath and D. N. H. Thanh, "Structure ten- sor adaptive total variation for image restoration," Turkish Journal Of Electrical Engineering & Com- puter Sciences, vol. 27, no. 2, pp. 1147-1156, 2019. http://doi.org/10.3906/elk-1802-76 [28] D. N. H. Thanh, V. B. S. Prasath, L. M. Hieu and N. N. Hien, "Melanoma Skin Cancer Detection Method Based on Adaptive Principal Curvature, Colour Nor- malisation and Feature Extraction with the ABCD Rule," Journal of Digital Imaging, 2019 (In press). http://doi.org/10.1007/s10278-019-00316-x 514 Informatica 43 (2019) 507–513 N.H. Hai et al.