Image processing apparatus, control method, and product capable of improving compression efficiency by converting close color to background color in a low light reading mode

A mechanism capable of improving the compression efficiency of image data generated by performing the dark reading is provided. An image processing apparatus comprising a reading unit configured to read a document and generate image data, a reading mode setting unit configured to set a reading mode of the reading unit to a first reading mode or a second reading mode, in which the document is read with the amount of light less than that in the first scanning mode, a background color determining unit configured to determine a background color in the image data generated by the reading unit, and a conversion image generating unit configured to generate image data, in which a color close to the background color in the image data is converted into the background color, in a case that the second reading mode is set.

BACKGROUND OF THE INVENTION

Field of the Invention

The present invention relates to an image processing apparatus capable of improving compression efficiency of electronic documents, a control method for the image processing apparatus, and a storage medium.

Description of the Related Art

An image processing apparatus that optically scans a paper document and generates an electronic document is known. In a case of digitizing a paper document having a background of an achromatic color whose density is low density, for example, a paper document having a white background, the image processing apparatus performs a background removal processing for converting a color of a region having a certain brightness or higher into white. By performing the background removal processing, a good-looking electronic document with a clear contrast between text and the background in the paper document is generated. Further, since a color of a background region that occupies most of the region in the electronic document is unified to white by performing the background removal processing, when data of the above electronic document is compressed, the compression efficiency is improved.

By the way, due to the revision of the legal system accompanying the progress of electronic document technology, tax-related forms, etc., which were previously accepted as originals only for paper documents, can now be accepted as originals if they satisfy prescribed conditions. The condition that the electronic document can be accepted as the original, is that, for example, the visibility of information such as correction marks, etc. is maintained. However, in a case that the above-mentioned background removal processing is performed in the image processing apparatus, there is a possibility that the above condition can not be satisfied. For example, the correction marks caused by a white correction fluid or the like are often whiter than a paper background portion of the paper document. When the background removal processing is executed, the correction marks are converted into white as well as the paper background portion, a gradation difference between the paper background portion and the correction marks disappears, the correction marks disappear on the electronic document, and then the above-mentioned condition can not be satisfied. On the other hand, a technique has been proposed, in which the amount of light emitted when reading a paper document is suppressed and the paper document is read darkly (hereinafter, such a reading method is referred to as “dark reading”) so as to maintain the gradation difference between the paper background portion and the correction marks (for example, see Japanese Laid-Open Patent Publication (kokai) No. 2006-295307).

However, in a case of generating an electronic document by means of the above-mentioned dark reading, in order to maintain the gradation difference between the paper background portion and the correction marks, in a paper background region that occupies most of the region of the electronic document, unification of color by means of the background removal processing is not performed. For this reason, conventionally, when data of the electronic document generated by performing the dark reading is compressed, the compression efficiency is lowered.

SUMMARY OF THE INVENTION

The present invention provides a mechanism capable of improving the compression efficiency of image data generated by performing the dark reading.

Accordingly, the present invention provides an image processing apparatus comprising a reading unit configured to read a document and generate image data, a reading mode setting unit configured to set a reading mode of the reading unit to a first reading mode or a second reading mode, in which the document is read with the amount of light less than that in the first scanning mode, a background color determining unit configured to determine a background color in the image data generated by the reading unit, and a conversion image generating unit configured to generate image data, in which a color close to the background color in the image data is converted into the background color, in a case that the second reading mode is set.

According to the present invention, it is possible to improve the compression efficiency of the electronic document (the image data) generated by performing the dark reading.

DESCRIPTION OF THE EMBODIMENTS

