Image processing apparatus, image processing method and image scanning apparatus

An image processing apparatus including: a determining unit that performs determination so as to determine a color mode of a target image in a color mode order, in a page unit; and a subtracting unit that calculates a subtraction total number of pixels, wherein, the determining unit performs the determination of a first color mode in the color mode order based on a pixel ratio of a number of pixels of the first color mode in the color mode order to a total number of pixels, and the determining unit performs the determination of the second or subsequent color mode in the color mode order based on a pixel ratio of a number of pixels of the second or subsequent color mode in the color mode order to the subtraction total number of pixels calculated by the subtracting unit.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority from Japanese Patent Application No. 2010-221072 filed on Sep. 30, 2010, the entire contents of which are incorporated herein by reference.

TECHNICAL FIELD

Aspects of the present invention relate to an image processing apparatus, an image processing method and an image scanning apparatus, which determine a color mode of a target image.

BACKGROUND

A variety of technologies for determining a color mode of a target image have been suggested.

For example, an image processing apparatus disclosed in JP-A-2007-251740 converts image data, which is input in a page unit from an image scanning unit and is resolved into three colors of R, G and B, into bitmap data of four colors of yellow (Y), cyan (C), magenta (M) and black (K). Subsequently, the apparatus counts a number of color pixels of a whole page for each color and compares the counted number of color pixels with a threshold value. When at least one of the numbers of the color pixels for the three colors is larger than the threshold value, the apparatus determines that the image data is a color image. Meanwhile, when all of the number of color pixels is the threshold value or smaller, the apparatus determines that the image data is a black-and-white image.

However, according to the image processing apparatus disclosed in JP-A-2007-251740, the determination result is influenced by a ratio of the number of color pixels to a total number of pixels of a whole page. Therefore, even when the image data is a color image, the image data may be determined as a black-and-white image.

For example, as shown inFIG. 10, a pixel ratio of the number of color pixels 15000 to the total number of pixels 100000 of a whole page is 15% in an upper color image100. When the threshold value for identifying a color mode is 2% or larger of the total number of pixels, the pixel ratio 15% is larger than the threshold value 2%. Accordingly, the upper color image100is determined as a color image. Meanwhile, in a lower color image101obtained by reducing the upper color image100, a pixel ratio of the number of color pixels 1500 to the total number of pixels 100000 of a whole page is 1.5%. Accordingly, when the threshold value for identifying a color mode is 2% of the total number of pixels, the lower color image101is not determined as a color image, but is determined as a black-and-white image.

SUMMARY

Accordingly, aspects of the present invention provide an image processing apparatus, an image processing method and an image scanning apparatus, capable of securely determining a color mode of a target image without being influenced by a ratio of the number of color pixels to the total number of pixels of a whole page.

According to an aspect of the present invention, there is provided an image processing apparatus including an identifying unit, a counting unit, an acquiring unit, a determining unit, and a subtracting unit. The identifying unit identifies a color mode of each pixel included in image data, based on color data of each pixel included in the image data. The counting unit counts a number of pixels included in the image data for each color mode of each pixel identified by the identifying unit in a page unit. The acquiring unit acquires a total number of pixels included in the image data in a page unit. The determining unit performs determination so as to determine a color mode of a target image in a color mode order, in a page unit. The subtracting unit calculates a subtraction total number of pixels obtained by subtracting a summed number of pixels, which is obtained by summing the number of pixels of each color mode before a second or subsequent color mode in the color mode order, from the total number of pixels acquired by the acquiring unit, before a determination to the second or subsequent color mode in the color mode order is performed by the determining unit. The determining unit performs the determination of a first color mode in the color mode order based on a pixel ratio of a number of pixels of the first color mode in the color mode order to the total number of pixels, and the determining unit performs the determination of the second or subsequent color mode in the color mode order based on a pixel ratio of a number of pixels of the second or subsequent color mode in the color mode order to the subtraction total number of pixels calculated by the subtracting unit.

According to another aspect of the present invention, there is provided an image processing method including: identifying a color mode of each pixel included in image data, based on color data of each pixel included in the image data; counting a number of pixels included in the image data for each color mode of each pixel identified by the identifying unit in a page unit; acquiring a total number of pixels included in the image data in a page unit; performing determination so as to determine a color mode of a target image in a color mode order, in a page unit; and calculating a subtraction total number of pixels obtained by subtracting a summed number of pixels, which is obtained by summing the number of pixels of each color mode before a second or subsequent color mode in the color mode order, from the total number of pixels acquired by the acquiring unit, before a determination to the second or subsequent color mode in the color mode order is performed by the determining unit, wherein, the determination of a first color mode in the color mode order is performed based on a pixel ratio of a number of pixels of the first color mode in the color mode order to the total number of pixels, and the determination of the second or subsequent color mode in the color mode order is performed based on a pixel ratio of a number of pixels of the second or subsequent color mode in the color mode order to the subtraction total number of pixels calculated by the subtracting unit.

