The modification method of gray-level linear array scanning image
Technical field
The present invention relates to a kind of gray scale scanning image correcting method, especially relate to a kind of modification method of plane antenna scanning grey pictures.
Background technology
Plane picture obtains extensively, is widely used in industrial production, business activity and the daily life, is divided into face battle array and linear array dual mode usually.The face system of battle formations has the advantages that as obtaining by camera or video camera speed is fast, cost is low, but often has the defective of edge deformation or whole distortion, can not be directly used in high-precision image processing.Linear array scanning such as flat bed scanner etc., can obtain high-precision plane picture, the problem that has anamorphose hardly can directly apply to the image processing field with strict quality requirement, as the online quality testing on the production line, ballot paper statistics, financial document processing etc.
The line scan image sensor array is used in linear array scanning usually, gray scale scanning bar with the most widely used A4 breadth, 200DPI is an example, on the length of 216mm, 40 led light sources are distributing, simultaneously evenly distributed 1728 image sensor modules, promptly the spacing of two modules is 125 μ m, has all comprised an optical lens, a transducer in each module, and other affiliated facilities.The corresponding pixel of sensor assembly.The irradiate light of light emitted is to scanned surface, and reflection enters lens, focuses on sensor array and lists, and delivers to amplifier through shift register output, handles the back and transfers to computer by image pick-up card, promptly forms delegation's image.Along with scanned object at the uniform velocity passes through scan stripes, can form a width of cloth original scan image.
Because the optical characteristics of pointolite array, and scanned surface contacts with scan stripes apart from there being deviation, determined that original scan image inevitably light and dark striped will occur, as shown in Figure 1.This just need have a balance or a correction to the analog output signal of each transducer, allows them that less electrical differences is arranged under identical light signal.
Finish this correction and can use and be with degenerative analog circuit,, before A/D, finish image correction to suppress the variation difference of input analog signal.The cost of this method is higher, and development difficulty is bigger, is not suitable for high speed scanner cheaply.
Summary of the invention
In order to overcome the above-mentioned shortcoming of prior art, the invention provides a kind of modification method of gray-level linear array scanning image, at first by blank sheet of paper is scanned, obtain initial scan image, utilize software on the basis of initial scan image, to calculate the correction factor of each transducer then on computers, again will be through the digital signal of the real time scan image of A/D conversion, the correction factor corresponding with this point passes through the adder addition, obtains the value of revised pixel.This modification method is simple, and the image that obtains after the correction has been eliminated the light and shade striped that exists in the existing modification method, and image more evenly, truly.
The technical solution adopted for the present invention to solve the technical problems is: a kind of modification method of gray-level linear array scanning image may further comprise the steps:
The first step, scanning a blank sheet of paper obtain the gradation data of initial scan image;
The gradation data of second step, the initial scan image that obtains according to blank sheet of paper scanning, calculate the correction factor of each point:
(1) suppose that the sampling line number is N, the transducer number is M, asks the mean value of capable each corresponding points of image of N of i transducer, obtains the row vector;
(2) mean value of the row vector of M transducer of calculating;
(3) correction factor of i transducer of calculating;
The 3rd step, by USB interface, the correction factor vector is write among the EEPROM of high speed scanner;
The 4th the step, in real-time image scanning, earlier the analog signal of each pixel is converted to the digital signal of a byte through A/D converter, then that it is corresponding with this some correction factor is by the adder addition: if do not have carry after the adder addition, just directly export result of calculation, as the value of revised pixel by adder; If after the adder addition carry is arranged, just directly export maximum, as the value of revised pixel by adder.
Compared with prior art, good effect of the present invention is: at first according to scanning the initial scan image that blank sheet of paper obtains, utilize the computed in software correction factor on computers, utilize the preposition correction factor of using of specialized hardware again, pass to adder under the correction factor after software will calculate, do simple pointwise add operation, finish image correction by adder, both reduced the realization difficulty of hardware, the time-delay of having avoided software application to bring again; Eliminated original light and shade striped by revised image, become even more, true, as shown in Figure 2.
Description of drawings
The present invention will illustrate by example and with reference to the mode of accompanying drawing, wherein:
Fig. 1 is an original scan image of not doing any processing;
Fig. 2 adopts the real-time revised image of the inventive method;
Fig. 3 is the schematic diagram of the inventive method.
Embodiment
A kind of modification method of gray-level linear array scanning image as shown in Figure 3, comprises the steps:
The first step, scanning a blank sheet of paper obtain initial scan image (with light and dark striped), and the initial scan image of establishing i capable transducer of j is
Second step, the initial scan image that scanning obtains according to blank sheet of paper
, calculate the correction factor of each point:
If
(i: i transducer), wherein:
: the actual signal of each transducer output
: the ideal signal of each transducer output
: the noise signal of each transducer output.
According to each physical characteristics of sensors, the real output signal of transducer
Be by its ideal signal
And noise signal
Constitute.Therefore, by formula
, obtain ideal signal
Because
To specific transducer relative fixed, just can synthesize desirable sensor signal so only need obtain it, this
Be exactly the correction factor of i transducer, obtain by following steps:
(1) suppose that the sampling line number is N, the transducer number is M, asks the mean value of capable each corresponding points of image of N of i transducer, obtains the row vector
:
(2) the row vector of M transducer of calculating
Mean value
:
(3) correction factor of i transducer of calculating
:
The 3rd step, by USB interface, the correction factor vector is write among the EEPROM of high speed scanner.
The 4th the step, in real-time image scanning, earlier the analog signal of each pixel is converted to the digital signal of a byte through A/D converter, correction factor vector that then will be corresponding with this point by the adder addition, obtains the value Rimage[i of revised pixel by following formula] [j]:
If there is not carry after the addition, just directly export Rimage[i by adder] [j]; If carry is arranged after the addition, just directly get maximum " FF ", i.e. the greatest measure that can represent of byte of 255(), obtain revised scan image thus.