1. Field of the Invention
The present invention relates to an image processing apparatus for performing predetermined processing on a read image acquired by a reading device reading an original, and an image processing method.
2. Description of the Related Art
An image reading device (scanner) for optically reading a written original and a photo and converting a read image into electronic data is widely spread. A number of such image reading devices are provided not only as a single device but also as a multifunction peripheral, such as a copying machine integrated with a printing device and a facsimile integrated with a transmission/reception function. Further, in recent years, various image processing methods have been proposed for electronic data that is read, such as the OCR (Optical Character Recognition) technique and the technique of PDF file conversion. At this time, it is regarded as important to accurately grasp, in particular, directional properties of a read original.
For example, Japanese Patent Laid-Open No. 2001-256491 discloses the technique to read an original together with a background whose color data is known in advance and to acquire an inclination of the read original as well as separating the background and the region of the original and to correct the inclination.
By using the technique such as this described in Japanese Patent Laid-Open No. 2001-256491, even in the case where an original is placed with an inclination, it is possible to perform OCR processing or carry out conversion into a PDF file after correcting the orientation of the original on electronic data, and therefore, it is made possible to efficiently acquire character information.
However, in the recent image reading device, it is common to utilize a white sheet having a high degree of whiteness as a background of an original. The reason is that ink or toner is prevented from being consumed wastefully for the region to be read other than the original at the time of printing the image after that. On the other hand, sheets used as an original include recycled paper recycled from waste paper and the degree of whiteness of the recycle paper increases year after year and has become substantially the same as that of the high-quality paper. Then, in the state where an original whose degree of whiteness is high is read together with a white sheet whose degree of whiteness is also high as a background as described above, it becomes difficult to separate the original and the background based on the difference in color data and to extract the edge of the original as described in Japanese Patent Laid-Open No. 2001-256491.
The present invention has been made in order to solve the above-described problems and an object thereof is to provide an image processing apparatus capable of accurately determining a region corresponding to an original in the read image of the original.
In a first aspect of the present invention, there is provided an image processing apparatus comprising: an acquisition unit configured to acquire a read image acquired by a reading device reading an original; a specifying unit configured to specify a region having a feature of fiber from a read image by analyzing the read image acquired by the acquisition unit; and a performing unit configured to perform predetermined processing on the read image based on the region specified by the specifying unit.
In a second aspect of the present invention, there is provided an image processing method comprising: an acquisition step of acquiring a read image acquired by a reading device reading an original; a specifying step of specifying a region having a feature of fiber from a read image by analyzing the read image acquired in the acquisition step; and a performing step of performing predetermined processing on the read image based on the region specified in the specifying step.
In a third aspect of the present invention, there is provided a non-transitory computer readable storage medium storing a program for causing a computer to perform as the image processing apparatus according to the first aspect.
Further features of the present invention will become apparent from the following description of exemplary embodiments (with reference to the attached drawings).
Hereinafter, with reference to drawings, preferred embodiments of the present invention are explained in detail in an illustrative manner.
Referring to
At step S302 that follows, the image processing unit 204 performs gamma correction to tune the gradation characteristics of the optical element to visual gradation characteristics. Specifically, by referring to a one-dimensional lookup table stored in the ROM 202 in advance or by using a calculation expression, the multivalued digital luminance signals RGB are converted into multivalued digital luminance signals R′G′B′. After the gamma correction at step S302 is completed, the image processing by the image processing unit 204 ends and the CPU 201 transfers these multivalued digital luminance signals R′G′B′ to the host device via the PC interface 207. At this time, in order to reduce the amount of data at the time of transfer, it is also possible to interpose the publicly-known compression processing. Further, it is also possible to determine whether or not compression processing is necessary in accordance with the transfer rate of the PC interface 207.
At step S402, the received entire image region corresponding to one page is searched and target sections are set. The target section is a section to be subjected to a paper characteristic detection analysis, to be described later, and basically, all the regions having a luminance signal value close to that of white data are set. Specifically, by gradually moving a unit region having a predetermined size (n pixels×n pixels) in the entire image region, all the regions where the average luminance signal values within the unit region are higher than respective threshold values of RGB are selected. At this time, it may also be possible to calculate averages of the luminance signal values at each position while moving a unit region in units smaller than n pixels and to determine whether or not the region can be the target section at each position. By the processing at step S402, it is possible to set the candidate of the region corresponding to the color of the sheet itself as the above-described target section by excluding the region corresponding to a color different from the color of the sheet itself on which the image to be printed is printed, for example, such as the region of a color photo printed on the sheet.
At step S403 that follows, the paper characteristic extraction processing characteristic of the present invention is performed on each target section set at step S402.
After the present processing is started, the host device 2 first carries out two-dimensional discrete Fourier transformation (hereinafter, referred to as DFT) on each target section and acquires a two-dimensional spatial frequency distribution at step S501.
At step S502 that follows, the host device 2 performs binarization processing on the spatial frequency distribution obtained at step S501. As a threshold value for binarization at this time, a value prepared in advance may be used or the threshold value may be found from an average value of image signals. By the binarization processing, each coordinate in the spatial frequency distribution is set to black (0) or white (1).
At step S503, the host device 2 performs bold processing on the spatial frequency distribution after being subjected to the binarization processing obtained at step S502. Specifically, with the coordinate set to white (1) as a center, the region of the several pixels surrounding the coordinate is set to white (1) forcibly.
At step S504, the host device 2 removes isolated points from the spatial frequency distribution after the bold processing obtained at step S503. As is seen in
At step S505 to S508 below, whether the spatial frequency distribution after isolated points are removed has a tendency characteristic of a sheet (paper fiber) is analyzed.
Here, the feature of a sheet is explained specifically. In general, the raw material of a sheet is wood chips and coarse fiber is removed first in the pulping process and after that, through the cleaning and bleaching processes, the paper making process is performed. In the paper making process, the remaining fine fiber is put side by side with directional properties by a wire part and a press part. As a result, the sheet has the feature of grain, such as crosswise grain or lengthwise grain. Although depending on the kind of the material wood, the general size of fiber is about tens of micrometers to 1 to 3 mm. In other words, the feature of a sheet is that fine lines are put side by side with directional properties. Then, in most cases, the roll paper thus manufactured is cut vertically or horizontally with respect to the conveyance direction or width direction and cut paper of a fixed size, such as A4 and B5, is manufactured. Because of this, the sheet of fixed size has fiber with lengthwise grain or crosswise grain with respect to the cut surface. As a summary of the above, in the case where the DFT processing is performed on image data obtained by scanning the white-paper region of a sheet, it can be said that the spatial frequency distribution thereof has features below.
Feature 1: The fiber is fine lines, and therefore, power is detected in high frequency components.
Feature 2: The fine line of the fiber has directional properties, and therefore, directivity occurs in the power spectrum.
Feature 3: Directivity appears in the direction vertical or horizontal to the orientation of rectangular paper.
In view of the above, at steps S505 to S508, whether the acquired spatial frequency distribution has a tendency characteristic of a sheet (paper fiber) is analyzed. First, at step S505, the host device 2 analyzes the spatial frequency distribution obtained at step S504 and determines whether or not power appears in the frequency component equal to or more than a predetermined threshold value (high frequency component). Whether or not power appears in the high frequency component can be checked by determining whether or not white data exists at a position a predetermined distance or more away from the origin by referring to
On the other hand, in the case where no power appears in the frequency component equal to or more than the predetermined value, the host device 2 proceeds to step S509 and determines that the target section is a non-fiber section (on the sheet) and exits the present processing.
At step S506, the host device 2 analyzes the spatial frequency distribution and calculates a flatness of the power spectrum existent region. Specifically, with reference to
f=(a−b)/a
Further, at step S507, whether or not the flatness f found at step S506 is equal to or more than a predetermined threshold value Tf is determined. Here, in the case where f>Tf, it can be said that the power spectrum has directivity and has the above-described feature 2. Consequently, the host device 2 proceeds to step S508 and determines that the target section is a fiber section (on the sheet) because of retaining the above-described feature 1 and feature 2. On the other hand, in the case where f≦Tf, no directivity is recognized in the power spectrum, and therefore, the host device 2 proceeds to step S509 and determines that the target section is not a fiber section (on the sheet), and exits the present processing.
At step S510, the host device 2 analyzes the spatial frequency distribution and acquires an inclination of the major axis with respect to the X-axis or the Y-axis. In the case of
As above, by performing the paper characteristic extraction processing explained by using
In the example in
Explanation is returned to the flowchart in
According to the present embodiment explained as above, it is possible to determine an inclination at the time of the original being placed by extracting the white-paper region of the sheet as a fiber section and by detecting the direction of fiber. Consequently, in the subsequent processing, it is possible to effectively perform various kinds of image processing, such as OCR, by taking into consideration the inclination of the image.
In the present embodiment also, as in the first embodiment, the image processing apparatus explained in
At step S905, the host device 2 optimizes an original edge extraction filter based on the inclination Θ of the original acquired at step S904. The original edge (i.e., cut side of the cut paper) is substantially parallel or vertical to the inclination Θ of the original, and therefore, the host device 902 selects a filter most suitable to the inclination Θ. At this time, it may also be possible to select a filter from filters of various angles prepared in advance or to newly produce a filter by calculating an optimum filter coefficient from the inclination Θ. After that, at step S906, the host device 2 extracts the original edges of the four sides by using the filter obtained by selection or production as above at step S905.
For example, referring to
Explanation is returned to the flowchart in
According to the present embodiments explained as above, it is possible to determine an inclination of an original being placed and to generate image data in which the inclination is corrected. Consequently, in the subsequent image processing, it is possible to perform appropriate processing in the correct direction without the need to take the inclination of the image into consideration.
In the embodiments explained as above, the processing at step S502 to step S504 of the paper characteristic extraction processing is performed in order to ensure the analysis after step S505 and is not necessarily required. As long as the frequency analysis after step S505 is performed effectively, the processing may be changed in any way or may be deleted.
Further, in the above-described embodiments, explanation is given on the assumption that the size of the target section in the read image, for which whether or not it is on the sheet is determined, is (n pixels×n pixels). It is preferable for the size n to be adjusted in accordance with the resolution of the image read by the reading device 1. Specifically, the resolution of the image is 500 ppi (pixel/inch) or more, preferably, 1,200 ppi or more. In the case where the image resolution is 1,200 ppi, the size of one pixel is about 20 μm. At this time, it is sufficient for the size n of the target section to be about 100 pixels. In the case where the image resolution is about 500 ppi, the size of one pixel is about 50 μm. At this time, it is sufficient for the size n of the target section to be about 50 pixels.
As described above, in the case where “n” of the above-described target section is adjusted, for example, the value of n is dynamically changed in accordance with the resolution in reading set of reading. For example, it may also be possible to store “n” corresponding to each of a plurality of resolutions that can be set in the reading device in the memory (e.g., ROM 202) within the reading device in association with the resolution and to read “n” in accordance with the resolution set at the time of reading from the above-described memory.
In the above embodiments, in order to detect the inclination of an original, whether the target section is on the sheet is determined. However, this is not limited and, for example, it may also be possible to apply the processing in the above embodiment in order to specify the region corresponding to the original in the read image.
For example, as shown in
Further, in the above, explanation is given by using the image processing apparatus shown in
It is also possible to implement the functions of the above-described embodiments by configurations below. In other words, the functions are achieved also by supplying program codes for performing the processing of the present embodiments to a system or a device and by a computer (or CPU or MPU) of the system or the device executing the program codes. In this case, the program codes themselves read from a storage medium implement the functions of the above-described embodiments as a result, and further, the storage medium storing the program codes also implements the functions of the present embodiments.
Further, there may be a case where the program codes for implementing the functions of the present embodiments are executed by one computer (CPU, MPU) or there may be a case where they are executed by a plurality of computers in cooperation with one another. Furthermore, there may be a case where the program codes are executed by a computer, or hardware, such as a circuit, for implementing the functions of the program codes may be provided. Alternatively, there may be a case where part of the program codes are implemented by hardware and the rest is executed by a computer.
Embodiments of the present invention can also be realized by a computer of a system or apparatus that reads out and executes computer executable instructions recorded on a storage medium (e.g., non-transitory computer-readable storage medium) to perform the functions of one or more of the above-described embodiment (s) of the present invention, and by a method performed by the computer of the system or apparatus by, for example, reading out and executing the computer executable instructions from the storage medium to perform the functions of one or more of the above-described embodiment(s). The computer may comprise one or more of a central processing unit (CPU), micro processing unit (MPU), or other circuitry, and may include a network of separate computers or separate computer processors. The computer executable instructions may be provided to the computer, for example, from a network or the storage medium. The storage medium may include, for example, one or more of a hard disk, a random-access memory (RAM), a read only memory (ROM), a storage of distributed computing systems, an optical disk (such as a compact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)™), a flash memory device, a memory card, and the like.
While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.
This application claims the benefit of Japanese Patent Application No. 2013-174718, filed Aug. 26, 2013, which is hereby incorporated by reference herein in its entirety.
Number | Date | Country | Kind |
---|---|---|---|
2013-174718 | Aug 2013 | JP | national |