According to another aspect of the present invention, there is provided an image processing apparatus including an identifying unit, a counting unit, an acquiring unit, a first determining unit, a subtracting unit and a second determining unit. The identifying unit identifies a color mode, which includes a first color mode and a second color mode, of each pixel included in image data, based on color data of each pixel included in the image data. The counting unit counts a number of pixels included in the image data for each color mode identified by the identifying unit so as to obtain a total number of pixels for each color mode, in a page unit. The acquiring unit acquires a total number of pixels included in the image data in a page unit. The first determining unit performs determination by comparing a pixel ratio of a total number of pixels of the first color mode to the total number of pixels acquired by the acquiring unit with a first threshold value. The subtracting unit calculates a subtraction total number of pixels obtained by subtracting the total number of pixels of the first color mode from the total number of pixels acquired by the acquiring unit. The second determining unit performs determination by comparing a pixel ratio of a total number of pixels of the second color mode to the subtraction total number of pixels with a second threshold value.

SUMMARY

Hereinafter, illustrative embodiments implementing an image processing apparatus, an image processing method and an image scanning apparatus of the invention will be specifically described with reference to the drawings.

First, a schematic configuration of an image scanning apparatus1according to an illustrative embodiment is described with reference toFIGS. 1 to 3.

As shown inFIGS. 1 and 2, the image scanning apparatus1has an apparatus body2, a feeder port3that is provided at an upper part of the apparatus body2, a feeder tray4that is disposed to be inclined at a substantially vertical angle above the feeder port3, a discharge port5that is provided at a lower part of a front side of the apparatus body2and a discharge tray6on which a sheet P discharged from the discharge port5is stacked and that is arranged substantially horizontally.

The feeder tray4is provided with a pair of sheet guides7that restrains a position of the set sheet P in a width direction. Each sheet guide7has a cross-sectional shape of a substantial L shape and includes a plate7A that can be slid while being supported by a pair of guide recesses8extending in a width direction of the feeder tray4and a sidewall7B that stands from a side edge part of the plate7A. In addition, the respective sheet guides7are configured so that when one sheet guide7is slid, the other sheet guide7is correspondingly slid in an opposite direction by an interlocking mechanism which is not shown.

In addition, auxiliary trays4A,4B, which are configured to be pulled out and stored in an upper and lower direction, are provided to an upper end portion of the feeder tray4. The discharge tray6is provided to be rotatable toward the apparatus body2about a base end of the apparatus body2and thus to be able to closely contact an upper surface of the apparatus body2. Also, the discharge tray6has auxiliary trays6A,6B at a side edge part thereof opposite to the apparatus body2. As shown inFIG. 3, the respective auxiliary trays6A,6B are configured to be rotatable inwards to thus be stored so as to overlap the discharge tray6.

The apparatus body2has a lower frame12that configures a conveyance path11from the feeder port3to the discharge port5of the sheet P and an upper frame13that covers an upper side of the lower frame12so as to be openable and closable. When seen from a front side of the lower frame12, a left edge part is provided with a gear receiving unit14in which a gear train, which is not shown, is stored. A start switch15A, an error lamp15B and the like are arranged on an upper surface of the gear receiving unit14.

As shown inFIGS. 2 and 3, the lower frame12is provided with a first conveyance roller17that is disposed adjacent to the feeder port3and separates and pulls the sheet P, which is set on the feeder tray4, along the conveyance path11. A second conveyance roller18that separates and pulls the sheet P along the conveyance path11is disposed downstream of the first conveyance roller17in a conveyance direction. A pair of third conveyance rollers19that is attached on a same shaft and conveys the sheet P along the conveyance path11is provided downstream of the second conveyance roller18in the conveyance direction.

A first separation member21, which is made of a high frictional elastic member such as rubber and is brought into contact with an outer circumference of the first conveyance roller17when closing the upper frame, is provided at a position of the upper frame13opposing the first conveyance roller17. When closing the upper frame13, the first separation member21is elastically pressed by a pushing member22and a compression spring23which are arranged on a backside of the upper frame13, so that it is pressed on the outer circumference of the first conveyance roller17with predetermined load.

In addition, a second separation member25, which is made of a high frictional elastic member such as rubber and is brought into contact with an outer circumference of the second conveyance roller18when closing the upper frame, is provided at a position of the upper frame13opposing the second conveyance roller18.

When closing the upper frame13, the second separation member25is elastically pressed by a pushing member26, which has a leading end portion having a rectangular cross section, and a compression spring27which are arranged on a backside of the upper frame13so that the second separation member25is pressed on the outer circumference of both axial ends of the second conveyance roller18with predetermined load.

In addition, a pair of pinch rollers31is rotatably provided at positions of the upper frame13opposing the pair of third conveyance rollers19. The pinch rollers31have shafts that are elastically pressed toward the third conveyance rollers19by compression springs32. Accordingly, the respective pinch rollers31are pressure-contacted to the outer circumferences of the third conveyance rollers19, and when the third conveyance rollers19are respectively rotated, the respective pinch rollers31are correspondingly rotated.

Regarding the sheets P that are fed to the feeder tray4and guided to a nip portion between the first conveyance roller17and the first separation member21, the lowest sheet P, i.e., the sheet P contacting the outer circumference of the first conveyance roller17is separated due to the friction with the first separation member21by the rotation of a shaft17A of the first conveyance roller17and is then conveyed to the second conveyance roller18.

Subsequently, regarding the sheet P conveyed to a nip portion between the second conveyance roller18and each contact part25A of the second separation member25, the sheet P contacting the outer circumference of the second conveyance roller18is separated by the friction with each contact part25A and is then conveyed to the pair of third conveyance rollers19disposed downstream in the conveyance direction.