FIG. 1is a schematic diagram that shows a system configuration of an MFP (multifunction peripheral)101as an image processing apparatus according to an embodiment of the present invention. As shown inFIG. 1, the MFP101is connected to a PC (personal computer)102via a network103. A user can operate an operating unit203ofFIG. 2, which will be described later and is included in the MFP101, to perform settings to be used when the MFP101reads a document. As the said settings, the user sets, for example, a resolution, a compression rate, a data format (for example, JPEG (Joint Photographic Experts Group), TIFF (Tagged Image File Format), PDF (Portable Document Format), minority color compression, minority color compression (with OCR (Optical Character Recognition) results), an e-document law mode), etc. Details of the e-document law mode will be described later. The MFP101reads a document set on a document table (not shown) based on various settings set by the user, generates a scanned image of the document, and transmits the scanned image generated to a designated destination, for example, the PC102.

FIG. 2is a block diagram that schematically shows the configuration of the MFP101ofFIG. 1. As shown inFIG. 2, the MFP101has a scanner unit201, a printer unit202, the operating unit203, and a control unit204.

The scanner unit201is an image input device, and for example, reads the document set on the document table, and generates the scanned image of the said document. Further, the scanner unit201, which functions as a reading mode setting unit, sets a reading mode to an ordinary reading mode (a first reading mode) or a dark reading mode (a second reading mode) based on setting values that are designated by the user. The dark reading mode is a reading mode, in which the amount of light when reading a document is less than that in the ordinary reading mode. The dark reading mode is set when it is necessary to maintain a gradation difference between background of a document and correction marks, for example, when generating a scanned image corresponding to Law on Book and Record Keeping through Electronic Methods (e-document law). The printer unit202is an image output device, and prints, for example, an image generated by the scanner unit. The operating unit203is a user interface in the MFP101.

The control unit204is connected to the scanner unit201, the printer unit202, and the operating unit203. Further, the control unit204performs input/output of image information and device information by connecting to the network103. The control unit204has a CPU (Central Processing Unit)205, a RAM (Random Access Memory)206, an operating unit I/F (interface)207, a network I/F208, a ROM (Read Only Memory)209, and a storage unit210. Further, the control unit204has an image bus I/F212, a RIP (Raster Image Processor) unit214, a device I/F215, and a data processing unit218that functions as a conversion image generating unit.

The CPU205is a processor that controls the entire system. The RAM206is a system working memory used when the CPU205works, and is an image memory for temporarily storing images. The operating unit I/F207is an interface unit between the control unit204and the operating unit203. For example, the operating unit I/F207outputs images to be displayed on the operating unit203to the operating unit203. Further, the operating unit I/F207transmits information, which is inputted into the operating unit203by the user, to the CPU205. The network I/F208connects the MFP101to the network103and performs input/output of packet format information. The ROM209is a boot ROM and stores boot programs of the system, etc. The storage unit210is a hard disk drive and stores system control software, images, and the like. The CPU205, the RAM206, the operating unit I/F207, the network I/F208, the ROM209, and the storage unit210are connected to each other via a system bus211. The image bus I/F212is a bus bridge that connects the system bus211and an image bus213and converts data structure. The image bus213enables high-speed transfer of images, and is configured by, for example, a PCI (Peripheral Component Interconnect) bus or IEEE 1394.

The RIP unit214, the device I/F215, and the data processing unit218are connected to the image bus213. The RIP unit214analyzes PDL (Page Description Language) codes of print data received from an external device or the like by the MFP101, and executes a rendering processing that expands the said print data into a bitmap image having a designated resolution. The device I/F215is connected to the scanner unit201via a signal line216, and is connected to the printer unit202via a signal line217. The data processing unit218executes an image processing of the scanned image obtained from the scanner unit201and a generation processing of a printed image to be output to the printer unit202, and also performs a processing such as the minority color compression and the OCR. As a result, compressed data, which will be described later, is generated. The compressed data generated is transmitted to a destination designated by the user, for example, the PC102, via the network I/F208and the network103. The data processing unit218can also decompress the compressed data received via the network I/F208and the network103. The expanded (decompressed) image is transferred to the printer unit202via the device I/F215, and the printer unit202prints the image obtained via the device I/F215.

