The present application claims priority under 35 U.S.C. §119 of Japanese Application No. 2011-030966, filed on Feb. 16, 2011, the disclosure of which is expressly incorporated by reference herein in its entirety.
1. Field of the Invention
The present invention is related to an image processing apparatus that processes an image obtained by scanning a paper surface of a document such as a book, and a document scanning system having the image processing apparatus.
2. Description of Related Art
A book scanner (document camera) is widely used, which can capture from above a page of a book in a naturally opened state and scan an image of the page. Such a book scanner makes it possible to sequentially scan images of pages while turning the pages, thereby allowing efficient digitization of books (Japanese Patent Laid-open Publication No. 2001-103240).
The book scanner may be used even when an image of only a potion of a paper surface of a book is required. In this case, however, after an image of an entirety or a required area of the book page is captured, a cumbersome work is necessary to load the image data on a PC and to cut out the image of the required area while viewing a screen of the PC.
The present invention provides an image processing apparatus and a document scanning system having the same, the image processing apparatus being configured to be capable of obtaining a cutout image by directly specifying an area on a paper surface of a document with a pointer such as a finger.
An image processing apparatus of the present invention includes: a captured image obtainer obtaining a first captured image and a second captured image, the first captured image being an image of a paper surface of a document captured along with a placing surface without a pointer, and the second captured image being an image of the paper surface of the document captured along with the pointer specifying an area to be cut out on the paper surface of the document; a cutout area obtainer detecting a point specified by the pointer from the second captured image and obtaining a cutout area such that a predetermined margin is secured around the specified area provided by connecting the points; a cutout image generator obtaining a cutout image by planarizing a portion of the first captured image corresponding to at least the cutout area obtained by the cutout area obtainer; and an image corrector removing an unnecessary image portion appearing in a peripheral area of the cutout image obtained by the cutout image generator.
A document scanning system of the present invention includes: the image processing apparatus according to the above invention; and an image inputting device having a camera. The image inputting device captures an image of a paper surface of a document along with a placing surface without a pointer and an image of the paper surface of the document along with the pointer specifying an area to be cut out on the paper of the document, and sends the first captured image and the second captured image to the image processing device.
The present invention is further described in the detailed description which follows, in reference to the noted plurality of drawings by way of non-limiting examples of exemplary embodiments of the present invention, in which like reference numerals represent similar parts throughout the several views of the drawings, and wherein:
The particulars shown herein are by way of example and for purposes of illustrative discussion of the embodiments of the present invention only and are presented in the cause of providing what is believed to be the most useful and readily understood description of the principles and conceptual aspects of the present invention. In this regard, no attempt is made to show structural details of the present invention in more detail than is necessary for the fundamental understanding of the present invention, the description is taken with the drawings making apparent to those skilled in the art how the forms of the present invention may be embodied in practice.
Hereinafter, an embodiment of the present invention is described with reference to drawings.
The book scanner 1 includes a camera 3 capturing an image of a paper surface of the book B and a stand 4 holding the camera 3. The stand 4 is placed on a placing surface 5 such as a desk. The book B is set on the placing surface 5 provided directly below the camera 3. The camera 3 captures an image of a paper surface of the book B. An image of a paper surface is captured in a state where the book B is naturally opened, and a captured image of a two-page spread of the book B is thus obtained. Further, planarization is performed on an image of a distorted paper surface in order to obtain a planarized image of the two-paper surface spread.
Furthermore, in this embodiment, an image of a specified area is cut out by directly specifying the area on a paper surface of the book B with a pointer F such as a finger, a pen, or the like, and thus a planarized cutout image can be obtained. At this time, the book scanner 1 captures an image of the paper surface of the book B along with the placing surface 5 without the pointer F, and the PC 2 generates an image of the paper surface based on the captured image. In addition, the book scanner 1 captures an image of the paper surface of the book B along with the pointer F specifying an area to be cut out on the paper surface of the book B, and the PC 2 identifies a cutout area based on the captured image.
In the PC 2, operation conditions such as resolution, a frame rate, and the like of an image to be captured by the book scanner 1 are input with an operation through the inputter 27 configured with a keyboard or the like. These operation conditions are transmitted from the operation system controller 24 to the book scanner 1. In the book scanner 1, the image capturing processor 11 performs a predetermined operation according to an instruction from the operation instructor 12 based on the operation conditions transmitted from the PC 2.
The image data inputter 22 of the PC 2 stores, in a memory, image data transmitted from the book scanner 1, and outputs the image data to the image processor 23 as needed. The image data inputter 22 obtains a first captured image and a second captured image, the first captured image being an image of a paper surface of the book B captured along with the placing surface 5 without the pointer F, and the second captured image being an image of the paper surface of the book B captured along with the pointer F specifying an area to be cut out on the paper surface of the book B.
The image processor 23 includes an outline obtainer 31, a primary mesh model generator 32, a cutout area obtainer 33, a secondary mesh model generator 34, a cutout image generator 35, and an image corrector 36.
The outline obtainer 31 obtains an outline of the book B from the first captured image. The primary mesh model generator 32 generates a primary mesh model based on the outline information obtained from the first captured image by the outline obtainer 31. The cutout area obtainer 33 detects a point specified by the pointer from the second captured image and obtains a cutout area. The secondary mesh model generator 34 generates a secondary mesh model based on the primary mesh model generated by the primary mesh model generator 32, the secondary mesh model having mesh spacing smaller than that of the first mesh model.
The cutout image generator 35 planarizes a portion of the first captured image corresponding to the cutout area obtained by the cutout area obtainer 33, and obtains a cutout image. The cutout image generator 35 includes an image transformer 37 that transforms a distorted image of a paper surface into a non-distorted image. The image transformer 37 performs a projective transformation (affine transformation) and thus planarizes an image. Thereby, it is possible to obtain an image similar to what is scanned by a flat bed scanner. The image corrector 36 performs an image correction that removes an unnecessary image portion appearing in a peripheral area of the cutout image obtained by the cutout image generator 35.
The cutout area obtainer 33 determines a cutout area using the primary mesh model. The cutout image generator 35 planarizes an image using the secondary mesh model. These will be described in detail later.
In the PC 2, the outline obtainer 31 performs a processing to obtain an outline of the book B from the first captured image (ST 103). Thereafter, based on the outline information obtained by the outline obtainer 31, the primary mesh model generator 32 performs, with respect to an entirety of the book B, a processing to generate a primary mesh model having a coarse mesh (ST 104).
Further, the cutout area obtainer 33 causes a user to perform an operation to specify an area to be cut out on the paper surface of the book B using the pointer F such as a finger, a pen, or the like, obtains a second captured image that is an image of the paper surface of the book B captured along with the pointer F, detects a point specified by the pointer F from the second captured image, and determines a cutout area (ST 105).
Then, with respect to the cutout area obtained by the cutout area obtainer 33, the secondary mesh model generator 32 generates a secondary mesh model based on the primary mesh model generated by the primary mesh model generator 32, the secondary mesh model having a finer mesh than the primary mesh model. Further, based on the secondary mesh model, the cutout image generator 34 performs an image transformation to planarize the image (ST 106).
Thereafter, the image corrector 36 performs an image correction that removes an unnecessary image portion appearing in a peripheral area of the cutout image obtained by the cutout image generator 35 (ST 107). The cutout image obtained above is displayed on the display 26 (ST 108). Thus, the user can confine whether or not the image has been properly cut out.
First, the main straight line element of an outer shape of the entire book is detected (ST 201). Herein, as shown in
Further, edge detection is performed on the captured image (ST 202). This edge detection may be performed with the Canny method. Then, outline elements (pixels configuring the outline of the document) in the obtained edge image is extracted (ST 203). Thereafter, singular points, which are edge points at the page top, bottom, left, and right, are detected based on the obtained outline element (ST 204). Herein, six singular points are detected as the top, bottom, left, and right edge points of the page in the captured image of the two-page spread as shown in
Then, adequacy of the singular points obtained in the singular point detection (ST 204) is determined (ST 205). Herein, the adequacy of the singular points, which are edge points at the page top, bottom, left, and right, is determined by comparing the obtained singular points with the straight line element obtained in the straight line element detection (ST 201). When the singular points are determined as adequate, the singular points are confirmed (ST 206).
Each of the edge detection (ST 202), the outline element extraction (ST 203), and the singular point detection (ST 204) may be simultaneously be performed with the straight line element detection (ST 201).
First, a distortion element is extracted, the distortion element indicating a distorted outline of a paper surface of the book B (ST 301). As shown in
Thereafter, a computation is performed to convert the distortion element into a height element (ST 304). The outlines of the upper and the lower edges of the page are shown in a distorted state in the captured image because the paper surface is three-dimensionally distorted so as to project toward the upper side. Thus, the height element, which indicates three-dimensionally distorted state of the upper and the lower edges of the page, can be obtained based on the distortion elements indicating the outlines of the upper and the lower edges of the page. Specifically, the heights (coordinates of a Z axis) of the upper and the lower edges of the page with respect to the placing surface 5 are obtained at regular intervals. With the height element, an actual length of the upper and the lower edges of the page can be estimated.
Thereafter, horizontal and vertical mesh lines are generated (ST 305). The horizontal mesh line and the vertical mesh line intersect with each other at a mesh intersection point. A coordinate of the mesh intersection point is stored in a mesh table (ST 306). Herein, as shown in
The present embodiment includes the one-stroke-writing specifying mode (first area specifying mode) shown in
As shown in
As shown in
Thereafter, it is determined whether or not the pointer F has stopped its motion for a predetermined time period (one second, for example) (ST 402). In a case where the pointer F has stopped its motion, it is then determined whether or not the pointer F has started a predetermined action (ST 403). In a case where the pointer F has started the predetermined action, tracking of a trajectory is started using the position where the pointer F has stopped first as a starting point. A coordinate of the obtained trajectory is stored in a memory (ST 404).
In this embodiment, a start of an area specifying action is detected when the pointer F stops and then moves in either left or right direction, that is, a direction substantially orthogonally intersecting with the centerline or the seam of the pages. Tracking of the trajectory is thus started. The trajectory of the pointer is drawn on a screen of the captured image displayed on the display 26.
Then, it is determined whether or not the predetermined specifying action has been ended, that is, whether or not the pointer has stopped its motion in a vicinity of the starting point (ST 405). In a case where the predetermined specifying action has been ended, tracking of the trajectory is ended, and main points of the specified area are extracted (ST 406). Herein, a polygonal area is specified, the polygonal area having vertexes that are bending points at which a movement direction of the pointer changes about 90°. These bending points and the starting point are extracted as the main points for the area specifying process. The polygonal-shaped specified area can be obtained by connecting the plurality of extracted bending points with a straight line in a clockwise order and a counter clockwise order indicated by the trajectory of the pointer.
In a case where the pointer F specifying an area is a user's finger or an ordinary pen used for writing, a process to identify the pointer F by shape identification is required. Alternatively, it is also possible to use a pointer that has an infrared light emitter at a tip thereof. In this case, infrared light coming out from the pointer appears in a captured image, and the infrared light may be detected.
On the other hand, as shown in
As shown in
Thereafter, from the two points specified by the two index fingers of left and right, respectively, straight lines parallel to the centerline indicating the seam of the pages and straight lines perpendicular to the centerline are extended. Intersection points of these lines are then obtained. The two intersection points obtained above and the two points specified by the index fingers are extracted as main points for an area specifying process. A rectangular area connecting the four main points becomes a specified area.
First, the secondary mesh model generator 34 synthesizes the coordinates of the main points of the specified area obtained by the cutout area obtainments shown in
The secondary mesh model can be generated by obtaining mesh intersection points that divide the primary mesh model such that spaces between each of the mesh intersection points become equal. An average size of a character is about 10 points (having a width of 3.5 mm). For example, when mesh spacing of the primary mesh model is 10.5 mm that is equivalent to three average sized characters of 10 points, the mesh spacing of the secondary mesh model is set to be one character of 10 points, that is, 3.5 mm or ⅓ of the mesh spacing of the primary mesh model.
Thereafter, the cutout image generator 35 performs planarization by projective transformation with respect to only an image portion corresponding to the cutout area for which the secondary mesh model has been generated, (ST 604). Thereby, as shown in
As described above, an image planarization is performed using the secondary mesh model having the smaller mesh spacing, therefore it is possible to increase transformation accuracy of the planarization. In addition, it is possible to obtain a cutout image of high quality having a smaller distortion. Furthermore, since only an image portion corresponding to a necessary cutout area is planarized, a burden of computation required for planarization is reduced, thereby making it possible to increase the processing speed.
Herein, a description is provided for image shifting that occurs at the time of specifying an area with the pointer F such as a finger, a pen, or the like.
As shown in
A width of the margin to be secured around the specified area at the time of setting a cutout area may be determined based on an amount of image shifting according to the sag of the paper due to pressure from the pointer F such as a finger, a pen, or the like. An amount of image shifting is different depending on a book type (a magazine, a hardcover, or the like) and a paper quality, but an expected value is about 5 mm at greatest. This value is roughly equivalent to two average sized characters of 10 points (having a width of 3.5 mm). Accordingly, it is preferable that a margin equivalent to at least two characters of 10 points be secured.
Particularly, in this embodiment, as shown in
In this case, the mesh spacing of the primary mesh model may be set such that at least three characters are included in one mesh. Since an average size of a character is about 10 points (having a width of 3.5 mm), as calculated as three characters of 10 points, the mesh becomes a square of 10.5 mm (3.5 mm×3) or more.
As described above, the cutout area is the area larger than the area actually specified by the pointer. Thus, an unnecessary image is included in a peripheral area of the cutout image obtained by the above-described processing. Therefore, the unnecessary portion is cut out from the cutout image in order to obtain a final cutout image.
As shown in
Thereafter, as shown in
On the other hand, in a case where there is no frame within the cutout image, it is determined whether or not any blank larger than character spacing and line spacing exists around a group of characters (ST 705). In a case where there is no such a blank, a side having no blank is extracted (ST 706).
Thereafter, as shown in
In this embodiment, a simple OCR is first performed on the character strings in the cutout image (ST 707). Based on the result of the simple OCR, a writing direction, that is, either one of vertical writing and horizontal writing, is determined (ST 708). In this embodiment, the determination is made based on a positional relationship of a punctuation mark. When a punctuation mark is positioned on a right side below a preceding character, it is determined as vertical writing. When a punctuation mark is positioned on a lower side to the right of a preceding character, it is determined as horizontal writing. Then, in a case of vertical writing, processes thereafter are performed only on the right and the left sides having no blank (ST 709). In a case of horizontal writing, processes thereafter are performed only on the upper and the lower sides having no blank (ST 710).
Next, it is determined whether or not there is a punctuation mark at the end of a character string on the first line (ST 711). In a case where there is a punctuation mark at the end of the character string on the first line, a border line is set on an inner side of the character string on the first line. Then, an image of the character string on the first line is cut out along the new border line (cut-out line) (ST 712). Thereafter, it is determined whether or not there is any punctuation mark at the end of a character string on the second line to the last (ST 713). In a case where there is a punctuation mark at the end of the character string on the second line to the last, a border line is set on an inner side of the character string on the last line. An image of the character string on the last line is cut out along the new border line (cut-out line) (ST 714).
In addition, in the above-described example, as shown in
Furthermore, in the above-described example, only a cutout area including an area specified by use of a pointer such as a finger, a pen, or the like is planarized to obtain a cutout image. However, an image portion corresponding to the cutout area may be cut out after planarization is performed on an entirety of a paper surface of a book.
It is noted that the foregoing examples have been provided merely for the purpose of explanation and are in no way to be construed as limiting of the present invention. While the present invention has been described with reference to exemplary embodiments, it is understood that the words which have been used herein are words of description and illustration, rather than words of limitation. Changes may be made, within the purview of the appended claims, as presently stated and as amended, without departing from the scope and spirit of the present invention in its aspects. Although the present invention has been described herein with reference to particular structures, materials and embodiments, the present invention is not intended to be limited to the particulars disclosed herein; rather, the present invention extends to all functionally equivalent structures, methods and uses, such as are within the scope of the appended claims.
The present invention is not limited to the above described embodiments, and various variations and modifications may be possible without departing from the scope of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
2011-030966 | Feb 2011 | JP | national |