As shown inFIG. 3, a first sheet sensor34detecting the sheet P is provided at a position adjacent to a left side of the first conveyance roller17when seen from the front side. A second sheet sensor35detecting the sheet P is provided at a position adjacent to a left side of the second conveyance roller18when seen from the front side. When the first sheet sensor34detects the sheet P conveyed to the nip portion between the first conveyance roller17and the first separation member21, the first sheet sensor outputs an ON signal. When the sheet P is not detected, the first sheet sensor outputs an OFF signal. Likewise, when the second sheet sensor35detects the sheet P conveyed to the nip portion between the second conveyance roller18and each contact part25A of the second separation member25, the second sheet sensor outputs an ON signal, and when the sheet P is not detected, the second sheet sensor outputs an OFF signal.

In addition, as shown inFIG. 3, a third sheet sensor37that detects a leading end portion of the sheet P having passed through the nip portions between the respective third conveyance rollers19and the respective pinch rollers31is provided at a substantially central position between the third conveyance rollers19. As shown inFIG. 2, when a contact member38is rotated in a downstream direction in the conveyance direction by the sheet P having passed through the nip portions between the pair of third conveyance rollers19and the pair of pinch rollers31, the third sheet sensor37outputs an ON signal. When the contact member38is not rotated by the sheet P, the third sheet sensor outputs an OFF signal.

As shown inFIGS. 2 and 3, the lower frame12is provided with a lower line sensor41, which is configured by a so-called contact image sensor, at a downstream side of the third conveyance rollers19and the third sheet sensor37in the conveyance direction. The lower line sensor scans an image of a surface of the sheet P conveyed along the conveyance path11.

In addition, the upper frame13is provided with an upper line sensor42, which is configured by a contact image sensor, at a downstream side of the pinch rollers31in the conveyance direction so as to oppose to the lower line sensor41. The upper line sensor scans an image of a backside of the sheet P conveyed along the conveyance path P.

The lower line sensor41and the upper line sensor42have the substantially same configuration. Each of the lower line sensor41and the upper line sensor42has a light source, a lens and a light receiving element, respectively. Also, each of the lower line sensor41and the upper line sensor42are provided with contact glasses43, respectively, so as to oppose to the sheet P. The sheet P passes between the contact glasses43of the lower line sensor41and the upper line sensor42while closely contacting the contact glasses43.

The respective line sensors41,42illuminate lights from the light sources to the sheet P through the contact glasses43, collect the lights reflected from the sheet P into the light receiving elements by the lenses, convert the lights into RGB signals corresponding to color data of an image and output the same. By performing image processing to the RGB signals, it is possible to obtain image data of both sides of the sheet P, which consists of RGB values of each pixel and the like, in a page unit.

The light receiving elements are arranged in a main scanning direction of the sheet P, which is a direction perpendicular to the conveyance path11, in a chip unit, for example. In addition, the light sources and the lenses are arranged in the same direction as the light receiving elements. In addition, the respective contact glasses43extend in the main scanning direction in correspondence to a length of the main scanning direction of the lower line sensor41and the upper line sensor42.

As shown inFIGS. 2 and 3, the lower frame12is provided with a pair of discharge rollers45at positions downstream from the conveyance direction of the lower line sensor41, which are attached on a same shaft and discharge the sheet P from the discharge port5along the conveyance path11. Also, the upper frame13is provided with a pair of pinch rollers46at positions opposed to the pair of discharge rollers45.

The pinch rollers46have shafts that are elastically pressed toward the opposing discharge rollers45by compressing springs47. Accordingly, the respective pinch rollers46are pressure-contacted on outer circumferences of the respective discharge rollers45, so that when the respective discharge rollers45are rotated, the respective pinch rollers46are correspondingly rotated.

Here, as shown inFIGS. 1 to 3, the upper frame13is pivotably supported at both end portions of the discharge port5by a pair of shafts49protruding from both end portions of the side edge parts of the respective pinch rollers46. By rotating the upper frame13to the lower frame12side and bringing the upper frame13into contact with the lower frame12, elastic engaging pieces not shown, which are provided at both end portions of the side edge parts of the feeder port3of the upper frame13, engages with respective engaging holes51provided at both side edge parts of the feeder port3of the lower frame12.

When the upper frame13engages with the lower frame12, a thin plate-shaped protruding piece52, which protrudes from a right edge when seen from the front of the feeder port3of the upper frame13, is received in a recess of a cover switch53configured by a recess-shaped photo micro sensor that is disposed at a right edge when seen from the front of the lower frame12. Thereby, when the upper frame13engages with the lower frame12and the protruding piece52is thus received in the recess, the cover switch53outputs an ON signal. On the other hand, when the upper frame13is open, the cover switch outputs an OFF signal.

In addition, when an opening button55disposed on an inner side of the feeder port3of the upper frame13is pulled forward, the respective elastic engagement pieces, which are not shown, are rotated upward, so that the engagement pieces are disengaged from the respective engagement holes51. Accordingly, when the sheet P is jammed on the conveyance path11, or when each contact glass43is dirty, a user can easily solve the jamming problem or clean the respective contact glasses43by pulling the opening button55forward to open the upper frame13in the front direction.