FIGS. 3A and 3Bare diagrams that show an example of a setting screen displayed on the operating unit203ofFIG. 2.FIG. 3Ais a diagram that show an example of a scan setting screen300displayed on the operating unit203.

The scan setting screen300is a screen for the user to instruct the MFP101to read a document. The scan setting screen300includes a color selection button301, a magnification button302, a document type button303, and a start button309. The color selection button301is a button for performing a color setting when storing or copying a scanned image of a document read by the scanner unit201. For example, the user operates the color selection button301to set “black and white” or “full color”. The magnification button302is a button for performing a magnification setting of the scanned image of the document read by the scanner unit201. The document type button303is a button for performing a document type setting of a document to be read. When the user selects the document type button303, the screen of the operating unit203changes to a document type setting screen304ofFIG. 3B.

The document type setting screen304includes a plurality of buttons corresponding to typical document types, specifically, a text/photo/map button305, a printed photo button306, a text button307, and an electronic document button308. The text/photo/map button305is a button that is selected when the document to be read is a document composed of various contents such as photos and texts. The printed photo button306is a button that is selected when the document to be read is a document mainly composed of photos. The text button307is a button that is selected when the document to be read is a document mainly composed of text. The electronic document button308is a button that is selected when instructing the generation of the scanned image corresponding to the Law on Book and Record Keeping through Electronic Methods (the e-document law). In the MFP101, with respect to the scanned image of the document read by the scanner unit201, an image processing corresponding to a document type set by the user on the document type setting screen304is executed.

Further, in the MFP101, a reading mode flag is set based on the document type set by the user on the document type setting screen304. For example, in a case that the user selects the electronic document button308on the document type setting screen304, the reading mode flag is set to “1”. The scanner unit201reads the document in the dark reading mode, which is set according to this reading mode flag. On the other hand, in a case that the user selects a button other than the electronic document button308on the document type setting screen304, the reading mode flag is set to “0”. The scanner unit201reads the document in the ordinary reading mode, which is set according to this reading mode flag. In this way, in the MFP101, the reading mode of the scanner unit201is controlled based on the reading mode flag. The reading mode flag is transferred to the data processing unit218via the operating unit I/F207and the CPU205.

When the user selects any one of buttons on the document type setting screen304, the screen of the operating unit203changes to the scan setting screen300. When the user performs various settings and selects the start button309on the scan setting screen300, the operating unit I/F207notifies the CPU205of setting values that are set on the scan setting screen300(hereinafter, referred to as “scan setting values”). The CPU205starts a scanning control processing ofFIG. 4based on the scan setting values that are received from the operating unit I/F207.

FIG. 4is a flowchart that shows procedures of the scanning control processing performed by the MFP101ofFIG. 1. The processing ofFIG. 4is realized by the CPU205executing a program stored in the ROM209or the storage unit210.

As shown inFIG. 4, at first, the CPU205sets the scan setting values, which are received from the operating unit I/F207, in the data processing unit218, and instructs the scanner unit201to read a document (a step S401). The scanner unit201, which functions as a reading unit, reads the document (paper document) according to the instruction received from the CPU205, generates a scanned image of the above document, and transmits the scanned image to the data processing unit218. The data processing unit218executes a color converting processing ofFIG. 7, which will be described later, based on the scanned image received to generate a conversion image, and compresses the said conversion image in a compression format such as JPEG format to generate compressed data. Further, the data processing unit218transmits a processing end notification indicating that the processing performed by the data processing unit218has been completed to the CPU205.

The CPU205waits until it receives the processing end notification. When receiving the processing end notification from the data processing unit218(YES in a step S402), the CPU205ends this processing.

FIG. 5is a block diagram that schematically shows one configuration of the data processing unit218ofFIG. 2. As shown inFIG. 5, the data processing unit218has a filter applying unit501that functions as an image processing unit, a background color determining unit502, a background neighboring color converting unit503, an image data selecting unit504, and an image compressing unit505.

