CN103778604A - Image restoration method based on texture direction - Google Patents

Image restoration method based on texture direction Download PDF

Info

Publication number
CN103778604A
CN103778604A CN201410011250.5A CN201410011250A CN103778604A CN 103778604 A CN103778604 A CN 103778604A CN 201410011250 A CN201410011250 A CN 201410011250A CN 103778604 A CN103778604 A CN 103778604A
Authority
CN
China
Prior art keywords
repaired
pixel
area
image
equation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410011250.5A
Other languages
Chinese (zh)
Inventor
董建锋
张丹
李盼
张大龙
历晓华
许端清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CN201410011250.5A priority Critical patent/CN103778604A/en
Publication of CN103778604A publication Critical patent/CN103778604A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

The invention discloses an image restoration method based on the texture direction. According to the image restoration method, a local texture coordinate system is constructed according to the local texture direction of a region to be restored, an energy functional based on the local texture coordinate system is constructed, the restoration equation of the region to be restored is obtained according to the energy functional, and then the restoration equation is discretized, and the image restoration equation is solved by the use of the Gauss-Seidel iterative method so as to obtain the pixel values of pixels in the region to be restored and complete restoration. According to the image restoration method, an image does not need to be pre-processed in advance and can be directly processed, the texture information and structure information of the region to be restored can be simultaneously restored, the restoration effect is greatly improved, and meanwhile, the amount of calculation is small, the restoration rate is effectively improved, and the restoration time is reduced.

Description

