Image processing apparatus, image file production method, and program

The image processing device optimizes background color determination by using DC components for subsequent pages and selectively employing AC components based on similarity, reducing processing load and enhancing efficiency.

JP2025165047APending Publication Date: 2025-11-04SEIKO EPSON CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024068893
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-04-22
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

Existing image processing technologies fail to efficiently reduce processing load for determining background color in scan data where the background color is unclear.

Method used

An image processing device and method that discriminates background color using DC components for subsequent pages and optionally AC components for initial pages, determining background color based on similarity with previous pages to optimize processing.

Benefits of technology

Reduces processing load by selectively using AC components only when necessary, thereby enhancing efficiency in background color determination.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025165047000001_ABST
    Figure 2025165047000001_ABST
Patent Text Reader

Abstract

To provide an image processing apparatus that can reduce the load on processing on scanned data required for discriminating a background color, even if the scanned data is obtained by scanning a document in which whether a background color is the same is unknown.SOLUTION: An image processing apparatus according to an aspect of the present disclosure comprises a first discrimination unit, a second discrimination unit, and a background color determination unit. The first discrimination unit discriminates a background color for a discrimination target page of scanned data obtained by converting a plurality of scanned pages into the JPEG format, by using a DC component and without using an AC component, and the second discrimination unit discriminates the background color for the discrimination target page, by using the DC component and the AC component. The background color determination unit, for a predetermined page of the scanned data, when a first background color that is a discrimination result from the first discrimination unit is not similar to a second background color determined for the previous page of the predetermined page, causes the second discrimination unit to execute discrimination, and determines the result of the discrimination as the background color of the predetermined page. When the first background color and the second background color are similar to each other, the background determination unit does not cause the second discrimination unit to execute discrimination and determines the second background color as the background color of the predetermined page.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present disclosure relates to an image processing device, an image file production method, and a program. [Background technology]

[0002] Patent Document 1 discloses an image processing device that facilitates the determination of pixels that can be replaced with a background color and aims to perform rapid processing regardless of the presence or absence of an object of observation. The image processing device disclosed in Patent Document 1 includes a pixel value histogram generation unit that generates a histogram of pixel values ​​of multiple pixels included in an image, and a background pixel value setting unit that sets a background pixel value using a peak value of the histogram generated by the pixel value histogram generation unit. The image processing device disclosed in Patent Document 1 further includes a noise range setting unit that sets a noise range for the background pixel value set by the background pixel value setting unit, and a pixel value replacement unit that replaces pixel values ​​present in the noise range set by the noise range setting unit with an arbitrary single pixel value. [Prior art documents] [Patent documents]

[0003] [Patent Document 1] Japanese Patent Application Laid-Open No. 2019-144294 Summary of the Invention [Problem to be solved by the invention]

[0004] However, the technology described in Patent Document 1 cannot reduce the processing load required to determine the background color of scan data obtained by scanning a document in which it is unclear whether the background color is the same or not.

[0005] Therefore, it is desirable to develop a technology that reduces the processing load required to determine the background color even for scan data obtained by scanning a document in which it is unclear whether the background color is the same or not. [Means for solving the problem]

[0006] An image processing device according to one aspect of the present disclosure includes an acquisition unit that acquires scan data of scanned multiple pages converted into JPEG format; a first discrimination unit that discriminates the background color of a page of the scan data to be discriminated using DC components without using AC components; a second discrimination unit that discriminates the background color of the page of the scan data to be discriminated using DC components and AC components; and a background color determination unit that determines the background color of a specified page of the scan data, wherein if a first background color, which is the background color determined by the first discrimination unit with the specified page of the scan data as the discriminated page, is dissimilar to a second background color, which is the background color determined with the page previous to the specified page as the discriminated page, the background color determination unit executes discrimination by the second discrimination unit with the specified page as the discriminated page, and determines a third background color, which is the background color determined by the second discrimination unit, as the background color of the specified page; and if the first background color is similar to the second background color, the background color determination unit does not execute discrimination by the second discrimination unit with the specified page as the discriminated page, and determines the second background color as the background color of the specified page.

[0007] An image file production method according to one aspect of the present disclosure includes an acquisition process for acquiring scan data of scanned multiple pages in JPEG format; a first determination process for determining a background color for a determination target page of the scan data using a DC component without using an AC component; a second determination process for determining a background color for a determination target page of the scan data using the DC component and the AC component; a background color determination process for determining a background color for a predetermined page of the scan data; and a production process for producing an image file of the scan data by performing predetermined image processing on the scan data using the background color determined in the background color determination process as a background. In the background color determination process, if a first background color, which is the background color determined in the first determination process using a specified page of the scan data as the determination target page, is dissimilar to a second background color, which is the background color determined using a page previous to the specified page as the determination target, the second determination process is executed using the specified page as the determination target page, and a third background color, which is the background color determined in the second determination process, is determined as the background color of the specified page; and if the first background color is similar to the second background color, the second determination process is not executed using the specified page as the determination target page, and the second background color is determined as the background color of the specified page.

[0008] A program according to one aspect of the present disclosure causes a computer to execute an acquisition process for acquiring scan data of multiple scanned pages converted into JPEG format; a first discrimination process for discriminating a background color for a page of the scan data using DC components but not AC components; a second discrimination process for discriminating a background color for the page of the scan data using DC components and AC components; and a background color determination process for determining a background color for a specified page of the scan data. In the background color determination process, if a first background color, which is the background color determined in the first discrimination process with the specified page of the scan data as the discriminant page, is dissimilar to a second background color, which is the background color determined with the page previous to the specified page as the discriminant page, the program executes the second discrimination process with the specified page as the discriminant page, and determines a third background color, which is the background color determined in the second discrimination process, as the background color of the specified page; and if the first background color is similar to the second background color, the program does not execute the second discrimination process with the specified page as the discriminant page, and determines the second background color as the background color of the specified page. [Brief explanation of the drawings]

[0009] [Figure 1] 1 is a block diagram showing an example of a configuration of an image processing device according to an embodiment; [Figure 2] 2 is a flowchart illustrating an example of image processing executed in the image processing device of FIG. 1. FIG. [Figure 3] 2 is a schematic diagram for explaining an example of background processing executed in the image processing device of FIG. 1. FIG. [Figure 4] 4 is a schematic diagram showing a specific example of a background color range determined from scan data by the background processing of FIG. 3. FIG. [Figure 5] 4 is a flowchart illustrating an example of a process for determining a background color range in the background process of FIG. 3. FIG. [Figure 6] FIG. 6 is a diagram showing an example of a part of a histogram of the first page generated in the process of FIG. 5. [Figure 7]FIG. 7 is a diagram showing a table showing values ​​in the histogram of FIG. 6. [Figure 8] FIG. 6 is a diagram showing an example of a part of a histogram of the second page generated in the process of FIG. 5. [Figure 9] FIG. 9 is a diagram showing a table showing values ​​in the histogram of FIG. 8. [Figure 10] FIG. 6 is a diagram showing another example of a part of the histogram of the second page generated in the process of FIG. 5. [Figure 11] FIG. 11 is a diagram showing a table showing values ​​in the histogram of FIG. [Figure 12] 2 is a schematic diagram for explaining an example of black character processing executed in the image processing device of FIG. 1. FIG. [Figure 13] 13 is a schematic diagram showing a specific example of a black character color range for the first page determined from scan data by the black character processing of FIG. 12. FIG. [Figure 14] 13 is a schematic diagram showing a specific example of a black character color range on the second page determined from the scan data by the black character processing of FIG. 12. FIG. [Figure 15] FIG. 10 is a schematic diagram for explaining image processing according to a comparative example. [Figure 16] 16A and 16B are schematic diagrams showing specific examples of background color ranges and black character color ranges determined from scan data by the image processing of FIG. 15. [Figure 17] FIG. 2 illustrates an example of a hardware configuration of the apparatus. DETAILED DESCRIPTION OF THE INVENTION

[0010] Hereinafter, embodiments of the present invention will be described with reference to the drawings. Note that the drawings are merely examples for explaining the embodiments of the present invention. Furthermore, not all of the components described in the embodiments of the present invention are necessarily essential components of the present invention.

[0011] (Embodiment) [Configuration of image processing device] The image processing device according to this embodiment is a device capable of acquiring multiple JPEG files corresponding to multiple pages. JPEG stands for Joint Photographic Experts Group. The image processing device may be a device capable of acquiring multiple JPEG files corresponding to multiple pages from an external device. Alternatively, the image processing device may be a device capable of scanning a document containing multiple pages, acquiring the resulting image data, and converting the image data into JPEG format to obtain scanned data. Alternatively, the image processing device may be a device capable of acquiring such scanned data from an external device.

[0012] In the following description, an example in which the image processing apparatus according to this embodiment has a scanning function for scanning a document will be given as an explanation for the image processing apparatuses having various configurations.

[0013] An example of the configuration of an image processing device according to this embodiment will be described below with reference to Fig. 1. Fig. 1 is a block diagram showing an example of the configuration of an image processing device according to this embodiment.

[0014] As shown in FIG. 1, an image processing device 10 according to this embodiment can include a control unit 11, a storage unit 12, a scanning unit 13, and an operation unit .

[0015] The control unit 11 controls the entire image processing device 10. The control unit 11 can be configured to include, for example, an arithmetic processing unit, a working memory, and a storage device that stores control programs, parameters, etc. The arithmetic processing unit can be a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), etc. The control unit 11 can also be configured as an SoC (System on a Chip). As can be seen from these examples, the control unit 11 can be configured to store the control program in an executable state. However, the control unit 11 can also be configured to store part of the control program as a circuit configuration such as an FPGA (Field-Programmable Gate Array), or can be configured as a dedicated circuit.

[0016] The control program can include a program for the arithmetic processing device to execute image processing in cooperation with the storage unit 12, the scanning unit 13, and the operation unit 14. In the following, an example will be described in which at least a part of the control program is stored in the storage unit 12 provided separately from the control unit 11, but the storage unit 12 may be part of a storage device within the control unit 11. In other words, the storage unit 12 can also be considered as part of the control unit 11.