Further, as shown inFIG. 2, a motor gear is attached to a motor shaft of a sheet conveyance motor56, which is attached on a sidewall14A of the gear receiving unit14and is configured to transfer the rotation driving to the first conveyance roller17, the second conveyance roller18, the third conveyance rollers19and the discharge rollers45through the gear train, which is not shown, received in the gear receiving unit14.

As shown inFIG. 4, by driving a plunger of a first keep solenoid58received in the gear receiving unit14to a position at which it protrudes, the shaft17A of the first conveyance roller17is rotated. Further, by driving the plunger of the first keep solenoid58to a position at which it is pulled, the rotating of the shaft17A of the first conveyance roller17is stopped.

In addition, as shown inFIG. 4, by driving a plunger of a second keep solenoid59received in the gear receiving unit14to a position at which it protrudes, the shaft18A of the second conveyance roller18is rotated. Further, by driving the plunger of the second keep solenoid59to a position at which it is pulled, the rotating of the shaft18A of the second conveyance roller18is stopped.

Hereinafter, a circuit configuration of the image scanning apparatus1is described with reference toFIG. 4.

As shown inFIG. 4, the image scanning apparatus1has a control circuit unit61that controls the whole image scanning apparatus1, an input-output interface62that is connected to the control circuit unit61, and a motor driving circuit63, a line sensor driving circuit65, a solenoid driving circuit66and the like, which are connected to the input-output interface62. In addition, the start switch15A, the error lamp15B, the first sheet sensor34, the second sheet sensor35, the third sheet sensor37, the cover switch53and the like are connected to the input-output interface62.

The control circuit unit61has a Central Processing Unit (CPU)71, which is a calculation and control device for controlling the whole image scanning apparatus1, a Read-Only Memory (ROM)72, a flash ROM73, a Random Access Memory (RAM)74, a communication interface75and the like. In addition, the CPU71, the ROM72, the flash ROM73, the RAM74and the communication interface75are connected to each other by a bus line76and transmit and receive data mutually.

The ROM72stores various parameters and programs necessary for controlling the image scanning apparatus1. For example, the ROM72stores a variety of programs for a conveyance control process of conveying the sheet P. The flash ROM73stores a control program for preparing and outputting image data of images on the sheet P scanned by the lower line sensor41and the upper line sensor42, and a variety of parameters.

The flash ROM73stores a pixel threshold value table91which is shown inFIG. 5. In the pixel threshold value table91, pixel threshold values for identifying a color mode of each pixel are stored. In addition, the flash ROM73stores a page threshold value table92which is shown inFIG. 6. In the page threshold value table, page threshold values for determining a color mode of a target image in a page unit are stored. Also, the flash ROM73stores various programs, for example, a program for a color mode identifying process of identifying a color mode of a target image in a page unit, which is shownFIG. 7.

The CPU71performs various calculations and controls based on the parameters and programs stored in the ROM72and the flash ROM73. The RAM74temporarily stores the various calculation results calculated by the CPU71, the image data on the sheet P scanned by the lower line sensor41and the upper line sensor42, and the like.

The sheet conveyance motor56is connected to the motor driving circuit63. The motor driving circuit63drives the sheet conveyance motor56in response to an instruction from the CPU71of the control circuit unit61. Also, the upper line sensor42and the lower line sensor41are connected to the line sensor driving circuit65.

The line sensor driving circuit65performs a driving control such as adjustment of operating current for turning on the light sources of the upper line sensor42and the lower line sensor41, converts the electric signals of the light receiving elements into the RGB signals and the like and outputs the same, in response to an instruction from the CPU71of the control circuit unit61. In addition, the CPU71temporarily stores the image data, which is prepared on the basis of the RGB signals and the like received from the line sensor driving circuit65, in the RAM74and outputs the same to an external PC81through the communication interface75. In this illustrative embodiment, the RGB signals are converted into digital signals of 0 to 255, which is expressed by a binary number of 8 bits. White is expressed by 255 and black is expressed by 0.

The first keep solenoid58and the second keep solenoid59are connected to the solenoid driving circuit66. The solenoid driving circuit66performs the driving control so that the respective plungers of the first keep solenoid58and the second keep solenoid59are located at the protruding or pulled-in positions, in response to an instruction from the CPU71of the control circuit unit61. The CPU71of the control circuit unit61controls the driving of the respective keep solenoids58,59through the solenoid driving circuit66, based on the detection signals from the first sheet sensor34, the second sheet sensor35and the third sheet sensor37.

Here, an example of the pixel threshold value table91that is stored in the flash ROM73is described with reference toFIG. 5.

As shown inFIG. 5, the pixel threshold value table91has a pixel column and a pixel threshold value column. In the pixel column, color modes of pixels are stored. In the pixel threshold value column, threshold values for identifying color modes of pixels are stored correspondingly to the color modes of the respective pixels stored in the pixel column.

For example, 240, which indicates RGB values as a background color threshold value, is stored in the pixel threshold value for identifying a color mode of a pixel as background color pixel. In addition, 10, which indicates a brightness difference as a color threshold value, is stored in the pixel threshold value for identifying a color mode of a pixel as color pixel. Also, 50, which indicates RGB values as a black threshold value, is stored in the pixel threshold value for identifying a color mode of a pixel as black pixel.

Next, an example of the page threshold value table92that is stored in the flash ROM73is described with reference toFIG. 6.