Based on the image repair method of grain direction
Technical field
The present invention relates to Computer Image Processing field, relate in particular to a kind of image repair method based on grain direction.
Background technology
Image repair problem is mainly repaired the part of losing in image or damage, and specifically comprises and repairs incomplete image, the dirt in removal image etc.In computer picture field, the original coordinate system of image is generally initial point take the upper left corner, and level is to the right directions X, is Y-direction straight down.
At present, repair by Texture Synthesis for texture information, use PDE algorithm repair structure information, this two classes algorithm has all been obtained certain breakthrough.But texture information and the structural information of repairing due to need are in itself not identical, so current a lot of algorithms are all difficult to repair texture information and structural information simultaneously.Just particularly, by Texture Synthesis, structural information is repaired to easy generation artificial trace, and use the algorithm of partial differential equation only effective to structural information, seem helpless for the reparation of texture information.The reasonable algorithm of another kind of repairing effect, first the image of need reparation to be analyzed, it is divided into texture information part and structural information part, then these two parts is repaired it with texture reparation algorithm and structure repair algorithm respectively, finally two-part result is merged.By image is carried out to predecomposition, then repair the result of algorithm in conjunction with two classes, the effect of this reparation is better than only using a kind of reparation algorithm (texture is repaired algorithm or structure repair algorithm), and complicated but this algorithm is implemented, the execution efficiency of algorithm is not high yet.
In addition, the reparation based on overall variation (Total Variation, TV) model is classical reparation algorithm, but the algorithm of repairing with many use partial differential equation is the same, poor effect for texture reparation; Reparation algorithm based on OABE (Oriented Anisotropic Brightness Equation) can be repaired simple texture, this algorithm is that the image repair based on partial differential equation is expanded, although this algorithm will be got well but can only repair some simple structural textures (as square mosaic) than TV algorithm, for complicated texture processing poor effect.
Summary of the invention
For the deficiencies in the prior art, the invention provides a kind of image repair method based on grain direction, this image repair method is mainly repaired from texture information and structural information two aspects of image, improve the repairing effect of image, calculated amount is little simultaneously, effectively improve reparation shrinkage, reduced the time of repairing.
Based on an image repair method for grain direction, comprising:
(1) specify the area to be repaired in image to be repaired with mark, and the minimum rectangle of definite area to be repaired covers box;
(2) area to be repaired in image to be repaired is expanded outwardly to several pixels obtain the borderline region of area to be repaired, according to the position of each pixel in borderline region, determine the local grain direction of area to be repaired, be designated as V ρ=(m, n);
(3) cover He center as true origin, with described local grain direction V take minimum rectangle ρand with local grain direction V ρorthogonal vectorial V γfor the positive dirction of coordinate axis, set up the local grain coordinate system of this area to be repaired, wherein V γ=(n, m);
(4) in local grain coordinate system, set up the energy functional formula of this area to be repaired;
(5) according to Euler-Lagrange equation, energy functional formula is carried out to minimization operation, the Euler-Lagrange that obtains area to be repaired is repaired equation;
(6) for each pixel to be repaired in area to be repaired, determine that the pixel that is h/2 with the distance of current pixel to be repaired in local grain coordinate axis is as neighborhood territory pixel point, according to neighborhood territory pixel point, described Euler-Lagrange is repaired to equation and carry out discretize processing, obtain the discrete reparation equation of current pixel to be repaired, h is local grain direction V ρmould;
(7) described discrete reparation equation distortion is simplified and obtained iterative equation;
(8) adopt Gauss-Seidel iteration method to carry out iteration to iterative equation, each iteration obtains a pixel value, when:
| u O ( n ) - u O ( n - 1 ) | ≤ μ
Or
n=N
Time, stop iteration, and the pixel value obtaining using last iteration is as the pixel value of current pixel to be repaired, and with this pixel value, current pixel to be repaired repaired, wherein, μ is the threshold value of setting, N is the maximum iteration time of setting, wherein with
Figure BDA0000455283170000032
be respectively the n time and the pixel value of the current pixel to be repaired that the n-1 time iteration obtains.
The present invention builds local grain coordinate system according to the local grain direction of area to be repaired, set up the energy functional formula based on this local grain coordinate system, can repair texture information and structural information simultaneously, energy functional formula is carried out to minimization operation, and then obtain the reparation equation of this area to be repaired, a continuous problem owing to solving the reparation equation of texture structure, for convenience of calculating, we are first to repairing equation according to the definition of the gradient of equation and divergence and in conjunction with the position relationship between pixel, carry out difference discrete operation to repairing equation, then by Gauss-Seidel iteration method, image repair equation is solved.
Image repair method based on grain direction of the present invention is applicable to the image repair of the small area structure texture disappearance of arbitrary shape.This image repair method not only can be repaired the texture information of image and can repair structural information, and does not need in advance image to be carried out to resolution process, thereby this algorithm is higher to the remediation efficiency of local structural texture.The image of the small area structure texture disappearance of new algorithm of the present invention to arbitrary shape is all very effective simultaneously, and this algorithm can guarantee to repair preferably border equally, avoids artificial trace.
In described step (1), the area to be repaired in image to be repaired being expanded outwardly to several pixels obtains borderline region and does not comprise the borderline pixel in area to be repaired, the pixel only obtaining for extension, the pixel number expanding outwardly is determined according to the size of area to be repaired.Area to be repaired is less, and the pixel number expanding outwardly is larger, and the reparation precision obtaining is higher, can reduce reparation speed when simultaneously.As preferably, 3~6 pixels that expand outwardly.
Described step is determined local grain direction by following steps in (2):
(2-1) for any two pixels in borderline region, if:
|(x 1,y 1)-(x 2,y 2)|<ε,
And vector (x 2-x 1, y 2-y 1) meet MAD condition, by vector (x 2-x 1, y 2-y 1) as candidate direction vector, and the vector set using all candidate direction vectors as candidate direction, wherein, (x 1, y 1) and (x 2, y 2) being respectively the coordinate of any two pixels in borderline region, ε is the threshold value of setting;
(2-2) set of candidate direction vector is made to absolute difference function:
&sigma; = 1 | Q | &Sigma; ( i , j ) &Element; Q ( i &prime; , j &prime; ) &Element; &Omega; \ D Abs ( P ( i , j ) - P ( i &prime; , j &prime; ) )
Get the candidate direction vector of minimum value as the local grain direction vector of this area to be repaired, be designated as V ρ=(m, n), wherein,
Wherein, σ is absolute difference function,
D represents the area to be repaired in image to be repaired,
Ω represents whole image-region, Ω D represent to remove in image to be repaired region outside the D of area to be repaired,
Q is the set of the pixel of a pixel of extension on the border of area to be repaired D, | Q| represents the number of the pixel of gathering Q,
Abs () represents to ask the function of absolute value,
P (i, j) represents the pixel value of any one pixel of set Q,
P (i ', j ') represent region Ω in D coordinate be the pixel value of the pixel of (i ', j '), and:
As (i+x t, j+y t) ∈ Ω when D, (i ', j ')=(i+x t, j+y t),
As (i-x t, j-y t) ∈ Ω when D, (i ', j ')=(i-x t, j-y t),
(x t, y t) be any one the candidate direction vector in the set of candidate direction vector.
The threshold epsilon of setting in described step (2-1) is 5~20.The local grain direction obtaining in the present invention is approximate grain direction, and ε represents two distances between pixel, and setting value is less, the local grain direction obtaining approaches actual grain direction, considers reparation speed simultaneously, and the scope of setting in the present invention is 5~20, as preferably, ε is 8.
In described step (2-1), the threshold value of MAD condition is 10~30, if this threshold value is too large, the approximate local grain direction finally obtaining that can make and real grain direction differ too large.
The energy functional formula that described step (4) obtains is as follows:
J &lambda; t [ u ] = &Integral; G &cup; D | &dtri; u | d&rho;d&gamma; + &lambda; 2 &Integral; G | u - u 0 | 2 d&rho;d&gamma; ,
Wherein,
Figure BDA0000455283170000043
represent energy functional formula,
G is the borderline region of area to be repaired,
D is the area to be repaired of repairing in image,
G ∪ D is the combination of area to be repaired and borderline region,
ρ, γ represents respectively horizontal ordinate and the ordinate of local grain coordinate system,
U is the pixel value of any one pixel to be repaired in area to be repaired, u 0for original pixel values corresponding to this pixel to be repaired,
for the gradient of any one pixel to be repaired in area to be repaired,
λ is constant.
All there is an original pixel values in each pixel to be repaired, can be directly from Image Acquisition to be repaired, and the pixel value of pixel to be repaired is unknown quantity.λ is constant, rule of thumb sets λ=15 in the present invention.
It is as follows that the Euler-Lagrange of described area to be repaired is repaired equation:
- &dtri; &CenterDot; ( &dtri; u | &dtri; u | ) + &gamma; ( u - u 0 ) = 0 ,
Wherein,
Figure BDA0000455283170000052
for asking divergence symbol.
Figure BDA0000455283170000053
for the divergence of the content in bracket under local coordinate system, this reparation equation is applicable to all pixels in area to be repaired.
In described step (6), the discrete reparation equation of current pixel to be repaired is as follows:
&Sigma; P &Element; &Lambda; 1 | &dtri; u p | ( u 0 - u p ) + &gamma; ( u O - u O 0 ) = 0 ,
Wherein, Λ represents the set of neighborhood territory pixel point,
P is any one neighborhood territory pixel point,
O is current pixel to be repaired,
U ofor the pixel value of current pixel O to be repaired,
Figure BDA0000455283170000059
for the original pixel values of current pixel O to be repaired,
U pfor the pixel value of neighborhood territory pixel point P,
Figure BDA00004552831700000510
for the gradient of neighborhood territory pixel point P point under local grain coordinate system.
Comprising the following steps of difference discrete processing in described step (6):
(6-1) Euler to current pixel to be repaired-Lagrange is repaired the divergence of equation and is carried out discretize operation, order:
&dtri; &CenterDot; &upsi; = &PartialD; &upsi; 1 &PartialD; &rho; + &PartialD; &upsi; 2 &PartialD; &gamma; &ap; &upsi; r 1 - &upsi; l 1 h + &upsi; u 2 - &upsi; d 2 h ,
Wherein,
Figure BDA0000455283170000056
represent vector v to ask divergence,
Figure BDA0000455283170000057
U, d, l, r is respectively neighbours territory pixel, and corresponding coordinate is respectively: (x+n/2, y-m/2), (x-n/2, y+m/2), (x-m/2, y-n/2), (x+m/2, y+n/2),
Figure BDA0000455283170000061
be illustrated respectively in r, the component value of (X direction in local grain coordinate system) in first dimension of l neighborhood territory pixel point vector,
Figure BDA0000455283170000062
be illustrated respectively in u, the component value of (X direction in local grain coordinate system) in second dimension of d neighborhood territory pixel point vector;
(6-2) according to formula:
v r 1 = 1 | &dtri; u r | u R - u O h
Calculate
Figure BDA0000455283170000064
wherein:
| &dtri; u r | &ap; { ( u R - u O h ) 2 + [ 1 2 ( u RU - u RD 2 h + u U - u D 2 h ) ] 2 } 1 / 2 ,
According to formula:
v l 1 = 1 | &dtri; u l | u L - u O h
Calculate
Figure BDA0000455283170000067
wherein:
| &dtri; u l | &ap; { ( u L - u O h ) 2 + [ 1 2 ( u LU - u LD 2 h + u U - u D 2 h ) ] 2 } 1 / 2 ,
According to formula:
v u 2 = 1 | &dtri; u u | u U - u O h
Calculate
Figure BDA00004552831700000610
wherein:
| &dtri; u u | &ap; { ( u U - u O h ) 2 + [ 1 2 ( u UR - u UL 2 h + u R - u L 2 h ) ] 2 } 1 / 2 ,
According to formula:
v d 2 = 1 | &dtri; u d | u D - u O h
Calculate
Figure BDA00004552831700000613
wherein:
| &dtri; u d | &ap; { ( u D - u O h ) 2 + [ 1 2 ( u DR - u DL 2 h + u R - u L 2 h ) ] 2 } 1 / 2 ,
The coordinate of U, D, L, R, LU, LD, RU and RD is respectively: (x+n, y-m), (x-n, y+m), (x-m, y-n), (x+m, y+n), (x-m+n, y-m-n), (x-m-n, y+m-n), (x+m+n, y-m+n) and (x+m-n, y+m+n),
U tfor the pixel value of pixel t, wherein t is u, d, l, r, U, D, L, R, LU, LD, RU and RD;
(6-3) above each public affairs successively substitution Euler-Lagrange repaired to equation obtain the discrete reparation equation of current pixel to be repaired.
Iterative equation in described step (7) is as follows:
u O = &Sigma; P &Element; &Delta; h OP u p + h OO u O 0 ,
Wherein, w p = 1 / | &dtri; u p | , h OP = w p / ( &Sigma; P &Element; &Lambda; w p + &lambda; ) , &lambda; / ( &Sigma; P &Element; &Lambda; w p + &lambda; ) = h OO .
Can obtain according to iterative equation the pixel value that the n time iteration obtains
Figure BDA0000455283170000072
for:
u O ( n ) = &Sigma; P &Element; &Lambda; h OP ( n - 1 ) u P ( n - 1 ) + h OO ( n - 1 ) u O ( n - 1 )
Wherein,
Figure BDA0000455283170000074
it is the pixel value that the n-1 time iteration obtains.
The threshold value μ setting in described step (8) is 1~5, selects less threshold value to obtain repairing preferably result.If the threshold value arranging is larger, although can improve the speed of algorithm, last repairing effect reduces greatly.
The maximum iteration time N setting in described step (8) is 50~150, sets maximum iteration time and is for fear of the poor absolute value of result of adjacent twice iteration after iteration many times to be still greater than threshold value μ, thus the speed of the algorithm reducing.
In the present invention, be not specifically noted, the position coordinates of all vector sum pixels is the value under original coordinate system.
Compared with prior art, advantage of the present invention is as follows:
(a) the present invention does not need in advance image to anticipate work, can directly process image, not only can repair the texture information of image but also the structural information that can repair image, has shortened widely the time loss of algorithm;
(b) image of the small area structure texture disappearance of algorithm of the present invention to arbitrary shape is all effective, and versatility is high, and this algorithm can guarantee good repairing effect simultaneously, avoids artificial trace;
(c) algorithm of the present invention can automanually be repaired image, only given image-region and the initial parameter (threshold value) that needs reparation, and the enforcement of algorithm is simple and convenient.
Embodiment
Based on an image repair method for grain direction, comprise the following steps:
(1) specify the area to be repaired in image to be repaired with mark, and the minimum rectangle of definite area to be repaired covers box;
(2) area to be repaired in image to be repaired is expanded outwardly to several (being 3 pixels in the present embodiment) pixels and obtain the borderline region of area to be repaired, according to the position of each pixel in borderline region, the local grain direction of determining area to be repaired, comprises the following steps:
Described step is determined local grain direction by following steps in (2):
(2-1) for any two pixels in borderline region, if:
|(x 1,y 1)-(x 2,y 2)|<ε, (1)
And vector (x 2-x 1, y 2-y 1) meet MAD condition, by vector (x 2-x 1, y 2-y 1) as candidate direction vector, and the vector set using all candidate direction vectors as candidate direction, be designated as T, wherein, (x 1, y 1) and (x 2, y 2) being respectively the coordinate of any two pixels in borderline region, ε is the threshold value (ε=8 in the present embodiment) of setting;
(2-2) will in candidate direction vector set T, make absolute difference function:
&sigma; = 1 | Q | &Sigma; ( i , j ) &Element; Q ( i &prime; , j &prime; ) &Element; &Omega; \ D Abs ( P ( i , j ) - P ( i &prime; , j &prime; ) ) - - - ( 2 )
Get the local grain direction vector of minimum candidate direction vector as this area to be repaired, be designated as V ρ=(m, n), wherein,
Wherein, σ is absolute difference function,
D represents the area to be repaired in image to be repaired,
Ω represents whole image-region, Ω D represent to remove in image to be repaired region outside the D of area to be repaired,
Q is the set of the pixel of a pixel of extension on the border of area to be repaired D, | Q| represents the number of the pixel of gathering Q,
Abs () represents to ask the function of absolute value,
P (i, j) represents the pixel value of any one pixel of set Q,
P (i ', j ') represent region Ω in D coordinate be the pixel value of the pixel of (i ', j '), and:
As (i+x t, j+y t) ∈ Ω when D, (i ', j ')=(i+x t, j+y t);
As (i-x t, j-y t) ∈ Ω when D, (i ', j ')=(i-x t, j-y t),
(x t, y t) be any one candidate direction vector in candidate direction vector set T.
Wherein, if vector (x 2-x 1, y 2-y 1) meet following condition:
Figure BDA0000455283170000091
, vector (x 2-x 1, y 2-y 1) meet MAD (Mean Absolute Difference) condition, wherein,
S={(Δx,Δy)|Δx∈[-1,1],Δy[-1,1],(x 1+Δx,y 1+Δy),(x 2+Δx,y 2+Δy)∈Ω\D},
| S| represents element number in S;
Figure BDA0000455283170000094
represent to think that the MAD condition threshold value of setting is (in the present embodiment );
Δ x, Δ y represents respectively the side-play amount of horizontal direction and vertical direction, and is integer;
X 1, x 2, y 1, y 2horizontal ordinate and the ordinate of pixel in presentation video respectively.
(3) cover He center as true origin, with the local grain direction V of this area to be repaired take minimum rectangle ρand with local grain direction V ρorthogonal vector V γfor the direction of coordinate axis, set up the local grain coordinate system of this area to be repaired, wherein V γ=(n, m);
(4) in local grain coordinate system, set up the energy functional formula of this area to be repaired:
J &lambda; t [ u ] = &Integral; G &cup; D | &dtri; u | d&rho;d&gamma; + &lambda; 2 &Integral; G | u - u 0 | 2 d&rho;d&gamma; , - - - ( 4 )
Figure BDA0000455283170000093
represent energy functional formula,
G is the borderline region of area to be repaired,
D is the area to be repaired of repairing in image,
G ∪ D is the combination of area to be repaired and borderline region,
ρ, γ represents respectively horizontal ordinate and the ordinate of local grain coordinate system,
U is that the pixel value of any one pixel to be repaired in area to be repaired (is unknown quantity, needs
The desired value solving), u 0for original pixel values corresponding to this pixel to be repaired,
for the gradient of any one pixel to be repaired in area to be repaired,
λ is constant (λ=15 in the present embodiment);
(5) according to Euler-Lagrange equation, energy functional formula is carried out to minimization operation, when this energy functional minimalization, meets equation:
- &dtri; &CenterDot; ( &dtri; u | &dtri; u | ) + &lambda; ( u - u 0 ) = 0 , - - - ( 5 )
This equation is the Euler-Lagrange of area to be repaired and repairs equation,
Wherein,
Figure BDA0000455283170000102
for ask divergence symbol (
Figure BDA0000455283170000103
for the divergence of the content in bracket under local coordinate system);
(6), for each pixel to be repaired in area to be repaired, determine that the pixel that is h/2 along the distance of local grain change in coordinate axis direction and current pixel to be repaired is as neighbours territory pixel, the discrete reparation equation of pixel to be repaired:
&Sigma; P &Element; &Lambda; 1 | &dtri; u p | ( u 0 - u p ) + &lambda; ( u O - u O 0 ) = 0 , - - - ( 6 )
Wherein, h is local grain direction V ρmould,
Λ represents the set of neighborhood territory pixel point,
P is any one neighborhood territory pixel point,
O is current pixel to be repaired.
U ofor the pixel value (being unknown quantity, the desired value that need to solve) of current pixel O to be repaired,
Figure BDA0000455283170000105
for the original pixel values of current pixel O to be repaired,
U pfor the pixel value of neighborhood territory pixel point P,
Figure BDA00004552831700001010
for the gradient of neighborhood territory pixel point P point under local grain coordinate system, the comprising the following steps of difference discrete processing:
(6-1) Euler to current pixel to be repaired-Lagrange is repaired the divergence of equation and is carried out discretize operation, order:
&dtri; &CenterDot; v = &PartialD; v 1 &PartialD; &rho; + &PartialD; v 2 &PartialD; &gamma; &ap; v r 1 - v l 1 h + v u 2 - v d 2 h , - - - ( 7 )
Wherein, represent vector v to ask divergence,
v = ( v 1 , v 2 ) = &dtri; u | &dtri; u | ,
U, d, l, r is respectively neighbours territory pixel, and corresponding coordinate is respectively: (x+n/2, y-m/2), (x-n/2, y+m/2), (x-m/2, y-n/2), (x+m/2, y+n/2),
Figure BDA00004552831700001112
be illustrated respectively in r, the component value in first dimension of l neighborhood territory pixel point vector,
Figure BDA00004552831700001113
be illustrated respectively in u, the component value in second dimension of d neighborhood territory pixel point vector;
(6-2) according to formula:
v r 1 = 1 | &dtri; u r | u R - u O h - - - ( 8 )
Calculate
Figure BDA00004552831700001114
wherein:
| &dtri; u r | &ap; { ( u R - u O h ) 2 + [ 1 2 ( u RU - u RD 2 h + u U - u D 2 h ) ] 2 } 1 / 2 , - - - ( 9 )
According to formula:
v l 1 = 1 | &dtri; u l | u L - u O h - - - ( 10 )
Calculate wherein:
| &dtri; u l | &ap; { ( u L - u O h ) 2 + [ 1 2 ( u LU - u LD 2 h + u U - u D 2 h ) ] 2 } 1 / 2 , - - - ( 11 )
According to formula:
v u 2 = 1 | &dtri; u u | u U - u O h - - - ( 12 )
Calculate
Figure BDA0000455283170000117
wherein:
| &dtri; u u | &ap; { ( u U - u O h ) 2 + [ 1 2 ( u UR - u UL 2 h + u R - u L 2 h ) ] 2 } 1 / 2 , - - - ( 13 )
According to formula:
v d 1 = 1 | &dtri; u d | u D - u O h - - - ( 14 )
Calculate wherein:
| &dtri; u d | &ap; { ( u D - u O h ) 2 + [ 1 2 ( u DR - u DL 2 h + u R - u L 2 h ) ] 2 } 1 / 2 , - - - ( 15 )
The coordinate of U, D, L, R, LU, LD, RU and RD is respectively: (x+n, y-m), (x-n, y+m), (x-m, y-n), (x+m, y+n), (x-m+n, y-m-n), (x-m-n, y+m-n), (x+m+n, and (x+m-n, y+m+n) y-m+n)
U tfor the pixel value of pixel t, wherein t is u, d, l, r, U, D, L, R, LU, LD, RU and RD;
(6-3) formula (7)~formula (15) substitution formula (5) is obtained to the discrete reparation equation (being formula (6)) of current pixel to be repaired.
(7) order:
1 / | &dtri; u p | = w p w p / ( &Sigma; P &Element; &Lambda; w p + &lambda; ) = h OP &lambda; / ( &Sigma; P &Element; &Lambda; w p + &lambda; ) = h OO , - - - ( 16 )
By in formula (16) substitution formula (6), obtain iterative equation:
u O = &Sigma; P &Element; &Lambda; h OP u p + h OO u O 0 ; - - - ( 17 )
(8) setting maximum iteration time is N, adopts Gauss-Seidel iteration method to carry out iteration to iterative equation, and each iteration obtains a pixel value, the pixel value that wherein the n time iteration obtains
Figure BDA0000455283170000126
for:
u O ( n ) = &Sigma; P &Element; &Lambda; h OP ( n - 1 ) u P ( n - 1 ) + h OO ( n - 1 ) u O ( n - 1 ) , - - - ( 18 )
Wherein,
Figure BDA0000455283170000124
be the pixel value that the n-1 time iteration obtains, when:
| u O ( n ) - u O ( n - 1 ) | &le; &mu;
Or
n=N
Time, stop iteration, and the pixel value obtaining using last iteration is as the pixel value of current pixel O to be repaired, and with this pixel value, current pixel to be repaired repaired to (μ=4 in the present embodiment, N=100).