[0017] The storage unit 12 is, for example, a storage device such as a hard disk drive, a solid state drive, or other memory. The storage unit 12 stores an image processing program 20 (described later) as part of a control program in a state executable by the control unit 11. The storage unit 12 can also store various types of data. The various types of data may include, for example, image data obtained by scanning, other intermediate data, and file data as products, which are processed by the image processing program 20.

[0018] The scanning unit 13 optically reads an image of a document placed on, for example, a document table, acquires the image data, and passes it to the control unit 11. The image processing device 10 may also be provided with an automatic document feeder (not shown) for automatically transporting multiple documents one by one to a reading position on the document table or the like in the scanning unit 13. An automatic document feeder is also called an ADF. ADF is an abbreviation for Automatic Document Feeder.

[0019] The operation unit 14 is a unit that accepts operations by the user of the image processing device 10, and can also be referred to as an operation acceptance unit. The image processing device 10 can also be provided with a display unit (not shown). The display unit is a unit for displaying a user interface (UI) image for operating the image processing device 10, and is configured by a display device such as a liquid crystal display or an organic electroluminescence display. The display unit can also be configured to include a display and a drive circuit for driving the display.

[0020] The operation unit 14 can be realized by, for example, physical buttons, a touch panel mounted on a display unit, etc. In a configuration in which the operation unit 14 is equipped with a touch panel, the display unit and the touch panel can be collectively referred to as the operation panel of the image processing device 10.

[0021] The image processing device 10 may include a communication unit instead of or in addition to the operation unit 14, and may receive signals indicating user operations from external devices via this communication unit. Examples of external devices include a terminal device and a printer.

[0022] The terminal device is, for example, an information processing device with a communication function, such as a PC (Personal Computer), a smartphone, or a tablet terminal, and can be used by a user who desires image processing, such as scanning a document. When the external device is a terminal device, the image processing device 10 can be connected to the terminal device via a wired or wireless network. This network can be, for example, a local area network. When the external device is a printer, the printer and the image processing device 10 can be configured as a copier or a multifunction device equipped with other functions.

[0023] The following describes the image processing program 20. The image processing program 20 can include an acquisition processing unit 21, a first discrimination processing unit 22, a second discrimination processing unit 23, and a background color determination processing unit 24 to execute background processing, which is a series of processes for determining a background color.

[0024] The acquisition processing unit 21 controls the scanning unit 13 to read an image of a document and stores the data of the read image in the storage unit 12 as scan data in JPEG format. This scan data will include data for one or more JPEG files. If the scanned document contains multiple pages, this scan data will include a JPEG file for each page. The acquisition processing unit 21, together with the control unit 11, can constitute an acquisition unit that acquires scan data of multiple scanned pages in JPEG format.

[0025] The first discrimination processing unit 22 performs a process of discriminating the background color using DC components but not AC components for discrimination target pages of the scan data stored in the storage unit 12. The discrimination target pages in the first discrimination processing unit 22 are the second page and subsequent pages. The discrimination of the background color in the first discrimination processing unit 22 can mean calculation of the background color, and is not limited to the discrimination here, and the discrimination of color can mean calculation of the color.

[0026] The first discrimination processing unit 22 may use any method for determining the background color. For example, the first discrimination processing unit 22 may generate a histogram of all pixels for only the DC component of the page to be determined, and determine the most frequent value as the background color. DC is an abbreviation for Direct Current.

[0027] However, the background color determined by the first discrimination processing unit 22 is information used to ultimately determine the background color of the page to be discriminated. The background color can be expressed, for example, as a background color range defined as a predetermined range, such as a predetermined number of pixels around, before, or after, a value indicating the frequency peak for each YUV component. Here, the value indicating the peak refers to the mode of the histogram, i.e., the peak position of the histogram. This predetermined range can be, for example, a range that continues from the mode of the histogram and is equal to or greater than a certain frequency. The certain frequency can also refer to a certain percentage of the frequency of the mode. The background color can also be expressed, for example, as a background color range defined as a predetermined range, such as a predetermined number of pixels around, before, or after, a peak position for each YUV component of a predetermined edge region of the page to be discriminated.

[0028] The first discrimination processing unit 22, together with the control unit 11, can constitute a first discrimination unit that performs such discrimination. The first discrimination unit can also be called a DC unit because it performs discrimination using only DC components and not AC components. Note that AC is an abbreviation for Alternating Current.

[0029] The second discrimination processing unit 23 performs a process of determining the background color of a target page of the scan data using DC and AC components. The target pages for discrimination by the second discrimination processing unit 23 include at least the first page and may also include pages 2 and beyond, depending on the determination by the background color determination processing unit 24 (described later). The background color discrimination method used here is not critical, but it is desirable to use the same discrimination method as the first discrimination processing unit 22, except for whether or not the AC component is used. For example, the second discrimination processing unit 23 can generate a histogram of all pixels for the target page and determine the most frequently occurring value as the background color. Of course, the background color here can also be expressed as a background color range. The second discrimination processing unit 23, together with the control unit 11, can constitute a second discrimination unit that performs this discrimination. Because the second discrimination unit uses not only DC components but also AC components for discrimination, it can also be referred to as an AC unit.

[0030] The specific processing will be explained below, but the background color determination processing unit 24 performs processing to determine the background color for a predetermined page of the scan data. The background color determination processing unit 24, together with the control unit 11, can constitute a background color determination unit that performs such processing.

[0031] If a first background color (described later) is dissimilar to a second background color (described later), the background color determination processing unit 24 causes the second determination processing unit 23 to perform determination on the predetermined page as the determination target page. In this case, the background color determination processing unit 24 performs processing to determine the third background color, which is the background color determined by the second determination processing unit 23, as the background color of the predetermined page.

[0032] Here, the first background color is the background color determined by the first determination processing unit 22 using a specified page of the scan data as the determination target page. The second background color is the background color determined using a page before the specified page as the determination target. The page before the specified page is a page that precedes the specified page, and can be one page or multiple pages, or it can be just the page immediately before the specified page.

[0033] Furthermore, the background color determination processor 24 must obtain a result of determining whether the first background color and the second background color are similar. Therefore, the background color determination processor 24, or a determination processor separately provided in the image processing program 20, performs processing to determine whether the first background color and the second background color are similar. Below, an example will be given in which this determination is also performed by the background color determination processor 24. Similarity can refer to whether the color values ​​of both colors completely match, but it can also be considered similar if the color values ​​of both colors fall within a predetermined range. Furthermore, the determination of similarity is not limited to whether the values ​​themselves are close, and may also be a determination of whether the characteristics of the first background color and the characteristics of the second background color are similar.

[0034] On the other hand, if the first background color is similar to the second background color, the background color determination processing unit 24 does not cause the second discrimination processing unit 23 to perform discrimination on the specified page as the discrimination target page, and determines the second background color as the background color of the specified page. Note that in this application, "not performing" means not performing all of the processing. Even if discrimination on the specified page as the discrimination target page is being performed in parallel by the second discrimination processing unit 23 while determining whether the first background color is similar to the second background color, and discrimination by the second discrimination processing unit 23 is stopped when it is determined that the first background color is similar to the second background color, and discrimination by the second discrimination processing unit 23 is not performed to the end, this also falls under the category of not performing discrimination by the second discrimination processing unit 23.

[0035] The image processing program 20 may also include a third discrimination processing unit 25 and a character color determination processing unit 26 to execute character processing, which is a series of processes for determining the character color. The third discrimination processing unit 25 performs processing to analyze all pixels for a discrimination target page of the scan data and determine the character color. The third discrimination processing unit 25, together with the control unit 11, can constitute a third discrimination unit that performs such discrimination. The third discrimination processing unit 25 may also be called an analysis processing unit because it analyzes all pixels.

[0036] The text color determination processor 26 performs processing to determine the text color of a specified page. The text color determination processor 26, together with the control unit 11, can constitute a text color determination unit that performs such determination. The text color determination processor 26 can determine the text color as black or various other colors. A text color can be expressed, for example, as a text color range defined as a predetermined range, such as a predetermined number of pixels before, after, or after the value indicating the text color, for each YUV component. This predetermined range can be, for example, a range that is continuous from the value indicating the text color in the histogram and that is equal to or greater than a certain frequency. The certain frequency can also refer to a certain percentage of the frequency of the value indicating the text color.

[0037] The text color determination processing unit 26 performs processing to determine the first text color as the text color of a specified page when the proportion of non-background color blocks whose difference from the first text color is less than a predetermined proportion is less than a predetermined proportion. The block may be an MCU block, but is not limited to this. MCU stands for Minimum Coded Unit. An MCU block refers to image data obtained by breaking down an MCU in JPEG into its components and converting it into 8-pixel x 8-pixel units. The first text color is the text color determined using the previous page as the target page. On the other hand, if the proportion is equal to or greater than the predetermined proportion, the text color determination processing unit 26 performs processing to determine the text color determined by the third determination processing unit 25 as the text color of the specified page.

[0038] The image processing program 20 may also include a file generation processing unit 27. The file generation processing unit 27 performs predetermined image processing on the scan data using the background color determined by the background color determination processing unit 24 as the background, thereby generating a PDF file of the scan data. Note that PDF is an abbreviation for Portable Document Format. The generation of a PDF file can mean the production of a PDF file. The file generation processing unit 27, together with the control unit 11, can constitute a production unit that produces such a PDF file.

[0039] The file generation processing unit 27 performs predetermined image processing using the background color determined for each page by the background color determination processing unit 24 as the background. The predetermined image processing may include replacing the determined background color range value with a representative value, such as the median or central value of the background color range, or the most frequent value of the determined background color. The content of the predetermined image processing is not critical, as long as it can generate a PDF file using the determined background color. The predetermined image processing may also include other predetermined image processing using the text color determined for each page by the text color determination processing unit 26. The other predetermined image processing may include replacing the determined text color range value for each text color with a representative value, such as the median or central value of the text color range, or the most frequent value of the determined text color. The predetermined image processing may also include, for example, overlaying a text color layer determined for each text color on the determined background color layer for each page.

