This application is based on and claims priority under 35 USC 119 from Japanese Patent Application No. 2008-101861 filed Apr. 9, 2008.
1. Technical Field
The present invention relates to an image extracting apparatus, an image extracting method and a computer readable medium.
2. Related Art
Techniques for separating and extracting each document image from a scan image obtained by simultaneously scanning one or a plurality of documents have been known.
According to an aspect of the invention, an image extracting apparatus includes an image acquiring section, a detecting section, a circumscribed rectangle setting section, an edge pixel detecting section, a determining section and a rectangular region setting section. The image acquiring section acquires a scan image obtained by scanning an object. The detecting section that generates a binary image of the acquired scan image and detects connected pixels in the generated binary image. The circumscribed rectangle setting section sets up a circumscribed rectangle for the connected pixels detected by the detecting section. The edge pixel detecting section that, in each side of a circumscribed rectangle, performs scan in a direction perpendicular to the side so as to detect edge pixels, wherein the scan starts at a plurality of points on a line, and the line extends to one vertex of the side, from a contacting point at which the connected pixels and the side contact. The determining section that determines whether the edge pixels detected by the edge pixel detecting section are located in a contour part of the object reproduced in the scan image. The rectangular region setting section sets up a rectangular region based on the edge pixels determined as being located in the contour part of the object. The image extracting section extracts an image from the rectangular region set up by the rectangular region setting section.
Exemplary embodiment(s) of the present invention will be described in detail based on the following figures, wherein:
An exemplary embodiment for implementing the present invention is described below with reference to the drawings.
As shown in
The scan section 12 includes an optical reader, and scans by optical processing a document placed at a predetermined image reading position of the optical reader so as to generate a scan image of the document. The number of document sheets contained in the scan image may be unity or a plural number.
The image acquiring section 14 acquires the scan image generated by the scan section 12. When the scan section 12 is constructed as an external device, the image acquiring section 14 acquires the scan image via an interface of USB type or the like.
The binarization processing section 16 performs binarization processing on the scan image acquired by the image acquiring section 14, so as to generate a binary image of the scan image. In the binarization processing section 16, binarization processing for emphasizing the edges in the scan image is performed such as to permit easier extraction of a contour part of the document contained in the scan image.
The circumscribed rectangle setting section 18 imparts a label to each group of connected pixels of black contained in the binary image generated by the binarization processing section 16 (labeling processing, and then sets up a circumscribed rectangle for each group of connected pixels to which the label has been imparted. The processing performed by the circumscribed rectangle setting section 18 is described below in detail with reference to
The document inclination determining section 20 determines whether the connected pixels (a document image) contained within the region of the circumscribed rectangle set up by the circumscribed rectangle setting section 18 for each connected pixel group is inclined relative to the set-up circumscribed rectangle. As for a document image determined by the document inclination determining section 20 as not inclined relative to the circumscribed rectangle, the region of the circumscribed rectangle is set up as an image region that contains the document image. On the other hand, as for a document image determined as inclined relative to the circumscribed rectangle, as describes below, a contour part of the document image is detected in the circumscribed rectangle, and then the region surrounded by the contour of the document image is set up as an extracted image region of the document image. Details of this processing of setting up an extracted image region for an inclined document image is described later.
Here, an example of determination criterion of whether a document image is inclined or not that is used in the document inclination determining section 20 is described below with reference to
From the image region within each circumscribed rectangle set up by the circumscribed rectangle setting section 18, the edge pixel detecting section 22 detects edge pixels of the document image in accordance with a rule described below. That is, the edge pixel detecting section 22 first selects one circumscribed rectangle side as a processing target. Then, starting at each of a plurality of points on the line segment extending from the point in contact with the connected pixels on the side to the more distant vertex, the edge pixel detecting section 22 performs scan in a direction perpendicular to the side, and then recognizes as the edge pixel a pixel detected first. The above-mentioned plurality of points may be taken, for example, in each pixel on the line segment or alternatively at predetermined intervals.
The processing performed by the edge pixel detecting section 22 is described below in detail with reference to
The valid edge determining section 24 determines whether the edge pixels detected by the edge pixel detecting section 22 are located in a contour part of the document image. The edge pixels determined by the valid edge determining section 24 as being located in a contour part of the document image are adopted as valid edge pixels. The valid edge determining section 24 determines that when an edge pixel satisfies any one of the following three determination criteria, the edge pixel is not located in a contour part of the document image, that is, the edge pixel is not a valid edge pixel. In contrast, an edge pixel does not satisfy any one of the determination criteria is determined as a valid edge pixel.
The first determination criterion is that an edge pixel detected at a position exceeding a diagonal line of the circumscribed rectangle from the circumscribed rectangle side serving as the start point of the scan is not adopted as a valid edge pixel. This is because when the four sides of the rectangular document image are reproduced appropriately in the scan image, a side of the document image cannot be detected at a position exceeding a diagonal line. In addition, this diagonal line faces the vertex of the circumscribed rectangle which is more distant from the contact point. For example, the diagonal line including the vertices 54-A and 54-C faces the vertex 54-B which is more distant from the contact point 44-A.
The second determination criterion is that an edge pixel whose positional difference from the adjacent edge pixels is greater than a predetermined positive value is not adopted as a valid edge pixel. This is because in the present exemplary embodiment, the respective sides of the circumscribed rectangle and the document image are in a relation of smoothly inclined pair. Thus, when a sudden positional difference is detected, it is expected as noise at a high probability.
The third determination criterion is that when an edge pixel approaches the circumscribed rectangle side rather than an edge pixel adjacent on the contact point side, the edge pixel is not adopted as a valid edge pixel. This is because in the present exemplary embodiment, when moving from the contact point on the circumscribed rectangle side to the vertex, the detected edge pixel should become distant from the circumscribed rectangle side. On the contrary, an edge pixel approaching the circumscribed rectangle side is determined as having a high possibility of being noise.
The situation that when various kinds of noise are contained in the scan image each of the above-mentioned determination criteria improves the noise tolerance in identifying the region of a document image is described below with reference to the example shown in
In the example shown in
In the example shown in
In the example shown in
As described above, on the basis of the first to the third criteria described above, edge pixels not located in a contour part of a document image are eliminated from those detected as edge pixels. By virtue of this, edge pixels located in a contour part of the document image can exclusively be selected as valid edge pixels.
On the basis of the position coordinates of the black pixels determined as valid edge pixels by the valid edge determining section 24, the side inclination calculating section 26 calculates the inclination of each side constituted from these valid edge pixels. The side inclination calculating section 26 recognizes as one group the valid edge pixels acquired in correspondence to a circumscribed rectangle side, then specifies a line segment for each group by the least square method or the like, and then calculates the inclination of each specified line segment relative to the corresponding side of the circumscribed rectangle.
On the basis of the coordinates of the sides constituted from the valid edge pixels and the conformity in the inclinations of the individual sides constituted from the valid edge pixels calculated by the side inclination calculating section 26, the extracted image region setting section 28 sets up an extracted image region which is a rectangular region where the document image is reproduced. Here, the extracted image region is not limited to the inside of the circumscribed rectangle set up by the circumscribed rectangle setting section 18, and may extend even to the outside of the circumscribed rectangle. Here, the processing of setting up an extended extracted image region described above is described below with reference to
The image extracting section 30 extracts an image from the rectangular region set up by the extracted image region setting section 28.
Next, the flow of image extracting processing performed by the image extracting apparatus 10 according to the present exemplary embodiment is described below with reference to the flow chart shown in
As shown in
For each set-up circumscribed rectangle, the image extracting apparatus 10 determines whether the connected pixels contained in the circumscribed rectangle are inclined relative to the circumscribed rectangle (S105). Here, as for a circumscribed rectangle determined as not inclined, the circumscribed rectangle is set up as an extracted image region (S109). On the other hand, as for a circumscribed rectangle determined as inclined, the following processing is performed.
For each circumscribed rectangle side, the image extracting apparatus 10 performs scan in a direction perpendicular to the side with starting at each point on the line extending from the point of contact with the connected pixels to the vertex more distant from the point of contact, so as to detect edge pixels (S106). From the detected edge pixels, the image extracting apparatus 10 selects valid edge pixels that constitute the contour part of the document image (S107).
The image extracting apparatus 10 performs the above-mentioned detection processing for valid edge pixels onto each circumscribed rectangle side, and then calculates the inclination of each side constituted from the obtained valid edge pixels (S108). Then, the image extracting apparatus 10 sets up a rectangular extracted image region on the basis of the conformity between the sides constituted from the valid edge pixels and the inclinations calculated for the individual sides (S109). The image extracting apparatus 10 performs the above-mentioned processing on each circumscribed rectangle so as to extract an image in each set-up rectangular region (S110). As a result, individual document images reproduced in the scan image are extracted.
As described above, according to the image extracting apparatus 10 described in the present exemplary embodiment, noise tolerance is improved in extracting rectangle images such as rectangle documents from a scan image.
Here, the present invention is not limited to the above-mentioned exemplary embodiment. That is, obviously, various changes, modifications, and substitutions can be made by a person skilled in the art who has ordinary knowledge in this field.
The foregoing description of the exemplary embodiments of the present invention has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Obviously, many modifications and variations will be apparent to practitioners skilled in the art. The embodiments were chosen and described in order to best explain the principles of the invention and its practical applications, thereby enabling others skilled in the art to understand the invention for various embodiments and with the various modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
2008-101861 | Apr 2008 | JP | national |
Number | Name | Date | Kind |
---|---|---|---|
5054098 | Lee | Oct 1991 | A |
5491759 | Nagao et al. | Feb 1996 | A |
5515181 | Iyoda et al. | May 1996 | A |
5828771 | Bloomberg | Oct 1998 | A |
6298157 | Wilensky | Oct 2001 | B1 |
6738154 | Venable | May 2004 | B1 |
6999209 | Kelly et al. | Feb 2006 | B2 |
7058224 | Herley | Jun 2006 | B2 |
7119807 | Matsui | Oct 2006 | B2 |
7184589 | Okubo | Feb 2007 | B2 |
7515772 | Li et al. | Apr 2009 | B2 |
7912295 | Chien | Mar 2011 | B1 |
7970231 | Tamura et al. | Jun 2011 | B2 |
8009931 | Li et al. | Aug 2011 | B2 |
20040264793 | Okubo | Dec 2004 | A1 |
20080137961 | Ishida et al. | Jun 2008 | A1 |
Number | Date | Country |
---|---|---|
A-6-162190 | Jun 1994 | JP |
A-07-089063 | Apr 1995 | JP |
A-2001-157018 | Jun 2001 | JP |
A-2001-298588 | Oct 2001 | JP |
A-2002-010059 | Jan 2002 | JP |
Number | Date | Country | |
---|---|---|---|
20090257658 A1 | Oct 2009 | US |