Image restoration method, system and terminal based on texture and structure separation
By performing texture and structure separation and edge prediction optimization on digital images, combined with multi-sample block fusion repair methods, the problem of texture and structure loss repair in the prior art is solved, and the consistency and quality of image repair are significantly improved.
Patent Information
- Application Number
- CN202010926365.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-07
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2040-09-07
AI Technical Summary
When existing digital image repair algorithms deal with large-area texture and structure loss, it is difficult to maintain the structural consistency and texture consistency of the results, and are easily affected by noise, especially in complex backgrounds.
The image is separated by the relative total variational image smoothing model, and the edge information of missing areas of structural images is predicted using the tensor voting model, and the priority function based on the sample block repair algorithm is optimized. At the same time, the suboptimal fusion of multi-sample blocks is used Match block repair method to repair texture images.
It realizes the high-quality restoration of image texture while maintaining structural consistency, improving subjective and objective indicators of repair results, especially in large-scale area loss and complex backgrounds.
Smart Images

Figure CN112070696B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital image processing, and in particular to an image restoration method, system and terminal based on separation of texture and structure. Background Art
[0002] Digital images may be damaged during the process of storage or transmission. The purpose of image restoration is to restore the missing areas in the image or remove specific targets in the image. In recent years, with the rapid development of computer technology, many excellent digital image restoration algorithms have emerged. When dealing with image restoration problems, it is difficult to maintain good structural consistency and texture consistency in the restoration results, but these two factors play a decisive role in the subjective effect of the image. How to better maintain the structure and texture information of the image is the focus of image restoration algorithm research. Existing algorithms can be roughly divided into two categories, namely diffusion-based restoration and sample-based restoration.
[0003] Diffusion-based inpainting: This method diffuses the known information smoothly into the area to be inpainted along the boundary to be inpainted by finding the solution of partial differential equations. Bertalmio M, Sapiro G, Caselles V, Ballester C, Image in painting, in: Proc. ACM SIGGRAPH, New Orleans, Louisiana, 2000, pp. 417–424. A diffusion-based inpainting method was first proposed, which propagates the boundary information to the unknown area in an anisotropic manner along the direction of the iso-illuminance line. Since this type of algorithm adopts the local smoothness assumption and only uses the boundary information of the area to be filled for inpainting, the diffusion-based method is suitable for the inpainting of smaller lost blocks and relatively smooth areas. When the area to be inpainted is large or contains complex textures, the inpainting result will be severely degraded and blurry artifacts will be produced.
[0004] Sample-based inpainting: In order to overcome the shortcomings of diffusion-based inpainting, the non-local self-similarity of the image is used to fill the missing area. The sample block-based method assumes that the area to be inpainted can be gradually inpainted according to a block centered on the boundary point. Criminisi A, Toyama K, Region Filling and Object Removal by Exemplar-Based Image Inpainting, IEEE TRANSACTIONS ON IMAGE PROCESSING, 2004, 13 (9): 1200-1212. The inpainting priority is extended to the sample-based inpainting algorithm, which can simultaneously propagate linear structures and two-dimensional textures to the area to be inpainted. The algorithm defines the inpainting priority by multiplying the confidence term of the block to be inpainted with the data term, thereby ensuring that the area containing the linear structure is repaired first. Then, the self-similarity is used to search for blocks that match the block to be inpainted to complete the inpainting. Rares A, Reinders M, Edge-Based Image Restoration, IEEE TRANSACTIONS ON IMAGE PROCESSING, 2005, 14(10): 1454-1468. By first predicting the edge of the missing area and then interpolating it, the restoration result can maintain good structural information. In order to further improve the algorithm, different constraints are introduced to improve the priority function and the search for matching blocks, such as structural sparsity, region segmentation technology, fractional gradient function, structural consistency, adaptive sample matching, etc. Ding D, Ram S, Image Inpainting Using Nonlocal Texture Matching and Nonlinear Filtering, IEEE TRANSACTIONS ON IMAGE PROCESSING, 2019, 28(4): 1705-1719. A restoration method based on non-local texture similarity measurement is proposed, which achieves good results when large areas of texture and geometric structure images are missing. Zeng J, Fu X, Image Inpainting Algorithm Based on Saliency Map and Gray Entropy, Arabian Journal for Science and Engineering, 2019, 44: 3549-3558. A restoration method based on angle perception and patch matching is proposed. This method first performs a pre-restoration on the image to be restored, and then uses it to guide the search for matching blocks.Existing sample-based restoration methods have good results in dealing with texture and large area loss, but they are easily affected by noise and can easily cause structural discontinuities. When the background information is complex, it is also easy to affect the restoration of its structure. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides an image restoration method, system and terminal based on separation of texture and structure.
[0006] The present invention is achieved through the following technical solutions.
[0007] According to one aspect of the present invention, there is provided an image restoration method based on separation of texture and structure, comprising:
[0008] The relative total variation image smoothing model is used to separate the image to be repaired, and the texture image and structure image of the image to be repaired are obtained;
[0009] For structural images, a tensor voting model is used to predict the edge information of the missing area of the structural image to be repaired;
[0010] Based on the predicted edge information of the missing area, the priority function of the sample block repair algorithm is optimized, and then the structural image is repaired to obtain the structural repair result;
[0011] For texture images, a suboptimal matching block restoration method based on multi-sample block fusion is used to restore the texture image and obtain the texture restoration result.
[0012] Combining the structure restoration results with the texture restoration results, the image is finally restored.
[0013] Preferably, the relative total variation image smoothing model is:
[0014]
[0015] Among them, I p represents the input image, S p represents the output structural image, p is the index value of the two-dimensional image pixel, λ is a constant; θ x (p) is the total change in absolute spatial difference of pixel p in the window R(p) along the x direction, θ y (p) is the total change in absolute spatial difference of pixel p in the window R(p) along the y direction, ξ x (p) is the absolute spatial difference inherent change of pixel p in the window R(p) along the x direction, ξ y (p) is the absolute spatial difference inherent change of pixel p in the window R(p) along the y direction, ε is a constant, and:
[0016]
[0017]
[0018] Among them, g p,q is a weighting function defined according to spatial similarity;
[0019] R(p) is the index of all pixels in a square area centered on p, and g is the Gaussian kernel function:
[0020]
[0021] Among them, x p is the horizontal coordinate of point p, x q is the horizontal coordinate of point q, y p is the ordinate of point p, y q is the ordinate of point q;
[0022] The structural image of the image is obtained by using the relative total variation image smoothing model, and the required texture image is obtained by subtracting the original image from the structural image.
[0023] Preferably, the value of λ is 0.015.
[0024] Preferably, the value of ε is 3.
[0025] Preferably, the tensor voting model infers the overall structural characteristics of the model in which it is located by propagating its own structural differential information to the surroundings and simultaneously receiving information from neighboring points; before performing tensor voting, a non-negative definite second-order symmetric matrix is assigned to each point according to the data information of the points on the two-dimensional image, which is the tensor T of the point:
[0026]
[0027] Among them, λ1≥λ2≥0 is the eigenvalue of the tensor, e1 and e2 are its corresponding eigenvectors, A t Represents the transpose of the matrix A; the tensor T consists of the rod tensor components T S and the spherical tensor component T B Composition, of which:
[0028]
[0029]
[0030] Point p i To point p j The stick tensor voting is represented as:
[0031]
[0032] in:
[0033]
[0034] v j =(I-2rr t )v i
[0035] In the above formula, v i represents point p i The unit vector of the principal eigenvector of the tensor at j For point p j received from point p i The unit vector of the main eigenvector of the stick tensor voting matrix, r is the point p i Point to point p j The unit vector, -l 2 / σ 2 Where l is p i and p j The distance between them, σ is the scale parameter that controls the size of the voting area;
[0036] Point p j The received ball tensor votes are expressed as:
[0037]
[0038] in:
[0039] R=(I-2rr t )
[0040] Where I is the input image;
[0041] After completing the ball tensor voting and stick tensor voting processes, each point in the tensor field extracts the stick tensor and ball tensor information of each point in the tensor field respectively, retains the points whose principal components of the tensors are greater than a certain threshold, and uses the method of selecting the local area maximum to select a curve from the edge breakpoint as the predicted lost structural information, which is the edge information of the missing area of the structural image to be repaired.
[0042] Preferably, let I be the damaged image to be repaired, Ω be the area to be repaired, Φ be the known area or the source area, represents the boundary between the area to be repaired and the known area, p is any point on the boundary, C(q) is the confidence term of point q, that is, the mean confidence value of the block centered at point q, Ψ P is the sample block to be repaired centered on p, Ψ q is the sample block to be repaired centered on q, n p is the normal direction of point p, is the direction of the iso-illuminance line at point p, and α is the normalization parameter;
[0043] The sample block-based repair algorithm is:
[0044] P(p)=C(p)·D(p)
[0045] Among them, P(p) is the value of the priority function of point p, C(p) is the confidence item of point p, and D(p) is the data item of point p.
[0046]
[0047]
[0048] The optimal matching block search is performed according to the SSD criterion of the sum of squared pixel differences, and the method is as follows:
[0049] d(Ψ p ,Ψ q )=∑(I(p)-I(q)) 2
[0050] In the formula, I(p) and I(q) represent the pixel values of the target block and the matching block respectively. After searching for the best matching block, the pixel values of the corresponding positions of the matching block are copied to the target block.
[0051] After the filling is completed, the confidence value of the newly filled area is updated, and the update strategy is:
[0052]
[0053] Repeat the above process until all the areas to be repaired are filled, thus completing the repair of the structural image.
[0054] Preferably, the confidence item initialization is divided into three categories, namely known areas, unknown areas and edge prediction areas; the confidence value for the known area is initialized to 1, the confidence value for the unknown area is initialized to 0, and the confidence value for the area with predicted edges is initialized to 50; the initialization values are as follows:
[0055]
[0056] When the block to be repaired contains a predicted edge, the value of its confidence item will be much larger than that of other blocks, so the value of its priority function will also be relatively large. In this way, the area with predicted edges will be repaired first, thereby maintaining the structural consistency of the image.
[0057] Preferably, in the suboptimal matching block repair method for fusion of multiple sample blocks, when searching for matching blocks, the sample block-based repair method only selects the best matching block, that is, the block with the smallest sum of square differences, and then copies the value of the best matching block to the block to be repaired; wherein, according to the square difference and criterion, the first n blocks with higher matching degrees are selected as candidate blocks, and then different weights are assigned to these candidate blocks as the final repair result of the block to be repaired.
[0058] Preferably, the value of n is 2, the weight ratio is 7:3, where Ψ1 is the best matching block and Ψ2 is the second best matching block, then:
[0059] Ψ p =0.7*Ψ1+0.3*Ψ2
[0060] Among them, P is the sample block to be repaired centered at p.
[0061] According to another aspect of the present invention, there is provided an image restoration system based on texture and structure separation, comprising:
[0062] Texture and structure separation module: uses the relative total variation image smoothing model to separate the image to be repaired, and obtains the texture image and structure image of the image to be repaired;
[0063] Edge prediction module: For structural images, the tensor voting model is used to predict the edge information of the missing area of the structural image to be repaired;
[0064] Structural image restoration module: Based on the predicted edge information of the missing area, the priority function based on the sample block restoration model is optimized, and then the structural image is restored to obtain the structural restoration result;
[0065] Texture image restoration module: For texture images, a suboptimal matching block restoration model with multi-sample block fusion is used to repair the texture image and obtain the texture restoration result;
[0066] Final restoration result acquisition module: combines the structure restoration result obtained by the structure image restoration module and the texture restoration result obtained by the texture image restoration module to finally restore the image.
[0067] Preferably, the relative total variation image smoothing model is:
[0068]
[0069] Among them, I p represents the input image, S p represents the output structural image, p is the index value of the two-dimensional image pixel, λ is a constant; θ x(p) is the total change in absolute spatial difference of pixel p in the window R(p) along the x direction, θ y (p) is the total change in absolute spatial difference of pixel p in the window R(p) along the y direction, ξ x (p) is the absolute spatial difference inherent change of pixel p in the window R(p) along the x direction, ξ y (p) is the absolute spatial difference inherent change of pixel p in the window R(p) along the y direction, ε is a constant, and:
[0070]
[0071]
[0072] Among them, g p,q is a weighting function defined according to spatial similarity;
[0073] R(p) is the index of all pixels in a square area centered on p, and g is the Gaussian kernel function:
[0074]
[0075] Among them, x p is the horizontal coordinate of point p, x q is the horizontal coordinate of point q, y p is the ordinate of point p, y q is the ordinate of point q;
[0076] The structural image of the image is obtained by using the relative total variation image smoothing model, and the required texture image is obtained by subtracting the original image from the structural image.
[0077] Preferably, the value of λ is 0.015.
[0078] Preferably, the value of ε is 3.
[0079] Preferably, the tensor voting model infers the overall structural characteristics of the model in which it is located by propagating its own structural differential information to the surroundings and simultaneously receiving information from neighboring points; before performing tensor voting, a non-negative definite second-order symmetric matrix is assigned to each point according to the data information of the points on the two-dimensional image, which is the tensor T of the point:
[0080]
[0081] Among them, λ1≥λ2≥0 is the eigenvalue of the tensor, e1 and e2 are its corresponding eigenvectors, A t Represents the transpose of the matrix A; the tensor T consists of the rod tensor components T S and the spherical tensor component T B Composition, of which:
[0082]
[0083]
[0084] Point p i To point p j The stick tensor voting is represented as:
[0085]
[0086] in:
[0087]
[0088] v j =(I-2rr t )v i
[0089] In the above formula, v i represents point p i The unit vector of the principal eigenvector of the tensor at j For point p j received from point p i The unit vector of the main eigenvector of the stick tensor voting matrix, r is the point p i Point to point p j The unit vector, -l 2 / σ 2 Where l is p i and p j The distance between them, σ is the scale parameter that controls the size of the voting area;
[0090] Point p j The received ball tensor votes are expressed as:
[0091]
[0092] in:
[0093] R=(I-2rr t )
[0094] Where I is the input image;
[0095] After completing the ball tensor voting and stick tensor voting processes, each point in the tensor field extracts the stick tensor and ball tensor information of each point in the tensor field respectively, retains the points whose principal components of the tensors are greater than a certain threshold, and uses the method of selecting the local area maximum to select a curve from the edge breakpoint as the predicted lost structural information, which is the edge information of the missing area of the structural image to be repaired.
[0096] Preferably, the sample block-based repair model is:
[0097] P(p)=C(p)·D(p)
[0098] Among them, P(p) is the value of the priority function of point p, C(p) is the confidence item of point p, and D(p) is the data item of point p.
[0099]
[0100]
[0101] The optimal matching block search is performed according to the SSD criterion of the sum of squared pixel differences, and the method is as follows:
[0102] d(Ψ p ,Ψ q )=∑(I(p)-I(q)) 2
[0103] In the formula, I(p) and I(q) represent the pixel values of the target block and the matching block respectively. After searching for the best matching block, the pixel values of the corresponding positions of the matching block are copied to the target block.
[0104] After the filling is completed, the confidence value of the newly filled area is updated, and the update strategy is:
[0105]
[0106] Repeat the above process until all the areas to be repaired are filled, thus completing the repair of the structural image.
[0107] In the above, I is the damaged image to be repaired, Ω is the area to be repaired, Φ is the known area or source area, represents the boundary between the area to be repaired and the known area, p is any point on the boundary, C(q) is the confidence term of point q, that is, the mean confidence value of the block centered at point q, Ψ P is the sample block to be repaired centered on p, Ψ q is the sample block to be repaired centered on q, n p is the normal direction of point p, is the direction of the iso-illuminance line at point p, and α is the normalization parameter.
[0108] Preferably, in the suboptimal matching block repair model for fusion of multiple sample blocks, when searching for matching blocks, the sample block-based repair method only selects the best matching block, that is, the block with the smallest sum of square differences, and then copies the value of the best matching block to the block to be repaired; wherein, according to the square difference and criterion, the first n blocks with higher matching degrees are selected as candidate blocks, and then different weights are assigned to these candidate blocks as the final repair result of the block to be repaired.
[0109] According to a third aspect of the present invention, a terminal is provided, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor can be used to execute any of the above-described methods when executing the computer program.
[0110] Due to the adoption of the above technical solution, the present invention has at least one of the following beneficial effects compared with the prior art:
[0111] The image restoration method, system and terminal based on separation of texture and structure provided by the present invention make full use of the known structural information of the image to be restored, so that the restoration result can better maintain structural consistency.
[0112] The image restoration method, system and terminal based on separation of texture and structure provided by the present invention make full use of known information of the image and can reasonably restore the texture part of the image while maintaining the structural continuity of the restoration result.
[0113] The image restoration method, system and terminal based on texture and structure separation provided by the present invention have significantly improved both the subjective quality and objective indicators of the restoration results.
[0114] The image restoration method, system and terminal based on separation of texture and structure provided by the present invention adopt a multi-matching block fusion method to obtain pixel values of the area to be restored when restoring the texture part, thereby improving the accuracy of matching block search and completing the background texture filling of large areas lost while maintaining the structural integrity of the image restoration result. BRIEF DESCRIPTION OF THE DRAWINGS
[0115] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0116] Figure 1 This is a flow chart of an image restoration method based on separation of texture and structure in a preferred embodiment of the present invention.
[0117] Figure 2 It is a schematic diagram of separating texture image and structure image in a preferred embodiment of the present invention.
[0118] Figure 3 It is a schematic diagram of edge prediction in a preferred embodiment of the present invention.
[0119] Figure 4 It is a schematic diagram of structural image restoration in a preferred embodiment of the present invention.
[0120] Figure 5 Schematic diagram of texture image restoration in a preferred embodiment of the present invention.
[0121] Figure 6 It is a schematic diagram of the repair result in a preferred embodiment of the present invention.
[0122] Figure 7 It is a schematic diagram of a sample block-based repair algorithm in a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0123] The following is a detailed description of the embodiments of the present invention: This embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation method and a specific operation process are given. It should be pointed out that for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
[0124] An embodiment of the present invention provides an image restoration method based on separation of texture and structure, which aims to restore good texture information while maintaining complete structural information in the image restoration result.
[0125] The image restoration method based on separation of texture and structure provided in this embodiment separates the texture and structure of the image to be restored, introduces edge prediction information to optimize the priority function in the restoration of the structural image, and introduces a new fusion restoration strategy in the restoration of the texture image. First, the structural map and texture map of the image are obtained by the relative total variation model, and are restored independently. Then, the edge prediction algorithm based on tensor voting is used to predict the missing edges in the area to be restored, and the predicted edge information is used to improve the priority function, so that the restoration priority is more reasonable and the accumulation of structural errors is reduced as the restoration proceeds. In order to improve the accuracy of the matching block search, the method adopts a multi-matching block fusion method to obtain the pixel value of the area to be restored for the restoration of the texture part. The method can complete the filling of the background texture lost in a large area while maintaining the structural integrity of the image restoration result.
[0126] Based on the above technical concept and purpose, the method provided in this embodiment takes the image restoration algorithm based on the sample block as the basic model, and performs some preprocessing on the image to be restored before restoration, which includes: separating the texture and structure of the original image, and predicting the edge of the missing area. First, the texture and structure of the image to be restored are separated. Then, the edge prediction in the missing area of the image to be restored is completed based on the structural image. Finally, the improved priority function and matching block search are used to complete the restoration of the structure and texture parts respectively.
[0127] This method comprises the following steps:
[0128] Step 1, using a relative total variation image smoothing model to separate the image to be repaired, and obtaining a texture image and a structure image of the image to be repaired;
[0129] Step 2: For the structural image, use the tensor voting model to predict the edge information of the missing area of the structural image to be repaired;
[0130] Step 3, based on the predicted edge information of the missing area, optimize the priority function of the sample block repair algorithm, and then repair the structural image to obtain the structural repair result;
[0131] Step 4: For the texture image, a suboptimal matching block repair method of multi-sample block fusion is used to repair the texture image to obtain a texture repair result;
[0132] Step 5: Combine the structure repair results and the texture repair results to finally repair the image.
[0133] In step 1, most images are not composed of texture or structure alone, but are composed of texture and structure together. Therefore, an image can be expressed as I=Is+It, where Is represents the structure part and It represents the texture part.
[0134] In step 2, edge prediction is performed on the structural image. Since the structural image does not contain detailed texture, the influence of the edge information of the texture part on the missing edge prediction can be removed, thereby improving the accuracy of edge prediction.
[0135] In step 3, the priority function of the sample block repair algorithm is improved based on the predicted edge information of the missing area, so that the repair result can maintain better structural consistency.
[0136] In step 4, based on the sample block repair, the search strategy for the best matching block is improved, thereby improving the accuracy and reliability of the matching block search.
[0137] In step 5, the final repair result is obtained from the repair results of steps 3 and 4.
[0138] As a preferred embodiment, the relative total variation image smoothing model is:
[0139]
[0140] Among them, I p represents the input image, S p represents the output structural image, p is the index value of the two-dimensional image pixel, λ is a constant, and its value is preferably 0.015; θ x (p) is the total change in absolute spatial difference of pixel p in the window R(p) along the x direction, θ y(p) is the total change in absolute spatial difference of pixel p in the window R(p) along the y direction, ξ x (p) is the absolute spatial difference inherent change of pixel p in the window R(p) along the x direction, ξ y (p) is the absolute spatial difference inherent change of pixel p in the window R(p) along the y direction, ε is a constant, whose value is preferably 3, and:
[0141]
[0142]
[0143] Among them, g p,q is a weighting function defined according to spatial similarity;
[0144] R(p) is the index of all pixels in a square area centered on p, and g is the Gaussian kernel function:
[0145]
[0146] Among them, x p is the horizontal coordinate of point p, x q is the horizontal coordinate of point q, y p is the ordinate of point p, y q is the ordinate of point q;
[0147] The structural image of the image is obtained by using the relative total variation image smoothing model, and the required texture image is obtained by subtracting the original image from the structural image.
[0148] As a preferred embodiment, the tensor voting model infers the overall structural characteristics of the model in which it is located by propagating its own structural differential information to the surroundings and receiving information from neighboring points at the same time; before performing tensor voting, a non-negative definite second-order symmetric matrix is assigned to each point according to the data information of the points on the two-dimensional image, which is the tensor T of the point:
[0149]
[0150] Among them, λ1≥λ2≥0 is the eigenvalue of the tensor, e1 and e2 are its corresponding eigenvectors; the tensor T is composed of the rod tensor components T S and the spherical tensor component T B Composition, of which:
[0151]
[0152]
[0153] Point p i To point p j The stick tensor voting is represented as:
[0154]
[0155] in:
[0156]
[0157] v j =(I-2rr t )v i
[0158] In the above formula, v i represents point p i The unit vector of the principal eigenvector of the tensor at j For point p j received from point p i The unit vector of the main eigenvector of the stick tensor voting matrix, r is the point p i Point to point p j The unit vector, -l 2 / σ 2 Where l is p i and p j The distance between them is σ, and σ is the scale parameter that controls the size of the voting area.
[0159] Point p j The received ball tensor votes are expressed as:
[0160]
[0161] in:
[0162] R=(I-2rr t )
[0163] Where I is the input image;
[0164] After completing the ball tensor voting and stick tensor voting processes, each point in the tensor field extracts the stick tensor and ball tensor information of each point in the tensor field respectively. A certain strategy is adopted for this information, that is, the points whose principal components of the tensor are greater than a certain threshold are retained as candidate edge points, and the remaining tensors are cleared to zero. Starting from the edge breakpoint, a curve is selected by selecting the local area maximum value as the predicted lost structural information, which is the edge information of the missing area of the structural image to be repaired.
[0165] As a preferred embodiment, let I be the damaged image to be repaired, Ω be the area to be repaired, Φ be the known area or the source area, represents the boundary between the area to be repaired and the known area, p is any point on the boundary, C(q) is the confidence term of point q, that is, the mean confidence value of the block centered at point q, Ψ Pis the sample block to be repaired centered on p, Ψ q is the sample block to be repaired centered on q, n p is the normal direction of point p, is the direction of the iso-illuminance line at point p, and α is the normalization parameter;
[0166] The repair algorithm based on the sample block is:
[0167] P(p)=C(p)·D(p)
[0168] Among them, P(p) is the value of the priority function of point p, C(p) is the confidence item of point p, and D(p) is the data item of point p.
[0169]
[0170]
[0171] The optimal matching block search is performed according to the SSD criterion of the sum of squared pixel differences, and the method is as follows:
[0172] d(Ψ p ,Ψ q )=∑(I(p)-I(q)) 2
[0173] In the formula, I(p) and I(q) represent the pixel values of the target block and the matching block respectively. After searching for the best matching block, the pixel values of the corresponding positions of the matching block are copied to the target block.
[0174] After the filling is completed, the confidence value of the newly filled area is updated, and the update strategy is:
[0175]
[0176] Repeat the above process until all the areas to be repaired are filled, thus completing the repair of the structural image.
[0177] As a preferred embodiment, confidence item initialization is divided into three categories, namely known areas, unknown areas and edge prediction areas; the confidence value for the known area is initialized to 1, the confidence value for the unknown area is initialized to 0, and the confidence value for the area with predicted edges is initialized to 50; the initialization values are as follows:
[0178]
[0179] When the block to be repaired contains a predicted edge, the value of its confidence item will be much larger than that of other blocks, so the value of its priority function will also be relatively large. In this way, the area with predicted edges will be repaired first, thereby maintaining the structural consistency of the image.
[0180] As a preferred embodiment, the suboptimal matching block repair method of multi-sample block fusion, when searching for matching blocks, the sample block-based repair method only selects the best matching block, that is, the block with the smallest sum of square differences, and then copies the value of the best matching block to the block to be repaired. The multi-sample block fusion repair method provided in this embodiment selects the first n blocks with higher matching degrees as candidate blocks according to the square difference and criterion, and then assigns different weights to these candidate blocks as the final repair result of the block to be repaired.
[0181] As a preferred embodiment, n is set to 2, and the weight ratio is 7:3, where Ψ1 is the best matching block and Ψ2 is the second best matching block, then:
[0182] Ψ p =0.7*Ψ1+0.3*Ψ2
[0183] Among them, P is the sample block to be repaired centered at p.
[0184] The technical solutions provided by the above embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings.
[0185] The overall process of the method provided in this embodiment is as follows: Figure 1 As shown, this embodiment is programmed and simulated in Windo10 and Matlab2016 environments. First, the image smoothing model based on relative total variation (RTV) is used to obtain the structural image part of the image to be repaired. The reason is that the RTV model has universal applicability and has no special requirements for smoothed images. Its texture image part is the difference between the image to be repaired and the structural image part. After obtaining the texture and structural images, the texture and structural image parts are repaired respectively. Edge prediction information is introduced in structural repair, and a layered fusion strategy is introduced in texture repair.
[0186] The method of this embodiment adopts a texture and structure separation strategy, and adds edge prediction information to the structure repair part to improve the priority function, and adopts a matching block search strategy to improve the matching accuracy in the texture repair part. The specific implementation steps are as follows:
[0187] Step 1. Use the RTV model to obtain the structure and texture of the image: decompose the image to be repaired into the structure image Is and the texture image It. The texture and structure separation results are as follows: Figure 2 shown.
[0188] Step 2. Edge prediction of the area to be repaired based on the tensor voting model: The tensor voting model is used to predict the edge information of the missing area of the structure image to be repaired; the predicted edge information is as follows: Figure 3 shown.
[0189] Step 3. Structural repair based on edge information: Use the predicted edge information to optimize the priority function. The specific method is: when the confidence value is initialized, a larger confidence value is assigned to the part where the edge is predicted, the confidence value of the known part is set to 1, and the confidence value of the unknown part is set to 0; specifically, the process of repairing the result image based on edge information is:
[0190] First, the priority of the boundary of the area to be repaired is calculated according to the priority function. Since a larger confidence value is given to the predicted edge, the priority function value of the area containing the predicted edge point will be larger, so it will be repaired first.
[0191] Secondly, after finding the block with the highest priority for repair, search for the best matching block of the block to be repaired in the known area according to the square difference and criterion;
[0192] Finally, copy the value of the best matching block to the area corresponding to the block to be repaired, and repeat the above process until all the areas to be repaired are filled.
[0193] The result after structural image restoration is as follows Figure 4 shown.
[0194] Step 4. Texture restoration based on multi-sample block fusion: Considering the non-optimal situation of the optimal matching block search in the original sample block-based restoration model, this step adopts a matching strategy of multi-sample block fusion to improve the accuracy of the matching result; specifically, the process of restoring the texture image based on multi-sample block fusion is as follows:
[0195] First, the priority of the boundary of the area to be repaired is calculated according to the priority function, and the block to be repaired with the highest priority is found;
[0196] Secondly, after finding the block with the highest priority for repair, search for the top n matching blocks with a high degree of matching with the block to be repaired in the known area according to the square difference and criterion;
[0197] Finally, different weights are assigned to the selected n matching blocks as the final value of the block to be repaired, and the above process is repeated until all the areas to be repaired are filled.
[0198] Furthermore, the value of n is 2, and the weight ratio is 7:3.
[0199] The result after texture image restoration is as follows Figure 5 shown.
[0200] Step 5. Obtain the final restoration result: Using the restoration method of separating texture and structure, the final restoration result can be obtained by simply adding the restoration results of texture and structure. Figure 6 shown.
[0201] In step 1, the mathematical expression of the RTV model is as follows:
[0202]
[0203] Where I represents the input image, p is the index value of the two-dimensional image pixel, and S represents the output structure image. And there are:
[0204]
[0205]
[0206] R(p) is the index of all pixels in a square area centered on p, and g is the Gaussian kernel function:
[0207]
[0208] In step 2, the tensor voting model is that each point infers the overall structural characteristics of its own model by propagating its own structural differential information to the surroundings and receiving information from neighboring points at the same time. Before performing tensor voting, a non-negative definite second-order symmetric matrix is assigned to each point based on the data information (gradient, curvature, etc.) of the points on the two-dimensional image, which is the tensor T of the point:
[0209]
[0210] Where λ1≥λ2≥0 is the eigenvalue of the tensor, and e1 and e2 are its corresponding eigenvectors. The tensor T can be composed of the rod tensor components T S (Stick Tensor) and the ball tensor component T B (Ball Tensor), where:
[0211]
[0212]
[0213] p i To p j The stick tensor voting can be expressed as:
[0214]
[0215] in:
[0216]
[0217] v j =(I-2rr T )v i (15)
[0218] In the above formula, v irepresents point p i The unit vector of the principal eigenvector of the tensor at j For p j Received from p i The unit vector of the main eigenvector of the stick tensor voting matrix, r is p i Point to p j The unit vector of .
[0219] And p j The received ball tensor votes can be expressed as:
[0220]
[0221] in:
[0222] R=(I-2rr T ) (17)
[0223] After each point in the tensor field completes the ball tensor voting and stick tensor voting processes, the stick tensor and ball tensor information of each point in the tensor field can be extracted respectively. By using certain strategies or methods for this information, the missing structural information can be predicted.
[0224] In step 3, the basic model used in this embodiment is a repair model based on sample blocks, such as Figure 7 As shown in Figure 1, it mainly includes three steps, namely, the calculation of the priority function, the search for matching blocks, and the update of the confidence value. Let I be the damaged image to be repaired, Ω be the area to be repaired, Φ be the known area or the source area, represents the boundary between the area to be repaired and the known area, p is any point on the boundary, Ψ P is a 9x9 block of samples to be repaired with p as the center, n p is the normal direction of point p, is the direction of the iso-illuminance line at point p.
[0225] The target block priority is calculated as follows:
[0226] P(p)=C(p)·D(p) (1)
[0227] In the above formula, C(p) is the confidence term of point p; D(p) is the data term of point p. The calculation of C(p) and D(p) is as follows:
[0228]
[0229]
[0230] In the above formula, α is a normalization parameter, and its value is 255.
[0231] The search for the best matching block is based on the Sum of Squared Differences (SSD) criterion, and its calculation formula is as follows:
[0232] d(Ψ p ,Ψ q )=∑(I(p)-I(q)) 2 (4)
[0233] Where I(p) and I(q) represent the pixel values of the target block and the matching block respectively. After searching for the best matching block, the pixel values of the corresponding positions of the matching block are copied to the target block.
[0234] After filling is completed, the confidence value of the newly filled area needs to be updated. The update strategy is as follows:
[0235]
[0236] Repeat the above process until all the areas to be repaired are filled.
[0237] The confidence value initialization of the method in this embodiment is divided into three categories, namely, known areas, unknown areas, and edge prediction areas. The confidence value of the known area is initialized to 1, the confidence value of the unknown area is initialized to 0, and the confidence value of the area with predicted edges is initialized to 50. The initialization value is as shown in formula (13):
[0238]
[0239] From the confidence term expression (2), we can see that when the block to be repaired contains the predicted edge, the value of its confidence term will be much larger than that of other blocks, so the value of its priority function will also be relatively large, so that the area with the predicted edge will be repaired first, thereby better maintaining the structural consistency of the image.
[0240] In step 4, the method of this embodiment proposes a repair strategy of multi-sample block fusion. There are certain defects in the search of matching blocks in the sample block-based algorithm. Experiments have found that the repair result of the optimal matching block searched according to the sum of squared differences (SSD) criterion is sometimes not as good as the repair result of the suboptimal matching block. Based on this, this embodiment proposes a multi-matching block search method for repairing the texture part. That is to say, when searching for matching blocks, the first n blocks with higher matching degrees are selected as candidate blocks, and then different weights are assigned to these candidate blocks as the final repair results. In this embodiment, the value of n is selected as 2, and the weight ratio is 7:3, where Ψ1 is the optimal matching block and Ψ2 is the suboptimal matching block.
[0241] Ψ p =0.7*Ψ1+0.3*Ψ2 (19)
[0242] Another embodiment of the present invention provides an image restoration system based on texture and structure separation, comprising:
[0243] Texture and structure separation module: uses the relative total variation image smoothing model to separate the image to be repaired, and obtains the texture image and structure image of the image to be repaired;
[0244] Edge prediction module: For structural images, the tensor voting model is used to predict the edge information of the missing area of the structural image to be repaired;
[0245] Structural image restoration module: Based on the predicted edge information of the missing area, the priority function based on the sample block restoration model is optimized, and then the structural image is restored to obtain the structural restoration result;
[0246] Texture image restoration module: For texture images, a suboptimal matching block restoration model with multi-sample block fusion is used to repair the texture image and obtain the texture restoration result;
[0247] Final restoration result acquisition module: combines the structure restoration result obtained by the structure image restoration module and the texture restoration result obtained by the texture image restoration module to finally restore the image.
[0248] As a preferred embodiment, the relative total variation image smoothing model is:
[0249]
[0250] Among them, I p represents the input image, S p represents the output structural image, p is the index value of the two-dimensional image pixel, λ is a constant, and its value is preferably 0.015; θ x (p) is the total change in absolute spatial difference of pixel p in the window R(p) along the x direction, θ y (p) is the total change in absolute spatial difference of pixel p in the window R(p) along the y direction, ξ x (p) is the absolute spatial difference inherent change of pixel p in the window R(p) along the x direction, ξ y (p) is the absolute spatial difference inherent change of pixel p in the window R(p) along the y direction, ε is a constant, whose value is preferably 3, and:
[0251]
[0252]
[0253] Among them, g p,q is a weighting function defined according to spatial similarity;
[0254] R(p) is the index of all pixels in a square area centered on p, and g is the Gaussian kernel function:
[0255]
[0256] Among them, x p is the horizontal coordinate of point p, x q is the horizontal coordinate of point q, y p is the ordinate of point p, y q is the ordinate of point q;
[0257] The structural image of the image is obtained by using the relative total variation image smoothing model, and the required texture image is obtained by subtracting the original image from the structural image.
[0258] As a preferred embodiment, the tensor voting model infers the overall structural characteristics of the model in which it is located by propagating its own structural differential information to the surroundings and receiving information from neighboring points at the same time; before performing tensor voting, a non-negative definite second-order symmetric matrix is assigned to each point according to the data information of the points on the two-dimensional image, which is the tensor T of the point:
[0259]
[0260] Among them, λ1≥λ2≥0 is the eigenvalue of the tensor, e1 and e2 are its corresponding eigenvectors; the tensor T is composed of the rod tensor components T S and the spherical tensor component T B Composition, of which:
[0261]
[0262]
[0263] Point p i To point p j The stick tensor voting is represented as:
[0264]
[0265] in:
[0266]
[0267] v j =(I-2rr t )v i
[0268] In the above formula, v i represents point p i The unit vector of the principal eigenvector of the tensor at j For point p j received from point pi The unit vector of the main eigenvector of the stick tensor voting matrix, r is the point p i Point to point p j The unit vector, -l 2 / σ 2 Where l is p i and p j The distance between them, σ is the scale parameter that controls the size of the voting area;
[0269] Point p j The received ball tensor votes are expressed as:
[0270]
[0271] in:
[0272] R=(I-2rr t )
[0273] Where I is the input image;
[0274] After completing the ball tensor voting and stick tensor voting processes, each point in the tensor field extracts the stick tensor and ball tensor information of each point in the tensor field respectively. A certain strategy is adopted for this information, that is, the points whose principal components of the tensor are greater than a certain threshold are retained as candidate edge points, and the remaining tensors are cleared. Starting from the edge breakpoint, a curve is selected by selecting the local area maximum value as the predicted lost structural information, which is the edge information of the missing area of the structural image to be repaired.
[0275] As a preferred embodiment, the repair model based on the sample block is:
[0276] P(p)=C(p)·D(p)
[0277] Among them, P(p) is the value of the priority function of point p, C(p) is the confidence item of point p, and D(p) is the data item of point p.
[0278]
[0279]
[0280] The optimal matching block search is performed according to the SSD criterion of the sum of squared pixel differences, and the method is as follows:
[0281] d(Ψ p ,Ψ q )=∑(I(p)-I(q)) 2
[0282] In the formula, I(p) and I(q) represent the pixel values of the target block and the matching block respectively. After searching for the best matching block, the pixel values of the corresponding positions of the matching block are copied to the target block.
[0283] After the filling is completed, the confidence value of the newly filled area is updated, and the update strategy is:
[0284]
[0285] Repeat the above process until all the areas to be repaired are filled, thus completing the repair of the structural image.
[0286] In the above, I is the damaged image to be repaired, Ω is the area to be repaired, Φ is the known area or source area, represents the boundary between the area to be repaired and the known area, p is any point on the boundary, C(q) is the confidence term of point q, Ψ P is the sample block to be repaired centered on p, Ψ q is the sample block to be repaired centered on q, n p is the normal direction of point p, is the direction of the iso-illuminance line at point p, and α is the normalization parameter.
[0287] As a preferred embodiment, the suboptimal matching block repair model of multi-sample block fusion, when searching for matching blocks, the repair method based on the sample block only selects the best matching block, that is, the block with the smallest sum of square differences, and then copies the value of the best matching block to the block to be repaired. In this embodiment, the multi-sample block fusion repair method selects the first n blocks with higher matching degrees as candidate blocks according to the square difference and criterion, and then assigns different weights to these candidate blocks as the final repair result of the block to be repaired.
[0288] According to a third aspect of the present invention, a terminal is provided, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor can be used to execute any of the above methods when executing the computer program.
[0289] Optionally, the memory is used to store programs; the memory may include volatile memory (English: volatile memory), such as random-access memory (English: random-access memory, abbreviated: RAM), such as static random-access memory (English: static random-access memory, abbreviated: SRAM), double data rate synchronous dynamic random access memory (English: Double Data Rate Synchronous Dynamic Random Access Memory, abbreviated: DDR SDRAM), etc.; the memory may also include non-volatile memory (English: non-volatile memory), such as flash memory (English: flash memory). The memory is used to store computer programs (such as applications, functional modules, etc. that implement the above method), computer instructions, etc., and the above computer programs, computer instructions, etc. can be partitioned and stored in one or more memories. And the above computer programs, computer instructions, data, etc. can be called by the processor.
[0290] The above-mentioned computer programs, computer instructions, etc. may be stored in one or more memories in partitions, and the above-mentioned computer programs, computer instructions, data, etc. may be called by a processor.
[0291] The processor is used to execute the computer program stored in the memory to implement the various steps in the method involved in the above embodiment. For details, please refer to the relevant description in the above method embodiment.
[0292] The processor and the memory may be independent structures or integrated structures. When the processor and the memory are independent structures, the memory and the processor may be coupled and connected via a bus.
[0293] The image restoration method, system, and terminal based on separation of texture and structure provided by the above-mentioned embodiments of the present invention achieve the purpose of separation of texture and structure by using the image smoothing model of relative total variation for the image to be restored. In the restoration of structural images, edge prediction information is introduced to optimize the priority function, and in the restoration of texture images, a new multi-sample block fusion restoration strategy is introduced. The image restoration method, system, and terminal based on separation of texture and structure provided by the above-mentioned embodiments of the present invention make full use of the known information of the image, and can reasonably restore the texture part of the image while maintaining the structural continuity of the restoration result. The method, system, and terminal have been significantly improved in both the subjective quality and objective indicators of the restoration results.
[0294] It should be noted that the steps in the method provided by the present invention can be implemented by using corresponding modules, devices, units, etc. in the system. Those skilled in the art can refer to the technical solution of the system to implement the step flow of the method, that is, the embodiments in the system can be understood as preferred examples of implementing the method, which will not be elaborated here.
[0295] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art may make various modifications or variations within the scope of the claims, which do not affect the essence of the present invention.
Claims
1. An image restoration method based on texture and structure separation, characterized in that: include: The relative total variation image smoothing model is used to separate the image to be repaired, and the texture image and structure image of the image to be repaired are obtained; For structural images, a tensor voting model is used to predict the edge information of the missing area of the structural image to be repaired; Based on the predicted edge information of the missing area, the priority function of the sample block repair algorithm is optimized, and then the structural image is repaired to obtain the structural repair result; For texture images, a suboptimal matching block restoration method based on multi-sample block fusion is used to restore the texture image and obtain the texture restoration result. Combining the structure restoration results with the texture restoration results, the image is finally restored. Let I be the damaged image to be repaired, Ω be the area to be repaired, Φ be the known area or source area, represents the boundary between the area to be repaired and the known area, p is any point on the boundary, C(q) is the confidence term of point q, that is, the mean confidence value of the block centered at point q, Ψ P is the sample block to be repaired centered on p, Ψ q is the sample block to be repaired centered on q, n p is the normal direction of point p, is the direction of the iso-illuminance line at point p, and α is the normalization parameter; The sample block-based repair algorithm is: P(p)=C(p)·D(p) Among them, P(p) is the value of the priority function of point p, C(p) is the confidence item of point p, and D(p) is the data item of point p. The optimal matching block search is performed according to the SSD criterion of the sum of squared pixel differences, and the method is as follows: d(Ψ p ,P q )=∑(I(p)-I(q)) 2 In the formula, I(p) and I(q) represent the pixel values of the target block and the matching block respectively. After searching for the best matching block, the pixel values of the corresponding positions of the matching block are copied to the target block. After the filling is completed, the confidence value of the newly filled area is updated, and the update strategy is: Repeat the above process until all the areas to be repaired are filled, thus completing the repair of the structural image. The confidence item initialization is divided into three categories, namely known areas, unknown areas and edge prediction areas; the confidence value for the known area is initialized to 1, the confidence value for the unknown area is initialized to 0, and the confidence value for the area with predicted edges is initialized to 50; the initialization values are as follows: When the block to be repaired contains the predicted edge, the value of its confidence item will be much larger than that of other blocks, so the value of its priority function will also be relatively large, so that the area with the predicted edge will be repaired first, thereby maintaining the structural consistency of the image; The suboptimal matching block repair method of multi-sample block fusion, when searching for matching blocks, only selects the best matching block, that is, the block with the smallest sum of square differences, and then copies the value of the best matching block to the block to be repaired; wherein, the first n blocks with higher matching degrees are selected as candidate blocks according to the square difference and criterion, and then different weights are assigned to these candidate blocks as the final repair result of the block to be repaired; The relative total variation image smoothing model is: Among them, I p represents the input image, S p represents the output structural image, p is the index value of the two-dimensional image pixel, λ is a constant; θ x (p) is the total change in absolute spatial difference of pixel p in the window R(p) along the x direction, θ y (p) is the total change in absolute spatial difference of pixel p in the window R(p) along the y direction, ξ x (p) is the absolute spatial difference inherent change of pixel p in the window R(p) along the x direction, ξ y (p) is the absolute spatial difference inherent change of pixel p in the window R(p) along the y direction, ε is a constant, and: Among them, g p,q is a weighting function defined according to spatial similarity; R(p) is the index of all pixels in a square area centered on p, and g is the Gaussian kernel function: Among them, x p is the horizontal coordinate of point p, x q is the horizontal coordinate of point q, y p is the ordinate of point p, y q is the ordinate of point q; The structural image of the image is obtained by using the relative total variation image smoothing model, and the original image is subtracted from the structural image to obtain the desired texture image; The tensor voting model infers the overall structural characteristics of the model by propagating its own structural differential information to the surroundings and receiving information from neighboring points at the same time. Before performing tensor voting, a non-negative definite second-order symmetric matrix is assigned to each point according to the data information of the points on the two-dimensional image, which is the tensor T of the point: Among them, λ1≥λ2≥0 is the eigenvalue of the tensor, e1 and e2 are its corresponding eigenvectors, A t Represents the transpose of the matrix A; the tensor T consists of the rod tensor components T S and the spherical tensor component T B Composition, of which: Point p i To point p j The stick tensor voting is represented as: in: v j =(I-2rr t )v i In the above formula, v i represents point p i The unit vector of the principal eigenvector of the tensor at j For point p j received from point p i The unit vector of the main eigenvector of the stick tensor voting matrix, r is the point p i Point to point p j The unit vector, -l 2 / σ2 where l is p i and p j The distance between them, σ is the scale parameter that controls the size of the voting area; Point p j The received ball tensor votes are expressed as: in: R=(I-2rr t ) Where I is the input image; After completing the ball tensor voting and stick tensor voting processes, each point in the tensor field extracts the stick tensor and ball tensor information of each point in the tensor field, retains the points whose principal components of the tensor are greater than a certain threshold, and uses them as candidate edge points. The remaining tensors are cleared to zero, and a curve is selected from the edge breakpoint by selecting the local area maximum value as the predicted lost structure information, which is the edge information of the missing area of the structural image to be repaired. The value of n is 2, and the weight ratio is 7:3, where Ψ1 is the best matching block and Ψ2 is the second best matching block, then: P p =0.7*Ψ1+0.3*Ψ2 Among them, P is the sample block to be repaired centered at p.
2. An image restoration system based on texture and structure separation, characterized in that: include: Texture and structure separation module: uses the relative total variation image smoothing model to separate the image to be repaired, and obtains the texture image and structure image of the image to be repaired; Edge prediction module: For structural images, the tensor voting model is used to predict the edge information of the missing area of the structural image to be repaired; Structural image restoration module: Based on the predicted edge information of the missing area, the priority function based on the sample block restoration model is optimized, and then the structural image is restored to obtain the structural restoration result; Texture image restoration module: For texture images, a suboptimal matching block restoration model with multi-sample block fusion is used to repair the texture image and obtain the texture restoration result; Final restoration result acquisition module: combines the structural restoration result obtained by the structural image restoration module and the texture restoration result obtained by the texture image restoration module to finally restore the image; -The sample block-based repair model is: P(p)=C(p)·D(p) Among them, P(p) is the value of the priority function of point p, C(p) is the confidence item of point p, and D(p) is the data item of point p. The optimal matching block search is performed according to the SSD criterion of the sum of squared pixel differences, and the method is as follows: d(Ψ p ,P q )=∑(I(p)-I(q)) 2 In the formula, I(p) and I(q) represent the pixel values of the target block and the matching block respectively. After searching for the best matching block, the pixel values of the corresponding positions of the matching block are copied to the target block. After the filling is completed, the confidence value of the newly filled area is updated, and the update strategy is: Repeat the above process until all the areas to be repaired are filled, thus completing the repair of the structural image. In the above, I is the damaged image to be repaired, Ω is the area to be repaired, Φ is the known area or source area, represents the boundary between the area to be repaired and the known area, p is any point on the boundary, C(q) is the confidence term of point q, that is, the mean confidence value of the block centered at point q, Ψ P is the sample block to be repaired centered on p, Ψ q is the sample block to be repaired centered on q, n p is the normal direction of point p, is the direction of the iso-illuminance line at point p, and α is the normalization parameter; The suboptimal matching block repair model of multi-sample block fusion selects only the best matching block, i.e., the block with the smallest sum of square differences, when searching for matching blocks, based on the sample block repair method, and then copies the value of the best matching block to the block to be repaired; wherein, the first n blocks with higher matching degrees are selected as candidate blocks according to the square difference and criterion, and then different weights are assigned to these candidate blocks as the final repair result of the block to be repaired; The relative total variation image smoothing model is: Among them, I p represents the input image, S p represents the output structural image, p is the index value of the two-dimensional image pixel, λ is a constant; θ x (p) is the total change in absolute spatial difference of pixel p in the window R(p) along the x direction, θ y (p) is the total change in absolute spatial difference of pixel p in the window R(p) along the y direction, ξ x (p) is the absolute spatial difference inherent change of pixel p in the window R(p) along the x direction, ξ y (p) is the absolute spatial difference inherent change of pixel p in the window R(p) along the y direction, ε is a constant, and: Among them, g p,q is a weighting function defined according to spatial similarity; R(p) is the index of all pixels in a square area centered on p, and g is the Gaussian kernel function: Among them, x p is the horizontal coordinate of point p, x q is the horizontal coordinate of point q, y p is the ordinate of point p, y q is the ordinate of point q; The structural image of the image is obtained by using the relative total variation image smoothing model, and the original image is subtracted from the structural image to obtain the desired texture image; The tensor voting model infers the overall structural characteristics of the model by propagating its own structural differential information to the surroundings and receiving information from neighboring points at the same time. Before performing tensor voting, a non-negative definite second-order symmetric matrix is assigned to each point according to the data information of the points on the two-dimensional image, which is the tensor T of the point: Among them, λ1≥λ2≥0 is the eigenvalue of the tensor, e1 and e2 are its corresponding eigenvectors, A t Represents the transpose of the matrix A; the tensor T consists of the rod tensor components T S and the spherical tensor component T B Composition, of which: Point p i To point p j The stick tensor voting is represented as: in: v j =(I-2rr t )v i In the above formula, v i represents point p i The unit vector of the principal eigenvector of the tensor at j For point p j received from point p i The unit vector of the main eigenvector of the stick tensor voting matrix, r is the point p i Point to point p j The unit vector, -l 2 / σ 2 Where l is p i and p j The distance between them, σ is the scale parameter that controls the size of the voting area; Point p j The received ball tensor votes are expressed as: in: R=(I-2rr t ) Where I is the input image; After completing the ball tensor voting and stick tensor voting processes, each point in the tensor field extracts the stick tensor and ball tensor information of each point in the tensor field respectively, retains the points whose principal components of the tensors are greater than a certain threshold, and uses the method of selecting the local area maximum to select a curve from the edge breakpoint as the predicted lost structural information, which is the edge information of the missing area of the structural image to be repaired.
3. A terminal comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor executes the computer program, it can be used to perform the method according to claim 1.