[0040] [Example of image processing] Next, before describing more specific examples of the background processing and text processing described above, the overall image processing including the background processing, text processing, and predetermined image processing will be described using Fig. 2. Fig. 2 is a flow diagram for explaining an example of image processing executed in the image processing device 10 of Fig. 1. The image processing described here is processing for scanning a document and ultimately generating a PDF file.

[0041] First, in response to an instruction from the acquisition processing unit 21, the scanning unit 13 scans the document and acquires the scanned image data (step S1). In step S1, if the document has multiple pages, the pages are scanned continuously. When scanning multiple pages of the document continuously, the user can reduce the time required to place the document on the document table by using the ADF.

[0042] The acquisition processing unit 21 JPEG-compresses the acquired image data and generates a JPEG file as the scanned data (step S2). The following describes the case where a document contains multiple pages. In this case, multiple JPEG files are generated as the scanned data in step S2. Prior to compression, the acquisition processing unit 21 can also perform noise removal and correction of values ​​for each sensor of the scanning unit 13 on the acquired image data. Next, the acquisition processing unit 21 stores the generated multiple JPEG files in the storage unit 12 (step S3). By temporarily storing the JPEG files in this manner, it becomes possible to execute the PDF conversion process even if the PDF conversion process speed is slow compared to the scanning speed.

[0043] Next, second discrimination processing unit 23 unpacks the JPEG file and stores YUV format image data for one page of the target page in a memory such as random-access memory (RAM) within control unit 11 (step S4). Note that Y, U, and V represent a luminance signal, a blue color difference signal, and a red color difference signal, respectively. Regarding step S4, in this embodiment, image data for the second and subsequent pages is processed by first discrimination processing unit 22 and, if necessary, by second discrimination processing unit 23; this will be described later as an example of background processing.

[0044] Then, the background color determination processing unit 24 generates a histogram for each YUV component for all pixels of the target page, and determines the background color range of the target page from the generated histogram (step S5). The background color range refers to the range defined as the background color of the target page.

[0045] The third discrimination processing unit 25 divides the image data saved in step S4 into predetermined blocks, analyzes all pixels to discriminate character colors, and classifies each block into a category based on the discrimination results (step S6). Here, the predetermined blocks may be, for example, but are not limited to, MCU blocks. Examples of categories include, but are not limited to, characters of various colors and non-characters. Hereinafter, classification into categories of background, photo, black text, and colored text is described. Colored text includes colored text of various defined colors. In other words, in step S6, each block is categorized into categories such as background, photo, black text, and colored text of each defined color. While colored text can conceptually include black text, the following description will refer to text of a color other than black. Similarly, colored text will be described hereinafter as text of a color other than black.

[0046] For example, the third discrimination processing unit 25 can determine, for each block, the category that contains the highest proportion of pixels in the target block as the category of the target block, but the method of determining the category of a block is not limited to this.

[0047] Next, the text color determination processor 26 generates a histogram for each YUV component from the pixels of all blocks in the black text category and determines a black text color range from the generated histogram (step S7). The black text color range refers to the range defined as the color of black text for the target page, i.e., the range representing black text color. Here, the values ​​representing black text for the Y, U, and V components may be defined as the most frequent values ​​within ranges such as 0-5, 124-130, or 124-130. The black text color range can be determined as a predetermined range, such as a predetermined number of pixels before, after, or after the value representing black text, for each YUV component. This predetermined range can be, for example, a range that is continuous from the value representing black text in the histogram and is equal to or greater than a certain frequency. The certain frequency can also refer to a certain percentage of the frequency of the values ​​representing black text.

[0048] In step S7, the text color determination processor 26 may perform similar processing on blocks in each color text category other than the black text category. Specifically, the text color determination processor 26 may generate a histogram for each YUV component from the pixels of all blocks in the target color text category and determine the color text range from the generated histogram. The color text range for a certain color text refers to the range defined as the color of that color text for the target page, i.e., the range representing the color text. Here, the values ​​representing a certain color text for the Y, U, and V components may be defined as the most frequent values ​​within each defined range. The color text range for a certain color text may be determined, for example, as a predetermined range for each YUV component, such as a predetermined number of pixels before, after, or after the value representing that color text. This predetermined range may be, for example, a range that is continuous from the value representing that color text in the histogram and is equal to or greater than a certain frequency. The certain frequency may also refer to a certain percentage of the frequency of the values ​​representing that color text.

[0049] In step S7, in this embodiment, the text color determination processing unit 26 performs processing for determining the text color based on the difference from the first text color as described above for image data from the second page onward. However, this will be described later as an example of black text processing.

[0050] Next, the file generation processing unit 27 extracts pixels that fall within the black character color range from the image data saved in step S4, replaces those pixels with representative values ​​of the black character color, generates image data for the black character layer, and compresses it (step S8). In step S8, the file generation processing unit 27 similarly generates and compresses image data for each color character layer, replacing the pixels with representative values ​​of each color character.

[0051] In step S8, the file generation processing unit 27 further generates and compresses image data for the background layer by extracting pixels that fall outside the black text color range and text color range from the image data saved in step S4. In this example, the image data for the background layer also includes image data for blocks classified as photographs. However, as with the black text color, image data for the background layer may also be generated and compressed by replacing the background with a representative value. In this case, for the photograph blocks, image data for the photograph layer may be generated and compressed by extracting pixels that fall outside the black text color range, text color range, and background color range.

[0052] Then, the file generation processing unit 27 writes the PDF so that the page configuration is one in which the image data of each layer is superimposed, thereby creating a PDF file, and stores the resulting PDF file in the storage unit 12 (step S9). When the processing of step S9 is completed, the image processing ends.

[0053] The file generation processing unit 27 can generate a PDF file that includes, for example, a header section and a footer section as well as multiple types of compressed data. The multiple types of compressed data can include, for example, compressed data obtained by compressing an image excluding photo areas and the like using an MMR method or the like and binarizing the image, and JPEG data obtained by compressing an image excluding text areas and the like into JPEG format. MMR is an abbreviation for Modified Modified Read.

[0054] [Example of background processing] An example of background processing executed on a plurality of JPEG files accumulated in step S3 of Fig. 2 will be described with reference to Fig. 3 and Fig. 4. Fig. 3 is a schematic diagram for explaining an example of background processing executed in the image processing device 10 of Fig. 1. Fig. 4 is a schematic diagram showing a specific example of a background color range determined from scan data by the background processing of Fig. 3.

[0055] As shown in Fig. 3, different processes are performed on the first and second pages of the scan data. In the following description, the JPEG files corresponding to the images of the first and second pages stored in the storage unit 12 by the acquisition processing unit 21 are referred to as JPEG file 31 and JPEG file 41, respectively. JPEG file 31 and JPEG file 41 are, for example, files of images such as those shown in Fig. 4 as JPEG file 31 and JPEG file 41, respectively.

[0056] The processing of the first page will now be described. First, the second discrimination processing unit 23 performs a JPEG development process 32 on the JPEG file 31 to generate a YUV image 33 of the first page, which is stored in the RAM of the control unit 11. Next, the second discrimination processing unit 23 performs a process 34 to generate a histogram 35 for all pixels of the YUV image 33 for each YUV component. In process 34, both the AC and DC components of YUV are used to generate the histogram 35. In the drawings from FIG. 3 onwards, the histogram will be abbreviated as HT and the background color as BGC. In process 34, the generated histogram 35 of the first page is stored in the RAM of the control unit 11.

[0057] The second discrimination processing unit 23 determines, for example, a predetermined range including the most frequently occurring value as the background color range in each of the histograms 35 for each YUV component. The background color range refers to a range defined as the background color of the target page, and includes the range for each YUV component.

[0058] Then, background color determination processing unit 24 performs process 36 to determine background color range 37 of page 1, which is the target page, from generated histogram 35, by determining the background color range determined by second determination processing unit 23 as background color range 37. Background color determination processing unit 24 stores determined background color range 37 in RAM within control unit 11 as the background color range of page 1. Background color range 37 refers to the range defined as the background color of the target page, and includes the ranges for each YUV component.

[0059] The generated histogram 35 and the determined background color range 37 may be as shown in Fig. 4, for example. Fig. 4 shows an example in which each YUV component value is expressed as 0 to 255 and the background color is white. Therefore, in the example of Fig. 4, the determined background color range 37 also has a predetermined range for Y including around 255, a predetermined range for U centered around 127, and a predetermined range for V centered around 127. Note that the predetermined ranges for YUV may be determined so that the difference from the upper limit to the lower limit is the same, but this is not limited to this; for example, it may be determined so that only Y has a small difference.

[0060] Next, the processing of the second page will be described. First, the first discrimination processing unit 22 performs JPEG development processing 42 on a JPEG file 41 corresponding to the image of the second page, generating a YUV image 43 of the second page. Then, the first discrimination processing unit 22 stores the YUV image 43 generated by processing 42 in the RAM of the control unit 11. At this time, the DC components 48 of the YUV image obtained when the YUV image 43 was generated, i.e., when the JPEG file 41 was developed, are stored so as to be readable by the first discrimination processing unit 22. Note that since processing 32 and processing 42 are basically the same process of performing JPEG development, for example, one of the second discrimination processing unit 23 and the first discrimination processing unit 22 may be configured to perform both processing 32 and 42.

[0061] Next, the first discrimination processing unit 22 reads the DC component 48 of the YUV image 43 and performs process 49 to generate a histogram of only the DC component 48 for all pixels for each YUV component. Process 49 uses only the DC component 48 without using the AC component, and has a lighter processing load than process 34 and process 44 described below. Therefore, the histogram generated by process 49 can be said to be a simplified histogram, and will be referred to as a simplified histogram 50 in the following description. The first discrimination processing unit 22 stores the generated simplified histogram 50 in RAM within the control unit 11.

