1. Field of the Invention
The present invention relates to an image processing apparatus that reads a document image with an image sensor and storing resulting image data in a storage section, as well as to its image processing method.
2. Description of the Related Art
When plural pages of a document are supplied to a reading device with an automatic sheet feeder and read by the reading device, there may occur an event that a document page is supplied to the reading device obliquely. In this case, a document image portion contained in image data obtained by reading such a document page is inclined and hence it is necessary to perform a correction of rotating the document image portion into a non-inclined one.
Where the maximum readable document size of a reading device is the A3 size and a document to be read has the A4 size, document pages can be read irrespective of whether they are oriented vertically or horizontally. In such a case, it may be necessary to rotate image data obtained by reading each document page from horizontal orientation to vertical orientation or vice versa.
The reading device sequentially produces image data of the lines of the whole of each document page by moving the document page or a line image sensor in the auxiliary scanning direction every time one line of the document page is read with the line image sensor in the main scanning direction, and hence image data of the lines are stored in an image memory sequentially.
An image processing apparatus of the above kind capable of rotating image data is known which is disclosed in Patent document 1. An image communication apparatus disclosed in Patent document 1 is such that a facsimile function is added to a printing apparatus such as a laser beam printer. In this image communication apparatus, if A4 printing sheets are oriented horizontally when it is attempted to print received A4 image data that is oriented vertically, image data of each page (A4 vertical) is divided into plural blocks and image data of the plural blocks are rotated so as to conform to respective A4-horizontal divisional blocks (target blocks) and printed sequentially. As a result, processing of rotating the entire image data of each page is not necessary and the necessary memory capacity can be reduced.
Patent document 1: JP-A-9-214745
The image communication apparatus disclosed in Patent document 1 merely rotate each page of an A4 document by 90° from vertical orientation to horizontal orientation. Therefore, target blocks can be divisional bands of an A4-horizontal area.
However, the image processing method of the image communication apparatus disclosed in Patent document 1 cannot accommodate a case of rotating image data that is inclined by an arbitrary angle other than 90°, 180°, and 270° with respect to a reference direction.
In rotating image data of each document page by an arbitrary angle, an image processing apparatus can be reduced in size or cost if the necessary buffer capacity is minimized.
An object of the present invention is therefore to provide an image processing apparatus and its image processing method that can reduce the buffer capacity which is necessary in rotating image data by an arbitrary angle.
An image processing apparatus according to the invention is characterized by comprising storage section for storing image data; storage managing section for managing the image data in the form of plural processing blocks that are arranged in a vertical direction and a horizontal direction, and storing at least part of the processing blocks in the storage section in such a manner that each processing block is accessible; block data reading section for reading, as processing subject blocks, processing blocks that overlap with a rectangular area inclined with respect to the image data by a certain angle and in which at most three processing blocks are arranged in a reference direction which is a vertical direction or a horizontal direction, from the storage section for each band of processing blocks arranged in the reference direction; rotated image buffering section for storing the read-out processing subject blocks, the rotated image buffering section having a capacity corresponding to three processing blocks for each band of processing blocks arranged in the reference direction; and block rotating section for rotating the processing subject blocks that are read out by the block data reading section by a specified angle while maintaining positional relationships between the processing subject blocks, and storing rotated processing subject blocks in the rotated image buffering section.
According to the invention, it suffices that the rotated image buffering section for storing processing blocks to perform rotation has a capacity that corresponds to three processing blocks E for each band, extending in the reference direction, of image data. Therefore, the necessary buffer capacity can be minimized. That is, the invention can save the memory capacity that is required in rotating image data by an arbitrary angle.
A first aspect of the invention provides an image processing apparatus comprising a storage section for storing image data; a storage managing section for managing the image data in the form of plural processing blocks that are arranged in a vertical direction and a horizontal direction, and storing at least part of the processing blocks in the storage section in such a manner that each processing block is accessible; a block data reading section for reading, as processing subject blocks, processing blocks that overlap with a rectangular area inclined with respect to the image data by a certain angle and in which at most three processing blocks are arranged in a reference direction which is a vertical direction or a horizontal direction, from the storage section for each band of processing blocks arranged in the reference direction; a rotated image buffering section for storing the read-out processing subject blocks, the rotated image buffering section having a capacity corresponding to three processing blocks for each band of processing blocks arranged in the reference direction; and a block rotating section for rotating the processing subject blocks that are read out by the block data reading section by a specified angle while maintaining positional relationships between the processing subject blocks, and storing rotated processing subject blocks in the rotated image buffering section. In this aspect of the invention, to cut out and rotate back a rectangular area that is inclined with respect to the area of image data by a certain angle, the block data reading section reads out, as processing subject blocks, for each band of processing blocks arranged in the reference direction, processing blocks that overlap with the inclined rectangular area and in which at most three processing blocks are arranged in the reference direction. As a result, the rotation processing can be performed by processing a smallest amount of data. It suffices that the rotated image buffering section for storing processing blocks to perform rotation has a capacity that corresponds to three processing blocks for each band, extending in the reference direction. Therefore, the necessary buffer capacity can be minimized.
A second aspect of the invention provides an image processing apparatus which further comprises a cutting-out area processing section for dividing the rectangular area into cutting-out blocks that are arranged in two orthogonal directions when a width of the rectangular area is greater than a prescribed value, and in which the block data reading section sequentially reads sets of processing subject blocks that overlap with respective band-shaped cutting-out blocks each extending in one of the two orthogonal directions. According to this aspect of the invention, since the cutting-out area into cutting out blocks that are arranged in the two orthogonal directions, data rotation can be performed without increasing the capacity of the rotated image buffering section even in the case where the width of the rectangular area is greater than the prescribed value.
A third aspect of the invention provides an image processing apparatus wherein the cutting-out area processing section sets the length of shorter sides of each of the band-shaped cutting-out blocks shorter than or equal to √{square root over (2)} times a length of each side of each of the processing blocks which are square. According to this aspect of the invention, for the following reason, the number of processing subject blocks that overlap with each band-shaped cutting-out block can be made smaller than or equal to three. The area of overlap between a processing block and a band-shaped cutting-out block is largest when the two longer sides of the band-shaped cutting-out block pass respective diagonal apices of the processing block. In this case, the band-shaped cutting-out block inclined with respect to the processing block E by 45°. If the length of the shorter sides of each band-shaped cutting-out block is set √{square root over (2)} times the length of each side of each processing block E, the band-shaped cutting-out blocks become rectangles whose width is equal to the diagonal length of each processing block. Therefore, the band-shaped cutting-out block overlaps with three processing blocks in total, that is, the middle processing block and the two processing block located on both sides of the middle processing block. Therefore, the cutting-out area R can be rotated using a minimum-capacity storage area if the rotated image buffering section 16 is provided with a storage capacity that corresponds to three processing blocks F. In conclusion, a cut-out rectangular area can be rotated with a minimum storage capacity by forming the rotated image buffering section so that it has a capacity corresponding to three processing blocks for each band, extending in the reference direction, of image data.
A fourth aspect of the invention provides an image processing apparatus wherein the block rotating section performs a combination of a rotation of 90°, 180°, or 270° and a rotation of an angle that is larger than 0° and smaller than or equal to 45° on the rectangular area when an angle formed by a longitudinal direction of the rectangular area and the reference direction which is an inclination angle of the rectangular area is larger than 45°. According to this aspect of the invention, since a combination of a rotation of 90°, 180°, or 270° and a rotation of an angle that is larger than 0° and smaller than or equal to 45° is performed on the rectangular area when the angle formed by the longitudinal direction of the rectangular area and the reference direction which is an inclination angle of the rectangular area is larger than 45°, the rectangular area can be rotated by an arbitrary angle from 0° to 360°.
A fifth aspect of the invention provides an image processing method which is characterized by comprising a storage managing step of managing image data in the form of plural processing blocks that are arranged in a vertical direction and a horizontal direction, and storing at least part of the processing blocks in storage section in such a manner that each processing block is accessible; a block data reading step of reading, as processing subject blocks, processing blocks that overlap with a rectangular area inclined with respect to the image data by a certain angle and in which at most three processing blocks are arranged in a reference direction which is a vertical direction or a horizontal direction, from the storage section for each band of processing blocks arranged in the reference direction; and a block rotating step of rotating the read-out processing subject blocks by a specified angle while maintaining positional relationships between the processing subject blocks, and storing rotated processing subject blocks in a rotated image buffering section for storing the read-out processing subject blocks which has a capacity corresponding to three processing blocks for each band of processing blocks arranged in the reference direction. In this aspect of the invention, to cut out and rotate back a rectangular area that is inclined with respect to the area of image data by a certain angle, processing blocks that overlap with the inclined rectangular area and in which at most three processing blocks are arranged in the reference direction are read out as processing subject blocks for each band of processing blocks arranged in the reference direction. As a result, the rotation processing can be performed by processing a smallest amount of data. It suffices that the rotated image buffering section for storing processing blocks to perform rotation has a capacity that corresponds to three processing blocks for each band extending in the reference direction. Therefore, the necessary buffer capacity can be minimized.
An image processing apparatus and its image processing method according to an embodiment of the invention will be hereinafter described with reference to the drawings using a scanner as an example.
As shown in
Being a general solid-state imaging device such as an optical reduction type CCD (charge-coupled device) or a contact sensor type CIS (contact image sensor), the line image sensor 10 can read a document image in full-color in the main scanning direction in units of a prescribed number of lines.
Where the scanner is of a flat bed type, a document is placed on a transparent platen and a document image is read as the line image sensor 10 is moved under the platen in the auxiliary scanning direction.
Where the scanner is of a sheet feed type, the line image sensor 10 is fixed at a position that is close to a reading position on a platen and a document is moved in the auxiliary scanning direction by transport rollers (not shown). The line image sensor 10 reads a moving document image in the main scanning direction in units of a prescribed number of lines.
In the embodiment, the line image sensor 10 reads a document image in the main scanning direction on a line-by-line basis. Alternatively, the scanner may be configured in such a manner that a document image is read in units of plural lines (e.g., four lines).
As shown in
More specifically, in the example of
The cutting-out area processing section 12 shown in
The cutting-out blocks F will be described below. As shown in
In other words, the cutting-out area processing section 12 recognizes, as the cutting-out area R, the area containing the read-out data of the document and the cutting-out area R is a set of 16 cutting-out blocks F.
If a document being inclined is read as image data IM, as shown in
The input image buffering section 13 shown in
The block data reading section 14 shown in
The block rotating section 15 shown in
The rotated image buffering section 16 shown in
The pixel interpolating section 17 shown in
The output image buffering section 18 shown in
The output section 19 shown in
An operation of the above-configured scanner according to the embodiment of the invention will be described below. The following description will be directed to a case that the scanner capable of reading an A3 document reads an A4 document in an inclined manner. As shown in
As shown in
Then, likewise, head addresses of processing blocks E (B, 0) to (B, 3), (C, 0) to (C, 3), and (D, 0) to (D, 3) are stored sequentially in the management table.
At step S20, the cutting-out area processing section 12 recognizes an inclination, a width, and a height of the document, a document position, a document direction, etc. while reading the head addresses from the management table of the storage managing section 11 and detects a cutting-out area R (see
As shown in
The size of cutting-out blocks F that is set by the cutting-out area processing section 12 will now be described with reference to
The band-shaped cutting-out block F′ (T1) which is indicated by a chain line overlaps with the top three processing blocks F (A, 0), (B, 0), and (C, 0) of the four processing blocks E which constitute band 0. The band-shaped cutting-out block F′ (T2) which is indicated by a broken line overlaps with the bottom three processing blocks F (B, 0), (C, 0), and (D, 0) of the same four processing blocks E. In this case, the area of overlap between a processing block E and a band-shaped cutting-out block F′ is largest when the two longer sides of the band-shaped cutting-out block F′ pass respective diagonal apices of the processing block E, that is, the two longer sides of the band-shaped cutting-out block F′ pass respective diagonal apices of the processing block E with the band-shaped cutting-out block F′ inclined with respect to the processing block E by 45°.
If the length of the shorter sides of each band-shaped cutting-out block F′ is set √{square root over (2)} times the length of each side of each processing block E, the band-shaped cutting-out blocks F′ become rectangles whose width is equal to the diagonal length of each processing block E as is understood from the band-shaped cutting-out block F′ (T3) shown in
Therefore, when the band-shaped cutting-out blocks F′ are inclined with respect to the processing blocks E by 45°, the band-shaped cutting-out blocks F′ (T1) and (T2) which are merely deviated in position from the band-shaped cutting-out block F′ (T3) overlap with the three processing blocks E in total, that is, the middle processing blocks E (B, 0) and (C, 0) and the one adjacent to the processing block E (A, 0) (located above) or (D, 0) (located below). Therefore, the cutting-out area R can be rotated using a minimum-capacity storage area if the rotated image buffering section 16 is provided with a storage capacity that corresponds to three processing blocks F for each band (see
Returning to
For example, as shown in
A method by which the block rotating section 15 shown in
The block rotating section 15 rotation-corrects a cutting-out area Rx of a document P by combining a positive rotation and a negative rotation so that the top side H of the cutting-out area Rx most efficiently coincides with a reference line L1 which extends in the main scanning direction from the center O which is the top-left apex of the cutting-out area Rx.
For example, if as shown in
If as shown in
If as shown in
In this embodiment, the reference line L2 extends perpendicularly to the reference line L1 (i.e., extends in the auxiliary scanning direction) and intersects the reference line L1 at the center O. However, the invention is not limited to such a case.
If as shown in
If as shown in
If as shown in
If as shown in
If as shown in
As described above, in each of the first to fourth quadrants which are defined by the reference lines L1 and L2, the block rotating section 15 rotates processing blocks E by an arbitrary angle from 0° to 360° in such a manner that first a rotation that is smaller than or equal to 45° is performed so that the top side H of the cutting-out area Rx coincides with the reference line L1 or L2 and then a rotation of 90°, 180°, or 270° is performed if necessary.
Since the inclination angle θp with respect to the main scanning direction is larger than 180° and smaller than or equal to 225°, the processing subject blocks G are rotated by −180° and stored in the rotated image buffering section 16. Then, the block rotating section 15 reads the processing subject blocks G from the rotated image buffering section 16 and rotates them by (180°−θp) which remains after the rotation of −180° (step S50).
The pixel interpolating section 17 detects coordinates of the apex pixel of the cutting-out block F (3, 3), calculates inter-pixel distances between the apex pixel and the four pixels (enclosed by thick circles) of the processing block E (D, 2) that surround the apex pixel, and calculates a position of interpolation image data on the basis of the calculated inter-pixel distances. Image data IM produced by the pixel interpolating section 17 through such interpolation is stored in the output image buffering section 18 (step S60).
At step S70, the block data reading section 14 judges whether or not all of the band-shaped cutting-out blocks F′ have been processed. If not all of the band-shaped cutting-out blocks F′ have been processed yet, the block data reading section 14 reads out processing blocks E that overlap with the band-shaped cutting-out block F′ that is next to the just-processed band-shaped cutting-out blocks F′.
When all of the cuffing-out blocks F that constitute the cutting-out area R have been subjected to the rotation processing in the above-described manner, the output section 19 reads resulting image data IM from the output image buffering section 18 and outputs it to the personal computer that is connected to the scanner.
As described above, in the scanner according to the embodiment, to cut out and rotate a rectangular area that is inclined with respect to the area of image data IM by a certain angle, at most three processing blocks E that overlap with each band-shaped cutting-out block F′ are read out as processing subject blocks G for each band of the image data IM. As a result, the rotation processing can be performed by processing a smallest amount of data.
It suffices that the rotated image buffering section 16 for storing processing blocks E to perform rotation has a capacity corresponding to three processing blocks E for each band of image data IM. Therefore, the necessary buffer capacity can be minimized.
Furthermore, since a cutting-out area is formed by cutting out blocks F which are arranged in the vertical direction and the horizontal direction and processing is performed in units of a cutting-out block F, data rotation can be performed without increasing the capacity of the rotated image buffering section 16 even in the case of rotating a wide cutting-out area.
Capable of reducing a memory capacity that is necessary in rotating image data by an arbitrary angle, the invention can suitably applied to an image processing apparatus and its image processing method for reading a document image with an image sensor and storing resulting image data in a storage section.
This application claims the benefit of Japanese Patent application No. 2009-084601 filed on Mar. 31, 2000, the entire contents of which are incorporated herein by reference.
Number | Date | Country | Kind |
---|---|---|---|
2009-084601 | Mar 2009 | JP | national |