Content of the invention
The invention aims to solving there is no depth excavation direction present in existing high-definition picture reconfiguration technique
Property texture information problem it is proposed that a kind of high-definition picture reconstructing method based on directional gradient, the method can be deeper
The useful information that degree excavation image is implied is as priori so that the image resolution ratio reconstructing is higher.
The purpose of the present invention is achieved through the following technical solutions:
A kind of high-definition picture reconstructing method based on directional gradient, comprises the following steps:
Step one: obtain input low-resolution imageMain grain direction θ.
Step 11: calculate horizontal gradient and the vertical gradient of low-resolution image i.Horizontal gradient δ1I (i, j)=i (i+
1, j)-i (i, j), i=1 ..., m-1, j=1 ..., n, and δ1The m behavior 0 of i.Vertical gradient δ2I (i, j)=i (i, j+
1)-i (i, j), i=1 ..., m, j=1 ..., n-1, and δ2The n-th of i is classified as 0.
Step 12: for the angle [alpha] of a determination0And length β (integer typically between 2 to 6 for the value of β), calculate
Low-resolution image i is in α0Under direction gradient value.
Low-resolution image i is in α0Under direction gradient value dtv (i) be above formula component sum it may be assumed that
Dtv (i)=∑I, jDi (i, j)
Step 13: determine main grain direction θ of low-resolution image i.Make α0Change from [- π, π], be spaced apart-π/
24 that is to say, that Calculate different α0Corresponding dtv (i) value, and
Find the α corresponding to dtv (i) value of minimum0Value, by this angle value determine based on texture direction θ.
Step 2: using bicubic interpolation method, low-resolution image i is interpolated to the interpolation image i of a panel height dimensionl,
If the image pixel point quantity after interpolation is original k2Times, that is,K value refers to the multiple of increase resolution, one
As round numbers, such as: 4,6,8 etc..
Step 3: the selection of initialization of variable and parameter.
Initializing variableT=0, wherein i=1 ..., km, j=1 ..., kn, xij
WithIt is all the column vector that dimension is 2, (0) represents initial value, and (t) represents the iteration updated value of the t time.
Represent the high-definition picture wanting to obtain.Choose the value of some parameters, including λ, μ, (λ is that error in data bound term is normal to beta, gamma
Number, μ, γ all represent iteration step length, wherein: μ-iteration step length 1, r- iteration step length 2, and β is the parameter in step one, representative be
The length of major axis in ELLIPTIC REVOLUTION coordinate transform), fuzzy operatorP is an odd number, maximum iteration time t, iteration
Stop discriminant value tol, λ according to circumstances depending on, typically select the numerical value between 1-100, μ typically takes 10-3, with step one, γ is general for β
Take 10-3, h typically takes 13 × 13 gaussian random matrix, and maximum iteration time t typically takes 100, tol typically to take 10-4.
Step 4: obtain fuzzy operator matrix fh and conjugate ambiguity operator matrix fhh.
Step 41: initialization matrixFor 0 matrix, by matrixIt is filled into
P row is arrived in the 1st of matrix fh, and the 1st arrives p row, then it is done with fast Fourier transform obtains fuzzy operator matrix fh.
Step 42: first matrix fh is done a conjugate transpose, the non-conjugated transposition that tries again obtains conjugate ambiguity Operator Moment
Battle array fhh.
Step 5: update xijValue.
Step 51: calculateHorizontal gradient and vertical gradient.Horizontal gradient
I=1 ..., km-1, j=1 ..., kn, andKth m behavior 0.Vertical gradient I=1 ..., km, j=1 ..., kn-1, andKth n
It is classified as 0.
Step 52: calculateDirection gradient value under θ (value that step one determines).
Step 53: calculateValue, Wherein sgn
For sign function, that is, as s > 0, sgn (s)=1, as s=0, sgn (s)=0, as s < 0, sgn (s)=- 1.Max is
Take max function .* is the point multiplication operation between vector.
Step 6: update ihValue.
Step 61: step 2 is obtainedIt is filled into one (km+p-1) × (kn+p-1) and tie up 0 matrix
1st arrives km row and 1 arrives kn row, is designated as i 'l.
Step 62: to i 'lDo fast Fourier transform, then put and be multiplied by conjugate ambiguity operator matrix fhh, then this result is done
Inversefouriertransform obtains a matrix, and the middle k m × kn submatrix finally taking out this matrix is designated as γ (il).
Step 63: two dimensions of initialization are the 0 matrix a of km × kn1And a2, and calculate:
Step 64: to matrix a1Carry out following computing:
To matrix a2Carry out following computing:
Step 65: calculate item on the right of system of linear equations,
Step 66: solve following linear operator equation, θ with conjugate gradient method*(θ(ih))+μλυ*(υ(ih))=
Eq_r, the solution obtained isθ, θ*, υ, υ*Represent four kinds of linear operators, they are to matrix ihComputing have as follows
Description,
θ: first to matrix ihThe padding of execution step 61, then fast Fourier transform is carried out to it, then dot product mould
Paste operator matrix fh, finally carries out inversefouriertransform to it.
θ*: to θ (ih) carry out fast Fourier transform, then put and be multiplied by conjugate ambiguity operator matrix fhh, it is carried out instead
Km × kn the submatrix taking out centre after Fourier transformation obtains θ*(θ(ih)).
υ: first to matrix ihAsk horizontal gradient and vertical gradient computing in execution step 51 obtain δ1ihAnd δ2ih,
Operation is weighted to two matrixes and finally gives matrix b1And b2, so υ (ih) result that obtains of computing is two matrixes.
υ*: two dimensions of initialization are the 0 matrix ab of km × kn first1And ab2, and calculate:
Again to matrix ab1In steps performed 64Computing obtainsTo matrix ab2In steps performed 64
Computing obtainsFinally
Step 7: updateValue.
Step 71: calculateDirection gradient value under θ, method is the same with 52 with step 51, finally obtains
Step 72: calculateValue,
Step 8: discriminate whether to restrain.
CalculateBecome 2 norm value after one-dimensional vector, this value is less than or equal to tol or t >=t if judging,
Iteration stopping simultaneously obtains high-definition pictureOtherwise iterationses t increases by 1 and return to step five.
The present invention passes through incoming direction gradient regular terms, preferably represents and excavate implicit direction texture in the picture
Information, thus introducing more valuable prior information for the high-resolution reconstruction problem of morbid state, obtains better high-resolution
Rate image.So the present invention is be applied to reconstruct high-definition picture from the low resolution image have certain orientation texture information
Situation.The method is widely used in the field such as computer vision and image procossing tool.
Specific embodiment
Below in conjunction with the accompanying drawings technical scheme is further described, but is not limited thereto, every to this
Inventive technique scheme is modified or equivalent, without deviating from the spirit and scope of technical solution of the present invention, all should cover
In protection scope of the present invention.
The invention provides a kind of high-definition picture reconstructing method based on directional gradient, as shown in figure 1, include with
Lower step:
Execution step one: obtain the main grain direction of input low resolution 270*270 image (as shown in Figure 2).
Execution step 11: calculate the horizontal gradient δ of this image1I and vertical gradient δ2i;
Execution step 12: order Calculate every respectively
One α0Corresponding direction gradient value:
Dtv (i)=∑I, jDi (i, j);
Execution step 13: find the corresponding α of minimum dtv (i)0Value, is designated as θ.θ=- π/3 in the present example, as Fig. 3 institute
Show.
Execution step two: using bicubic interpolation method, low resolution 270*270 image interpolation is become the high score of 810*810
Resolution image, is designated asAs shown in Figure 4.
Execution step three: initializing variableT=0, wherein i=1 ...,
810, j=1 ..., 810, xijWithIt is all the column vector of 2 dimensions,Represent the high resolution graphics wanting to obtain
Picture.Choose the value of some parameters, including λ=10, μ=10-3, γ=10-3, fuzzy operatorChoose is one
Average is 0, and variance is 1.8 Gaussian matrix.Maximum iteration time t=100, iteration stopping discriminant value tol=10-4.
Execution step four: obtain fuzzy operator matrix fh and conjugate ambiguity operator matrix fhh.
Execution step 41: initialization matrixFor 0 matrix, by matrixIt is filled into square
1 to 13rd row of battle array fh, the 1 to 13rd row, then it is done with fast Fourier transform obtain fuzzy operator matrix fh;
Execution step 42: first matrix fh is done a conjugate transpose, the non-conjugated transposition that tries again obtains conjugate ambiguity and calculates
Submatrix fhh.
Execution step five: update xijValue.
Execution step 51: calculateHorizontal gradient and vertical gradient.Horizontal gradient
I=1 ..., 809, j=1 ..., 810, andThe 810th behavior 0.Vertical gradient I=1 ..., 810, j=1 ..., 809, andThe 810th
It is classified as 0;
Execution step 52: calculateDirection gradient value under θ=- π/3,
Execution step 53: calculateValue,
Wherein sgn is sign function, that is, as s > 0, sgn (s)=1, and as s=0, sgn (s)=0, as s < 0, sgn (s)=-
1.Max is to take max function, and .* is the point multiplication operation between vector.
Execution step six: update ihValue.
Execution step 61: step 2 is obtainedBe filled into one 823 × 823 dimension 0 matrix the 1st is arrived
810 row and 1 to 810 row, are designated as i 'l;
Execution step 62: to i 'lDo fast Fourier transform, then put and be multiplied by conjugate ambiguity operator matrix fhh, then to this knot
Fruit is cooked inversefouriertransform and obtains a matrix, and centre 810 × 810 submatrix finally taking out this matrix is designated as γ (il);
Execution step 63: two dimensions of initialization are 810 × 810 0 matrix a1And a2, and calculate:
Execution step 64: to matrix a1Carry out following computing:
To matrix a2Carry out following computing:
Execution step 65: calculate item on the right of system of linear equations,
Execution step 66: use conjugate gradient method, specifically use the pcg function in matlab software to solve following linear operator
Equation, θ*(θ(ih))+10-2υ*(υ(ih))=eq_r, solve unknown matrix ih, obtain ihThe t+1 time iterative value
Execution step seven: updateValue.
Execution step 71: calculateDirection gradient value under θ=- π/3, method is the same with 52 with step 51, finally
Obtain
Execution step 72: calculateValue,
Execution step eight: calculateBecome 2 norm value after one-dimensional vector, this value is less than or equal to if judging
10-4Or t >=100, iteration stopping simultaneously obtains high-definition picture(as shown in Figure 5), otherwise iterationses t increase by 1 and
Return execution step five.