[0062] For example, if the sampling ratio of the Y, U, and V components of a JPEG file is 4:4:4, then for 8 pixel x 8 pixel Y, 8 pixel x 8 pixel U, and 8 pixel x 8 pixel V, there will be only three DC components in total: Y, U, and V. Therefore, the process of generating simplified histogram 50 using the YUV values ​​of the DC components calculated during the JPEG development process can reduce the number of accesses to the memory device, which is RAM in control unit 11, compared to when generating histogram 35.

[0063] The first discrimination processing unit 22 determines, for example, a predetermined range including the most frequently occurring value in each simplified histogram 50 for each YUV component as the simplified background color range. The simplified background color range refers to a range defined as the background color by simplified processing for the second page, which is the target page, and includes ranges for each YUV component. However, the background color range determined by the first discrimination processing unit 22 is information used to ultimately determine the background color range.

[0064] The background color determination processing unit 24 performs a process 51 for determining a simple background color range 52 for the second page, which is the target page, from the generated simplified histogram 50, by determining the simple background color range determined by the first determination processing unit 22 as the simple background color range 52. The background color determination processing unit 24 stores the determined simple background color range 52 in the RAM in the control unit 11. As described above, the simple background color range 52 refers to the range defined as the background color by the simplified processing for the second page, and includes the ranges for each YUV component.

[0065] The generated simplified histogram 50 and the determined simplified background color range 52 are, for example, as shown in Fig. 4. In the example of Fig. 4, the determined simplified background color range 52 also has a predetermined range for Y including around 255, a predetermined range for U centered around 127, and a predetermined range for V centered around 127. Note that the predetermined ranges for Y, UV may be determined so that the difference from the upper limit to the lower limit is the same, but this is not limited to this; for example, the difference may be determined so that only Y has a smaller difference.

[0066] Next, background color determination processing unit 24 performs process 53, which determines whether the first background color and the second background color are similar by comparing them. In this example, the first background color is the background color determined by first determination processing unit 22 using page 2 of the scanned data as the determination target page, and refers to simple background color range 52. In addition, the second background color is the background color determined using page 1, which is the page before page 2, as the determination target, and refers to background color range 37. In other words, in process 53, background color determination processing unit 24 compares simple background color range 52 with background color range 37, as indicated by the white arrow in FIG. 4, and determines whether the two are similar.

[0067] As described above regarding the determination of similarity, in process 53, whether or not there is similarity can refer to whether the ranges of color values ​​of simplified background color range 52 and background color range 37 completely match, or whether they fall within a predetermined error range. Furthermore, the determination of similarity may also refer to whether the characteristics of simplified background color range 52 are similar to the characteristics of background color range 37. In other words, the similarity between simplified background color range 52 and background color range 37 refers to the similarity of the background color characteristics between simplified histogram 50 of page 2 and histogram 35 of page 1. In this way, process 53 merely determines whether simplified background color range 52 is similar to or different from background color range 37. More specific examples of the similarity determination process will be described later using Figures 5 to 11.

[0068] If simple background color range 52 is similar to background color range 37, background color determination processing unit 24 does not cause second determination processing unit 23 to perform determination on page 2 as the determination target page, and performs processing to determine background color range 37, which is the second background color, as the background color range of page 2. Background color determination processing unit 24 stores, in RAM within control unit 11, the determined background color range 37 as the background color range of page 2, or stores information indicating that background color range 37 will also be used as the background color range of page 2.

[0069] On the other hand, if the simplified background color range 52 is dissimilar to the background color range 37, the background color determination processing unit 24 causes the second discrimination processing unit 23 to perform discrimination on the second page as the discrimination target page. In response to this discrimination instruction, the second discrimination processing unit 23 performs process 44 to generate a histogram 45 of all pixels for each YUV component of the YUV image 43 of the second page obtained by expanding the JPEG file 41. In process 44, both the AC and DC components of YUV are used to generate the histogram 45. In process 44, the generated histogram 45 of the second page is stored in RAM within the control unit 11. Then, the second discrimination processing unit 23 determines, as the background color range, a predetermined range that includes, for example, the most frequently occurring value in each of the histograms 45 for each YUV component. The background color range thus determined by the second discrimination processing unit 23 is an example of the third background color described above.

[0070] Next, background color determination processing unit 24 performs process 46 to determine background color range 47 of page 2, the target page, from generated histogram 45, by determining the background color range determined by second determination processing unit 23 as background color range 47. Background color determination processing unit 24 stores determined background color range 47 in RAM within control unit 11 as the background color range of page 2. Note that, although background color range 47 of page 2 stored here is basically not similar to background color range 37 of page 1, because the similarity determination described above is based solely on simplified background color range 52, it may end up being similar to background color range 37.

[0071] As described above, the image processing device 10 determines the background color range to be applied to the second page by comparing the similarity of the features between the simplified background color range 52 determined from the simplified histogram 50 and the background color range 37 determined for the histogram 35 of the first page. If the image processing device 10 determines that the ranges are similar through this comparison, it applies the background color range 37 of the first page as the background color range to be applied to the second page. On the other hand, if the image processing device 10 determines that the ranges are different through this comparison, it applies the background color range 47 determined by generating a new histogram 45 for all pixels of the second page, as was done for the first page, as the background color range to be applied to the second page.

[0072] 3 and 4 have been used to show examples of determining background color ranges that represent the background colors of pages 1 and 2, but similar processing can be performed for pages 3 and onward. In this processing, pages 3 and onward are set as specified pages, and a simplified background color range is determined and compared with the background color range of the previous page. In this processing, it is then possible to determine whether to apply the background color range of the previous page as the background color range of the specified page, or to determine the background color range of the specified page using both the AC components and the DC components.

[0073] Next, an example of a process for determining a background color range in background processing will be described with reference to FIGS. 5 to 11, focusing mainly on a process for determining similarity. FIG. 5 is a flow diagram for describing an example of a process for determining a background color range in the background processing of FIG. 3. FIG. 6 is a diagram showing an example of a portion of a histogram for the first page generated in the process of FIG. 5. FIG. 7 is a diagram showing a table indicating values ​​in the histogram of FIG. 6. FIG. 8 is a diagram showing an example of a portion of a histogram for the second page generated in the process of FIG. 5. FIG. 9 is a diagram showing a table indicating values ​​in the histogram of FIG. 8. FIG. 10 is a diagram showing another example of a portion of a histogram for the second page generated in the process of FIG. 5. FIG. 11 is a diagram showing a table indicating values ​​in the histogram of FIG. 10. FIGS. 9 and 11 also show the difference in proportion from the first page.

[0074] First, second discrimination processing unit 23 and first discrimination processing unit 22 generate histogram 35 for the first page and simplified histogram 50 for the second page, respectively (step S11). Simplified histogram 50 is a simplified histogram generated by first discrimination processing unit 22 for all pixels of a predetermined page, where the predetermined page is page 2. Histogram 35 is a histogram generated by second discrimination processing unit 23 for all pixels of a previous page, where the previous page is page 1.

[0075] Next, the background color determination processor 24 determines that the first background color and the second background color are dissimilar if the difference between the simplified histogram 50 and the histogram 35 in any one of the peak position, the background color range, and the slope of the frequency in the background color range is greater than a threshold. Note that any one of the three differences described above is an example of the difference between the characteristics of the first background color exemplified as the characteristics of the simplified background color range 52 and the characteristics of the second background color exemplified as the characteristics of the background color range 37. On the other hand, if the difference in any one of the peak position, the background color range, and the slope of the frequency is equal to or less than the threshold, the background color determination processor 24 determines that the first background color and the second background color are similar.

[0076] Here, the peak position of the histogram is determined as the background color value. Therefore, the peak can also be referred to as the background color peak. In the case of a 0-255 representation, the peak position refers to a position expressed by an integer between 0 and 255, that is, any value between 0 and 255. The background color range is a predetermined range that includes the peak position. The frequency slope can refer to the slope of the histogram shape, but it can also refer to, for example, the rate of change of frequency. As described above, the first background color refers to the background color determined by the first determination processor 22 for the second page, for example, the simple background color range 52. The second background color refers to the background color determined by the background color determination processor 24 for the first page, for example, the background color range 37.

[0077] Furthermore, the background color determination processor 24 may determine the similarity between the first and second background colors by comparing the difference in only one of the peak position, background color range, and frequency slope with a threshold, but this is not limited to this. For example, the background color determination processor 24 may determine the similarity between the first and second background colors by comparing the differences in two or three of the peak position, background color range, and frequency slope with the corresponding threshold. In this case, for example, the background color determination processor 24 may determine that the first and second background colors are dissimilar if any one difference is greater than the threshold, and may determine that the first and second background colors are similar if all two or three differences are equal to or less than the corresponding threshold.

[0078] The following explanation will be given using an example in which the background color determination processing unit 24 determines that the first background color and the second background color are similar if all three differences are below the corresponding threshold values, but the following explanation can also be applied to examples in which threshold processing is performed for one difference or two differences.

[0079] Following step S11, the background color determination processor 24 first determines whether the peak difference, which is the difference between the peak positions of the simplified histogram 50 and the histogram 35, is greater than a peak threshold (step S12). As explained in step S53, whether or not the histograms are similar, i.e., whether or not there is similarity, can be determined by whether or not the difference falls within a predetermined error range. Therefore, in step S12, the background color determination processor 24 can determine whether a condition such as (peak position of the first page - α) ≦ (peak position of the second page) ≦ (peak position of the first page + α) is satisfied. If this condition is not satisfied, it means that the peak difference is greater than the peak threshold. Here, α is an example of a peak threshold, and can be set to 1, for example, but it can be any threshold. Note that α may be a threshold determined independently of the width of the background color range, such as the background color range 37 of the first page.

[0080] If step S12 returns NO, the background color determination processor 24 determines whether the range difference, which is the difference between the background color ranges of the simplified histogram 50 and the histogram 35, is greater than the background color range threshold (step S13). As described in step S13, the presence or absence of similarity can be determined by whether the range difference falls within a predetermined error range. Therefore, in step S13, the background color determination processor 24 can determine whether a condition, such as (lower limit of the background color range 37 of the first page - β) ≦ (simple background color range 52 of the second page) ≦ (upper limit of the background color range 37 of the first page + β), is satisfied. Failure to satisfy this condition indicates that the range difference is greater than the background color range threshold. As described above, the background color range can be calculated as a range that continues from the most frequent value of the histogram and has a certain frequency or higher. β is an example of a threshold for the background color range, and can be set to 1, for example, but may be any threshold. β may also be a threshold determined independently of the width of the background color range, such as the background color range 37 of the first page.