As shown inFIG. 6, the page threshold value table92has a page column and a page threshold value column. In the page column, color modes of pages are stored. In the page threshold value column, threshold values for identifying color modes of pages are stored correspondingly to the color modes of the respective pages stored in the page column.

For example, 98%, which indicates a pixel ratio as a blank sheet threshold value, is stored in the page threshold value for identifying a color mode of a page as blank page. In addition, 2%, which indicates a pixel ratio as a color page threshold value, is stored in the page threshold value for identifying a color mode of a page as color page. Also, 5%, which indicates a pixel ratio as a gray page threshold value, is stored in the page threshold value for identifying a color mode of a page as gray page.

Hereinafter, a color mode identifying process of identifying a color mode of a target image in a page unit by the image scanning apparatus1, which is configured as described above, is described with reference toFIGS. 7 to 12. The program that is shown with flowcharts ofFIGS. 7 to 9is stored in the flash ROM73and executed by the CPU71. The image data of the sheet P, which is obtained by the lower line sensor41and the upper line sensor42, is stored in a page unit in the RAM74.

As shown inFIG. 7, in step (hereinafter, abbreviated to S)11, the CPU71extracts the image data of a first page, which is stored in the RAM74, into a working area of the RAM74. Then, the CPU71reads out RGB values of a leading pixel of the image data extracted into the working area, i.e., RGB values of a first pixel on a first line and stores the same in the RAM74, as RGB values of a target pixel.

In addition, the CPU71initializes a background color pixel counter that counts background color pixels, a color pixel counter that counts color pixels, a gray pixel counter that counts gray pixels and a black pixel counter that counts black pixels.

In S12, as described inFIG. 8, the CPU71executes a sub-process of a pixel color mode identifying process of identifying a color mode of a pixel and counting pixels for each color mode.

In S13, the CPU71determines whether RGB values of a next pixel in the page are stored in the RAM74. That is, the CPU71determines whether or not a color mode for all pixels in the page has been identified. When it is determined that RGB values of a next pixel in the page are stored in the RAM74(S13: NO), the CPU71proceeds to S14. In S14, the CPU71reads out the RGB values of a next pixel in the page, stores the same in the RAM74, as RGB values of a target pixel, and then re-executes the processes after S12.

On the other hand, when it is determined that RGB values of a next pixel in the page is not stored in the RAM74, that is, when it is determined that a color mode has been identified for all pixels in the page (S13: YES), the CPU71proceeds to S15. In S15, as described inFIG. 9, the CPU71executes a sub-process of a page color mode identifying process of identifying a color mode of a target image on the page.

Then, in S16, the CPU71determines whether image data of a next page is stored in the RAM74. When it is determined that image data of a next page is stored in the RAM74(S16: YES), the CPU71initializes the working area of the RAM74, extracts the image data of a next page into the working area of the RAM74and re-executes the processes after S11.

On the other hand, when it is determined that image data of a next page is not stored in the RAM74(S16: NO), the CPU71determines that color modes of target images on all pages are identified and proceeds to S17. In S17, the CPU71outputs the image data of each page having header information indicating the color mode of the image and the like to the PC81and the like through the communication interface75and then ends the above process.

Hereinafter, a sub-process of the pixel color mode identifying process that is executed by the CPU71in S12is described with reference toFIG. 8.

As shown inFIG. 8, in S111, the CPU71reads out the background color threshold value, which is a threshold value for identifying a color mode of a pixel as background color pixel, from the pixel threshold value table91that is stored in the flash ROM73. Then, the CPU71reads out the RGB values of a target pixel, which are stored in the RAM74in S11or S14, and determines whether all values of R, G and B are equal to or larger than a background color threshold value.

For example, as shown inFIG. 5, when the background color threshold value, which is a threshold value for identifying a color mode of a pixel as background color pixel, is240, the CPU71reads out the RGB values of a target pixel, which are stored in the RAM74in S11or S14, to determine whether all values of R, G and B are 240 or larger.

When it is determined that all values of R, G and B of the target pixel are 240 or larger (S111: YES), the CPU71proceeds to S112. In S112, the CPU71determines that a color mode of the pixel is a background color pixel mode indicating a pixel of a background color. The CPU71counts the pixel as a background color pixel, i.e., adds 1 to the background color pixel counter. The CPU71ends the above sub-process and returns to S13of the main flowchart.

On the other hand, when it is determined that at least one value of R, G and B of the target pixel is below the background color threshold value (S111: NO), the CPU71proceeds to S113. In S113, the CPU71reads out the RGB values of the target pixel and calculates brightness differences |R−G|, |G−B| and |B−R|.

Subsequently, in S114, the CPU71reads out the color threshold value, which is a threshold value for identifying a color mode of a pixel as color pixel, from the pixel threshold value table91that is stored in the flash ROM73. Then, the CPU71determines whether at least one of the calculated brightness differences |R−G|, |G−B| and |B−R| is equal to or larger than the color threshold value.

For example, as shown inFIG. 5, when the color threshold value, which is a threshold value for identifying a color mode of a pixel as color pixel, is 10, the CPU71determines whether at least one of the calculated brightness differences |R−G|, |G−B| and |B−R| is 10 or larger.