Claims (10)

1. the image repair method based on grain direction, is characterized in that, comprising:
(1) specify the area to be repaired in image to be repaired with mark, and the minimum rectangle of definite area to be repaired covers box;
(2) area to be repaired in image to be repaired is expanded outwardly to several pixels obtain the borderline region of area to be repaired, according to the position of each pixel in borderline region, determine the local grain direction of area to be repaired, be designated as V ρ=(m, n);
(3) cover He center as true origin, with described local grain direction V take minimum rectangle ρand with local grain direction V ρorthogonal vectorial V γfor the positive dirction of coordinate axis, set up the local grain coordinate system of this area to be repaired, wherein V γ=(n, m);
(4) in local grain coordinate system, set up the energy functional formula of this area to be repaired;
(5) according to Euler-Lagrange equation, energy functional formula is carried out to minimization operation, the Euler-Lagrange that obtains area to be repaired is repaired equation;
(6) for each pixel to be repaired in area to be repaired, determine that the pixel that is h/2 with the distance of current pixel to be repaired in local grain coordinate axis is as neighborhood territory pixel point, according to neighborhood territory pixel point, described Euler-Lagrange is repaired to equation and carry out discretize processing, obtain the discrete reparation equation of current pixel to be repaired, h is local grain direction V ρmould;
(7) described discrete reparation equation distortion is simplified and obtained iterative equation;
(8) adopt Gauss-Seidel iteration method to carry out iteration to iterative equation, each iteration obtains a pixel value, when:
| u O ( n ) - u O ( n - 1 ) | &le; &mu;
Or
n=N
Time, stop iteration, and the pixel value obtaining using last iteration is as the pixel value of current pixel to be repaired, and with this pixel value, current pixel to be repaired repaired, wherein, μ is the threshold value of setting, N is the maximum iteration time of setting, wherein
Figure FDA0000455283160000012
with be respectively the n time and the pixel value of the current pixel to be repaired that the n-1 time iteration obtains.
2. the image repair method based on grain direction as claimed in claim 1, is characterized in that, described step is determined local grain direction by following steps in (2):
(2-1) for any two pixels in borderline region, if:
|(x 1,y 1)-(x 2,y 2)|<ε,
And vector (x 2-x 1, y 2-y 1) meet MAD condition, by vector (x 2-x 1, y 2-y 1) as candidate direction vector, and the vector set using all candidate direction vectors as candidate direction, wherein, (x 1, y 1) and (x 2, y 2) being respectively the coordinate of any two pixels in borderline region, ε is the threshold value of setting;
(2-2) set of candidate direction vector is made to absolute difference function:
&sigma; = 1 | Q | &Sigma; ( i , j ) &Element; Q ( i &prime; , j &prime; ) &Element; &Omega; \ D Abs ( P ( i , j ) - P ( i &prime; , j &prime; ) )
Get the candidate direction vector of minimum value as the local grain direction vector of this area to be repaired, be designated as V ρ=(m, n), wherein,
Wherein, σ is absolute difference function,
D represents the area to be repaired in image to be repaired,
Ω represents whole image-region, Ω D represent to remove in image to be repaired region outside the D of area to be repaired,
Q is the set of the pixel of a pixel of extension on the border of area to be repaired D, | Q| represents the number of the pixel of gathering Q,
Abs () represents to ask the function of absolute value,
P (i, j) represents the pixel value of any one pixel of set Q,
P (i ', j ') represent region Ω in D coordinate be the pixel value of the pixel of (i ', j '), and:
As (i+x t, j+y t) ∈ Ω D, (i ', j ')=(i+x t, j+y t),
As (i-x t, j-y t) ∈ Ω D, (i ', j ')=(i-x t, j-y t),
(x t, y t) be any one the candidate direction vector in the set of candidate direction vector.
3. the image repair method based on grain direction as claimed in claim 2, is characterized in that, the threshold epsilon of setting in described step (2-1) is 5~20.
4. the image repair method based on grain direction as claimed in claim 3, is characterized in that, in described step (2-1), the threshold value of MAD condition is 10~30.
5. the image repair method based on grain direction as claimed in claim 4, is characterized in that, the energy functional formula that described step (4) obtains is as follows:
J &lambda; t [ u ] = &Integral; G &cup; D | &dtri; u | d&rho;d&gamma; + &lambda; 2 &Integral; G | u - u 0 | 2 d&rho;d&gamma; ,
Wherein,
Figure FDA0000455283160000032
represent energy functional formula,
G is the borderline region of area to be repaired,
D is the area to be repaired of repairing in image,
G ∪ D is the combination of area to be repaired and borderline region,
Figure FDA0000455283160000036
for the gradient of any one pixel to be repaired in area to be repaired,
ρ, γ represents respectively horizontal ordinate and the ordinate of local grain coordinate system,
U is the pixel value of any one pixel to be repaired in area to be repaired, u 0for this picture to be repaired
The original pixel values that vegetarian refreshments is corresponding,
λ is constant.
6. the image repair method based on grain direction as claimed in claim 5, is characterized in that, it is as follows that the Euler-Lagrange of described area to be repaired is repaired equation:
- &dtri; &CenterDot; ( &dtri; u | &dtri; u | ) + &gamma; ( u - u 0 ) = 0 ,
Wherein,
Figure FDA0000455283160000037
for asking divergence symbol.
7. the image repair method based on grain direction as claimed in claim 6, is characterized in that, in described step (6), the discrete reparation equation of current pixel to be repaired is as follows:
&Sigma; P &Element; &Lambda; 1 | &dtri; u p | ( u 0 - u p ) + &gamma; ( u O - u O 0 ) = 0 ,
Wherein, the set that Λ is neighborhood territory pixel point,
P is any one neighborhood territory pixel point,
O is current pixel to be repaired,
U ofor the pixel value of current pixel O to be repaired, for the original pixel values of current pixel O to be repaired,
U pfor the pixel value of neighborhood territory pixel point P,
Figure FDA0000455283160000038
for the gradient of neighborhood territory pixel point P point under local grain coordinate system.
8. the image repair method based on grain direction as claimed in claim 7, is characterized in that, the iterative equation in described step (7) is as follows:
u O = &Sigma; P &Element; &Lambda; h OP u p + h OO u O 0 ,
Wherein, w p = 1 / | &dtri; u p | , h OP = w p / ( &Sigma; P &Element; &Lambda; w p + &lambda; ) , &lambda; / ( &Sigma; P &Element; &Lambda; w p + &lambda; ) = h OO .
The pixel value that wherein the n time iteration obtains
Figure FDA0000455283160000042
for:
u O ( n ) = &Sigma; P &Element; &Lambda; h OP ( n - 1 ) u P ( n - 1 ) + h OO ( n - 1 ) u O ( n - 1 )
Wherein,
Figure FDA0000455283160000044
it is the pixel value that the n-1 time iteration obtains.
9. the image repair method based on grain direction as claimed in claim 8, is characterized in that, the threshold value μ setting in described step (8) is 1~5.
10. the image repair method based on grain direction as claimed in claim 9, is characterized in that, the maximum iteration time N setting in described step (8) is 50~150.
CN201410011250.5A 2014-01-10 2014-01-10 Image restoration method based on texture direction Pending CN103778604A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410011250.5A CN103778604A (en) 2014-01-10 2014-01-10 Image restoration method based on texture direction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410011250.5A CN103778604A (en) 2014-01-10 2014-01-10 Image restoration method based on texture direction