[0081] If the answer is NO in step S13, the background color determination processor 24 determines whether the slope difference, which is the difference in the slope of the frequency of the background color range between the simplified histogram 50 and the histogram 35, is greater than a slope threshold (step S14). In step S14, the background color determination processor 24 can determine whether a condition is met, for example, (slope of the frequency of the background color range 37 of the first page)≈(slope of the frequency of the simplified background color range 52 of the second page). If this condition is not met, it means that the slope difference is greater than the slope threshold.

[0082] A more specific example of the determination made in step S14 will now be described. Here, we will take an example in which the background color range 37 of the Y component, i.e., the luminance component, of the first page is 250 to 255, resulting in the partial histogram 35g shown in Fig. 6. Histogram 35g has frequencies as shown in frequency table 35t in Fig. 7. Frequency table 35t also shows the frequency corresponding to each Y value, as well as the result of calculating the percentage of that value to the total.

[0083] First, the background color determination processor 24 determines whether the peak position of the simplified histogram 50 of the second page is included in the background color range 37 of the first page. This determination may be made for only the Y component, but it may also be made for all components, and if it can be said that all components are included, a determination result that they are included is issued.

[0084] If the peak position of the second page is not included in the background color range 37 of the first page, the background color determination processing unit 24 determines that the frequency slope of the background color range 37 and the frequency slope of the simple background color range 52 differ by more than the threshold value for the slope.

[0085] On the other hand, if the peak position of the second page is included in the background color range 37 of the first page, the background color determination processing unit 24 calculates the frequency of the Y component of the first page in the background color range 37, that is, the sum of the frequencies of 250 to 255, and calculates the percentage of the frequency of each Y value in the total. In the example of frequency table 35t, for example, when Y is 253, the percentage is calculated as 13%.

[0086] Next, the background color determination processing unit 24 finds the total frequency of the range same as the background color range 37 in the simplified histogram 50 of the second page, that is, the frequency of 250 to 255, and calculates the proportion of the frequency of each Y value in the total.

[0087] The background color determination processor 24 then compares the two calculated ratios. If the difference is 1 or less, the ratio falls within the slope threshold, i.e., the ratio is determined to be similar. For example, if the slope threshold is set to 1% and the range of the simplified histogram 50 for the Y component of the simplified histogram for the second page, corresponding to the background color range 37, becomes the partial simplified histogram 50gs shown in FIG. 8, the ratio is determined to be similar. Here, the simplified histogram 50gs has frequencies as shown in the frequency table 50ts shown in FIG. 9. The frequency table 50ts shows the results of calculating the ratio to the total along with the frequency corresponding to each Y value, and also shows the difference from the ratio shown in the frequency table 35t for the first page as a percentage. In the example of the frequency table 50ts, the difference from the ratio for the first page is within ±1% for all frequencies from 250 to 255, indicating that the ratio is determined to be similar.

[0088] On the other hand, if the difference is 2 or more, the background color determination processor 24 determines that the difference exceeds the slope threshold, i.e., that the two images are dissimilar. For example, if the range of the simplified histogram 50 for the Y component of the second page, corresponding to the background color range 37, becomes the partial simplified histogram 50gd shown in FIG. 10, the images are determined to be dissimilar. Here, the simplified histogram 50gd has frequencies as shown in the frequency table 50td shown in FIG. 11. The frequency table 50td shows the results of calculating the frequency corresponding to each Y value and its percentage relative to the total, as well as the percentage difference from the percentage shown in the frequency table 35t for the first page, expressed as a percentage. In the example of the frequency table 50td, it can be seen that the difference from the percentage for the first page is not within the slope threshold of ±1% for any of the frequencies 251 to 254, resulting in a determination of dissimilarity.

[0089] If the result of step S14 is NO, the background color determination processing unit 24 determines the background color of the first page as the background color of the second page (step S15). Specifically, in step S15, the background color determination processing unit 24 determines the background color range of the second page as background color range 37. The processing of step S15 ends the processing of FIG. 5.

[0090] On the other hand, if the result of step S14 is YES, the second discrimination processing unit 23 discriminates the background color of the second page from the DC and AC components of the second page, and the background color determination processing unit 24 determines the background color of the discrimination result as the background color of the second page (step S16). Specifically, in step S16, the background color determination processing unit 24 determines the background color range of the second page to be background color range 47. The processing of step S16 ends the processing of FIG. 5.

[0091] Similarly, if the answer is YES in step S12 or YES in step S13, the process of step S16 is executed. Note that the determinations of steps S12, S13, and S14 are not limited to the order shown in FIG. 5, and may be executed in any order.

[0092] [Alternative examples of background processing] In the above example, when determining the background color range for a specified page, the background color range or the background color range determined using the AC and DC components is applied based on the result of determining the similarity between the simplified background color range of the specified page and the background color range determined for the page immediately preceding the specified page. This is because the previous page is considered to be more closely related to the specified page than the page immediately preceding it, which has the advantage that it is only necessary to access information about the background color range of the previous page when determining the similarity with the simplified background color range 52.

[0093] However, the following alternative background processing can also be employed. That is, in determining the background color range for a given page, the background color range may be determined based on the results of a similarity assessment between the simplified background color range for the given page and the background color ranges determined for one or more pages prior to the given page. Even in this case, if the background color range is not to be applied, the background color range determined for the given page using the AC and DC components can be determined as the background color range for the given page. Even with this type of processing, it can be said that the number of accesses to memory such as RAM can be reduced compared to when the second discrimination processing unit 23 always discriminates the background color for each page. Of course, this is not limited to cases in which a background color represented by a background color range is determined, and the same applies to cases in which a background color is determined.

[0094] The processing of the background color determination processing unit 24 in the above alternative example will be described. If the first background color is dissimilar to either the second background color or one or more fourth background colors, the background color determination processing unit 24 determines the third background color as the background color of the specified page. Here, the one or more fourth background colors refer to the background colors determined for one or more pages before the page immediately preceding the specified page. Note that an upper limit may be set on the number of the one or more pages, thereby setting an upper limit on the number of memory accesses.

[0095] On the other hand, if the first background color is similar to either the second background color or the one or more fourth background colors, the background color determination processing unit 24 determines the background color of the similar page as the background color of the predetermined page. In this case, the background color determination processing unit 24 does not allow the second discrimination processing unit 23 to perform discrimination on the predetermined page as the discrimination target page.

[0096] Furthermore, when the first background color is similar to two or more of the second background color and the one or more fourth background colors, the background color determination processing unit 24 may determine the background color of the page having the background color closest to the first background color among the two or more similar pages as the background color of the predetermined page. Of course, in this case, the background color determination processing unit 24 will not cause the second discrimination processing unit 23 to perform discrimination on the predetermined page as the discrimination target page.

[0097] [Example of black text processing] 12 to 14, black character processing for determining a black character color will be described as an example of processing in the character color determination processing unit 26. This black character processing is an example of character processing for determining a character color. Although a description of processing for other color character colors will be omitted below, in character processing, the color of color characters can be determined by performing processing basically similar to the black character processing for each color character to be determined.

[0098] Fig. 12 is a schematic diagram for explaining an example of black character processing executed in the image processing device 10 of Fig. 1. Fig. 13 is a schematic diagram showing a specific example of the black character color range of the first page determined from the scan data by the black character processing of Fig. 12. Fig. 14 is a schematic diagram showing a specific example of the black character color range of the second page determined from the scan data by the black character processing of Fig. 12.

[0099] As shown in Fig. 12, different processes are performed on the first and second pages of the scan data. Note that in Fig. 12 and Fig. 15 described later, black text color will be abbreviated as BKC.

[0100] First, the processing of the first page will be described. First, as explained in step S6 of Fig. 2, the third discrimination processing unit 25 divides the YUV image 33 into predetermined blocks, analyzes all pixels to discriminate the character color, and executes a category classification process 68 that classifies each block into a category based on the discrimination results. Below, an example will be given in which the predetermined blocks are 8 pixel x 8 pixel MCU blocks.

[0101] The categories include background, photo, black text, and color text for each defined color. That is, process 68 classifies each block as a background block, photo block, black text block, color text block, etc. Process 68 compares the value of each pixel with the determined background color range 37 to classify each pixel in the target block as a background color pixel. A background color pixel is a pixel whose value falls within background color range 37.

[0102] For example, in process 68, it is possible to determine for each block whether it is a background block, whether it is a photo block, whether it is a black text block, and whether it is a color text block, in that order.

[0103] A background block refers to a block in which all pixels are background color pixels. A photo block refers to a block in which the ratio of background color pixels is below a threshold and the changes in brightness and color difference exceed a predetermined range. A black text block refers to a block in which the changes in brightness and color difference fall within this predetermined range and includes both background color pixels and achromatic color pixels other than the background. A text block refers to a block in which the changes in brightness and color difference fall within this predetermined range and includes both background color pixels and chromatic color pixels other than the background. Furthermore, color text blocks can be classified into color text blocks for each chromatic color.

[0104] 13 illustrates the results of a categorization process 68 performed on a YUV image 33 obtained from a JPEG file 31. As a result of the process 68, each block 68b of a classification target image 68a is classified into a background block 68bg, a photo block 68pic, a black text block 68bl, and a color text block 68co. Note that, for convenience, the classification target image 68a in FIG. 13 illustrates an image of one of the YUV components in the YUV image 33, but the categorization is performed as a result that takes into consideration the other components as well.

[0105] Then, the third discrimination processing unit 25 stores category information 69 indicating the category of each block obtained by the process 68 in the RAM in the control unit 11.

[0106] Next, the text color determination processing unit 26 generates a histogram for each YUV component from the pixels of the black text block as described in step S7 of FIG. 2, and determines the black text color range from the generated histogram.