When it is determined that at least one of the calculated brightness differences |R−G|, |G−B| and |B−R| is equal to or larger than the color threshold value (S114: YES), the CPU71proceeds to S115. In S115, the CPU71determines that a color mode of the pixel is a color pixel mode indicating a pixel of a color, counts the pixel as a color pixel, i.e., adds 1 to the color pixel counter, ends the above sub-process and returns to S13of the main flowchart.

On the other hand, when it is determined that all of the calculated brightness differences |R−G|, |G−B| and |B−R| are below the color threshold value (S114: NO), the CPU71proceeds to S116.

In S116, the CPU71reads out the black threshold value, which is a threshold value for identifying a color mode of a pixel as black pixel, from the pixel threshold value table91that is stored in the flash ROM73. Subsequently, the CPU71reads out the RGB values of the target pixel to determine whether all values of R, G and B are the black threshold value or larger.

For example, as shown inFIG. 5, when the black threshold value, which is a threshold value for identifying a color mode of a pixel as black pixel, is 50, the CPU71reads out the RGB values of the target pixel, which are stored in the RAM74in S11or S14, and determines whether all values of R, G and B are 50 or smaller.

When it is determined that all values of R, G and B of the target pixel are equal to or smaller than the black threshold (S116: YES), the CPU71proceeds to S117. In S117, the CPU71determines that a color mode of the pixel is the black pixel mode indicating a pixel of black. The CPU71counts the pixel as a black pixel, i.e., adds 1 to the black pixel counter. The CPU71ends the above sub-process and returns to S13of the main flowchart.

On the other hand, when it is determined that at least one value of R, G and B of the target pixel is larger than the black threshold value (S116: NO), the CPU71proceeds to S118. In S118, the CPU71determines that a color mode of the pixel is the gray pixel mode indicating a pixel of gray. The CPU71counts the pixel as a gray pixel, i.e., adds 1 to the gray pixel counter. The CPU71ends the above sub-process and returns to S13of the main flowchart.

Hereinafter, a sub-process of the page color mode identifying process, which is executed by the CPU71in S15, is described with reference toFIG. 9.

As shown inFIG. 9, in S211, the CPU71reads out and sums the respective count values of the background color pixel counter, the color pixel counter, the gray pixel counter and the black pixel counter. The CPU71stores the sum in the RAM74, as the total number of pixels of the page. Alternatively, the total number of pixels of a page unit, which can be read out by the respective line sensors41,42, may be stored beforehand in the flash ROM73for each size of the sheet P, for example, A3, A4, A5 sizes.

In S212, the CPU71reads out the count value of the background color pixel counter and the total number of pixels from the RAM74. The CPU71divides the count value of the background color pixel counter by the total number of pixels to calculate a background color pixel ratio. The CPU71stores the background color pixel ratio in the RAM74.

Subsequently, in S213, the CPU71reads out the blank sheet threshold value, which is a page threshold value for identifying a color mode of the page as blank page, from the page threshold value table92that is stored in the flash ROM73. Then, the CPU71reads out the background color pixel ratio of the page from the RAM74and determines whether the background color pixel ratio of the page is equal to or larger than the blank sheet threshold value.

For example, as shown inFIG. 6, when the blank sheet threshold value is 98%, the CPU71determines whether the background color pixel ratio of the page is 98% or larger.

When it is determined that the background color pixel ratio of the page is equal to or larger than the blank sheet threshold value (S213: YES), the CPU71proceeds to S214. In S214, the CPU71determines that the image data of the page is image data of a blank page. The CPU71adds header information, which indicates that the page is a color mode of the blank page, to a header of the image data. The CPU71stores the image data with the header information in the RAM74. The CPU71converts the image data into monochrome data. The CPU71converts values of all pixels into 255 corresponding to white. The CPU71stores the values in the RAM74. The CPU71ends the above sub-process and returns to S16of the main flowchart.

On the other hand, when it is determined that the background color pixel ratio of the page is below the blank sheet threshold value (S213: NO), the CPU71proceeds to S215. In S215, the CPU71reads out the count value of the background color pixel counter and the total number of pixels from the RAM74. The CPU71stores a value, which is obtained by subtracting the count value of the background color pixel counter from the total number of pixels, in the RAM74, as a first subtraction total number of pixels. Then, the CPU71reads out the count value of the color pixel counter and the first subtraction total number of pixels from the RAM74. The CPU71calculates a color pixel ratio by dividing the count value of the color pixel counter by the first subtraction total number of pixels. The CPU71stores the color pixel ratio in the RAM74.

Subsequently, in S216, the CPU71reads out the color page threshold value, which is a page threshold value for identifying a color mode of the page as color page, from the page threshold value table92that is stored in the flash ROM73. Then, the CPU71reads out the color pixel ratio of the page from the RAM74and determines whether the color pixel ratio of the page is equal to or larger than the color page threshold value.

For example, as shown inFIG. 6, when the color page threshold value, which is a page threshold value for identifying a color mode of a page as color page, is 2%, the CPU71reads out the color pixel ratio of the page from the RAM74and determines whether the color pixel ratio of the page is 2% or larger.

When it is determined that the color pixel ratio of the page is equal to or larger than the color page threshold value (S216: YES), the CPU71proceeds to S217. In S217, the CPU71determines that the image data of the target image of the page is image data of a color page. The CPU71adds header information, which indicates that the page is a color mode of a color page, to a header of the image data. The CPU71stores the image data with the header information in the RAM74. The CPU71ends the above sub-process and returns to S16of the main flowchart.

