Abstract
Image inpainting is an effective method to repair damaged image. In this paper, we mainly studied some typical image inpainting models and analyzed these corresponding repair qualities. Firstly, we studied three typical algorithms based on PDE (Partial Differential Equation) model to repair images whose damaged areas are relative small. And then we studied the image inpainting algorithm based on texture synthesis. This kind of inpainting algorithm is suitable for image with large damaged area. Finally, we studied Criminisi inpainting algorithm based on image segmentation in detail, on which we proposed an improved priority formula image repair algorithm, the simulation results indicate that the improved algorithm of this paper showed better performance in repair quality from both subjective and objective aspects.
Introduction
Image quality would be inevitably affected by environmental factor, some information or area would be lost in the procedure of shooting and processing [1], so image inpainting is an important research field, it is one way to reconstruct images’ damaged area or it is an effective method to remove the noise and targets in images. Nowadays, image inpainting has been used widely in object removal [2], damaged painting reconstruction, image compression and coding [3], error concealment [4]. According to the definition of image inpainting, an image can be divided into two parts, one part is the undamaged area, which is also called the known region of the image; the other is the damaged area and it is the inpainting area of the image [5]. The processing of image inpainting is to fill the missing information with the full pixel information in the image. At present, the methods of image inpainting are mainly divided into three categories: diffusion-based inpainting [6], exemplar-based inpainting [7] and hybrid inpainting [8]. Usually, the image inpainting algorithm could be evaluated from two aspects. The first is to evaluate the effectiveness by human eye, that is subjective evaluation, and the second is objective evaluation criteria to evaluate the efficiency of the algorithm, which mainly including Peak Signal to Noise Ratio (PSNR) [9].
There are some classical image inpainting algorithms based on PDE (Partial Differential Equation) models [10]. For example BSCB algorithm [11] (Bertalmio, Sapiro, Caselles, Ballester) applying numerical iteration to solve the transmission equation and adding a variety of anisotropic diffusion equation to avoid the intersection of multiple isophotes in the area to be repaired, which could extend the edge of the restoration area to the inner restoration area according to the original angle. Total variation (TV) repair model [12] can overcome the disadvantage that the linear filter would smooth the edge of the image when it is used to suppress the noise. While Curvature-Drive Diffusion (CDD) model [13] is an improved algorithm for TV models, which aims to solve the problem of visual discontinuity in TV model. As for the repair results, TV has the fastest repair speed and CDD is the slowest. However, CDD has the highest PSNR value and TV algorithm is the smallest one. The aforementioned three models are suitable for images with obvious structure information and small damaged areas. While Criminisi algorithm [14] combines the advantages of structure and texture based image restoration methods, and it can complete texture synthesis and structural repair at the same time, which is suitable for images with obvious texture information and large damaged areas. However, the image inpainting quality still needs to be improved.
The rest of this paper is organized as follows. Section 2 presents fundamental principle of Criminisi algorithm. In Section 3, we propose an improved priority formula for Criminisi algorithm. Section 4 introduces the simulation results from both subjective and objective aspects in detail, and Section 5 gives the conclusions of this paper.
Fundamental principle of Criminisi algorithm
The main idea of the Criminisi algorithm [14] is to determine the priority of the repair block by using the restoration priority method based on the isophotes; Secondly, according to a certain search strategy, the best matching block is sought for the inpainting block with the highest priority in the undamaged area [15]. Thirdly, the pixel information in the best matching block is filled in the area to be repaired. Finally, repeat the above procedures until the entire damaged area is filled in. The schematic diagram is shown in Fig. 1.
Schematic diagram of criminisi algorithm.
As shown in Fig. 1,
Step 1: Calculating the highest priority pixel block in the area to be repaired. Select a point
In Eq. (1),
Where
In Eq. (4),
Step 2: Searching the best matching pixel block for the target block in the area with known information, and their corresponding pixels are used to fill in the repair area. Searching the best matching block
Step 3: After the filling is finished, we need to update the confidence level
Step 4: Repeating the above steps until the entire damaged area is repaired.
Criminisi algorithm’s priority is calculated in an unreasonable manner, it is easy to cause inaccuracy of the inpainting order [17]. Therefore, in this paper, we propose an improved calculation algorithm of the priority on the basis of the Criminisi algorithm.
To describe the question easier, we repeat the calculating formula of the priority in the Criminisi algorithm:
By analyzing the image reconstruction principle of Criminisi algorithm, we can see that there is a close relationship between the final repaired image and the sequence of the inpainting points for the quality. With the progress of image reconstruction, the damaged area becomes smaller. When calculating the priority, the value of the data item
In this paper, based on the multiplication of the confidence level term and the data term of the Criminisi algorithm, the data item and confidence level in the priority are transformed into the form of weighted sums, and factoris introduced for
Image inpainting result of ‘Chunhua’.
The influence of 
By bringing in factor, the proportion of the data item
Figure 2 shows the results of the reconstruction of the damaged image ‘Chunhua’. Figure 3 shows the results of the proposed algorithm with
Table 1 gives the corresponding PSNR value when factor
The influence of different factor
on PSNR value
The influence of different factor
The Comparison of PSNR values for different inpainting algorithm (dB)
Image inpainting results of ‘Hua’.
Image inpainting results of ‘Barb’.
In order to further verify the superiority and effectiveness of the proposed algorithm, we used Criminisi algorithm [14], Ref.[17] algorithm and the proposed algorithm in this paper to repair three kinds damaged images of ‘Hua’, ‘Barb’ and ‘Lena’. We made some comparison of the inpainting results from both objective and subjective aspects. The inpainting effect on the three broken images of ‘Hua’, ‘Barb’ and ‘Lena’ were shown in Figs 4–6, respectively. By comparing the repaired parts of the damaged image, we found that the proposed algorithm in this paper could repair the edges of the three damaged images well. Meanwhile, the left arm portion of the damaged image of ‘Barb’ and the hat portion of ‘Lena’, which showed that the inpainting effect of the proposed algorithm is better than that of Criminisi algorithm [14] and the algorithm in Ref.[17] (in this section, factor
Image inpainting results of ‘Lena’.
From objective aspect, we compared several algorithms’ PSNR. The comparison results were showed in Table 2, the proposed algorithm showed at least 0.8 dB higher than Criminisi algorithm [14], and 0.1
In a word, through the subjective effects of the inpainting results shown in Figs 4–6 and the objective PSNR indicated in Table 2, compared with the Criminisi algorithm [14] and the algorithm in Ref.[17], we can see that the improved algorithm proposed in this paper shows better image inpainting effectiveness.
Several image inpainting algorithms based on image segmentation are discussed in this paper. We compared their performance and summarized their advantages and disadvantages. This paper focuses on the sample-based inpainting algorithm proposed by Criminisi, we propose an improved formula of the priority calculation, add
Footnotes
Acknowledgments
This work has been supported in part by Hunan Provincial Natural Science Foundation of China (2017JJ3099, 2016JJ2064), the National Science Foundation of China (51704115, 61772195), the Science and Technology Program of Hunan Province (2016TP1021), the Open Fund of Education Department of Hunan Province (15K051), and the Fund of Education Department of Hunan Province (16C0723).