[0107] For example, the character color determination processing unit 26 executes a process 70 for generating a histogram 71 for each YUV component by limiting pixels other than background color pixels for all black character blocks on the first page. In the process 70, for example, for a certain black character block 70b shown in FIG. 13, the pixels are limited to those shown by hatching among the 64 pixels, and similar pixels are also limited for the other black character blocks, and a histogram 71 is generated from these limited pixel groups. Note that in this example, the background color range 37 is white.

[0108] The text color determination processor 26 then performs process 72 to determine a black text color range 73 from the generated histogram 71. Here, the values ​​representing black text for the Y, U, and V components may be defined as the most frequent values ​​within ranges such as 0-5, 124-130, and 124-130. The black text color range 73 may be determined, for example, as a predetermined range including values ​​representing black text for each YUV component. This predetermined range may be, for example, a range that is continuous from the value representing black text in the histogram 71 and is equal to or greater than a certain frequency. The certain frequency may refer to a certain percentage of the frequency of values ​​representing black text. The text color determination processor 26 stores the black text color range 73 determined by process 72 in the RAM within the control unit 11.

[0109] The generated histogram 71 and the determined black character color range 73 may be as shown in Fig. 13, for example. Fig. 13 shows an example in which each YUV component value is expressed as 0 to 255. Therefore, in the example of Fig. 13, the determined black character color range 73 also has a predetermined range for Y including around 0, a predetermined range for U centered around 127, and a predetermined range for V centered around 127. Note that the predetermined ranges for Y, UV may be determined so that the difference from the upper limit to the lower limit is the same, but this is not limited to this; for example, the difference may be determined so that only Y has a smaller difference.

[0110] Next, the processing of the second page will be described. First, similar to process 68, the third discrimination processing unit 25 divides the YUV image 43 of the second page into predetermined blocks, analyzes all pixels to discriminate the character color, and executes category classification process 88, which classifies each block into a category based on the discrimination results. Process 88 compares the value of each pixel with background color range 37 or background color range 47, which is the background color range already determined for the second page, to classify each pixel in the target block as a background color pixel or not. Category information 89 can be generated for each block by, for example, scanning the YUV image 43 horizontally, starting from the block in the upper left corner and ending at the block in the lower right corner.

[0111] 14 illustrates the results of a categorization process 88 performed on a YUV image 43 obtained from a JPEG file 41. As a result of the process 88, each block 88b of an image to be classified 88a is classified into a background block 88bg, a black text block 88bl, and a color text block 88co. Note that this example shows an example in which no photo blocks exist. Also, in FIG. 14, for convenience, the image to be classified 88a shows an image of one of the YUV components in the YUV image 43, but the categorization is performed as a result that takes into consideration the other components as well.

[0112] Then, the third discrimination processing unit 25 stores category information 89 indicating the category of each block obtained by the process 88 in the RAM in the control unit 11.

[0113] Next, the text color determination processor 26 performs a process 94 to extract a set of black text blocks from the category information 89 for the second page. This set can be created by memorizing the position of the black text block that first appears when the category information 89 is generated, and then extracting that black text block. Any black text blocks surrounding the black text block that first appears are added to the set. Here, "surrounding" the black text block that first appears can refer to, for example, blocks to the right, lower right, lower, or lower left of the black text block, with a number of blocks equivalent to one character to one word. In the example of FIG. 14, in a portion 94a of the extraction source block group, the black text blocks below and to the lower right of the black text block 88bl that first appears are also added to the set.

[0114] The text color determination processor 26 then performs process 95, which determines whether a predetermined percentage or more of the non-background color pixels in the extracted set are included in the black text color range 73 of the first page. The non-background color pixels in the extracted set are examples of colors in black text blocks whose difference from a representative color, such as the most frequent color within the black text color range 73, is smaller than a threshold value, which is an example of the difference between the representative color and both ends of the black text color range 73. Here, the black text block is an example of a non-background color block. The difference from a representative color, such as the most frequent color within the black text color range 73, is an example of a difference from the first text color. This condition is (the percentage of non-background color pixels that are within the black text color range 73 of the first page) ≧ γ, where γ represents the predetermined percentage and is an arbitrary threshold value, such as 90%. Thus, process 95 determines the similarity in characteristics between the non-background color pixels in the extracted set and the black text color range 73 determined for the first page.

[0115] If this condition is met, the text color determination processing unit 26 applies the black text color range 73 of the first page as the black text color range of the second page, and stores information indicating this application in the RAM within the control unit 11.

[0116] On the other hand, if this condition is not met, the text color determination processing unit 26 generates a histogram 91 for all black text blocks on the second page, just as it did for the first page, and performs a process 92 to determine the black text color range 93.

[0117] That is, the text color determination processing unit 26 references the category information 89 and executes a process 90 for generating a histogram 91 for each YUV component for all black text blocks on the second page, limiting the pixels other than the background color pixels. In process 90, for example, for a certain black text block 90b shown in Figure 14, the pixels are limited to those shown by hatching among the 64 pixels, and similar pixels are also limited for the other black text blocks, and a histogram 91 is generated from these limited pixel groups. Note that here too, an example is given in which the background color range 37 is white.

[0118] Then, the text color determination processing unit 26 performs a process 92 to determine a black text color range 93 from the generated histogram 91. The text color determination processing unit 26 stores the black text color range 93 determined by the process 92 in the RAM in the control unit 11.

[0119] The generated histogram 91 and determined black text color range 93 may be as shown in Fig. 14, for example. Fig. 14 also shows an example in which each YUV component value is expressed as 0 to 255. Therefore, in the example of Fig. 14, the determined black text color range 93 also has a predetermined range for Y that includes values ​​near 0, a predetermined range for U centered around 127, and a predetermined range for V centered around 127. Note that in Fig. 14, the black text color range 93 is illustrated as being almost the same as the black text color range 73 on the first page, but this is merely for convenience of illustration, and in reality the two will often differ.

[0120] As described above, the image processing device 10 first extracts some black text blocks and determines the similarity of the features of only the extracted set of black text blocks with the black text color range 73 determined for the first page by comparing them. If the image processing device 10 determines that the black text blocks are similar, it applies the black text color range 73 for the first page as the black text color range to be applied to the second page. On the other hand, if the image processing device 10 determines that the comparison results in a difference, it newly determines the black text color range 93 for the second page, as with the first page, as the black text color range to be applied to the second page. The black text color range 93 is determined by generating a histogram 91 for the pixels other than the background color pixels of all black text blocks and then determining the black text color range 93 from that histogram 91.

[0121] 12 to 14, an example was given in which a black text color range representing the black text color of pages 1 and 2 was determined. However, a similar process can be performed for pages 3 and onward. In this process, a set of black text blocks is extracted, with pages 3 and onward being designated as specified pages, and the similarity of characteristics with the black text color range of the previous page is determined. In this process, it is then determined whether to apply the black text color range of the previous page as the black text color range of the specified page, or to determine the black text color range for the specified page from the beginning. Furthermore, the same concept as in the alternative example of background processing can be applied to black text processing, and the target for determining the similarity of characteristics is not limited to the page previous to the specified page.

[0122] Furthermore, the above-described black character processing is applied only when the background color is determined to be similar, thereby reducing the number of accesses to the memory device when determining the black character color range and improving processing speed. Of course, the above-described black character processing can be performed even when the background color is not determined to be similar, but this black character processing can determine the black character color with higher accuracy when the background color is determined to be similar.

[0123] [Image processing comparison example] Before describing the effects of this embodiment, image processing according to a comparative example will be described with reference to Figs. 15 and 16. The image processing according to the comparative example includes background processing and black character processing as described below. Fig. 15 is a schematic diagram for explaining image processing according to the comparative example. Fig. 16 is a schematic diagram showing specific examples of background color ranges and black character color ranges determined from scan data by the image processing of Fig. 15.

[0124] In the comparative example, JPEG files 101 for multiple pages are also subjected to JPEG development process 102 to generate YUV images 103. Furthermore, in the comparative example, process 104 is executed for the page to be processed to generate histograms 105 for each YUV component for all pixels of YUV image 103, and process 106 is executed to determine background color range 107 from histogram 105. For example, as shown in FIG. 16 , histogram 105 is generated from JPEG file 101 of the first page, and background color range 107 is determined.

[0125] In the comparative example, the histogram 105 is generated and the background color range 107 is determined for each of the second and subsequent pages by the same process as for the first page.

[0126] Next, in the comparative example, a process 108 is executed on the processing target page, in which each block is categorized using the YUV image 103 and background color range 107, and category information 109 is stored. FIG. 16 illustrates the results of the categorization process 108 on the YUV image 103 obtained from the JPEG file 101. As a result of the process 108, each block 108b of the classification target image 108a is categorized into a background block 108bg, a photo block 108pic, a black text block 108bl, and a color text block 108co. Note that in FIG. 16, as in FIG. 13, for convenience, the classification target image 108a represents an image of any one of the YUV components in the YUV image 103.

[0127] In the comparative example, a process 110 is executed to generate a histogram 111 by limiting pixels other than background color pixels for each YUV component of all black character blocks in the YUV image 103 of the first page. In the process 110, for example, the 64 pixels of a black character block 110b shown in FIG. 16 are limited to the hatched pixels, and similar pixels are also limited for the other black character blocks, and a histogram 111 is generated from these limited pixel groups. Note that, again, an example is given in which the background color range 107 is white. Next, in the comparative example, a process 112 is executed to determine a black character color range 113 from the histogram 111. For example, as shown in FIG. 16, a histogram 111 is generated from the YUV image 103 obtained from the JPEG file 101 of the first page, limited to pixels other than background color pixels, and a background color range 113 is determined.

[0128] In the comparative example, the histogram 111 is generated and the black character color range 113 is determined for each page from the second page onwards by the same process as for the first page.

[0129] In this way, in the comparative example, the same process is performed on each page of a JPEG file 101 containing multiple pages, and the background color range 107 and the black text color range 113 are determined. The same process is performed on the color text color ranges for other color text. In other words, in the comparative example, the histograms required for these determinations are generated for each page, which can result in a large number of accesses to the memory device and a slowdown in processing speed.

