IMAGE PROCESSING APPARATUS, CONTROL METHOD FOR IMAGE PROCESSING APPARATUS, AND PROGRAM
The image processing device addresses the challenge of maintaining gradation differences and improving compression efficiency by reading documents with reduced light, filtering, and converting colors in the image processing device, ensuring the visibility of correction marks and enhancing data compression.
Patent Information
- Application Number
- JP2020169184
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-10-06
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2040-10-06
AI Technical Summary
Existing image processing technologies face challenges in maintaining the gradation difference between paper parts and correction marks during the digitization of paper documents, which affects the visibility of correction marks and reduces compression efficiency.
An image processing device that generates image data by reading documents in a second reading mode with reduced light irradiation, filters the data using a smoothing filter, and determines the underlying color based on a histogram. It then converts colors with a color difference less than a specified value to the underlying color, improving compression efficiency.
The solution effectively maintains the gradation difference between paper parts and correction marks, ensuring the visibility of correction marks and enhancing the compression efficiency of image data.
Smart Images

Figure 0007654375000002 
Figure 0007654375000003 
Figure 0007654375000004
Abstract
Description
[Technical field]
[0001] The present invention relates to an image processing apparatus, a control method for an image processing apparatus, and a program. [Background technology]
[0002] There is known an image processing device that generates an electronic document by optically scanning a paper document. When digitizing a paper document with a low density achromatic color, for example, a white background, the image processing device performs background removal processing to convert the color of an area having a certain brightness or more to white. By performing background removal processing, an electronic document with a good appearance in which the contrast between the characters and the background in the paper document is clear is generated. Furthermore, by performing background removal processing, the color of the background area that occupies most of the area in the electronic document is unified to white, thereby improving the compression efficiency when compressing the data of the electronic document.
[0003] However, due to the revision of the legal system accompanying the advancement of electronic document technology, electronic documents, such as tax-related documents, which were previously only recognized as originals on paper, are now recognized as originals if they meet certain conditions. For example, the condition for an electronic document to be recognized as an original is that the visibility of information such as correction marks is maintained. However, when the above-mentioned background removal process is performed in an image processing device, the above-mentioned condition may not be satisfied. For example, correction marks made with white correction fluid or the like are often whiter than the paper base of a paper document. When the background removal process is performed, the correction marks are also converted to white, just like the paper base, and the gradation difference between the paper base and the correction marks disappears, and the correction marks disappear on the electronic document, and the above-mentioned condition cannot be satisfied. In response to this, a technology has been proposed that suppresses the amount of light irradiated when reading a paper document and reads the paper document darkly (hereinafter, such a reading method is referred to as "dark reading"), thereby maintaining the gradation difference between the paper base and the correction marks (see, for example, Patent Document 1). [Prior art documents] [Patent documents]
[0004] [Patent Document 1] JP 2006-295307 A Summary of the Invention [Problem to be solved by the invention]
[0005] However, in the above-mentioned generation of an electronic document by blind reading, in order to maintain the gradation difference between the paper base and the correction marks, the paper base area, which occupies most of the area of the electronic document, is not color-unified by background removal processing. For this reason, in the past, the compression efficiency of the data compression of an electronic document generated by blind reading was reduced.
[0006] The object of the present invention is to generate image data by performing filtering processing using a smoothing filter on image data generated by reading an original in a second reading mode in which the amount of light irradiated on the original is less than that in the first reading mode, generate a histogram based on the generated image data, determine the color with the highest frequency of appearance in the histogram as the background color, and when the first reading mode is set, not perform conversion processing to convert colors in the filtered image data whose color difference with the background color is smaller than a predetermined value into the background color. The image data generated by scanning the document in the first scanning mode is compressed. When the second reading mode is set, image data is generated in which a color in the filtered image data, the color difference between which is smaller than a predetermined value from the background color, is converted to the background color. and compressing the generated image data. The present invention aims to provide a mechanism for improving the compression efficiency of image data by performing the above-mentioned operations. [Means for solving the problem]
[0007] In order to achieve the above object, an image processing device of the present invention includes a reading means for reading an original and generating image data, a setting means for setting a reading mode of the reading means to a first reading mode or a second reading mode in which a smaller amount of light is irradiated onto the original than in the first reading mode, an image processing means for generating image data obtained by subjecting the image data generated by the reading means to filtering processing using a smoothing filter, a determining means for generating a histogram based on the image data generated by the image processing means and determining a color having the highest frequency of appearance in the histogram as a background color, and a generating means for, when the first reading mode is set, not performing a conversion process for converting a color in the image data generated by the image processing means whose color difference with the background color is smaller than a predetermined value into the background color, and, when the second reading mode is set, generating image data in which a color in the image data generated by the image processing means whose color difference with the background color is smaller than the predetermined value is converted into the background color. When the first reading mode is set, Image data generated by the reading means and when the second reading mode is set, The image data generating device further comprises a compression device for compressing the image data generated by the generation device. Effect of the Invention
[0008] According to the present invention, image data is generated by performing filtering processing using a smoothing filter on image data generated by reading an original in a second reading mode in which the amount of light irradiated on the original is less than that in the first reading mode, a histogram is generated based on the generated image data, and the color with the highest frequency of appearance in the histogram is determined as the background color, and when the first reading mode is set, a conversion process is not performed to convert colors in the filtered image data whose color difference with the background color is smaller than a predetermined value to the background color. The image data generated by scanning the document in the first scanning mode is compressed. When the second reading mode is set, image data is generated in which a color in the filtered image data, the color difference between which is smaller than a predetermined value from the background color, is converted to the background color. and compressing the generated image data. This makes it possible to improve the compression efficiency of image data. [Brief description of the drawings]
[0009] [Figure 1] 1 is a schematic diagram showing a system configuration of an MFP as an image processing apparatus according to an embodiment of the present invention. [Diagram 2] 2 is a block diagram illustrating a schematic configuration of the MFP in FIG. [Diagram 3] 3 is a diagram showing an example of a setting screen displayed on the operation unit in FIG. 2. [Figure 4] 4 is a flowchart showing the procedure of a scan control process executed by the MFP of FIG. [Diagram 5] 3 is a block diagram showing a schematic configuration of a data processing unit in FIG. 2. [Figure 6] 3A and 3B are diagrams illustrating an example of a filtered image and a histogram generated by the data processing unit in FIG. 2. [Figure 7] 3 is a flowchart showing the procedure of a color conversion process executed by the data processing unit in FIG. 2. [Figure 8] FIG. 8 is a diagram for explaining details of the color conversion process in FIG. 7. [Figure 9] 7 is a diagram for explaining generation of a background vicinity color-converted image of a document including correction marks by the data processing unit in FIG. 5. [Figure 10] 3 is a block diagram illustrating roughly another configuration of the data processing unit in FIG. 2. [Figure 11] 11 is a flowchart showing the procedure of correction mark detection processing executed by a correction mark detection unit in FIG. 10 . [Figure 12] 12A to 12C are diagrams for explaining details of the correction mark detection process in FIG. 11. [Figure 13] 11 is a flowchart showing the procedure of a color conversion process executed by the data processing unit in FIG. [Figure 14] FIG. 14 is a diagram showing an example of a background vicinity color-converted image generated by the color conversion process of FIG. 13. [Figure 15] 3 is a block diagram illustrating roughly another configuration of the data processing unit in FIG. 2. [Figure 16] 16 is a flowchart showing the procedure of a color conversion process executed by the data processing unit in FIG. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings.
[0011] FIG. 1 is a schematic diagram showing a system configuration of an MFP 101 as an image processing apparatus according to an embodiment of the present invention. In FIG. 1, the MFP 101 is connected to a PC 102 via a network 103. A user can operate an operation unit 203 of the MFP 101, which will be described later in FIG. 2, to perform settings to be used when the MFP 101 reads a document. The user sets, for example, a resolution, a compression rate, a data format (for example, JPEG, TIFF, PDF, few-color compression, few-color compression (with OCR result), e-Documentation mode), etc. as the settings. The e-Documentation mode will be described in detail later. The MFP 101 reads a document set based on various settings set by the user, generates a scanned image of the document, and transmits the generated scanned image to a specified destination, for example, the PC 102.
[0012] Fig. 2 is a block diagram showing a schematic configuration of the MFP 101 in Fig. 1. In Fig. 2, the MFP 101 includes a scanner unit 201, a printer unit 202, an operation unit 203, and a control unit 204.
[0013] The scanner unit 201 is an image input device, and for example, reads a set document and generates a scan image of the document. The scanner unit 201 also sets the reading mode to normal reading mode or dark reading mode based on a setting value designated by the user (mode setting means). The dark reading mode is a reading mode in which the amount of light when reading a document is less than that in the normal reading mode. The dark reading mode is set when it is necessary to maintain the gradation difference between the background of the document and the correction marks, for example, when generating a scan image that complies with the Electronic Bookkeeping Act (e-Document Act). The printer unit 202 is an image output device, and for example, prints an image generated by the scanner unit. The operation unit 203 is a user interface in the MFP101.
[0014] The control unit 204 is connected to the scanner unit 201, printer unit 202, and operation unit 203. The control unit 204 also inputs and outputs image information and device information by connecting to the network 103. The control unit 204 includes a CPU 205, a RAM 206, an operation unit I / F 207, a network I / F 208, a ROM 209, and a storage unit 210. The control unit 204 further includes an image bus I / F 212, a RIP unit 214, a device I / F 215, and a data processing unit 218 (converted image generating means). Note that RIP is an abbreviation for Ruster Image Processor.
[0015] The CPU 205 is a processor that controls the entire system. The RAM 206 is a system work memory for the CPU 205 to operate, and is also an image memory for temporarily storing images. The operation unit I / F 207 is an interface between the control unit 204 and the operation unit 203. For example, the operation unit I / F 207 outputs an image to be displayed on the operation unit 203 to the operation unit 203. The operation unit I / F 207 also transmits information input by a user to the operation unit 203 to the CPU 205. The network I / F 208 connects the MFP 101 to the network 103, and inputs and outputs information in a packet format. The ROM 209 is a boot ROM, and stores a boot program for the system, etc. The storage unit 210 is a hard disk drive, and stores system control software, images, etc. The CPU 205, the RAM 206, the operation unit I / F 207, the network I / F 208, the ROM 209, and the storage unit 210 are connected to one another via a system bus 211. The image bus I / F 212 is a bus bridge that connects the system bus 211 and the image bus 213 and converts the data structure. The image bus 213 enables high-speed transfer of images, and is configured by, for example, a PCI bus or IEEE1394.
[0016] The image bus 213 is connected to a RIP unit 214, a device I / F 215, and a data processing unit 218. The RIP unit 214 analyzes the PDL code of print data received by the MFP 101 from an external device or the like, and performs rendering processing to develop the print data into a bitmap image with a specified resolution. PDL is an abbreviation for Page Description Language. The device I / F 215 is connected to the scanner unit 201 via a signal line 216, and is connected to the printer unit 202 via a signal line 217. The data processing unit 218 performs image processing of a scanned image acquired from the scanner unit 201, generation processing of a print image to be output to the printer unit 202, and processing such as low-color compression and OCR. In this way, compressed data, which will be described later, is generated. The generated compressed data is transmitted to a destination specified by the user, for example, the PC 102, via the network I / F 208 and the network 103. The data processing unit 218 can also decompress compressed data received via the network I / F 208 and the network 103. The decompressed image is transferred to the printer unit 202 via the device I / F 215 , and the printer unit 202 prints the image acquired via the device I / F 215 .
[0017] Fig. 3 is a diagram showing an example of a setting screen displayed on the operation unit 203 in Fig. 2. Fig. 3(a) is a diagram showing an example of a scan setting screen 300 displayed on the operation unit 203.
[0018] The scan setting screen 300 is a screen for the user to instruct the MFP 101 to read a document. The scan setting screen 300 includes a color selection button 301, a magnification button 302, a document type button 303, and a start button 309. The color selection button 301 is a button for setting a color when saving or copying a scanned image of a read document. For example, the user operates the color selection button 301 to set "black and white" or "full color". The magnification button 302 is a button for setting a magnification of the scanned image of the read document. The document type button 303 is a button for setting the type of document to be read. When the user selects the document type button 303, the screen of the operation unit 203 transitions to a document type setting screen 304 in FIG. 3(b).
[0019] The document type setting screen 304 includes a plurality of buttons corresponding to representative document types, specifically, a text / photo / map button 305, a print photo button 306, a text button 307, and an electronic document button 308. The text / photo / map button 305 is a button selected when the document to be read is a document composed of various contents such as photos and text. The print photo button 306 is a button selected when the document to be read is a document composed mainly of photos. The text button 307 is a button selected when the document to be read is a document composed mainly of text. The electronic document button 308 is a button selected when instructing the generation of a scanned image that complies with the Electronic Bookkeeping Act (e-Document Act). In the MFP 101, image processing corresponding to the document type set by the user on the document type setting screen 304 is performed on the scanned image of the read document.
[0020] In addition, in the MFP 101, a reading mode flag is set based on the type of document set by the user on the document type setting screen 304. For example, when the user selects the electronic document button 308 on the document type setting screen 304, the reading mode flag is set to "1". The scanner unit 201 reads the document in the dark reading mode set according to this reading mode flag. On the other hand, when the user selects a button other than the electronic document button 308 on the document type setting screen 304, the reading mode flag is set to "0". The scanner unit 201 reads the document in the normal reading mode set according to this reading mode flag. In this way, in the MFP 101, the reading mode of the scanner unit 201 is controlled based on the reading mode flag. The reading mode flag is transferred to the data processing unit 218 via the operation unit I / F 207 and the CPU 205.
[0021] When the user selects any button on the document type setting screen 304, the screen of the operation unit 203 transitions to a scan setting screen 300. When the user performs various settings on the scan setting screen 300 and selects a start button 309, the operation unit I / F 207 notifies the CPU 205 of the setting values (hereinafter referred to as "scan setting values") set on the scan setting screen 300. The CPU 205 starts the scan control process of FIG. 4 based on the scan setting values received from the operation unit I / F 207.
[0022] Fig. 4 is a flowchart showing the procedure of scan control processing executed by MFP 101 of Fig. 1. The processing of Fig. 4 is realized by CPU 205 executing a program stored in ROM 209 or storage unit 210.
[0023] 4, first, the CPU 205 sets the scan setting values received from the operation unit I / F 207 in the data processing unit 218, and instructs the scanner unit 201 to read an original (step S401). The scanner unit 201 reads an original (paper document) in accordance with the instruction received from the CPU 205, generates a scanned image of the original, and transmits the scanned image to the data processing unit 218. The data processing unit 218 executes a color conversion process in FIG. 7, which will be described later, based on the received scanned image to generate a converted image, and generates compressed data by compressing the converted image in a compression format such as JPEG format. The data processing unit 218 also transmits a processing end notification to the CPU 205, indicating that the processing by the data processing unit 218 has been completed.
[0024] CPU 205 waits until it receives a process end notification. When it receives a process end notification from data processing unit 218 (YES in step S402), CPU 205 ends this process.
[0025] Fig. 5 is a block diagram showing a schematic configuration of the data processing unit 218 in Fig. 2. In Fig. 5, the data processing unit 218 includes a filter application unit 501 (image processing means), a base color determination unit 502, a base neighboring color conversion unit 503, an image data selection unit 504, and an image compression unit 505.
[0026] The filter application unit 501 performs a filter process on the scanned image acquired from the scanner unit 201, using an edge-preserving smoothing filter such as a median filter or a bilateral filter, to smooth small edges while preserving large edges. In the following, the scanned image will be described as an RGB image including R, G, and B components. The above filter process suppresses variations in the R, G, and B values (hereinafter referred to as "RGB values") of multiple pixels constituting the scanned image, making it possible to easily determine the background color described below. As a result of the above filter process, a filter-applied image 601 (processed image) in FIG. 6(a) is generated, and the filter application unit 501 outputs the filter-applied image 601 to the background color determination unit 502.
[0027] The base color determination unit 502 determines the base color based on the filter-applied image 601 acquired from the filter application unit 501. Here, even in the filter-applied image 601 that has been subjected to the above-mentioned filter processing, the base color may not be uniform. When an RGB histogram of such a filter-applied image 601 is calculated, it can be shown as shown in FIG. 6(b). Note that, originally, it is shown as a four-dimensional histogram with the horizontal axis representing each component of RGB and the vertical axis representing the frequency of occurrence, but in FIG. 6(b), for ease of explanation, the horizontal axis is shown as the total value of RGB values, and the vertical axis is shown as the frequency of occurrence. In this embodiment, the base color determination unit 502 determines the color corresponding to the total value 602 of the RGB values that appears most frequently in this histogram as the base color. Note that the method of determining the base color is not limited to this. For example, a histogram of values in which the values of each component of RGB are mixed at a predetermined ratio may be calculated, and the color that appears most frequently may be determined as the base color. The base color determination unit 502 generates base color information indicating the determined base color, and outputs the base color information to the base neighboring color conversion unit 503. The base color information is represented by RGB values such as (190, 190, 190), for example.
[0028] The background vicinity color conversion unit 503 generates a background vicinity color-converted image 802 shown in Fig. 8(c) described later, in which a color close to the color indicated by the background color information in the filter application image 601 (hereinafter simply referred to as "background color") is converted into the background color. The generation of the background vicinity color-converted image 802 will be described later with reference to Fig. 7.
[0029] The image data selection unit 504 selects an output image based on the reading mode flag. If the reading mode flag is "1", that is, if the user has selected the electronic document button 308 on the document type setting screen 304, the image data selection unit 504 outputs the background vicinity color converted image 802 to the image compression unit 505. If the reading mode flag is "0", that is, if the user has selected a button other than the electronic document button 308 on the document type setting screen 304, the image data selection unit 504 outputs the scanned image received from the scanner unit 201 to the image compression unit 505 as is.
[0030] The image compression unit 505 compresses the image acquired from the image data selection unit 504 in a compression format such as JPEG format to generate compressed data. The compressed data is transmitted to a destination included in the scan setting values, for example, to the PC 102. When transmission of the compressed data is completed, the image compression unit 505 transmits a processing end notification to the CPU 205.
[0031] Fig. 7 is a flowchart showing the procedure of the color conversion process executed by the data processing unit 218 in Fig. 2. The process in Fig. 7 is executed when the data processing unit 218 acquires a reading mode flag set to "1" from the CPU 205. As described above, when the reading mode flag is set to "1", the scanner unit 201 reads the document in the dark reading mode.
[0032] 7, the data processing unit 218 selects one pixel, for example, pixel 801 in FIG. 8(a), as a pixel of interest from among a plurality of pixels constituting the filter-applied image 601 (step S701). The selection order of the pixels of interest in the filter-applied image 601 is, for example, the raster scan order of the entire filter-applied image 601. Note that the selection order of the pixels of interest in the filter-applied image 601 is not limited to this order, and may be another order.
[0033] Next, the data processing unit 218 determines whether the color corresponding to the RGB value of the pixel of interest is close to the color of the background determined by the background color determination unit 502 (step S702). Specifically, the data processing unit 218 calculates the difference between the RGB value of the pixel of interest and the RGB value of the background color for each RGB component. For example, as shown in FIG. 8B, if the RGB value of the pixel of interest is (189, 188, 190) and the RGB value of the background color is (190, 190, 190), the difference for each RGB component is (1, 2, 0). In this way, if all the differences of the R component, G component, and B component are equal to or less than a predetermined value set in advance, the data processing unit 218 determines that the color corresponding to the RGB value of the pixel of interest is close to the color of the background. The predetermined value is a value less than the color difference between the paper base part of the paper document and the correction mark, and is a value determined based on the A-class tolerance, for example, 3. That is, in this embodiment, a color corresponding to an RGB value whose color difference with the background color is less than the color difference between the paper base part of the paper document and the correction mark is determined to be a color close to the background color. On the other hand, if the difference of any of the R component, G component, and B component is greater than the above-mentioned predetermined value, the data processing unit 218 determines that the color corresponding to the RGB value of the target pixel is not a color close to the background color. Note that the determination method in step S702 is not limited to the above-mentioned method, and may use, for example, a difference value of the CbCr component in the YCbCr color space consisting of lightness and color difference, or a difference value of the L* component in the L*a*b* color space.
[0034] If the result of the determination in step S702 is that the color corresponding to the RGB value of the pixel of interest is not close to the color of the background, the data processing unit 218 performs the process of step S704 described below. If the result of the determination in step S702 is that the color corresponding to the RGB value of the pixel of interest is close to the color of the background, the data processing unit 218 converts the RGB value of the pixel of interest to the RGB value of the color of the background (step S703). In this manner, in this embodiment, the color corresponding to the RGB value whose color difference with the color of the background in the filter application image 601 is less than the color difference between the paper background part of the paper document and the correction marks is converted to the color of the background. Next, the data processing unit 218 determines whether or not all pixels constituting the filter application image 601 have been selected (step S704).
[0035] If the result of the determination in step S704 is that any pixel constituting the filter-applied image 601 has not been selected, the color conversion process returns to step S701. The data processing unit 218 selects one pixel from among the unselected pixels in the filter-applied image 601 as a pixel of interest, and performs the processes in and after step S702.
[0036] If it is determined in step S704 that all pixels constituting the filter-applied image 601 have been selected, the color conversion process ends. As a result of the color conversion process, a background-proximate color-converted image 802 shown in Fig. 8(c) is generated in which colors close to the background color in the filter-applied image 601 are converted to the background color.
[0037] According to the above-described embodiment, when the dark reading mode is set, a background-proximate color-converted image 802 in which a color close to the background color in the filter-applied image 601 is converted to the background color is generated as an electronic document. This makes it possible to unify the color of the background region, which occupies the majority of the area in the electronic document generated in the dark reading mode, to the background color, thereby improving the compression efficiency of the electronic document generated in the dark reading mode.
[0038] Furthermore, in the above-described embodiment, the background color is determined based on the filter-applied image 601, which is obtained by performing filtering using a smoothing filter on the scanned image generated by the scanner unit 201. This makes it possible to easily determine the background color using the filter-applied image 601 in which the variation in RGB values of multiple pixels constituting the scanned image is suppressed.
[0039] Furthermore, in the above-described embodiment, a histogram is generated based on the filter-applied image 601, and the color that appears most frequently in the histogram is determined as the background color. This makes it possible to easily determine the background color even if the color of the background region in the filter-applied image 601 is not uniform.
[0040] In the above-described embodiment, when the dark reading mode is set, a color in the filter application image 601 whose color difference with the background color is equal to or less than a predetermined value is converted to the background color. The predetermined value is a value less than the color difference between the paper base part of the paper document and the correction marks. This makes it possible to convert a color corresponding to an RGB value whose color difference with the background color is less than the color difference between the paper base part of the paper document and the correction marks to the background color. As a result, it is possible to generate an electronic document that maintains the gradation difference between the paper base part and the correction marks while improving compression efficiency.
[0041] Although the present invention has been described above using the above-mentioned embodiment, the present invention is not limited to the above-mentioned embodiment. For example, when a correction trace area of a document in a scanned image is detected and a dark reading mode is set, a converted image may be generated in which a color close to the background color in the area other than the correction trace area in the filter application image 601 is converted to the background color.
[0042] In the above-described embodiment, when a document including correction marks made with correction fluid is read in the dark reading mode, a filter-applied image 902 including a correction mark area 901 shown in Fig. 9(a) is generated, and a histogram shown in Fig. 9(b) is calculated. A color corresponding to a total value 903 of RGB values that appears most frequently based on this histogram is determined as the background color, and a color close to the background color in the filter-applied image 902 is converted to the background color. Here, if the color of the base part of the document is the same color as the color of the correction marks, for example, white, there is a concern that the color of at least a part of the correction mark area will be converted to the background color, and an electronic document as shown in Fig. 9(c) will be generated in which the contrast between the base part of the document and the correction marks is not clear.
[0043] In contrast, in the present embodiment, correction trace areas of a document are detected in a scanned image, and when dark reading mode is set, a converted image is generated in which colors close to the background color in areas other than the correction trace areas in the filter-applied image are converted to the background color.
[0044] Fig. 10 is a block diagram showing an outline of another configuration of the data processing unit 218 in Fig. 2. In Fig. 10, a data processing unit 1000 (converted image generating means) which is another configuration of the data processing unit 218 includes a correction mark detection unit 1001 (detection means) and a base color conversion unit 1002 in addition to the components shown in Fig. 5.
[0045] The correction mark detection unit 1001 executes the correction mark detection process of FIG. 11 to detect a correction mark area in a scanner image acquired from the scanner unit 201.
[0046] Fig. 11 is a flowchart showing the procedure of correction mark detection processing executed by the correction mark detection unit 1001 of Fig. 10. Note that the processing of Fig. 11 is premised on the fact that the scanner image 1201 of Fig. 12(a) has been acquired from the scanner unit 201. The scanner image 1201 includes correction marks 1202.
[0047] In FIG. 11, the correction mark detection unit 1001 generates a variance distribution image 1203 in FIG. 12(b) based on a scanner image 1201 acquired from the scanner unit 201 (step S1101). The variance distribution image is an image expressing the distribution of variance values of each pixel calculated from the luminance values of each pixel in a range of M×N centered on the pixel. In this embodiment, as an example of the luminance value, a value obtained by adding the values of each component of the RGB value in a ratio of (R:G:B=6:3:1) is used, but this is not limited to this. Also, in this embodiment, the range of M×N is described as a range of 5×5 pixels, but this is not limited to this, and the number of pixels (range) acquired may be changed depending on the size of the image, etc. The variance value is calculated using the following formula (1).
[0048]
number
[0049] σL[n] represents the luminance value of the nth pixel in the scanned image. xLi represents the luminance value of the i-th pixel in the 5×5 pixel region. μL represents the average luminance value of the 5×5 pixels. N represents the total number of pixels (25). Σ represents the calculation of the sum. In step S1101, the correction mark detection unit 1001 performs calculations for all pixels and generates a variance distribution image 1203.
[0050] Next, the correction mark detection unit 1001 generates an edge image 1204 of Fig. 12(c) based on the variance distribution image 1203 (step S1102). In step S1102, for example, the correction mark detection unit 1001 performs edge extraction using the Canny method or the like, and generates an edge image 1204, which is a binary image in which edge pixels are set to 1 and non-edge pixels are set to 0. For example, in reading by the scanner unit 201, edges are generated at the boundary between the correction mark and the background of the document, so that the end of the correction mark is determined as an edge pixel.
[0051] Next, the correction mark detection unit 1001 detects a correction mark area in the scanned image using the variance distribution image 1203 and the edge image 1204. Specifically, the correction mark detection unit 1001 first extracts an edge that forms an enclosure. The correction mark detection unit 1001 selects one edge pixel from among a plurality of edge pixels whose pixel value is 1 in the edge image 1204, and determines whether an edge pixel exists among the eight pixels surrounding the selected edge pixel. If an edge pixel exists among the eight pixels surrounding the selected edge pixel, the correction mark detection unit 1001 selects one edge pixel from the eight pixels surrounding the selected edge pixel, and determines whether an edge pixel exists among the eight pixels surrounding the selected edge pixel. The correction mark detection unit 1001 repeatedly executes this process, and if a pixel adjacent to the finally selected edge pixel is a pixel that has already been determined to be an edge pixel, the correction mark detection unit 1001 determines that an enclosure-shaped edge pixel group including the selected edge pixel exists. On the other hand, if there is no edge pixel within the eight pixels surrounding the selected edge pixel, the correction trace detection unit 1001 determines that there is no enclosing edge pixel group that includes the selected edge pixel. After extracting the enclosing edge in this manner, the correction trace detection unit 1001 determines that, for the pixels inside the enclosing edge pixel group, the pixels with a variance value equal to or less than a predetermined value are correction trace candidate pixels.
[0052] Next, the correction mark detection unit 1001 generates the correction mark candidate image 1205 of Fig. 12(d) in which the pixel values of pixels determined to be correction mark candidate pixels are set to 1 and the pixel values of other pixels are set to 0 (step S1103). Next, the correction mark detection unit 1001 outputs the correction mark candidate image 1205 to the background vicinity color conversion unit 503, and the correction mark detection process ends.
[0053] FIG. 13 is a flowchart showing the procedure of the color conversion process executed by the data processing unit 1000 in FIG.
[0054] 13, the data processing unit 1000 performs the process of step S701 described above. Next, the data processing unit 1000 determines whether or not the pixel of interest is a correction mark candidate pixel, based on the correction mark candidate image 1205 generated by the correction mark detection unit 1001 (step S1301). In step S1301, if the pixel value of the pixel of interest in the correction mark candidate image 1205 is 1, the data processing unit 1000 determines that the pixel of interest is a correction mark candidate pixel. On the other hand, if the pixel value of the pixel of interest in the correction mark candidate image 1205 is 0, the data processing unit 1000 determines that the pixel of interest is not a correction mark candidate pixel.
[0055] If the result of the determination in step S1301 is that the pixel of interest is not a correction mark candidate pixel, the color conversion process proceeds to step S702. In this manner, in this embodiment, colors close to the color of the background in areas other than the correction mark area in the filter-applied image are converted to the background color. If the result of the determination in step S1301 is that the pixel of interest is a correction mark candidate pixel, the color conversion process proceeds to step S704, and when all pixels constituting the filter-applied image 601 have been selected, the color conversion process ends. As a result of the color conversion process in Figure 13, a background vicinity color-converted image is generated in which the RGB values of pixels that are not correction mark candidate pixels and have colors close to the background color are converted to the RGB values of the background color.
[0056] Returning to FIG. 10, the background color conversion unit 1002 reduces the brightness of the background color in the background neighborhood color conversion image by a predetermined amount. Specifically, the background color conversion unit 1002 subtracts a first value, for example, 10, from each component of the RGB values of all pixels having the same RGB values as the RGB values included in the background color information generated by the background color determination unit 502 in the above background neighborhood color conversion image. Note that 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 dividing the average value of the RGB values of the background color information by 1 / 10. The correction mark basically has a higher RGB value than the color of the background. Therefore, by subtracting the first value from the RGB values of all pixels having the same RGB values as the RGB values included in the background color information as described above, the color difference between the background and the correction mark becomes clearer, and an electronic document 1401 in which the correction mark area 1402 is easily visible as shown in FIG. 14 is generated.
[0057] In the above-described embodiment, when a correction trace area of a document in a scanned image is detected and the dark reading mode is set, a converted image is generated in which a color close to the background color in the area other than the correction trace area in the filter application image is converted to the background color. This makes it possible to prevent the color of at least a part of the correction trace area in the filter application image from being converted to the background color, thereby preventing the generation of an electronic document in which the contrast between the paper part of the document and the correction traces is unclear.
[0058] Furthermore, in the above-described embodiment, the electronic document 1401 is generated by lowering the lightness of the background color in the background nearby color converted image by a predetermined amount. This makes it possible to generate an electronic document in which correction traces are easily visible.
[0059] In the above-described embodiment, the lightness of the color of the correction trace area in the background vicinity color-converted image may be increased by a predetermined amount.
[0060] Fig. 15 is a block diagram showing an outline of another configuration of the data processing unit 218 of Fig. 2. In Fig. 15, a data processing unit 1500 (converted image generating means), which is another configuration of the data processing unit 218, includes a correction mark detection unit 1001 and a correction mark color conversion unit 1501 in addition to the components shown in Fig. 5. The correction mark color conversion unit 1501 increases the lightness of the color of the correction mark area in the background vicinity color-converted image by a predetermined amount. Specifically, the correction mark color conversion unit 1501 adds a second value, for example, 10, to the RGB values of the correction mark candidate pixels. Note that the second value is not limited to 10 and may be another value.
[0061] FIG. 16 is a flowchart showing the procedure of the color conversion process executed by the data processing unit 1500 in FIG.
[0062] In FIG. 16, a data processing unit 1500 performs the processes of steps S701 and S1301 described above.
[0063] If the result of the determination in step S1301 is that the pixel of interest is not a correction mark candidate pixel, the color conversion process proceeds to step S702. If the result of the determination in step S1301 is that the pixel of interest is a correction mark candidate pixel, the data processing unit 1500 performs the process of step S1601. In step S1601, the data processing unit 1500 determines whether the color corresponding to the RGB value of the pixel of interest is close to the background color determined by the background color determination unit 502, as in step S702.
[0064] If it is determined in step S1601 that the color corresponding to the RGB values of the pixel of interest is not close to the background color determined by the base color determination unit 502, the color conversion process proceeds to step S704. If it is determined in step S1601 that the color corresponding to the RGB values of the pixel of interest is close to the background color determined by the base color determination unit 502, the data processing unit 1500 adds a second value, for example, 10, to the RGB values of the pixel of interest (step S1602). Thereafter, the color conversion process proceeds to step S704.
[0065] In the above-described embodiment, the data processing unit 1500 increases the brightness of the color of the correction trace area in the background vicinity color-converted image by a predetermined amount. This makes it possible to generate an electronic document with a clear contrast between the paper background part of the document and the correction trace.
[0066] The present invention can also be realized by supplying a program that realizes one or more functions of the above-mentioned embodiments to a system or device via a network or a storage medium, and having one or more processors in a computer of the system or device read and execute the program. The present invention can also be realized by a circuit (e.g., ASIC) that realizes one or more functions. [Explanation of symbols]
[0067] 101 MFP 201 Scanner section 205 CPU 218 Data Processing Unit 502 Base color determination unit 503 Background Near Color Conversion Unit 601 Filter applied images 1000 Data Processing Unit 1001 Correction mark detection section 1002 Background color conversion section 1500 Data Processing Unit 1501 Correction mark color conversion section
Claims
1. A reading means for reading an original and generating image data; a setting means for setting a reading mode of the reading means to a first reading mode or a second reading mode in which an amount of light irradiated onto the document is smaller than that of the first reading mode; an image processing means for generating image data by subjecting the image data generated by the reading means to filtering processing using a smoothing filter; a determining means for generating a histogram based on the image data generated by the image processing means, and determining a color having the highest frequency of appearance in the histogram as a background color; a generating means for generating image data in which, when the first reading mode is set, a conversion process is not performed for converting a color in the image data generated by the image processing means, the color difference of which from the color of the background is smaller than a predetermined value, into the color of the background, and, when the second reading mode is set, a color in the image data generated by the image processing means, the color difference of which is smaller than the predetermined value, into the color of the background is converted; and a compression means for compressing image data generated by the reading means when the first reading mode is set, and for compressing image data generated by the generating means when the second reading mode is set.
2. 2. The image processing apparatus according to claim 1, wherein the predetermined value is a value less than a color difference between a base portion of the document and correction marks.
3. 3. The image processing apparatus according to claim 1, wherein the compression means compresses the image data generated by the reading means or the image data generated by the generation means into compressed data in JPEG format.
4. The apparatus further includes a display means for displaying a screen including a character button and an electronic document button as document types; 4. The image processing device according to claim 1, wherein the setting means sets the reading mode of the reading means to the first reading mode when the character button is selected, and sets the reading mode of the reading means to the second reading mode when the electronic document button is selected.
5. A method for controlling an image processing apparatus having a reading unit that reads an original and generates image data, comprising the steps of: a setting step of setting a reading mode of the reading means to a first reading mode or a second reading mode in which an amount of light irradiated onto the document is smaller than that of the first reading mode; an image processing step of generating image data by subjecting the image data generated by the reading means to filtering processing using a smoothing filter; a determining step of generating a histogram based on the image data generated in the image processing step, and determining a color having the highest frequency of appearance in the histogram as a background color; a generating step of generating image data in which, when the first reading mode is set, a conversion process is not performed to convert a color in the image data generated in the image processing step, the color difference of which from the color of the background is smaller than a predetermined value, into the color of the background, and, when the second reading mode is set, a color in the image data generated in the image processing step, the color difference of which from the color of the background is smaller than the predetermined value, is converted into the color of the background; a compression step of compressing image data generated by the reading means when the first reading mode is set, and a compression step of compressing image data generated in the generation step when the second reading mode is set.
6. 6. A program for causing a computer to execute the control method for an image processing apparatus according to claim 5.
Citation Information
Patent Citations
Image forming apparatus and method
JP2006262344A
Image reading apparatus
JP2006295307A
Image reading apparatus and method
JP2006303784A
Image processor, image processing method, computer program, and recording medium
JP2007124541A
Image processing system and computer program
JP2014128023A