Publications (1)

Publication Number Publication Date
CN103778604A true CN103778604A (en) 2014-05-07

Family

ID=50570803

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410011250.5A Pending CN103778604A (en) 2014-01-10 2014-01-10 Image restoration method based on texture direction

Country Status (1)

Country Link
CN (1) CN103778604A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104484866A (en) * 2014-12-15 2015-04-01 天津大学 Image inpainting method based on rotation and scale space expansion
CN114418902A (en) * 2022-03-31 2022-04-29 深圳市华汉伟业科技有限公司 Image restoration method and computer-readable storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101777178A (en) * 2010-01-28 2010-07-14 南京大学 Image restoring method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101777178A (en) * 2010-01-28 2010-07-14 南京大学 Image restoring method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YAN NIU ET AL: "Using an oriented PDE to repair image textures", 《VARIATIONAL,GEOMETRIC, AND LEVEL SET METHODS IN COMPUTER VISION》, 16 October 2005 (2005-10-16) *
陈雨: "基于偏微分方程的图像结构纹理修复方法", 《中国优秀硕士学位论文全文数据库基础科学辑》, 15 August 2008 (2008-08-15), pages 31 - 40 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104484866A (en) * 2014-12-15 2015-04-01 天津大学 Image inpainting method based on rotation and scale space expansion
CN114418902A (en) * 2022-03-31 2022-04-29 深圳市华汉伟业科技有限公司 Image restoration method and computer-readable storage medium
CN114418902B (en) * 2022-03-31 2022-07-08 深圳市华汉伟业科技有限公司 Image restoration method and computer-readable storage medium