[0130] [Advantages of this embodiment] In contrast, in this embodiment, when determining the background color range or background color range and character color range for scanned data of multiple pages, information on a simplified background color range or a simplified determined color character block is first generated. Then, in this embodiment, if the generated information is similar to the previous page, the range determined by analyzing the histogram for the previous page is applied, i.e., reused. Only if the generated information is dissimilar is the range determined by analyzing the histogram for the target page in the same way as for the previous page. Therefore, according to this embodiment, the number of accesses to the memory device during determination can be reduced compared to the comparative example, thereby improving processing speed.

[0131] In this way, according to this embodiment, it is possible to reduce the processing load required to determine the background color or the background color and the character color, even for scan data obtained by scanning a document in which it is unclear whether the background color or the background color and the character color are the same.

[0132] This effect will be explained using a specific example. First, the number of comparison accesses, which is the number of memory accesses when determining the background color range in the comparative example, is roughly calculated as follows: (Number of comparison accesses) = (Number of YUV image references) + (Number of histogram updates) = (Number of pixels in YUV image x 3) + (Number of histogram updates) = (Number of pixels in YUV image x 3) x 2 Here, the 3x value refers to the 3 channels of YUV. Also, the number of times the histogram is updated is equal to (the number of pixels in the YUV image x 3).

[0133] Next, when the number of memory accesses is reduced from the second page onwards according to this embodiment, the actual number of accesses is roughly calculated as follows: (Number of accesses) = (Number of references to DC components (YUV values)) + (Number of histogram updates) = (total number of DC components x 3) + number of histogram updates = (total number of DC components x 3) x 2 Here, the 3x value refers to the 3 channels of YUV. Also, the number of times the histogram is updated is equal to (total number of DC components x 3).

[0134] Furthermore, because the DC component is calculated for every 8 pixels x 8 pixels of the image, if the sampling ratio of the YUV components of a JPEG file is 4:4:4, the total number will be 1 / 64 of the number of pixels in the YUV image. Therefore, the above calculation formula becomes as follows, and the number of memory accesses can be reduced to 1 / 64. (Number of accesses) = ((Number of pixels in YUV image ÷ 64) × 3) × 2

[0135] The reduction effect varies depending on the sampling ratio of the YUV components of the JPEG file. For example, when the sampling ratio of the YUV components is 4:4:4, 4:2:2, or 4:2:0, the reduction effect of memory access is 1 / 64, 1 / 96, or 1 / 128, respectively.

[0136] The image processing according to the comparative example and the image processing according to the present embodiment were performed using an SoC with the same processing capabilities. The processing times for generating histograms for the second and subsequent pages were measured for an A4, 200 dpi image, and were 36 ms and 1 ms or less, respectively. Note that, due to accuracy concerns, times below 1 ms could not be measured. It can be seen that the processing speed for the second and subsequent pages in the present embodiment is significantly improved compared to the comparative example.

[0137] Furthermore, when an SoC with lower performance was used in the image processing of the comparative example, the processing time was approximately 100 ms. Therefore, it can be said that the effects of this embodiment are more pronounced when a device with lower performance is used. Furthermore, when the document size is larger, such as A3, and the resolution is high, the processing time increases in proportion to the number of pixels, so it can be said that the effects of this embodiment are more pronounced under such conditions. Furthermore, in order to improve the accuracy of the background color range, etc., a process of generating histograms multiple times is sometimes applied, and it can be said that the effects of this embodiment are more pronounced in such cases.

[0138] Next, the number of comparison accesses, which is the number of memory accesses when determining the black character color range in the comparative example, is roughly calculated as follows: (Number of comparison accesses) = (Number of references to pixels in all black character blocks) + (Number of references to background color) + (Number of histogram updates) = (total number of black text blocks x 8 x 8 x 3) + (number of background color references) + (number of histogram updates) = (total number of black text blocks x 8 x 8 x 3) x 3 + (number of histogram updates)

[0139] Here, the tripled number of times pixels in all black text blocks are referenced refers to three YUV channels. The background color reference count is the number of times required to determine whether a pixel in a black text block is within the background color range, and refers to the number of times the upper and lower limit values ​​of the background color are referenced for each of Y, U, and V. Therefore, the background color reference count can be expressed as (number of times pixels in all black text blocks are referenced) x 2. The doubling here represents the upper and lower limit values. The histogram update count refers to (number of pixels in black text blocks excluding pixels in the background color range) x 3. The tripled number here refers to three YUV channels.

[0140] Next, when the number of memory accesses when determining the black character color range for the second page and thereafter is reduced according to this embodiment, the actual number of accesses is roughly calculated as follows: (Number of accesses) = (Number of times pixels in the black text block set are referenced) + (Number of times background color is referenced) + (Number of times black text color on the first page is referenced) + (Updated black text ratio) = (number of blocks in the set x 8 x 8 x 3) x 3 + (number of times black text color is referenced on the first page) + (updated black text ratio)

[0141] Here, the tripled number of blocks in the set refers to the three YUV channels. The black text color reference count for page 1 is the number of times it is necessary to determine whether the pixels in the black text block other than the background color are within the range of the black text color for page 1, and refers to the number of times the upper and lower limits of the black text color are referenced for each of Y, U, and V. Therefore, the black text color reference count for page 1 can be expressed as (the number of times pixels other than the background color are referenced) x 2. The doubling here represents the upper and lower limits. The black text ratio is the number of non-background pixels in the black text block as the denominator, and the numerator is the number of non-background pixels included in the black text color, and this update means updating both the numerator and denominator.

[0142] The number of blocks included in the set of black text blocks is assumed to be between one character and one word, and here it is set to about 10 blocks at 200 dpi. The total number of black text blocks varies depending on the occurrence rate of black text in the image, but is set to about 10% of the page, for example, about 6,000 blocks at 200 dpi. Furthermore, it is assumed that about 30% of the pixels in a black text block are not the background color, and all 30% of the pixels are the black text color of the first page. Based on these conditions, the calculation results for the number of comparative accesses and the actual accesses when determining the black text color range are as follows:

[0143] (Number of comparative accesses) = (number of total black text blocks x 8 x 8 x 3 x 3) + (number of histogram updates) =(6000×8×8×3×3)+(6000×8×8×3×0.3) =3801600

[0144] (Number of accesses) = (Number of blocks in the set x 8 x 8 x 3 x 3) + (Number of times black text color is referenced on the first page) + (Black text ratio update) =(10×8×8×3×3)+(10×8×8×3×0.3×2)+(10×8×8×3×0.3+10×8×8×3×0.3) =8064

[0145] As can be seen from the calculation results under the above conditions, the number of memory accesses can be reduced to approximately 1 / 471. Therefore, it can be seen that the processing time can be reduced by this amount in this embodiment compared to the comparative example.

[0146] As described above, according to this embodiment, the number of accesses to the memory device during determination can be reduced compared to the comparative example, thereby improving processing speed. Furthermore, with the recent increase in scanning speed, the time required to scan one page has been shortened, for example, to 550 ms for double-sided scanning at 110 ipm. This necessitates an improvement in PDF conversion speed to keep up with this. However, by improving processing speed in this embodiment, PDF conversion can be completed in a time closer to the scanning time while maintaining the accuracy of determining the representative color ranges of background and character colors.

[0147] The image processing device 10 according to this embodiment has been mainly described above. In other words, this embodiment can provide an image processing program 20. The image processing program 20 is a program that causes a computer to execute the processes described as being performed by the acquisition processing unit 21, the first discrimination processing unit 22, the second discrimination processing unit 23, and the background color determination processing unit 24. Of course, this program can also include a program that causes a computer to execute the processes described as being performed by the third discrimination processing unit 25 and the text color determination processing unit 26. This program can also include a program that causes a computer to execute the processes described as being performed by the file generation processing unit 27.

[0148] In other words, this embodiment can provide an image file production method that includes the processes described as being performed by the acquisition processing unit 21, the first discrimination processing unit 22, the second discrimination processing unit 23, the background color determination processing unit 24, and the file generation processing unit 27. Supplementally, this image file production method includes the following process as a production process performed by the file generation processing unit 27. That is, this file production method includes a process of producing an image file of the scan data by performing predetermined image processing on the scan data using the background color determined by the background color determination processing unit 24 as the background. Of course, this image file production method can also include the processes described as being performed by the third discrimination processing unit 25 and the character color determination processing unit 26.

[0149] (Other variations) The present disclosure is not limited to the above-described embodiments and may be modified as appropriate without departing from the spirit and scope of the present disclosure. For example, the configuration of the image processing device, the configuration of each program included in the image processing device, the processing procedure of the image processing device, etc. are not limited to those exemplified. Furthermore, while the above-described embodiments have been described as examples of processing colored characters such as black character processing, the present disclosure is not limited to this. For example, the image processing device according to the present embodiments may be configured to perform only background processing, or may be configured to perform only background processing and black character processing without processing other character colors.

[0150] Furthermore, in the above-described embodiment, the process of determining a background color range and the like has been described assuming its application to PDF conversion processing, but application examples are not limited thereto. For example, the determination of a representative color range, such as the background color range described above, can also be applied to determining whether a background color / text color is similar to that of another file when analyzing a histogram from a multi-page JPEG file. Furthermore, the method of determining a simplified background color range using only the DC component described in determining the background color range can also be applied to generating a histogram using only the DC component of a JPEG file in cases where high accuracy is not required. This allows the above determination method to be applied as a technique for quickly generating an image histogram. Note that the image data is not limited to JPEG format, and other formats may be used as long as they describe DC and AC components. Even in other formats, similar speedups can be achieved using the DC and AC components contained in the image data.

[0151] Furthermore, the image processing device according to this embodiment has been explained using a specific example that assumes that it has a scanning function, but as mentioned above, it is sufficient that the device is capable of acquiring multiple JPEG files corresponding to multiple pages.

