Summary of the invention
It is an object of the invention to provide a kind of image processing method eliminating ghost and system, to solve in prior art
The problem that image on planar detector exists ghost.
In order to achieve the above object, this invention takes techniques below scheme:
A kind of image processing method eliminating ghost, wherein, said method comprising the steps of:
A1, gather reference picture according to predetermined time of exposure;
A2, reference picture is carried out noise reduction process, the reference picture after noise reduction is transformed to gradient field, obtains reference picture
Gradient field;
A3, gather target image according to predetermined time of exposure;
A4, target image is carried out noise reduction process, the target image after noise reduction is transformed to gradient field, obtains target image
Gradient field;
A5, reference picture gradient field and target image gradient field are carried out calculus of differences, obtain final image gradient field;
A6, according to described final image gradient field obtain final image.
The described image processing method eliminating ghost, wherein, carries out noise reduction process to reference picture in described step A2
Time, its concrete grammar is as follows:
Wherein, (m, n) is pixel pending on reference picture to I ', and (i is j) that (m, n) in surrounding 5 × 5 neighborhoods for I ' to I
Pixel, m, n, i and j are natural number.
The described image processing method eliminating ghost, wherein, converts the reference picture after noise reduction in described step A2
To reference picture gradient field, use following algorithm:
(m is n) that in reference picture gradient field, (m, n) Grad of pixel, by the Grad of all pixels to described G
Insert respective position successively and just constitute reference picture gradient field.
The method of the described ghost eliminating target image, wherein, becomes the reference picture after noise reduction in described step A2
Change to reference picture gradient field, use following algorithm:
G (m, n)=| I (m, n)-I (m-1, n) |+| I (m, n)-I (m, n-1) |;
(m is n) that in reference picture gradient field, (m, n) Grad of pixel, by the Grad of all pixels to described G
Insert respective position successively and just constitute reference picture gradient field.
The described image processing method eliminating ghost, wherein, carries out noise reduction process to target image in described step A4
Time, use following wave filter:
Wherein,
σsIt is similarity distribution standard deviation, σdIt is that spatial spread standard is poor;I ' (m, n) is pending pixel, I ' (i,
J) it is the pixel in 5 × 5 neighborhoods about;M, n, i and j are natural number.
The described image processing method eliminating ghost, wherein, to reference picture gradient field and target in described step A5
Before image gradient domain carries out calculus of differences, reference picture being carried out linear transformation, its formula is as follows:
Linear transformation reference picture gradient field=A × reference picture gradient field+B;
Wherein, the interval of A is [0.5,1.5], and the interval of B is [-0.2 reference picture gradient field, 0.2 reference
Image gradient domain].
The described image processing method eliminating ghost, wherein, described step A6 obtains according to described final image gradient field
Taking final image is to be obtained final image by method of least square coupling by final image gradient field.
A kind of image processing system eliminating ghost, wherein, described system includes:
Reference picture acquisition module, for gathering a sub-picture as reference picture according to predetermined time of exposure;
Reference picture processing module, for reference picture is carried out noise reduction process, the reference picture after noise reduction is transformed to
Gradient field, obtains reference picture gradient field;
Target image acquisition module, for gathering target image according to predetermined time of exposure;
Target image processing module, for target image is carried out noise reduction process, the target image after noise reduction is transformed to
Gradient field, obtains target image gradient field;
Difference block, for reference picture gradient field and target image gradient field are done difference, obtain final image gradient field;
Final image acquisition module, for according to described final image gradient field obtain final image.
Beneficial effect:
Flat board ghost is reduced or eliminated, makes image apparent, be more favorable for doctor and observe, reduce mistaken diagnosis, meanwhile, with existing
The hardware solution of technology is compared, and cost is lower, disposes more flexible, has broader market application foreground.
Detailed description of the invention
For making the purpose of the present invention, technical scheme and effect clearer, clear and definite, referring to the drawings and give an actual example to this
Invention further describes.
Referring to Fig. 1, it is the flow chart of image processing method eliminating ghost of the present invention, as it can be seen, described side
Method comprises the following steps:
S1, gather reference picture according to predetermined time of exposure;
S2, reference picture is carried out noise reduction process, the reference picture after noise reduction is transformed to gradient field, obtains reference picture
Gradient field;
S3, gather target image according to predetermined time of exposure;
S4, target image is carried out noise reduction process, the target image after noise reduction is transformed to gradient field, obtains target image
Gradient field;
S5, reference picture gradient field and target image gradient field are carried out calculus of differences, obtain final image gradient field;
S6, according to described final image gradient field obtain final image.
It is described in detail for above-mentioned steps separately below:
Described step S1 is to gather a sub-picture as reference picture, particularly, such as according to predetermined time of exposure
When medical diagnosis, a time of exposure can be determined according to diagnosis requirement, it is set to predetermined time of exposure, according to upper
State predetermined time of exposure, in the case of without exposure, gather a sub-picture as reference picture.
Reference picture after noise reduction, for reference picture is carried out noise reduction process, is transformed to gradient field by described step S2,
To reference picture gradient field.Owing to, in black white image, the profile of object is main information, therefore the image after denoising is converted
To gradient field, the body feature that can retain image is greatly reduced amount of calculation simultaneously.In the present embodiment, to ginseng in described step S2
Examining image when carrying out noise reduction process, use holding edge filter device, its concrete grammar is as follows:
Wherein, (m, n) is pixel pending on reference picture to I ', and (i is j) that (m, n) in surrounding 5 × 5 neighborhoods for I ' to I '
Pixel, I (m, n) be process after pixel value;M, n, i and j are natural number.Certainly, I ' (i, j) included by neighborhood also
Can be enlarged as required.At this moment, the reference picture gradient field obtained is defined as G1 by us.
Carry out the mode of noise reduction process according to above-mentioned employing holding edge filter device, the algorithm of reference picture gradient field G1 is such as
Under:
Wherein, (m is n) that in reference picture gradient field G1, (m, n) Grad of pixel, by the Grad of each pixel to G
(G (m, n)) that the most all pixels are corresponding insert successively corresponding position (i.e. (m, n)) just constitute reference picture gradient field G1.
In order to reduce operand, can be further simplified as:
G (m, n)=| I (m, n)-I (m-1, n) |+| I (m, n)-I (m, n-1) |;
Time of exposure predetermined according to described step S3 gathers target image.Target image is and to carry out eliminating ghost
The image processed, above-mentioned predetermined time of exposure refers to the time determined in step sl, step S1 and step according to diagnosis requirement
The time that rapid S3 uses is identical.
Essentially identical with step S2, described step S4 is for carry out noise reduction process to target image.Objective image quality good
Badly final image is existed large effect, and the method for noise reduction is more, in order to retain the details contained in target image as far as possible,
In the present embodiment, have employed one and details is kept preferable wave filter, its concrete grammar is as follows:
Wherein, 、
σsIt is similarity distribution standard deviation, σdIt is that spatial spread standard is poor;(m n) is picture pending on target image to I '
Vegetarian refreshments, (i is j) that (m, n) pixel in surrounding 5 × 5 neighborhoods, (m n) is the pixel value after processing to I to I ' to I ';M, n, i and j are equal
For natural number.
Then the target image after noise reduction is transformed to gradient field, obtain target image gradient field.Its method can use
It is same as the algorithm of reference picture, the target image gradient field obtained is defined as G2.
Above-mentioned steps S1 and S2 are used for obtaining reference picture gradient field G1, step S3 and S4 and are used for obtaining target image gradient
Territory G2, the two operating process does not has the requirement of sequencing, can first obtain target image gradient field G2, then obtain with reference to figure
As gradient field G1.
Described step S5 carries out calculus of differences to reference picture gradient field and target image gradient field, obtains final image ladder
Degree territory, i.e. final image gradient field G=G2-G1.
Further, in order to reduce error, first reference picture gradient field can be done a linear transformation, linearly be become
Change reference picture gradient field M=A × G1+B, then carry out calculus of differences, i.e. final image gradient field G=G2-M.
The value of A, B manually regulates acquisition, determines the optimal value of A, B according to the image effect finally calculated.
Wherein, the value of A is near 1, it is proposed that interval is [0.5,1.5], and the value of B is near 0, it is proposed that interval be [-0.2G1,
0.2G1]。
Finally, described step S6 is to obtain removing the final image of ghost by described final image gradient field G.This enforcement
In example, being obtained final image by Least squares matching by final image gradient field G, its specific algorithm is as follows:
Above formula to be made takes minima, then must be fulfilled for:
Substitute into F:
I.e. obtain:
Again by above-mentioned Poisson's equation discretization, use finite-difference approximation, obtain:
DivG=Gx(i, j)-Gx(i-1, j)+Gy(i, j)-Gy(i, j-1);
Owing to Least squares matching belongs to optimal fitting, fitting result is had not significant impact by the error in data of indivedual points,
It can be assumed that in image border, luminance difference is divided into 0, to simplify calculating, it may be assumed that
I (-1, y)-I (0, y)=0;
Finally use full multi grid or conjugate gradient method to solve, i.e. can obtain removing the final image of ghost.By upper
State gradient domain transformation, calculus of differences removes ghost, then passes through image after method of least square coupling is corrected, thus alleviates flat
The ghost problem that partitioned detector brings.
It addition, present invention also offers a kind of image processing system eliminating ghost, as in figure 2 it is shown, described system includes:
Reference picture acquisition module 100, for gathering a sub-picture as reference picture according to predetermined time of exposure;
Reference picture processing module 200, for reference picture is carried out noise reduction process, the reference picture after noise reduction is converted
To gradient field, obtain reference picture gradient field;
Target image acquisition module 300, for gathering target image according to predetermined time of exposure;
Target image processing module 400, for target image is carried out noise reduction process, the target image after noise reduction is converted
To gradient field, obtain target image gradient field;
Difference block 500, for reference picture gradient field and target image gradient field are done difference, obtain final image gradient
Territory;
Final image acquisition module 600, for according to described final image gradient field obtain final image.
The reference picture acquisition module 100 of the image processing system of above-mentioned elimination ghost, reference picture processing module 200,
Target image acquisition module 300, target image processing module 400, difference block 500 and final image acquisition module 600 are respectively
Corresponding with step S1-S6 in the image processing method of above-mentioned elimination ghost, its concrete implementation details and algorithm the most exist
Eliminate in the image processing method of ghost and be described in detail, the most just repeat no more.
In sum, the image processing method eliminating ghost of the present invention and system, first by target image with reference to figure
After transforming to gradient field, then obtain final image gradient field through difference processing, obtain finally by method of least square coupling
Image after rectification.The image processing method eliminating ghost of the present invention and system can be reduced or eliminated flat board ghost, make image
Apparent, it is more favorable for doctor and observes, reduce mistaken diagnosis, meanwhile, compared with the hardware solution of prior art, cost is lower,
Dispose more flexible, there is broader market application foreground.
It is understood that for those of ordinary skills, can be according to technical scheme and send out
Bright design in addition equivalent or change, such as change boundary filter, uses other algorithm to obtain removing the final of ghost
Image etc., and all these change or replacement all should belong to the protection domain of appended claims of the invention.