The filter applying unit501uses an edge preservation smoothing filter such as a median filter or a bilateral filter to perform a filter processing for smoothing a small edge while holding a large edge with respect to the scanned image obtained from the scanner unit201. Hereinafter, the scanned image will be described as an RGB image including an R (Red) component, a G (Green) component, and a B (Blue) component. By the above filter processing, the variation of each value of the R component, the G component, and the B component (hereinafter, referred to as “RGB value”) of a plurality of pixels, which constitutes the scanned image, is suppressed, and it becomes possible that the determination of a background color described later is easily performed. As a result of performing the above filter processing, a filter-applied image601(image-processed image data) ofFIG. 6Ais generated, and the filter applying unit501outputs the filter-applied image601to the background color determining unit502.

The background color determining unit502determines the background color based on the filter-applied image601obtained from the filter applying unit501. Here, even in the filter-applied image601that is obtained by performing the above filter processing, sometimes the color of the background region is not uniformized. When an RGB histogram of such a filter-applied image601is calculated, it can be shown as shown inFIG. 6B. Moreover, originally, it is shown as a four-dimensional histogram, in which the horizontal axis is the R component, the G component, and the B component and the vertical axis is an appearance frequency, but in a histogram ofFIG. 6B, for ease of explanation, the horizontal axis is a total value of RGB values and the vertical axis is the appearance frequency. In the present embodiment, the background color determining unit502determines a color corresponding to a total value602of the RGB values that has the highest appearance frequency in the histogram ofFIG. 6Bas the background color. Moreover, the method of determining the background color is not limited to the above-mentioned method. For example, a histogram of values obtained by blending the values of the R component, the G component, and the B component in a predetermined ratio may be calculated, and a color having the highest appearance frequency may be determined as the background color. The background color determining unit502generates background color information that indicates the determined background color, and outputs the generated background color information to the background neighboring color converting unit503. For example, the background color information is indicated by the RGB values (190,190,190).

The background neighboring color converting unit503converts a color close to a color indicated by the background color information in the filter-applied image601(hereinafter, the color indicated by the background color information in the filter-applied image601is simply referred to as “background color”) into the background color, so as to generate a background neighboring color conversion image802ofFIG. 8C, which will be described later. Further, the generation of the background neighboring color conversion image802will be described later with reference toFIG. 7.

The image data selecting unit504selects an output image based on the reading mode flag. In the case that the reading mode flag is “1”, that is, in the case that the user has selected the electronic document button308on the document type setting screen304, the image data selecting unit504outputs the background neighboring color conversion image802to the image compressing unit505. In the case that the reading mode flag is “0”, that is, in the case that the user has selected the button other than the electronic document button308on the document type setting screen304, the image data selecting unit504outputs the scanned image received from the scanner unit201as it is to the image compressing unit505.

The image compressing unit505compresses the image obtained from the image data selecting unit504in the compression format such as JPEG format to generate the compressed data. The said compressed data is transmitted to the destination included in the scan setting values, for example, the PC102. When the transmission of the compressed data is completed, the image compressing unit505transmits the processing end notification to the CPU205.

FIG. 7is a flowchart that shows procedures of the color converting processing performed by the data processing unit218ofFIG. 2. The processing ofFIG. 7is executed when the data processing unit218obtained the reading mode flag set to “1” from the CPU205. Further, as described above, when the reading mode flag is set to “1”, the scanner unit201reads the document in the dark reading mode.

As shown inFIG. 7, the data processing unit218selects one pixel from a plurality of pixels constituting the filter-applied image601, for example, a pixel801ofFIG. 8Aas a pixel of interest (a step S701). A selection order of the pixel of interest in the filter-applied image601is, for example, a raster scan order of the entire filter-applied image601. Moreover, the selection order of the pixel of interest in the filter-applied image601is not limited to the raster scan order of the entire filter-applied image601, and may be other orders.

