METHOD FOR AUTOMATICALLY DETERMINING DOCUMENT POSITION IN A SCANNER WINDOW
A method for determining the position of a document placed in the scanning widow of a flatbed scanner is disclosed. The method can correctly determine the precise position of a document from a pre-scanned image, including portions of a pressing cover (background color), illuminator (different color from the background) and the document. By color identification, a preliminary range having a rectangular area covering the document and the illuminator is first determined. Then, the colors of the four corners of the preliminary range are identified. Finally, the precise position of the document is determined by color identification, approaching from the rim of the preliminary range toward the the document.
1. Field of the Invention
The invention generally relates to an automatic method for a scanner, and more particularly relates to a method for determining the position of a document placed in the scanning widow of a flatbed scanner.
2. Related Art
Automatic methods for a flatbed scanner to determine the position of a document placed on the scanner window are already well known. However, the prior methods are limited to the application of flatbed scanners that have a single background pattern of the scanner window. In other words, the prior method obtains a background image pattern of the scanner window by a pre-scanning process, then the background image pattern (a certain image color) can be omitted later from automatic ranged scanning so as to produce the document image only. When the prior method is applied to a flatbed scanner with two kinds (two colors) of background image pattern, incorrect determining of the document range may occur.
For example, beside a common black or white pressing cover for the flatbed, a conventional scanner may include an illuminator for lighting a transparency or a film for scanning. The illuminator has a color different from that of the pressing cover. Therefore, with the prior method the scanner mistakes the image of the illuminator as a part of the scanned document if only one background color (the color of the pressing cover) is considered. Or, a partial image of the scanned document is cropped if two background colors are considered.
SUMMARY OF THE INVENTIONThe object of the invention is therefore to provide a method for determining the position of a document placed on a flatbed scanner in which the background image of the flatbed includes two color regions.
The method of the invention includes two steps for finding the scanned document. The first step is to locate a preliminary range of scanning. The preliminary range is determined from the rim toward the center of the scanner window. The preliminary range is a rectangular area covering the hardware (the illuminator) and the document located within the scanner window. The second step is to determine the portion of the document in the preliminary region by sampling certain points and comparing the relative position of the preliminary range to the center of the illuminator, then determining the precise position of the document by approaching the document in that portion through color identification.
Further scope of applicability of the invention will become apparent from the detailed description given hereinafter. However, it should be understood that the detailed description and specific examples, while indicating preferred embodiments of the invention, are given by way of illustration only, since various changes and modifications within the spirit and scope of the invention will become apparent to those skilled in the art from this detailed description.
BRIEF DESCRIPTION OF THE DRAWINGSThe invention will become more fully understood from the detailed description given hereinbelow. However, this description is for purposes of illustration only, and thus is not limitative of the invention, wherein:
As shown in
The size and position of a scanned document D relative to the scanner window 10 and the illuminator 21 influences the result of the automatic determining of document position. Firstly, an example is shown in
Even when the document D is larger than or the same size as the illuminator 21, it is still possible, as shown in
The method for determining the position of document D in the scanned image with two background colors according to the invention is described below.
As with a conventional flatbed scanner, the scanner of the invention first pre-scans the scanner widow 10 with a document D placed thereon, and obtains a pre-scanned image that includes images of the pressing cover 20, the illuminator 21 and the document D.
After obtaining the pre-scanned image, the invention processes the following steps to locate the position of the document D. The process is described in reference to the flowchart of
Since most documents are rectangular in shape, in order to speed up the recognition process, the area of the preliminary ranges 1 is also preferably rectangular and a minimum one including images of the illuminator 21 and the document D. The process for obtaining the preliminary ranges 1 of
As shown in
Using the same process as above to search along the other axis (for example, the Y-axis) of the X-Y coordinates and verify the color of the pixels on each row, the rim rows of the preliminary range 1 in Y-axis, marked Y1 and Y2, can also be obtained. Therefore, the coordinates of four corners of the preliminary range 1 are P1(X1,Y2), P2(X2,Y2), P3(X2,Y1) and P4(X1,Y1). In other words, the four points enclose a minimum area covering the document D and the illuminator 21 as the preliminary range 1.
Steps B to E, as shown in
The step C is to determine the positional relationship between the center point 211 of the illuminator 21 and the center point 10 of the preliminary range 1. Since the physical position of the illuminator 21 is fixed, we can use the origin point “0” of the coordinates of the scanner window as the origin of the center point 10 of the preliminary range 1 and the center point 211 of the illuminator 21 so that the position of the preliminary range 1 relative to the illustrator 21 can be identified. For example, the coordinates of the center 211 of the illuminator 21 can be expressed as (Xm, Ym); the center point 10 of the preliminary range 1 can be calculated as [(X2-X1)/2, (Y2−Y1)/2] from the corner coordinates thereof. The two points, as shown in
Step D is to determine the direction of the document D in the preliminary range 1 for approaching the detailed position of the document D in the next step. The determination is based on the aforesaid identification codes of the document D and the illuminator 21 in the preliminary range 1, and the aforesaid coordinates of the centers 211, 10 of the illuminator 21 and the preliminary range 1. For example, in
Step E is to determine the precise position of the document D by searching the boundary of the document D from the rim of the preliminary range 1 in the direction toward the document D. For example, in
In
In
In
In
In
As described above, the invention can correctly determine the precise position of a document from a pre-scanned image, including portions of the pressing cover, illuminator and the document.
The invention being thus described, it will be obvious that the same may be varied in many ways. Such variations are not to be regarded as a departure from the spirit and scope of the invention, and all such modifications as would be obvious to one skilled in the art are intended to be included within the scope of the following claims.
Claims
1.-6. (canceled)
7. An apparatus, comprising:
- means for obtaining a pre-scanned image, wherein the pre-scanned image includes a document image portion and a background image portion;
- means for determining a preliminary range of the pre-scanned image;
- means for distinguishing at least a portion of said document image portion from said background image portion; and
- means for determining a position of the document image portion within the range of the pre-scanned image.
8. The apparatus of claim 7, wherein said means for determining said preliminary range further comprises means for locating one side of said pre-scanned image, and means for searching along the one side to identify at least one corner of the pre-scanned image.
9. The apparatus of claim 7, wherein said means for distinguishing comprises means for identifying color differences between said document image portion and said background image portion.
10. The apparatus of claim 7, wherein means for distinguishing comprises means for identifying one or more corners of the document image portion within the pre-scanned image.
11. The apparatus of claim 10, wherein means for identifying one or more corners comprises means for identifying color differences between said document image portion and said background image portion at the one or more corners.
12. The apparatus of claim 10, wherein means for identifying one or more corners further comprises means for identifying a center point of said document image portion.
13. The apparatus of claim 7, wherein the document image portion and a background image portion comprise different colors.
14. The apparatus of claim 7, and further comprising means for distinguishing at least a portion of said document image portion and/or said background image portion from an illuminated portion of the pre-scanned image.
15. The apparatus of claim 7, and further comprising means for determining the positional relationship between said document image portion and said background image portion within the range of the pre-scanned image.
16. An apparatus, comprising:
- circuitry to obtain a pre-scanned image of at least a portion of a scanning object including a document portion and a background portion;
- circuitry to determine a preliminary range of the pre-scanned image;
- circuitry to distinguish at least a portion of the pre-scanned image comprising said portion of the document from at least a portion of the image comprising said portion of the background; and
- circuitry to determine a position of the document portion within the preliminary range of the pre-scanned image.
17. The apparatus of claim 16, and further comprising an illuminator adapted to illuminate the scanning object.
18. The apparatus of claim 16, wherein said circuitry to determine a preliminary range further comprises circuitry to locate one side of said pre-scanned image, and searchalong the one side to identify at least one corner of the pre-scanned image.
19. The apparatus of claim 16, further comprising circuitry to identify at least one color difference between said document portion and said background portion.
20. The apparatus of claim 16, further comprising circuitry to identify a center point of said document portion.
21. The apparatus of claim 16, wherein the document portion and a background portion comprise different colors.
22. The apparatus of claim 16, further comprising circuitry to determine a positional relationship between said document portion and said background portion within the preliminary range of the pre-scanned image.
23. An article comprising a computer readable storage medium having stored thereon instructions that, when executed, result in:
- obtaining a pre-scanned image, wherein the pre-scanned image includes a document image portion and a background image portion;
- determining a preliminary range of the pre-scanned image;
- distinguishing at least a portion of said document image portion from said background image portion; and
- determining a position of the document image portion within the range of the pre-scanned image.
24. The article of claim 23, wherein the instructions, when executed, further result in determining said preliminary range by locating one side of said pre-scanned image, and searching along the one side to identify at least one corner of the pre-scanned image.
25. The article of claim 23, wherein the instructions, when executed, further result in distinguishing by identifying color differences between said document image portion and said background image portion.
26. The article of claim 23, wherein the instructions, when executed, further result in distinguishing by identifying one or more corners of the document image portion within the pre-scanned image.
27. The article of claim 26, wherein the instructions, when executed, further result in identifying color differences between said document image portion and said background image portion at the one or more corners.
28. The article of claim 26, wherein the instructions, when executed, further result in identifying one or more corners by identifying a center point of said document image portion.
29. The apparatus of claim 23, wherein the document image portion and a background image portion comprise different colors.
30. The article of claim 23, wherein the instructions, when executed, further result in determining the positional relationship between said document image portion and said background image portion within the range of the pre-scanned image.
Type: Application
Filed: Sep 19, 2006
Publication Date: Jan 18, 2007
Inventor: Chun-Hung Lee (Kaohsiung Hsien)
Application Number: 11/533,326
International Classification: H04N 1/04 (20060101);