On the other hand, when it is determined that the color pixel ratio of the page is below the color page threshold value (S216: NO), the CPU71proceeds to S218. In S218, the CPU71reads out the count value of the color pixel counter and the first subtraction total number of pixels from the RAM74. The CPU71stores a value, which is obtained by subtracting the count value of the color pixel counter from the first subtraction total number of pixels, in the RAM74, as a second subtraction total number of pixels. Then, the CPU71reads out the count value of the gray pixel counter and the second subtraction total number of pixels from the RAM74. The CPU71calculates a gray pixel ratio by dividing the count value of the gray pixel counter by the second subtraction total number of pixels, and stores the gray pixel ratio in the RAM74.

Alternatively, in S218, the CPU71may read out the count value of the color pixel counter, the count value of the background color pixel counter and the total number of pixels from the RAM74. The CPU71may store a value, which is obtained by subtracting the count value of the background color pixel counter and the count value of the color pixel counter from the total number of pixels, in the RAM74, as the second subtraction total number of pixels.

Subsequently, in S219, the CPU71reads out the gray page threshold value, which is a page threshold value for identifying a color mode of the page as gray page, from the page threshold value table92that is stored in the flash ROM73. Then, the CPU71reads out the gray pixel ratio of the page from the RAM74and determines whether the gray pixel ratio of the page is equal to or larger than the gray page threshold value.

For example, as shown inFIG. 6, when the gray page threshold value is 5%, the CPU71determines whether the gray pixel ratio of the page is 5% or larger.

When it is determined that the gray pixel ratio of the page is equal to or larger than the gray page threshold value (S219: YES), the CPU71proceeds to S220. In S220, the CPU71determines that the image data of the target image of the page is image data of a gray page. The CPU71adds header information, which indicates that the page is a color mode of the gray page, to a header of the image data. The CPU71stores the image data with the header information in the RAM74.

Subsequently, in S221, the CPU71performs a gradation conversion of the predetermined number of gradations, for example, 256 gradations, for the image data, based on the RGB values of each pixel, to convert the image data into image data of a gradation image. The CPU71stores the converted image data in the RAM74, ends the above sub-process and returns to S16of the main flowchart.

On the other hand, when it is determined that the gray pixel ratio of the page is below the gray page threshold value (S219: NO), the CPU71proceeds to S222. In S222, the CPU71determines that the image data of the target image of the page is image data of a black-and-white page. The CPU71adds header information, which indicates that the page is a color mode of a black-and-white page, to a header of the image data. The CPU71stores the image data with the header in the RAM74.

Then, in S223, the CPU71converts the image data into image data of a black-and-white image by performing a RGB averaging process and the like for the RGB values of each pixel. The CPU71stores the image data in the RAM74, ends the above sub-process and returns to S16of the main flowchart.

Hereinafter, an example in which the color mode identifying process has been performed for the sheet P having a color photograph printed thereon is described with reference toFIGS. 6 and 10to12.

As shown in an upper portion ofFIG. 10, a color photograph100of a rose is printed on the sheet P1. In addition, as shown in a lower portion ofFIG. 10, a color photograph101, which is obtained by reducing the color photograph100of a rose of the sheet P1, is printed on the sheet P2. Meanwhile, the sheet P1and the sheet P2have the same sheet size.

When the sheet P1is scanned by the image scanning apparatus1, the number of pixels for each color mode, which is counted in the process of S12, is as shown inFIGS. 10 and 11. That is, the number of background color pixels is 70000, the number of color pixels is 15000, the number of gray pixels is 5000 and the number of black pixels is 1000.

In addition, when the sheet P2is scanned by the image scanning apparatus1, the number of pixels for each color mode, which is counted in the process of S12, is as shown inFIGS. 10 and 12. That is, the number of background color pixels is 97000, the number of color pixels is 1500, the number of gray pixels is 500 and the number of black pixels is 1000.

Accordingly, as shown inFIG. 11, the total number of pixels of the image data of the sheet P1, which is calculated in the process of S15, is 100000 and the background color pixel ratio is 70%. In addition, the first subtraction total number of pixels, which is obtained by subtracting the number of background color pixels from the total number of pixels, is 30000 and the color pixel ratio is 50%. In addition, the second subtraction total number of pixels, which is obtained by subtracting the number of color pixels from the first subtraction total number of pixels, is 15000 and the gray pixel ratio is 16.7%.

In addition, as shown inFIG. 12, the total number of pixels of the image data of the sheet P2, which is calculated in the process of S15, is 100000 and the background color pixel ratio is 97%. Also, the first subtraction total number of pixels, which is obtained by subtracting the number of background color pixels from the total number of pixels, is 3000 and the color pixel ratio is 50%. Further, the second subtraction total number of pixels, which is obtained by subtracting the number of color pixels from the first subtraction total number of pixels, is 1500 and the gray pixel ratio is 16.7%.

Thereby, as shown inFIG. 6, when the blank sheet threshold value is 98% and the color page threshold value is 2%, the respective background color pixel ratios of the sheet P1and the sheet P2are below the blank sheet threshold value and the respective color pixel ratios of the sheet P1and the sheet P2are both 50% and are equal to or larger than the color page threshold value. Therefore, the CPU71determines that the image data of the respective sheets P1and P2is image data of a color page and thus obtains the same determination result for the respective sheets P1and P2in the process of S15. In addition, even when the color pixel ratios and gray pixel ratios of the target images of the respective sheets P1and P2are the same, i.e., the target image is an image obtained by reducing the same image, the same color mode determination result can be obtained.