[0152] For example, if the image processing device according to the present embodiment is configured as a device without a scanning function, the scanning function is provided in an external device such as a scanner in the above-described specific example. The image processing device then simply acquires image data resulting from the scan from the external device, either directly or via another device. In this configuration, the image processing device can perform similar processing on the acquired image data, such as converting it to JPEG format, determining a background color range or a background color range and a text color range, or generating a PDF file based on the determination.

[0153] For example, if the image processing device according to the present embodiment is configured as a device without the ability to generate JPEG files, the JPEG file generation function is provided in the above-described specific example. The image processing device then simply acquires multiple JPEG files corresponding to multiple pages from the external device, either directly or via another device. In this configuration, the external device may be, for example, a scanner, a terminal device, or a terminal device connected to a scanner. In this configuration, the image processing device may perform similar processing on the acquired JPEG files, for example, determining a background color range or a background color range and a text color range, or generating a PDF file based on that determination.

[0154] Furthermore, the multiple JPEG files corresponding to multiple pages acquired by the image processing device in this configuration are not limited to JPEG files based on image data obtained by scanning multiple pages of a document with a scanner. For example, the multiple JPEG files may be JPEG files based on image data of multiple images captured by a camera.

[0155] Furthermore, each of the image processing devices according to the above-described embodiments and each of the devices such as external devices connectable to the image processing device may have, for example, the following hardware configuration. Here, each device may be an image processing device, a terminal device, or a printer. Fig. 17 is a diagram showing an example of the hardware configuration of the device.

[0156] 17 may include a processor 1001, a memory 1002, and an interface 1003. The interface 1003 may include, for example, a communication interface or an interface with an input / output device, as required depending on the device.

[0157] The processor 1001 may be, for example, a CPU, a GPU, or an MPU (Micro Processor Unit), also known as a microprocessor. The processor 1001 may include multiple processors. The memory 1002 is configured, for example, by a combination of volatile memory and non-volatile memory. The functions of each device are realized by the processor 1001 reading a program stored in the memory 1002 and executing it while exchanging necessary information via the interface 1003.

[0158] The above-described program includes instructions (or software code) that, when loaded into a computer, cause the computer to perform one or more functions described in the embodiments. The program may be stored in a non-transitory computer-readable medium or a tangible storage medium. Examples of computer-readable media or tangible storage media include, but are not limited to, random-access memory (RAM), read-only memory (ROM), flash memory, solid-state drive (SSD), or other memory technologies. Examples of computer-readable media or tangible storage media include, but are not limited to, CD-ROMs, digital versatile discs (DVDs), Blu-ray discs, or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage, or other magnetic storage devices. The program may be transmitted on a transitory computer-readable medium or communication medium. Examples of transitory computer-readable media or communication media include, but are not limited to, electrical, optical, acoustic, or other forms of propagated signals. The program may also be included in a program product.

[0159] While the present invention has been described above in accordance with the above-described embodiments, the present invention is not limited to the configurations of the above-described embodiments, and naturally includes various modifications, alterations, and combinations that can be made by those skilled in the art within the scope of the invention set forth in the claims of this application. For example, an invention relating to a method for producing an image file can also be considered an invention relating to a method for processing an image. [Explanation of symbols]

[0160] 10...image processing device, 11...control unit, 12...storage unit, 13...scanning unit, 14...operation unit, 20...image processing program, 21...acquisition processing unit, 22...first discrimination processing unit, 23...second discrimination processing unit, 24...background color determination processing unit, 25...third discrimination processing unit, 26...character color determination processing unit, 27...file generation processing unit, 31...JPEG file, 32...JPEG expansion processing, 33...first page YUV image, 34...HT generation processing, 35...HT, 35g...first page HT, 35t...first page frequency table, 36...background color range determination processing, 37...background color range, 41...JPEG G file, 42...JPEG expansion process, 43...YUV image of page 2, 44...HT generation process, 34...HT, 46...Background color range determination process, 47...Background color range, 48...DC component, 49...HT generation process using only DC component, 50...Simple HT, 50gs...Simple HT of page 2, 50ts...Frequency table of page 2, 50gd...Simple HT of page 2, 50td...Frequency table of page 2, 51...Simple background color range determination process, 52...Simple background color range, 53...Comparison process, 68...Category classification process, 68a...Image to be classified, 68b...Block, 68 bg...background block, 68bl...black text block, 68co...colored text block, 68pic...photo block, 69...category information, 70...HT generation process, 70b...black text block, 71...HT, 72...black text color range determination process, 73...black text color range, 88...category classification process, 88a...image to be classified, 88b...block, 88bg...background block, 88bl...black text block, 88co...colored text block, 89...category information, 90...HT generation process, 90b...black text block, 91...HT, 92...black text color range determination process, 93...black text color range 94...set extraction process, 94a...part of the source block group, 95...judgment process, 101...JPEG file, 102...JPEG expansion process, 103...YUV image, 104...HT generation process, 105...HT, 106...background color range determination process, 107...background color range, 108...category classification process, 108a...image to be classified, 108b...block, 108bg...background block, 108bl...black text block, 108co...color text block, 108pic...photo block, 109...category information, 110...HT generation process, 110b...black text block,111...HT, 112...processing for determining black character color range, 113...black character color range, 1000...device, 1001...processor, 1002...memory, 1003...interface.

Claims

1. an acquisition unit that acquires scan data of the scanned multiple pages in JPEG format; a first discrimination unit that discriminates a background color of a discrimination target page of the scan data using a DC component without using an AC component; a second discrimination unit that discriminates a background color of a discrimination target page of the scan data using a DC component and an AC component; a background color determination unit that determines a background color for a predetermined page of the scan data; Equipped with The background color determination unit When a first background color, which is the background color determined by the first discrimination unit with a predetermined page of the scan data as a discrimination target page, is dissimilar to a second background color, which is the background color determined with a page previous to the predetermined page as a determination target, the second discrimination unit executes discrimination with the predetermined page as the discrimination target page, and determines a third background color, which is the background color determined by the second discrimination unit, as the background color of the predetermined page; If the first background color is similar to the second background color, the second discrimination unit does not execute discrimination using the predetermined page as a discrimination target page, and the second background color is determined to be the background color of the predetermined page. Image processing device.

2. The background color determination unit If the first background color is dissimilar to any of the second background color and one or more fourth background colors that are background colors determined for one or more pages prior to the previous page of the predetermined page, the third background color is determined as the background color of the predetermined page; If the first background color is similar to any of the second background color and the one or more fourth background colors, the second discrimination unit does not perform discrimination using the specified page as a discrimination target page, and the background color of the similar page is determined to be the background color of the specified page. The image processing device according to claim 1 .

3. The background color determination unit If the first background color is similar to two or more of the second background color and the one or more fourth background colors, the second discrimination unit does not perform discrimination with the specified page as a discrimination target page, and the background color of the page that is closest to the first background color among the two or more similar pages is determined as the background color of the specified page. The image processing device according to claim 2 .

4. The background color determination unit If a difference in any one of a peak position, a background color range including the peak position, and a frequency slope in the background color range between a histogram generated by the first discrimination unit using DC components but not AC components for all pixels of the predetermined page and a histogram generated by the second discrimination unit using DC components and AC components for all pixels of the previous page is greater than a threshold, the first background color and the second background color are determined to be dissimilar, and if the difference is equal to or less than the threshold, the first background color and the second background color are determined to be similar.

3. The image processing device according to claim 1 or 2.

5. a third discrimination unit that analyzes all pixels of the discrimination target page of the scan data to discriminate the character color; a character color determination unit that, in a block of the predetermined page that is a non-background color, determines the first character color as the character color of the predetermined page when a ratio of colors whose difference from a first character color, which is the character color determined by the third determination unit using the previous page as a determination target page, is smaller than a predetermined ratio, and determines the character color determined by the third determination unit as the character color of the predetermined page when the ratio is equal to or greater than the predetermined ratio; The image processing device according to claim 1 , further comprising:

6. The block is a Minimum Coded Unit block. The image processing device according to claim 5 .

7. 3. The image processing device according to claim 1, further comprising a production unit that produces a Portable Document Format file of the scan data by performing predetermined image processing on the scan data using the background color determined by the background color determination unit as a background.

8. An acquisition process for acquiring scanned data of the scanned multiple pages in JPEG format; a first discrimination process for discriminating a background color of a discrimination target page of the scan data using a DC component without using an AC component; a second discrimination process for discriminating a background color of a discrimination target page of the scan data using a DC component and an AC component; a background color determination process for determining a background color for a predetermined page of the scan data; a production process for producing an image file of the scan data by performing predetermined image processing on the scan data using the background color determined in the background color determination process as a background; Including, The background color determination process includes: When a first background color, which is the background color determined by the first determination process using a predetermined page of the scan data as a determination target page, is dissimilar to a second background color, which is the background color determined by using a page previous to the predetermined page as a determination target, the second determination process is executed using the predetermined page as the determination target page, and a third background color, which is the background color determined by the second determination process, is determined as the background color of the predetermined page; If the first background color is similar to the second background color, the second determination process is not performed with the predetermined page as a determination target page, and the second background color is determined to be the background color of the predetermined page. Image file production method.

9. An acquisition process for acquiring scanned data of the scanned multiple pages in JPEG format; a first discrimination process for discriminating a background color of a discrimination target page of the scan data using a DC component without using an AC component; a second discrimination process for discriminating a background color of a discrimination target page of the scan data using a DC component and an AC component; a background color determination process for determining a background color for a predetermined page of the scan data; Let the computer run The background color determination process includes: When a first background color, which is the background color determined by the first determination process using a predetermined page of the scan data as a determination target page, is dissimilar to a second background color, which is the background color determined by using a page previous to the predetermined page as a determination target, the second determination process is executed using the predetermined page as the determination target page, and a third background color, which is the background color determined by the second determination process, is determined as the background color of the predetermined page; If the first background color is similar to the second background color, the second determination process is not performed with the predetermined page as a determination target page, and the second background color is determined to be the background color of the predetermined page. program.

Citation Information

Patent Citations

  • Image processor, microscope system, method for processing image, and image processing program

    JP2019144294A