Image correction method
An image correction method is provided. First, scan an all-white document and form a scanned image including a plurality of image pixels with each of them having a gray level value. Next, gather these gray level values statistically such that each of them has an image pixel quantity. Then the maximum gray level value and the minimum gray level value are selected and a middle gray level value is obtained accordingly. Following that, determine whether the reference gray level value is greater or smaller than the middle gray level value according to the document, select the gray level values from within the interval of (the reference gray level value ± a gray level value), and weight average the selected gray level values according to these selected gray level values and their corresponding image pixel quantities to obtain a corrected gray level value.
This application claims the benefit of Taiwan application Serial No. 91120807, filed on Sep. 11, 2002.
BACKGROUND OF THE INVENTION1. Field of the Invention
The invention relates in general to an image correction method, and more particularly to an image correction method, which, according to the pattern of the document scanned, determines whether the necessary reference gray level value with a maximum image pixel quantity should be greater or smaller than the middle gray level value calculated from the maximum gray level value and the minimum gray level value.
2. Description of the Related Art
Before scanning a document, a scanner normally proceeds with an image correction to avoid an undesirable image distortion of the scanned image. Among the many image correction methods available nowadays, the image correction method disclosed in Taiwan Patent Publication Serial No. 376648 will be used as an example for explanation in assistance with
Please refer to
Referring to
Ideally, when an all-white document is scanned, the profile of the gray level values should show a tendency towards white, i.e., the gray level value of the image pixel is near 255. In reality, due to the dusts alighting on the all-white document, a profile of gray level values whose distribution curve shows a peak at each of the two ends and a valley in the middle is resulted as shown in
Next, proceed to procedure 106 where a median gray level value ME is taken from the profile of gray level values as shown in
However, if blemishes on the all-white document are numerous or the scanner is interfered with: by external noises during scanning, the gray level values obtained and their corresponding image pixel quantities might results in a profile as shown in
It is therefore an object of the invention to provide an image correction method, which filters the many blemishes on an all-white document, white spots on an all-black document and the occurrence of interference due to external noises during scanning, and excludes these special conditions from being included in the correction range assuring an appropriate image correction. According to the design of this method, whether the necessary reference value of gray levels with maximum pixels is greater or smaller than the middle value of gray levels calculated from the maximum value and the minimum value of gray levels is determined according to the patterns of the document scanned.
An image correction method is provided according to the object of the invention. First, scan an all-white document and form a scanned image including a plurality of image pixels with each of them having a gray level value. Next, gather these gray level values statistically such that each of them has an image pixel quantity. Then the maximum gray level value and the minimum gray level value are selected and a middle gray level value is obtained accordingly. Following that, determine whether the reference gray level value is greater or smaller than the middle gray level value according to the document, select the gray level values from within the interval of (the reference gray level value ± gray level value), and weight average all of these selected gray level values according to these selected gray level values and their corresponding image pixel quantities to obtain a corrected gray level value. Otherwise, method ends.
An image correction method is provided according to the object of the invention. First, scan the document and focus the light on a number of sensitive pixels of a sensitive element to form a scanned image, wherein the scanned image includes a number of image pixels with each of them having a gray level value. Next, these gray level values corresponding to each sensitive pixel are gathered statistically so that each gray level value has an image pixel quantity. A profile of gray level values is formed according to the gray level values and their corresponding image pixel quantities. Then select the maximum gray level value and the minimum gray level value to obtain a middle gray level value. Following that, determine whether the reference gray level value is greater or smaller than the middle gray level value according to the document, select the gray level values from within the interval of (the reference gray level value±a gray level value), and weight average all of these selected gray level values according to these selected gray level values and their corresponding image pixel quantities to obtain a corrected gray level value. Otherwise, this method ends.
Other objects, features, and advantages of the invention will become apparent from the following detailed description of the preferred but non-limiting embodiments. The following description is made with reference to the accompanying drawings.
BRIEF DESCRIPTION OF THE DRAWINGS
Please refer to
In
Following that, proceed to procedure 406. Select a maximum gray level value A and a minimum gray level value B from the profile of gray level values corresponding to the sensitive pixels to obtain a middle gray level value C accordingly. Of which, C can be equal to a half of the difference by subtracting the minimum gray level value B from the maximum gray level value A, i.e., C=(A−B)/2; or C can be equal to a half of the sum of the maximum gray level value A and the minimum gray level value B, i.e., C=(A+B)/2. Furthermore, the middle gray level value C must be situated around the valley between the two wave peaks of
Proceed to procedure 410. Determine if the reference gray level value M is greater than the middle gray level value C or not. If yes, proceed to the next procedure; otherwise, end this method. Since the scanned document is all-white, the reference gray level value M obtained in the invention must be greater than the middle gray level value C to accord with expectations before proceeding to the next procedure. In other words, a result with the reference gray level value M obtained in the invention being smaller than the middle gray level value C, as shown in
Such a decision module, which can filter special conditions such as too many blemishes being alighted on an all-white document and the occurrence of interference due to external noises during scanning, excludes these biases which have enormous differences with expected results from the correction range. An appropriate image correction can thus be obtained.
At last, proceed to procedure 412. Select all the gray level values from within the interval of (reference gray level value M±a gray level value P) and weight average all of these selected gray level values according to these selected gray level values and their corresponding image pixel quantities to obtain a corrected gray level value. End this method. The gray level value P can be set with flexibility. For example, P can be set to be one tenth of the reference gray level value M.
It is noteworthy that anyone who is familiar the technology of the invention can make necessary adjustments to achieve a similar function without violating the spirit of the invention. For example, when an all-black document is scanned, the image correction method according to the invention can be adjusted as follows:
First, scan an all-black document and form a scanned image including a plurality of image pixels with each of them having a gray level value. Next, these gray level values are gathered statistically to generate an image pixel quantity of each gray level value, then the maximum and the minimum gray level values are selected, and a middle gray level value is obtained accordingly. Following that, the reference gray level value for the largest image pixel quantity is selected and compared to the middle gray level value. If the reference gray level value is smaller than the middle gray level value, then select gray level values from within the interval of (reference gray level value±gray level value), and weight average all of these selected gray level values according to these selected gray level value and their corresponding image pixel quantities to obtain a corrected gray level value. Otherwise, this method ends. Of which, the middle gray level value can be equal to a half of the difference by subtracting the minimum gray level value from the maximum gray level value, or can be equal to a half of the sum of the maximum gray level value and the minimum gray level value.
Such a decision module filters special conditions such as having too many blemishes on an all-white document or the occurrence of interference due to external noises during scanning and excludes these biases which have enormous differences with expected results from the correction range. An appropriate image correction can thus be obtained.
An image correction method is disclosed in the above preferred embodiment. According to the design of this method, whether the reference gray level value is greater than or smaller than the middle gray level value determined according to the patterns of the document scanned. Special conditions such as too many blemishes on an all-white document, white spots on an all-black document and the occurrence of interference due to external noises during scanning are filtered out and are excluded from the correction range by means of this design. An appropriate image correction can thus be obtained.
While the invention has been described by way of example and in terms of a preferred embodiment, it is to be understood that the invention is not limited thereto. On the contrary, it is intended to cover various modifications and similar arrangements and procedures, and the scope of the appended claims therefore should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements and procedures.
Claims
1-20. (canceled)
21. An image correction method for use with a scanned document having a plurality of image pixels with each of the image pixels having a gray level value, comprising:
- calculating a middle gray level value;
- selecting a reference gray level value;
- determining whether the reference gray level value is greater or smaller than the middle gray level value; and
- selecting the gray level values from within an interval of (the reference gray level value±a gray level value), and weight averaging the selected gray level values according to the selected gray level values to obtain a corrected gray level value.
22. The image correction method of claim 21 wherein the middle gray level value equals half or nearly half of a sum of a maximum gray level value and a minimum gray level value.
23. The image correction method of claim 21 wherein the middle gray level value equals half or nearly half of a difference between a maximum gray level value and a minimum gray level value.
24. An image corrector for use with a scanned document having a plurality of image pixels with each of the image pixels having a gray level value, comprising:
- means for calculating a middle gray level value;
- means for selecting a reference gray level value;
- means for determining whether the reference gray level value is greater or smaller than the middle gray level value; and
- means for selecting the gray level values from within an interval of (the reference gray level value±a gray level value), and weight averaging the selected gray level values according to the selected gray level values to obtain a corrected gray level value.
25. The image corrector of claim 24 wherein the middle gray level value equals half or nearly half of a sum of a maximum gray level value and a minimum gray level value.
26. The image corrector of claim 24 wherein the middle gray level value equals half or nearly half of a difference between a maximum gray level value and a minimum gray level value.
27. A method of filtering image blemishes, comprising:
- calculating a middle gray level value of a scanned document having a plurality of image pixels with one or more of the image pixels having a gray level value;
- selecting a reference gray level value that is a gray level value common to most or nearly most image pixels;
- determining whether the reference gray level value is greater or smaller than the middle gray level value; and
- selecting the gray level values from within an interval of (the reference gray level value ±a gray level value), and weight averaging the selected gray level values according to the selected gray level values to obtain a corrected gray level value.
28. An image correction method, comprising:
- calculating a middle gray level value from a maximum gray level value and a minimum or nearly minimum gray level value of a scanned document having a plurality of image pixels with one or more of the image pixels having a gray level value and one or more gray level value having an image pixel quantity;
- selecting a reference gray level value, wherein the reference gray level value has a largest or nearly largest image pixel quantity;
- determining whether the reference gray level value is greater or smaller than the middle gray level value; and
- selecting the gray level values from within an interval of (the reference gray level value±a gray level value), and weight averaging the selected gray level values according to the selected gray level values and their corresponding image pixel quantities to obtain a corrected gray level value.
29. The image correction method of claim 28 further comprising forming a profile of the gray level values according to the gray level values and their corresponding image pixel quantities.
30. The image correction method of claim 28 wherein the middle gray level value equals half or nearly half of a sum of the maximum gray level value and the minimum gray level value.
31. The image correction method of claim 28 wherein the middle gray level value equals half or nearly half of a difference between the maximum gray level value and the minimum gray level value.
32. A scanner having an image corrector that corrects images by:
- calculating a middle gray level value;
- selecting a reference gray level value;
- determining whether the reference gray level value is greater or smaller than the middle gray level value; and
- selecting the gray level values from within an interval of (the reference gray level value±a gray level value), and weight averaging the selected gray level values according to the selected gray level values to obtain a corrected gray level value.
33. The scanner of claim 32 wherein the middle gray level value equals half or nearly half of a sum of a maximum gray level value and a minimum gray level value.
34. The scanner of claim 32 wherein the middle gray level value equals half or nearly half of the difference between a maximum gray level value and a minimum gray level value.
35. The scanner of claim 32 wherein the reference gray level value is a gray level value common to most or nearly most image pixels.
36. An image correction method for use with a scanned document having a plurality of image pixels with the image pixels having a gray level value, comprising:
- calculating a middle gray level value;
- selecting a reference gray level value by determining which gray level value is common to most or nearly most image pixels;
- comparing the reference gray level value to the middle gray level value;
- selecting gray level values from within an interval of (the reference gray level value±a gray level value); and
- calculating a corrected gray level value from weight averaging the selected gray level values according to the reference gray level value.
37. The image correction method of claim 36 wherein the middle gray level value equals half or nearly half of a sum of a maximum gray level value and a minimum gray level value.
38. The image correction method of claim 36 wherein the middle gray level value equals half or nearly half of the difference between a maximum gray level value and a minimum gray level value.
39. A scanner with an image corrector comprising:
- means for calculating a middle gray level value of a scanned document having a plurality of image pixels with one or more of the image pixels having a gray level value and one or more gray level value having an image pixel quantity;
- means for selecting a reference gray level value, wherein the reference gray level value has a largest or nearly largest image pixel quantity;
- means for determining whether the reference gray level value is greater or smaller than the middle gray level value; and
- means for selecting the gray level values from within an interval of (the reference gray level value±a gray level value); and
- means for calculating a corrected gray level value by weight averaging the selected gray level values according to the selected gray level values and their corresponding image pixel quantities to obtain a corrected gray level value.
Type: Application
Filed: Aug 29, 2006
Publication Date: Apr 26, 2007
Inventor: Wen-Chao Tseng (Taichung)
Application Number: 11/512,669
International Classification: G06K 9/00 (20060101); G06K 9/40 (20060101);