Next, the data processing unit218judges whether or not a color corresponding to the RGB values of the pixel of interest is a color close to the background color determined by the background color determining unit502(a step S702). Specifically, the data processing unit218calculates a difference between the RGB value of the pixel of interest and the RGB value of the background color with respect to the R component, the G component, and the B component. For example, as shown inFIG. 8B, in the case that the RGB values of the pixel of interest are (189, 188, 190) and the RGB values of the background color are (190, 190, 190), the differences of the R component, the G component, and the B component are (1, 2, 0). In this way, in the case that all the differences of the R component, the G component, and the B component are equal to or less than a preset predetermined value, the data processing unit218judges that the color corresponding to the RGB values of the pixel of interest is the color close to the background color. Further, the above predetermined value is a value less than a color difference between the paper background portion of the paper document and the correction mark, and is a value determined based on class “A” tolerance of color difference, for example, 3. That is, in the present embodiment, a color corresponding to RGB values that a color difference from the background color is less than the color difference between the paper background portion of the paper document and the correction mark, is judged as the color close to the background color. On the other hand, in the case that any one of the differences of the R component, the G component, and the B component is larger than the above predetermined value, the data processing unit218judges that the color corresponding to the RGB values of the pixel of interest is not the color close to the background color. Moreover, the judging method in the step S702is not limited to the above-mentioned method, and for example, difference values of a Cb component and a Cr component in YCbCr color space consisting of the brightness and the color difference may be used, or a difference value of a L* component in L*a*b* color space may be used.

As a result of judging in the step S702, in the case that the color corresponding to the RGB values of the pixel of interest is not the color close to the background color, the data processing unit218performs a processing of a step S704that will be described later. As the result of the judging in the step S702, in the case that the color corresponding to the RGB values of the pixel of interest is the color close to the background color, the data processing unit218converts the RGB values of the pixel of interest into the RGB values of the background color (a step S703). In this way, in the present embodiment, the color corresponding to the RGB values that the color difference from the background color in the filter-applied image601is less than the color difference between the paper background portion of the paper document and the correction mark, is converted into the background color. Next, the data processing unit218judges whether or not all the pixels constituting the filter-applied image601have been selected (the step S704).

As a result of judging in the step S704, in the case that any one of the pixels constituting the filter-applied image601is not selected, the color converting processing returns to the step S701. The data processing unit218selects one pixel from the pixels not selected in the filter-applied image601as the pixel of interest, and performs the processing of the step S702and following.

As the result of the judging in the step S704, in the case that all the pixels constituting the filter-applied image601are selected, the color converting processing ends. As a result of the color converting processing, the background neighboring color conversion image802ofFIG. 8Cthat the color close to the background color in the filter-applied image601is converted into the background color, is generated.

According to the above-described embodiment, in the case that the dark reading mode is set, the background neighboring color conversion image802that is obtained by converting the color close to the background color in the filter-applied image601into the background color, is generated as the electronic document. As a result, it is possible to unify the color of the background region that occupies most of the region in the electronic document generated in the dark reading mode to the background color, and thus it is possible to improve the compression efficiency of the electronic document generated in the dark reading mode.

Further, in the above-described embodiment, the background color is determined based on the filter-applied image601that is obtained by performing the filter processing by means of the smoothing filter with respect to the scanned image generated by the scanner unit201. As a result, it is possible to easily perform the determination of the background color by using the filter-applied image601, in which the variations in the RGB values of the plurality of pixels constituting the scanned image are suppressed.

Furthermore, in the above-described embodiment, a histogram is generated based on the filter-applied image601, and a color that has the highest appearance frequency in the said histogram is determined as the background color. As a result, it is possible to easily determine the background color even in the case that the color of the background region is not uniformized in the filter-applied image601.

