With the popularity of computer and widespread application of digital images technology, digital image processing technology has become a hot topic in the field of computer vision. Image restoration is an important part of image processing, which is the process of filling information to the damaged area, the aim is to restore the damaged image, and so that observers or other people are difficult to perceive the image has ever been edited or not.At present, the image restoration algorithm based on the size of the area to be restored, can be divided into two categories, namely based on partial differential equations(PDE) and based on image texture. Bertalmio introduced PDE into the field of image restoration, the damaged image is restored according to the information diffusion theory in physics, when the damaged area is small, repair effect is very good, but when the damaged area is large, there will be a blur effect and cost so much time. Because of this shortcoming, the algorithm based on the texture has gradually become the mainstream in the field of image restoration, and attracted so many scholars to study it. No matter the damaged area is large or small, the effect is obviously.This thesis mainly studied the Criminisi algorithm, and on the basis of this algorithm, the patch size, the calculation of pixel’s priority and the searching of best match patch are improved. According to the gradient information of the edge pixel, an adaptive strategy has been introduced to determine whether the patch size can be expanded or not in order to adapt to different texture images. For the sake of avoiding the defect of single multiplication when calculates the priority of one pixel, the information around the damaged area has been taken into account, and at the same time assign different weights to the value of confidence and data. Finally, color histogram is introduced to help to find the best matching block. The color histogram defines the image or the color distribution in the image, and invariant to the translation, rotation, and scaling. Through the intersection distance of color histogram can help to judge the similarity of two patches, and thus reduce the probability of error matching.At last, through many experiments on different images, including the texture is rich or the structure is complex, and compare these results with other image inpainting algorithms, for example, like Sun and Criminisi and so on, to illustrate the effectiveness of the improved algorithm in this thesis. |