Introduction to Image Restoration

Image inpainting is a technology that utilizes the information of known parts in the defect image to predict the content of the defect area, allowing the replacement content to be used to fill the target area. The ultimate goal is to ensure that the overall structure of the repaired image is coherent and unified, the transition at the edge of the repaired area is natural, the details of the repaired content are rich and reasonable, and it is best to make it impossible for the observer to tell whether the image has been repaired or not.
Two methods for image inpainting are integrated in the Opencv library.

  1. INPAINT_NS: Image restoration based on Navier-Stokes
    is a method based on the theory of fluid mechanics. We need to abstract the problem to be solved into a black area on a shoe picture, and by filling the black area, the shoe can be restored optimally.
    insert image description here
    As for how to fill the black area, it can be abstracted that there is a curve that separates the black area from A to B, and it is guaranteed that one side of the curve is blue and the other side is white. This curve should have the following constraints: maintain edge features, and maintain color information in smooth areas
    2. INPAINT_TELEA: Image repair based on the fast method
    is described by the weighted average of the known image neighborhood of the pixel, while using neighboring pixels and the gradient restores the color of the pixels in the filled area.
    opencv function:
void cv::inpaint(InputArray src,
				 InputArray inpaintMask,
				 OutputArray dst,
				 double inpaintRadius,
				 int flags 
)	

Reference materials: http://www.cjig.cn/html/jig/2020/12/20201204.htm

Guess you like

Origin blog.csdn.net/qq_41596730/article/details/126906845