In the above-described embodiment, in the case that the dark reading mode is set, a color in the filter-applied image601that a color difference from the background color is equal to or less than the predetermined value, is converted into the background color. The predetermined value is the value less than the color difference between the paper background portion of the paper document and the correction mark. As a result, it is possible to convert the color corresponding to the RGB values that the color difference from the background color is less than the color difference between the paper background portion of the paper document and the correction mark into the background color. Thus, it is possible to generate an electronic document that the gradation difference between the paper background portion and the correction marks is maintained while improving the compression efficiency.

Although the present invention has been described above with reference to the above-described embodiment, the present invention is not limited to the above-described embodiment. For example, in the case that a correction mark region of the document in the scanned image is detected and the dark reading mode is set, a conversion image that is obtained by converting a color close to a background color in a region other than the correction mark region in the filter-applied image601into the background color, may be generated.

In the above-described embodiment, in the case of reading a document including correction marks caused by a correction fluid in the dark reading mode, a filter-applied image902including a correction mark region901shown inFIG. 9Ais generated, and a histogram shown inFIG. 9Bis calculated. Based on the histogram ofFIG. 9B, a color corresponding to a total value903of the RGB values that has the highest appearance frequency is determined as the background color, and in the filter-applied image902, a color close to the above background color is converted into the background color. Here, in the case that the color of the paper background portion of the document is the same color as the color of the correction mark, for example, white, there is a concern that the color of at least a part of the correction mark region is converted into the background color, and an electronic document ofFIG. 9C, in which a contrast between the paper background portion of the document and the correction mark is not clear, is generated.

In contrast, in an embodiment described below, in the case that the correction mark region of the document in the scanned image is detected and the dark reading mode is set, the conversion image that is obtained by converting the color close to the background color in the region other than the correction mark region in the filter-applied image into the background color, is generated.

FIG. 10is a block diagram that schematically shows another configuration of the data processing unit218ofFIG. 2. As shown inFIG. 10, in addition to constituent elements shown inFIG. 5, a data processing unit1000, which is another configuration of the data processing unit218and functions as the conversion image generating unit, has a correction mark detecting unit1001that functions as a detecting unit and a background color converting unit1002.

The correction mark detecting unit1001executes a correction mark detection processing ofFIG. 11to detect the correction mark region in the scanned image obtained from the scanner unit201.

FIG. 11is a flowchart that shows procedures of the correction mark detection processing performed by the correction mark detecting unit1001ofFIG. 10. Further, in the processing ofFIG. 11, it is assumed that a scanned image1201ofFIG. 12Ahas been obtained from the scanner unit201. The scanned image1201includes a correction mark1202.

As shown inFIG. 11, the correction mark detecting unit1001generates a dispersion distribution image1203ofFIG. 12Bbased on the scanned image1201obtained from the scanner unit201(a step S1101). The dispersion distribution image is an image that expresses the distribution of dispersion values of respective pixels calculated from luminance values of a pixel and respective pixels in a range of M×N centered on the pixel. In the present embodiment, as an example of the luminance value, although a value obtained by adding the values of the R component, the G component, and the B component at a ratio of (R:G:B=6:3:1) is used, the luminance value is not limited to this value. Further, in the present embodiment, although the range of M×N is described as a range of 5 pixels×5 pixels, the range of M×N is not limited to the range of 5 pixels×5 pixels, and the number of pixels (range) to be obtained may be changed according to the size of the image or the like. Furthermore, the dispersion value is calculated by using the following expression (1).
Expression (1)
σL[n]=√{square root over (Σi=1N(xLi−μL)2/N)}  (1)

σL[n] represents the luminance value of the n-th pixel in the scanned image. xLi represents the luminance value of the i-th pixel within 5 pixels×5 pixels. μL represents the average value of the luminance values of 5 pixels×5 pixels. N represents the total number of pixels (25). Further, Σ represents the calculation of the sum. In the step S1101, the correction mark detecting unit1001performs calculations for all pixels and generates the dispersion distribution image1203.