Similar Documents

Publication Publication Date Title
CN108010081B (en) RGB-D visual odometer method based on Census transformation and local graph optimization
CN101742122B (en) Method and system for removing video jitter
CN102999887B (en) Sample based image repairing method
CN104751465A (en) ORB (oriented brief) image feature registration method based on LK (Lucas-Kanade) optical flow constraint
CN103106688A (en) Indoor three-dimensional scene rebuilding method based on double-layer rectification method
CN104463871A (en) Streetscape facet extraction and optimization method based on vehicle-mounted LiDAR point cloud data
CN105447828B (en) The one-view image deblurring method of one-dimensional deconvolution is carried out along motion blur path
CN105005964A (en) Video sequence image based method for rapidly generating panorama of geographic scene
CN104517317A (en) Three-dimensional reconstruction method of vehicle-borne infrared images
CN111028292A (en) Sub-pixel level image matching navigation positioning method
CN103971338A (en) Variable-block image repair method based on saliency map
CN107862674B (en) Depth image fusion method and system
CN103841298A (en) Video image stabilization method based on color constant and geometry invariant features
CN105761236A (en) Image preprocessing method and apparatus for image registering
CN110807459A (en) License plate correction method and device and readable storage medium
CN103903256A (en) Depth estimation method based on relative height-depth clue
CN108021857B (en) Building detection method based on unmanned aerial vehicle aerial image sequence depth recovery
CN104134195A (en) Image restoration method based on geometric sparsity of blocks
CN105678791A (en) Lane line detection and tracking method based on parameter non-uniqueness property
CN103942756A (en) Post-processing filtering method for depth map
CN103514587B (en) Ship-based image-stabilizing method based on sea-sky boundary detecting
CN103700082A (en) Image splicing method based on dual quaterion relative orientation
CN103778604A (en) Image restoration method based on texture direction
CN102324043B (en) Image matching method based on DCT (Discrete Cosine Transformation) through feature description operator and optimization space quantization
CN104778673A (en) Improved depth image enhancing algorithm based on Gaussian mixed model

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20140507