As described above, in the image scanning apparatus1of this illustrative embodiment, the CPU71counts the number of pixels of the image data in a page unit for each color mode of each pixel and obtains the total number of pixels of the image data in a page unit. In addition, the CPU71selects the number of pixels for each color mode of each page in order of background color pixel, color pixel and gray pixel. When the background color pixel ratio, which is obtained by dividing the number of background color pixels, which is first selected, by the total number of pixels, is equal to or larger than the blank sheet threshold value, the CPU determines that the page is a blank page.

When it is determined that the page is not a blank page, when the color pixel ratio, which is obtained by dividing the number of color pixels by the first subtraction total number of pixels obtained by subtracting the number of background color pixels, which is first selected, from the total number of pixels, is equal to or larger the color page threshold value, the CPU71determines that the page is a color page. In case that it is determined that the page is not a color page, when the gray pixel ratio, which is obtained by dividing the number of gray pixels by the second subtraction total number of pixels obtained by subtracting the number of color pixels, which is secondarily selected, from the first subtraction total number of pixels, is equal to or larger than the gray page threshold value, the CPU71determines that the page is a gray page. Furthermore, when it is determined that the page is not a gray page, the CPU71determines that the page is a black-and-white page.

Thereby, since the first subtraction total number of pixels is a value obtained by subtracting the number of background color pixels from the total number of pixels and the second subtraction total number of pixels is a value obtained by subtracting the number of color pixels, which is used in the second page color mode determination, from the first subtraction total number of pixels, it is possible to regard the color pixel ratio and the gray pixel ratio as the pixel ratios of the respective color modes of the target image. Accordingly, when the pixel ratios of the respective color modes of the target image are the same in a page unit, it is possible to reliably make the determination results of the color modes of the target image same. For example, even when the target image is reduced in a page unit, it is possible to reliably make the determination results of the color modes of the target image same.

Further, when identifying the color mode of the target image of the page, it is possible to rapidly determine whether the page is a blank page by first selecting the number of pixels of the background color pixel mode, which is a background color of a sheet. In addition, when identifying the color mode of the target image of the page, by selecting the number of background color pixels first, the number of color pixels and the number of gray pixels can be reliably selected thereafter, so that it is possible to reliably obtain the pixel ratios with respect to the first subtraction total number of pixels and the second subtraction total number of pixels.

Further, when identifying the color mode of the target image of the page, the color pixel ratio is calculated secondly, so that it is possible to rapidly determine whether the image data is image data of a color page for each page. Also, when identifying the color mode of the target image of the page, the gray pixel ratio is thirdly calculated, so that it is possible to quickly determine whether the image data is image data of a gray page or black-and-white pate for each page.

The invention is not limited to the above illustrative embodiment and can be can variously modified and changed without departing from the scope of the invention. For example, the invention can be modified in the following way:

(A) For example, in the illustrative embodiment, the CPU71executes the processes of S11to S16in accordance with the program stored in the flash ROM73. However, the CPU71may output the image data to the PC81or server, which is not shown, connected via a network, which is not shown, through the communication interface75. The PC81or server, which is not shown, may execute the processes of S11to S16.

(B) For example, the program shown by the flowcharts ofFIGS. 7 to 9and the various parameters stored in the pixel threshold value table91or page threshold value table92may be stored in a portable storage medium, for example, an SD memory card, having a flash memory mounted thereto. For example, the program and the various parameters may be stored in a storage medium such as CD-ROM and DVD-ROM. The CPU71may read out the programs and the like, which are stored in the portable storage medium or the storage medium such as CD-ROM and DVD-ROM, through a data read unit, which is not shown, and store the same in the flash ROM73.

(C) For example, in S214of the illustrative embodiment, the CPU converts the image data of the page, which is determined as a blank sheet, into monochrome data and all data into a white page. However, the CPU may delete the data of the page that is determined as a blank sheet.

(D) For example, in S111of the illustrative embodiment, the CPU determines whether all the RGB values are equal to or larger than the threshold value. However, the invention is not limited thereto. For example, the CPU may set a color of a head line of a sheet as a background color and count, as a background color pixel, pixels having RGB values close to RGB values of the background color. In addition, the CPU may examine frequencies of colors that are used in all data of a page and set a color having the highest frequency as a background color. By providing such a background color determination unit that determines a background color of a sheet, it is possible to determine a unicolor and solid color page as a blank page by using only the background color.

(E) For example, in S111of the illustrative embodiment, the CPU determines whether all the RGB values are equal to or larger than the background color threshold value. However, the CPU may determine whether each of the RGB values is close to a predetermined value.

(F) For example, in the illustrative embodiment, the process is performed using the color space of the RGB color system. However, the invention is not limited to the process in the color space. For example, a CMY color system or a XYZ color system can also be used.

(G) For example, in the illustrative embodiment, the pixel color mode identifying process is performed in the order of background color, color, black and gray. In addition, the page color mode identifying process is performed in the order of background color, color, gray and black. However, the invention is not limited thereto, and the pixel color mode identifying process and the page color mode identifying process may be performed in an arbitrary order.