Next, the correction mark detecting unit1001generates an edge image1204ofFIG. 12Cbased on the dispersion distribution image1203(a step S1102). In the step S1102, for example, the correction mark detecting unit1001performs edge extraction by using Canny method or the like to generate the edge image1204, which is a binary image and in which an edge pixel is “1” and a non-edge pixel is “0”. For example, since in reading by the scanner unit201, an edge is generated at the boundary between the correction mark and the background of the document, the edge of the correction mark is judged as the edge pixel.

Next, the correction mark detecting unit1001detects the correction mark region in the scanned image by using the dispersion distribution image1203and the edge image1204. Specifically, the correction mark detecting unit1001first extracts an edge having an enclosing shape. The correction mark detecting unit1001selects one edge pixel from a plurality of edge pixels having a pixel value of “1” in the edge image1204, and then judges whether or not the edge pixel exists in eight pixels around the selected edge pixel. In the case that the edge pixel exists in the eight pixels around the selected edge pixel, the correction mark detecting unit1001selects one edge pixel from the eight pixels around the selected edge pixel, and then judges whether or not the edge pixel exists in eight pixels around the selected edge pixel. The correction mark detecting unit1001repeatedly executes this processing, and in the case that the pixel adjacent to the finally selected edge pixel is a pixel already judged to be an edge pixel, the correction mark detecting unit1001judges that an edge pixel group, which has an enclosing shape and includes the selected edge pixels, exists. On the other hand, in the case that the edge pixel does not exist in the eight pixels around the selected edge pixel, the correction mark detecting unit1001judges that the edge pixel group, which has the enclosing shape and includes the selected edge pixels, does not exist. After extracting the edges having the enclosing shape in this way, the correction mark detecting unit1001judges that with respect to pixels inside the edge pixel group having the enclosing shape, a pixel having the dispersion value equal to or less than a predetermined value is a correction mark candidate pixel.

Next, the correction mark detecting unit1001generates a correction mark candidate image1205ofFIG. 12D, in which the pixel values of the pixels judged to be the correction mark candidate pixel are set to “1” and the pixel values of the pixels other than the pixels judged to be the correction mark candidate pixel are set to “0” (a step S1103). Next, the correction mark detecting unit1001outputs the correction mark candidate image1205to the background neighboring color converting unit503, and the correction mark detection processing ends.

FIG. 13is a flowchart that shows procedures of a color converting processing performed by the data processing unit1000ofFIG. 10.

As shown inFIG. 13, the data processing unit1000performs the processing of the step S701described above. Next, the data processing unit1000judges whether or not the pixel of interest is a correction mark candidate pixel based on the correction mark candidate image1205generated by the correction mark detecting unit1001(a step S1301). In the step S1301, in the case that the pixel value of the pixel of interest in the correction mark candidate image1205is “1”, the data processing unit1000judges that the pixel of interest is the correction mark candidate pixel. On the other hand, in the case that the pixel value of the pixel of interest in the correction mark candidate image1205is “0”, the data processing unit1000judges that the pixel of interest is not the correction mark candidate pixel.

As a result of judging in the step S1301, in the case that the pixel of interest is not the correction mark candidate pixel, the color converting processing proceeds to the step S702. In this way, in the present embodiment, the color close to the background color in the region other than the correction mark region in the filter-applied image is converted into the background color. As the result of the judging in the step S1301, in the case that the pixel of interest is the correction mark candidate pixel, the color converting processing proceeds to the step S704, in the case that all the pixels constituting the filter-applied image601are selected, the color converting processing ends. As a result of the color converting processing ofFIG. 13, a background neighboring color conversion image that the RGB values of the pixels having a color close to the background color but not the correction mark candidate pixels are converted into the RGB values of the background color, is generated.

Returning toFIG. 10, the background color converting unit1002decreases the brightness of the background color in this background neighboring color conversion image by a predetermined amount. Specifically, in above background neighboring color conversion image, the background color converting unit1002subtracts a first value, for example, 10 from the RGB values of the R component, the G component, and the B component of all pixels having the same RGB values as the RGB values included in the background color information generated by the background color determining unit502. Moreover, the first value is not limited to 10, and may be, for example, a value obtained by rounding down the decimal point from a value obtained by reducing the average value of the RGB values of the background color information to 1/10. The RGB values of the correction mark are basically higher than that of the background color. Therefore, as described above, by subtracting the first value from the RGB values of all the pixels having the same RGB values as the RGB values included in the background color information, the color difference between the background and the correction marks becomes clearer, and an electronic document1401shown inFIG. 14, in which a correction mark region1402is easily visible, is generated.

In the above-described embodiment, in the case that the correction mark region of the document in the scanned image is detected and the dark reading mode is set, the conversion image that is obtained by converting the color close to the background color in the region other than the correction mark region in the filter-applied image into the background color, is generated. Therefore, it is possible to prevent the color of at least a part of the correction mark region in the filter-applied image from being converted into the background color to generate an electronic document, in which the contrast between the paper background portion of the document and the correction mark is not clear.

Further, in the above-described embodiment, the electronic document1401, in which the brightness of the background color in the background neighboring color conversion image is decreased by the predetermined amount, is generated. As a result, it is possible to generate an electronic document, in which the correction marks are easily visible.

In the above-described embodiment, the brightness of the color of the correction mark region in the background neighboring color conversion image may be increased by a predetermined amount.

FIG. 15is a block diagram that schematically shows another configuration of the data processing unit218ofFIG. 2. As shown inFIG. 15, in addition to constituent elements shown inFIG. 5, a data processing unit1500, which is another configuration of the data processing unit218and functions as the conversion image generating unit, has the correction mark detecting unit1001and a correction mark color converting unit1501. The correction mark color converting unit1501increases the brightness of the color of the correction mark region in the background neighboring color conversion image by the predetermined amount. Specifically, the correction mark color converting unit1501adds a second value, for example, 10 to the RGB values of the correction mark candidate pixel. Moreover, the second value is not limited to 10, and may be other values.

FIG. 16is a flowchart that shows procedures of a color converting processing performed by the data processing unit1500ofFIG. 15.

As shown inFIG. 16, the data processing unit1500performs the processing of the step S701described above and the processing of the step S1301described above.

As the result of the judging in the step S1301, in the case that the pixel of interest is not the correction mark candidate pixel, the color converting processing proceeds to the step S702. As the result of the judging in the step S1301, in the case that the pixel of interest is the correction mark candidate pixel, the data processing unit1500performs a processing of a step S1601. In the step S1601, as with the step S702, the data processing unit1500judges whether or not the color corresponding to the RGB values of the pixel of interest is the color close to the background color determined by the background color determining unit502.

As a result of judging in the step S1601, in the case that the color corresponding to the RGB values of the pixel of interest is not the color close to the background color determined by the background color determining unit502, the color converting processing proceeds to the step S704. As the result of the judging in the step S1601, in the case that the color corresponding to the RGB values of the pixel of interest is the color close to the background color determined by the background color determining unit502, the data processing unit1500adds the second value, for example, 10 to the RGB values of the pixel of interest (a step S1602). After that, the color converting processing proceeds to the step S704.

In the above-described embodiment, the data processing unit1500increases the brightness of the color of the correction mark region in the background neighboring color conversion image by the predetermined amount. As a result, it is possible to generate an electronic document, in which the contrast between the paper background portion of the document and the correction mark is clear.

OTHER EMBODIMENTS

This application claims the benefit of Japanese Patent Application No. 2020-169184, filed Oct. 6, 2020, which is hereby incorporated by reference herein in its entirety.