Image processing device and image processing method
The image processing device optimizes compression by classifying characters by size and adjusting rates based on their number, addressing the imbalance in existing technologies to maintain quality and efficiency in image storage and transmission.
Patent Information
- Application Number
- JP2021162787
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-10-01
- Publication Date
- 2026-01-14
- Estimated Expiration
- 2041-10-01
AI Technical Summary
Existing image processing technologies prioritize print quality over the balance between compression rate and character quality when images are stored or transmitted, neglecting the need for a balanced approach.
An image processing device that classifies characters by size and determines compression rates based on the number of classified characters, optimizing the balance between compression rate and character quality.
Enables image processing that maintains character quality while achieving efficient compression, suitable for storage or transmission.
Smart Images

Figure 0007798520000001 
Figure 0007798520000002 
Figure 0007798520000003
Abstract
Description
[Technical Field]
[0001] The present disclosure relates to an image processing device and the like. [Background technology]
[0002] Image processing devices such as multi-function peripherals (MFPs) have been widely used. Some MFPs are equipped with a scanner that reads documents, and also have the function of storing images of the documents as electronic data and outputting the electronic data.
[0003] Technologies for compressing electronic data have also been proposed, such as a technology that determines a compression rate based on the font size, font type, and font style (bold, etc.) of the smallest character included in print data representing a print image, and performs lossy compression on the print data according to the determined compression rate (see, for example, Patent Document 1). [Prior art documents] [Patent documents]
[0004] [Patent Document 1] Japanese Patent Application Laid-Open No. 2008-227661 Summary of the Invention [Problem to be solved by the invention]
[0005] In Patent Document 1, the compression rate is determined with emphasis on the quality of the characters when printing an image. However, in addition to being printed, images may also be stored in a user's storage or transmitted to a device such as a server. Therefore, there is a problem that the compression rate needs to be determined by prioritizing the balance between the compression rate and the quality of the characters, rather than the print quality. This problem is not taken into consideration in Patent Document 1.
[0006] In view of the above-mentioned problems, the present disclosure aims to provide an image processing device and the like that classifies characters included in an image according to their sizes and outputs an image compressed at a determined compression rate. [Means for solving the problem]
[0007] In order to solve the above-mentioned problems, the image processing device of the present disclosure comprises an input unit for inputting an image of an original document, a compression rate determination unit for determining the compression rate when outputting the image, and an output unit for outputting an output image obtained by compressing the image using the compression rate determined by the compression rate determination unit, wherein the compression rate determination unit obtains the character size of each character included in the image, classifies the characters into one of a predetermined character size range according to the character size, and determines the compression rate according to the number of classified characters.
[0008] The control method disclosed herein is a control method for an image processing device, and includes an input step of inputting an image of an original document, a compression rate determination step of determining the compression rate at which the image is output, and an output step of outputting an output image obtained by compressing the image using the compression rate determined in the compression rate determination step, wherein the compression rate determination step obtains the character size of each character included in the image, classifies the characters into one of a predetermined character size range according to the character size, and determines the compression rate according to the number of classified characters. [Effects of the Invention]
[0009] According to the present disclosure, it is possible to provide an image processing device or the like that outputs an image compressed at a determined compression rate by classifying characters included in the image according to their sizes. [Brief explanation of the drawings]
[0010] [Figure 1] 1 is a perspective view of an appearance of an image forming apparatus according to a first embodiment. [Figure 2] FIG. 2 is a diagram illustrating a functional configuration of the image forming apparatus according to the first embodiment. [Figure 3] 4 is a diagram showing an example of a data configuration of character rectangle information in the first embodiment. FIG. [Figure 4] FIG. 4 is a diagram illustrating an example of the data configuration of character string area information in the first embodiment. [Figure 5] FIG. 3 is a diagram illustrating an example of a resolution correspondence table in the first embodiment. [Figure 6] FIG. 10 is a diagram illustrating an example of a character rectangle number ratio table in the first embodiment. [Figure 7] FIG. 4 is a diagram illustrating an example of an integration range table in the first embodiment. [Figure 8] FIG. 3 is a flowchart showing the flow of main processing in the first embodiment. [Figure 9] FIG. 4 is a flowchart showing the flow of a resolution estimation process in the first embodiment. [Figure 10] FIG. 4 is a flowchart showing the flow of a compression ratio determination process in the first embodiment. [Figure 11] FIG. 2 is a diagram illustrating an outline of processing in the first embodiment. [Figure 12] FIG. 10 is a diagram illustrating an example of the operation of a resolution estimation process in the first embodiment. [Figure 13] FIG. 10 is a diagram illustrating an example of the operation of a compression ratio determination process in the first embodiment. [Figure 14] FIG. 10 is a diagram showing a procedure for adjusting the loading range. [Figure 15] 10A and 10B are diagrams illustrating a procedure for adjusting the loading range. [Figure 16] 10A and 10B are diagrams illustrating a procedure for adjusting the loading range. [Figure 17] FIG. 3 is a diagram showing an example of a screen in the first embodiment. [Figure 18] FIG. 3 is a diagram showing an example of a screen in the first embodiment. [Figure 19] FIG. 10 is a flowchart showing the flow of a compression ratio determination process in the second embodiment. [Figure 20] FIG. 10 is a diagram illustrating an example of operation in the second embodiment. [Figure 21] FIG. 10 is a flowchart showing the flow of a compression ratio determination process in the second embodiment. DETAILED DESCRIPTION OF THE INVENTION
[0011] Hereinafter, an embodiment for carrying out the present disclosure will be described with reference to the drawings. Note that the following embodiment is an example for explaining the present disclosure, and the technical scope of the invention described in the claims is not limited to the following description.
[0012] [1. First embodiment] [1.1 Functional Configuration] The functional configuration of an image forming apparatus 10 of this embodiment will be described with reference to Fig. 1 and Fig. 2. Fig. 1 is an external perspective view of the image forming apparatus 10, and Fig. 2 is a block diagram showing the functional configuration of the image forming apparatus 10.
[0013] The image forming apparatus 10 is an information processing apparatus having functions such as a copy function, a scan function, and a document print function, and is also called an MFP (Multi-Function Printer / Peripheral).
[0014] As shown in FIG. 2, the image forming apparatus 10 includes a control unit 100, an image input unit 120, an image forming unit 130, a display unit 140, an operation unit 150, a storage unit 160, and a communication unit 190.
[0015] The control unit 100 is a functional unit for controlling the entire image forming apparatus 10. The control unit 100 realizes various functions by reading and executing various programs stored in the storage unit 160, and is configured, for example, by one or more arithmetic units (CPUs (Central Processing Units)). The control unit 100 may also be configured as an SoC (System on a Chip) having multiple functions among those described below.
[0016] By executing the programs stored in the memory unit 160, the control unit 100 functions as an image processing unit 102, an output mode setting unit 104, a document characteristic determination unit 106, a character rectangle extraction unit 108, a character string extraction unit 110, a resolution estimation unit 112, and a compression rate determination unit 114.
[0017] The image processing unit 102 performs various image-related processes. For example, the image processing unit 102 performs sharpening and tone conversion on an image of a document (hereinafter referred to as an "input image") read and input by the image input unit 120. The image processing unit 102 also converts the resolution of the image and compresses the image.
[0018] The output mode setting unit 104 sets an output mode. The output mode indicates a method for outputting an image (hereinafter referred to as an "output image") based on an input image. In this embodiment, one of the following five types is set as the output mode. (1) Size Priority (Normal) (2) Size priority (makes small text clearer) (3) Standard (normal) (4) Standard (makes small text clearer) (5) Image quality priority
[0019] "Size Priority" is an output method that prioritizes the high compression rate of the output image (small file size of the output image), and emphasizes the compression rate of the output image. "Image Quality Priority" is an output method that emphasizes the quality of the text in the output image. "Standard" is an output method that balances the compression rate of the output image with the quality of the text.
[0020] In this embodiment, "size priority" and "standard" are further divided into two types of output modes: "normal" and "clarify small characters." The output mode corresponding to "clarify small characters" is estimated to have a higher resolution as the resolution of the output image by the resolution estimation unit 112, which will be described later, compared to the output mode corresponding to "normal." In the following description, the term "size priority" corresponds to the two output modes, "size priority (normal)" and "size priority (clarify small characters)." Similarly, the term "standard" corresponds to the two output modes, "standard (normal)" and "standard (clarify small characters)."
[0021] The document characteristic determination unit 106 determines the characteristics of the document read by the image input unit 120. The document characteristic refers to the characteristics of the document, such as the characteristics of the content written on the document and the type of document. In this embodiment, the document characteristic determined by the document characteristic determination unit 106 is one of the following three types: (1) "Text" indicates that the manuscript is primarily composed of text. (2) "Text + Photo" indicates that the manuscript is composed of text and non-text elements. (3) A "photo" showing that the manuscript contains no text or very little text.
[0022] The document characteristic determination unit 106 determines the document characteristic based on, for example, the pixel values of pixels included in the input image. In this case, the document characteristic determination unit 106 creates a histogram of the density of pixels included in the input image and detects two peaks (the background density and the character density) from the histogram. The document characteristic determination unit 106 sets a class range (peak range) based on the peak class and classes surrounding the peak class, and determines the document characteristic as "photograph" if the sum of the number of pixels included in the peak range is less than a predetermined threshold TH1. On the other hand, if the sum of the number of pixels included in the peak range is equal to or greater than the threshold TH1, the document characteristic determination unit 106 determines whether the number of pixels in the classes sandwiched between the two peak ranges is both less than a predetermined threshold TH2. If the number of pixels in the classes sandwiched between the two peak ranges is both less than the threshold TH2, the document characteristic determination unit 106 determines the document characteristic as "text." Otherwise, the document characteristic determination unit 106 determines the document characteristic as "text + photo." The above-described determination method is merely an example, and any known technique can be used as long as it determines whether the document characteristic is "text," "text + photo," or "photo."
[0023] The character rectangle extraction unit 108 extracts character rectangles from the input image. A character rectangle is a rectangle that circumscribes the edge pixels that make up a character. In this embodiment, the resolution estimation unit 112 and compression rate determination unit 114, which will be described later, perform predetermined processing assuming that one character rectangle corresponds to one character included in the input image.
[0024] For example, the character rectangle extraction unit 108 selects one pixel included in the input image and calculates the amount of change in pixel value (e.g., density) between the selected pixel (target pixel) and a pixel adjacent to the target pixel. If the amount of change is equal to or greater than a predetermined threshold, the character rectangle extraction unit 108 determines that the target pixel is a pixel that exhibits a steep rise and is an edge pixel that constitutes a character. Furthermore, even if the target pixel is not an edge pixel, if there are a predetermined number (e.g., two or more) of edge pixels around the target pixel (e.g., eight pixels around the target pixel), the character rectangle extraction unit 108 performs an expansion process to treat the target pixel as an edge pixel. Then, the character rectangle extraction unit 108 connects the edge pixels and extracts a rectangle circumscribing the connected edge pixels as a character rectangle. Note that the above-described extraction method is merely an example, and any known technique for extracting a character rectangle can be used.
[0025] The character string extraction unit 110 extracts regions that constitute a character string (character string regions) based on the character rectangles extracted by the character rectangle extraction unit 108. For example, the character string extraction unit 110 selects one character rectangle and groups other character rectangles whose horizontal distance from the selected character rectangle is equal to or less than a predetermined threshold, thereby grouping character rectangles that are within a predetermined distance from each other (horizontally adjacent character rectangles). The character string extraction unit 110 also extracts a rectangular region that circumscribes the group of character rectangles as a character string region.
[0026] The character string extraction unit 110 may extract character string regions in units of columns (lines) by detecting (extracting) an area where character rectangles can be considered to be lined up in a horizontal row as a character string area. The character string extraction unit 110 may also detect symbols such as periods, commas, and parentheses, and spaces from the character string area, and divide the character string area in units of lines into multiple character string areas (for example, character string areas for each period, each punctuation mark, or each space) based on the detected symbols and spaces.
[0027] The resolution estimation unit 112 executes a resolution estimation process to estimate the resolution at which the input image is to be output, that is, the resolution of the output image. The resolution estimation process will be described later.
[0028] The compression rate determination unit 114 executes a compression rate determination process to determine the compression rate at which the input image is to be output, that is, the compression rate of the output image. The compression rate determination process will be described later.
[0029] The image input unit 120 inputs an image as digital data (image data) to the image forming apparatus 10. For example, the image input unit 120 is configured by a scanner device or the like that can read an image of a document and generate image data. The scanner device converts the image into an electrical signal using an image sensor such as a CCD (Charge Coupled Device) or a CIS (Contact Image Sensor), and generates digital data by quantizing and encoding the electrical signal.
[0030] Image forming unit 130 forms (prints) an image on a recording medium such as recording paper. Image forming unit 130 is configured, for example, by a printing device such as a laser printer that uses an electrophotographic method. Image forming unit 130, for example, feeds recording paper from paper feed tray 132 in FIG. 1, forms an image on the surface of the recording paper, and discharges the recording paper from paper discharge tray 134.
[0031] The display unit 140 displays various types of information. The display unit 140 is configured by a display device such as an LCD (Liquid Crystal Display), an organic EL (Electro-Luminescence) display, or a micro LED (Light Emitting Diode) display.
[0032] The operation unit 150 accepts operation instructions from a user of the image forming apparatus 10. The operation unit 150 is configured with input devices such as key switches (hard keys) and touch sensors that detect inputs made by contact (touch). The touch sensor may use any common detection method, such as a resistive film method, an infrared method, an electromagnetic induction method, or a capacitance method. The image forming apparatus 10 may be equipped with a touch panel in which the display unit 140 and the operation unit 150 are integrally formed.
[0033] The storage unit 160 stores various programs and various data necessary for the operation of the image forming apparatus 10. The storage unit 160 is configured by a storage device such as a semiconductor memory such as an SSD (Solid State Drive) or an HDD (Hard Disk Drive).
[0034] The storage unit 160 secures a character rectangle information storage area 162 and a character string area information storage area 164 as storage areas, and further stores a resolution correspondence table 166, a character rectangle number ratio table 168, and an accumulation range table 170.
[0035] The character rectangle information storage area 162 stores information about character rectangles (character rectangle information). For example, as shown in Fig. 3, the character rectangle information includes a character rectangle ID (e.g., "1") that identifies the character rectangle, sx (e.g., "100") and sy (e.g., "10") that indicate the coordinates of the upper left corner of the character rectangle, ex (e.g., "130") and ey (e.g., "40") that indicate the coordinates of the lower right corner of the character rectangle, a character size (e.g., "12"), and a character string area ID (e.g., "1") that identifies the character string area to which the character rectangle belongs.
[0036] For example, the coordinates are expressed as (x,y) where the pixel in the upper left corner of the input image is the origin (0,0), the number of horizontal pixels from the origin to the pixel of interest is x, and the number of vertical pixels is y. In the example of Figure 3, the character rectangle with character rectangle ID "1" is a rectangular area with the coordinates of the upper left corner (100,10) and the coordinates of the lower right corner (130,40).
[0037] The character size is the size of a character made up of pixels within a character rectangle. In this embodiment, the character size is expressed in points (pt).
[0038] The character string area information storage area 164 stores information about character string areas (character string area information). For example, as shown in Fig. 4, the character string area information includes a character string area ID (e.g., "1") that identifies the character string area, sx (e.g., "100") and sy (e.g., "10") that indicate the coordinates of the upper left corner of the character string area, ex (e.g., "400") and ey (e.g., "40") that indicate the coordinates of the lower right corner of the character string area, and a character string size (e.g., "12").
[0039] The character string size is the height of the character string area in points. In the example in Figure 4, the character string area with the character string area ID "1" is a rectangular area with a character string size of 12, the upper left coordinates of which are (100,10) and the lower right coordinates of which are (400,40).
[0040] The resolution correspondence table 166 is a table that associates character sizes with the resolution of images when an image including characters of that character size is output. In the resolution correspondence table 166, for example, as shown in Fig. 5, character sizes and resolution values (unit: dpi (dots per inch)) are set for each output mode. In this embodiment, the resolution value is assumed to be one of 300 dpi, 200 dpi, and 150 dpi. The resolution correspondence table 166 is stored in advance.
[0041] Character rectangle count ratio table 168 is a table that indicates threshold values for the ratio of the number of character rectangles (character rectangle ratios). Character rectangle ratios are values used in the resolution estimation process and are stored in advance for each output mode. For example, as shown in FIG. 6, character rectangle count ratio table 168 stores a value such as "0.5" if the output mode is "size priority" or "standard," and "0.3" if the output mode is "image quality priority."
[0042] The integration range table 170 is a table showing the ranges of character sizes (integration ranges) when classifying characters included in an input image according to character size, and the compression ratios corresponding to those ranges. In this embodiment, the ranges of character sizes and the compression ratios corresponding to those ranges are determined for each output image resolution, each output mode, and each document characteristic. The integration range table 170 is stored in advance.
[0043] In this embodiment, the compression rate is one of "medium," "medium-high," and "high," with the compression rates increasing in the order of "medium," "medium-high," and "high." Generally, the size of an image compressed at the "medium" compression rate is larger than the size of an image compressed at the "medium-high" compression rate, and the size of an image compressed at the "medium-high" compression rate is larger than the size of an image compressed from an input image at the "high" compression rate.
[0044] As shown in Fig. 7, the integration range table 170 is stored as a table according to the resolution of the output image, the document characteristics, and the output mode. Fig. 7(a) is a table when the document characteristics are "text + photo" or "text" and the output image resolution is 300 dpi. Similarly, Fig. 7(b) is a table when the document characteristics are "text + photo" or "text" and the output image resolution is 200 dpi, and Fig. 7(c) is a table when the document characteristics are "text + photo" or "text" and the output image resolution is 150 dpi. Fig. 7(d) is a table when the document characteristics are "photo" and the output image resolution is 100 dpi. Note that when the document characteristics are "photo," 100 dpi is set as the output image resolution in the processing of the image forming apparatus 10, which will be described later.
[0045] For example, D100 in Figure 7(b) shows the range of character sizes and the compression ratios corresponding to that range when the document characteristics are "text + photo" or "text," the output image resolution is 200 dpi, and the output mode is "standard." D100 indicates that the range of character sizes from 3 points to 10 points corresponds to the cumulative range corresponding to a "medium" compression ratio. Similarly, the range of character sizes from 11 points to 17 points corresponds to the cumulative range corresponding to a "medium-high" compression ratio, and the range of character sizes of 18 points or more corresponds to the range corresponding to a "high" compression ratio.
[0046] The communication unit 190 communicates with external devices and is configured by, for example, a communication device or a communication module such as a network interface card (NIC) used in a wired / wireless local area network (LAN).
[0047] [1.2 Processing flow] The flow of processing executed by the image forming apparatus 10 of this embodiment will be described with reference to Fig. 8 to Fig. 10. The processing shown in Fig. 8 to Fig. 10 is executed by the control unit 100 that reads out a program stored in the storage unit 160.
[0048] [1.2.1 Main Processing] The main processing executed by the image forming apparatus 10 will be described with reference to Fig. 8. The processing shown in Fig. 8 is executed, for example, when a user selects to use the scan function. First, the control unit 100 causes the image input unit 120 to read an original document, thereby inputting an image of the original document as an input image (step S100).
[0049] Next, the control unit 100 (output mode setting unit 104) determines whether the output mode is automatically set (step S102). For example, the output mode setting unit 104 displays a screen for setting the output mode on the display unit 140, and if a specific output mode is selected by the user, the output mode setting unit 104 determines that the output mode is not automatically set. On the other hand, if a specific output mode is not selected by the user or if automatic setting of the output mode is selected, the output mode setting unit 104 determines that the output mode is automatically set.
[0050] When the output mode is set automatically, the control unit 100 (output mode setting unit 104) automatically sets the output mode (step S102; Yes → step S104). For example, the output mode setting unit 104 sets "standard (normal)" as the output mode. The output mode setting unit 104 may set the output mode depending on the output method of the output image. For example, the output mode setting unit 104 may set the output mode to "size priority (normal)" when the output image is output to another device by attaching it to an email and sending it, and may set the output mode to "image quality priority" when the output image is output by storing it in an external storage medium such as a USB memory. The output mode setting unit 104 may also set the output mode to "standard (normal)" when the output image is output by storing it in an external server.
[0051] On the other hand, if the output mode is not automatically set, the control unit 100 (output mode setting unit 104) sets the output mode in accordance with the user's selection (step S102; No→step S106).
[0052] Next, the control unit 100 causes the document characteristic determination unit 106 to determine the document characteristics of the document input in step S100, and determines whether the determination result of the document characteristics is "text" or "text+photo" (step S108).
[0053] If the document characteristic is "text" or "text + photo", the control unit 100 (resolution estimation unit 112) executes a resolution estimation process and sets the resolution of the output image (step S108; Yes → step S110). Also, the control unit 100 (compression rate determination unit 114) executes a compression rate determination process and sets the compression rate of the output image (step S112). The resolution estimation process and the compression rate determination process will be described later.
[0054] On the other hand, if the document characteristic is "photograph", the control unit 100 sets the resolution of the output image to a predetermined resolution (for example, 100 dpi) (step S108; No → step S114). Also, the control unit 100 acquires the compression ratio according to the output mode from the integration range table 170, and sets the acquired compression ratio as the compression ratio of the output image (step S116).
[0055] Next, the control unit 100 converts the resolution of the input image to the resolution set in step S110 or step S114, and obtains an image (output image) obtained by compressing the converted image according to the compression ratio set in step S112 or step S116 (step S118).
[0056] For example, the control unit 100 inputs image data, resolution, and compression rate of an input image to the image processing unit 102. In this case, the image processing unit 102 converts the resolution of the input image to the input resolution and converts the converted input image into image data (image file) in JPEG (Joint Photographic Experts Group) format. At this time, the image processing unit 102 specifies a value corresponding to the set compression rate as the compression rate when converting into the JPEG format image file. In this way, the image processing unit 102 converts the input image into image data in JPEG format. The control unit 100 acquires the image data in JPEG format converted by the image processing unit 102 as image data of the output image.
[0057] Next, the control unit 100 outputs the output image acquired in step S118 (step S120). For example, the control unit 100 outputs the output image by attaching it to an email and sending it, by storing the output image in a predetermined area of the storage unit 160, or by storing the output image in a server or external storage device designated by the user. The output method may be selected in advance by the user, for example.
[0058] [1.2.2 Resolution estimation process] Next, the resolution estimation process will be described with reference to Fig. 9. The resolution estimation process is performed by the resolution estimation unit 112.
[0059] First, the resolution estimation unit 112 extracts character rectangles and character strings from the input image (step S140). For example, the resolution estimation unit 112 extracts character rectangles from the input image via the character rectangle extraction unit 108, and extracts character strings (character string areas) via the character string extraction unit 110. Furthermore, the resolution estimation unit 112 stores character rectangle information and character string area information by executing the following processes.
[0060] (1) The resolution estimation unit 112 selects one character string area and issues a character string area ID that identifies the selected character string area. The resolution estimation unit 112 stores character string area information, including the issued character string area ID and the coordinates (sx, sy) of the upper left and lower right of the selected character string area, in the character string area information storage area 164. The resolution estimation unit 112 repeats the above-described process until all extracted character string areas have been selected.
[0061] (2) The resolution estimation unit 112 selects one character rectangle and issues a character rectangle ID that identifies the selected character rectangle. The resolution estimation unit 112 then searches for a character string area that includes the selected character rectangle. The resolution estimation unit 112 then stores character rectangle information in the character rectangle information storage area 162, including the issued character string area ID, the coordinates (sx, sy) of the upper left corner and the coordinates (ex, ey) of the lower right corner of the selected character rectangle, and the character string area ID corresponding to the searched character string area. The resolution estimation unit 112 repeats the above-described process until all extracted character rectangles have been selected.
[0062] If the resolution estimation unit 112 does not find a character string containing the selected character rectangle, it sets the character string area ID of the character string area corresponding to the character rectangle to a value such as empty or NULL. Character rectangle information with an empty or NULL character string area ID does not include a valid character string area ID and indicates that the character rectangle information corresponds to a character that does not belong to a specific character string (for example, a character in a table).
[0063] Next, the resolution estimation unit 112 extracts the character rectangle size for each character rectangle and calculates the character size (step S142). For example, the resolution estimation unit 112 reads out character rectangle information that does not include a valid character string area ID from the character rectangle information storage area 162, one by one, and extracts the longer of the height or width of the character rectangle corresponding to the read character rectangle information. For example, based on the read character rectangle information, the resolution estimation unit 112 obtains the larger value (number of pixels) between the value obtained by subtracting sy from ey and the value obtained by subtracting sx from ex, and converts the value of the number of pixels into a value in points (character size). The resolution estimation unit 112 may calculate the value in points corresponding to the number of pixels according to the value of the number of pixels obtained using the resolution used when the document was read. The resolution estimation unit 112 stores the character size in the read character rectangle information.
[0064] Next, the resolution estimation unit 112 counts the character rectangle size for each corresponding character size (step S144). In this way, the resolution estimation unit 112 counts, for each character size, characters written in the document that do not belong to a specific character string.
[0065] Next, resolution estimation unit 112 extracts the character string size for each character string (step S146). For example, resolution estimation unit 112 reads out character string area information one by one from character string area information storage area 164, and converts the height of the character string area (the value (number of pixels) obtained by subtracting sy from ey) into a value in points. Furthermore, resolution estimation unit 112 stores the value in points as the character string size of the read character string area information.
[0066] Next, the resolution estimation unit 112 counts the character rectangle sizes in the character string region for each corresponding character size (step S148). For example, the resolution estimation unit 112 reads out character rectangle information including a valid character string region ID from the character rectangle information storage area 162 one by one, and acquires the character string size included in the character string region information corresponding to the character string region ID included in the read character rectangle information. The resolution estimation unit 112 stores the acquired character string size as the character size in the read character rectangle information, and counts (aggregates) the stored character sizes for each character size. In this way, the resolution estimation unit 112 determines the character size of characters written in the document and belonging to a specific character string as the character size based on the height of the character string. The resolution estimation unit 112 can also aggregate the character sizes of characters in the character string based on the height of the character string. The resolution estimation unit 112 adds up the aggregation results of step S144 and step S148 to obtain aggregation results for each character size for all characters included in the document.
[0067] Next, the resolution estimation unit 112 estimates the resolution of the output image according to the ratio of the number of character rectangles (number of characters) tallied for each character size (step S150). For example, the resolution estimation unit 112 executes the following process.
[0068] (1) The resolution estimation unit 112 refers to the character rectangle number ratio table 168 and acquires the character rectangle ratio corresponding to the output mode. (2) The resolution estimation unit 112 acquires the minimum character size that includes one or more character rectangles (characters) from the counting result obtained in step S148. The resolution estimation unit 112 also sets the minimum character size as the target character size. (3) The resolution estimation unit 112 calculates the total number of character rectangles (number of characters) counted for any character size from the minimum character size to the target character size. (4) The resolution estimation unit 112 calculates the ratio (proportion) of the total value calculated in (2) to the number of all character rectangles (number of characters). (5) If the ratio calculated in (4) exceeds the character rectangle ratio, the resolution estimation unit 112 refers to the resolution correspondence table 166 and estimates the resolution that corresponds to the target character size and the output mode as the resolution suitable for the output image. On the other hand, if the ratio calculated in (4) does not exceed the character rectangle number ratio, the resolution estimation unit 112 increases the target character size by one point and repeats from (3). By the above-mentioned processing, the resolution estimation unit 112 adds up the counts of character rectangles of each character size and character rectangles within a character string, starting from the smallest character size, and estimates the resolution at the stage where the ratio of the added character rectangle counts exceeds the character rectangle count ratio as the resolution of the output image.
[0069] Next, the resolution estimation unit 112 sets the resolution estimated in step S150 as the resolution of the output image (step S152).
[0070] [1.2.3 Compression ratio determination process] Next, the compression rate determination process will be described with reference to Fig. 10. The compression rate determination process is executed by the compression rate determination unit 114.
[0071] First, the compression rate determination unit 114 sets an integration range corresponding to the resolution estimated by the resolution estimation process and the output mode by referring to the integration range table 170 (step S170).
[0072] Next, the compression rate determination unit 114 acquires information about character rectangles included in the predetermined character string (step S172). For example, the compression rate determination unit 114 acquires character rectangle information including a valid character string region ID from the character rectangle information storage area 162.
[0073] Next, the compression rate determination unit 114 counts (aggregates) the character rectangles for each character size (step S174). Here, the character rectangle information including a valid character string area ID includes the character size of the character string identified by the character string area ID as the character size. Therefore, the compression rate determination unit 114 can count the number of character rectangles (number of characters) based on the character size corresponding to the height of the character string.
[0074] Next, the compression rate determination unit 114 accumulates the number of character rectangles (number of characters) for each accumulation range (step S176). As a result, by using the information on the character rectangles, the compression rate determination unit 114 can classify each character included in the input image into one of the accumulation ranges according to the character size, and obtain the number of classified characters (number of character rectangles).
[0075] Next, the compression rate determination unit 114 compares the number of character rectangles (number of characters) for each integration range, and determines the compression rate corresponding to the integration range with the largest number of character rectangles (number of characters) as the compression rate of the output image. At this time, the compression rate determination unit 114 weights the count number (number of characters) of character rectangles after integration (step S178).
[0076] For example, the compression rate determination unit 114 multiplies the count of character rectangles after integration in an integration range corresponding to a "medium" compression rate by 2.0. Similarly, the compression rate determination unit 114 multiplies the count of character rectangles after integration in an integration range corresponding to a "medium-high" compression rate by 1.5, and multiplies the count of character rectangles after integration in an integration range corresponding to a "high" compression rate by 1.0. The value by which the count of character rectangles after integration is multiplied may be predetermined or may be set by the user.
[0077] Next, the compression rate determination unit 114 compares the values of the count numbers after weighting in step S178 to identify the accumulation range with the largest count number (step S180). Furthermore, the compression rate determination unit 114 sets the compression rate corresponding to the accumulation range identified in step S180 as the compression rate for the output image (step S182).
[0078] If there are multiple integration ranges with the maximum value, the compression rate determination unit 114 sets the compression rate on the higher image quality side of the compression rates corresponding to the multiple integration ranges as the compression rate for the output image. For example, if the compression rates corresponding to the integration ranges with the maximum value are "medium" and "high," the compression rate determination unit 114 sets "medium," which is the compression rate on the higher image quality side, as the compression rate for the output image.
[0079] The compression rate determination unit 114 may omit the weighting process in step S178. In this case, the compression rate determination unit 114 sets the compression rate corresponding to the accumulation range into which the largest number of character rectangles (number of characters) is classified as the compression rate for the output image.
[0080] Through the above-described process, the compression rate determination unit 114 can classify characters included in the scanned document image into a predetermined cumulative range (for example, three levels of size) based on the character size, and compare the number of classified characters to determine the compression rate. As a result, the compression rate determination unit 114 can set the compression rate to "medium" when there are many small characters, to "medium-high" when there are many medium-sized characters, and to "high" when there are many large characters.
[0081] Furthermore, when comparing the number of characters for each accumulation range, the compression rate determination unit 114 assigns a greater weight to accumulation ranges with smaller compression rates (ranges with smaller character sizes), thereby allowing the number of characters with smaller character sizes to be given more importance in determining the compression rate.
[0082] [1.3 Example of operation] An overview of the operation of the image forming apparatus 10 of this embodiment will be described with reference to Fig. 11. First, the image forming apparatus 10 sets the output mode (Fig. 11 (1)). If the document characteristic is "photograph" (Fig. 11 (2)), the image forming apparatus 10 sets the resolution of the output image to a predetermined resolution (e.g., 100 dpi) (Fig. 11 (3)), and determines the compression rate of the output image according to the output mode (Fig. 11 (4)).
[0083] On the other hand, when the document characteristics are "text" or "text + photo" ((5) in FIG. 11), the image forming apparatus 10 estimates the resolution of the output image from the character size of the characters included in the input image and the output mode ((6) in FIG. 11). Furthermore, the image forming apparatus 10 classifies the characters included in the input image into one of the integration ranges according to the character size for each character, based on the integration range (threshold value of the integration range) corresponding to the estimated resolution and output mode. The threshold value of the integration range is the smallest character size value within each integration range. The image forming apparatus 10 then determines the compression rate of the output image according to the number of classified characters ((7) in FIG. 11).
[0084] Note that the image forming apparatus 10 may estimate a higher resolution when the output mode is "size priority (clarifies small characters)" than when the output mode is "size priority (normal)." For example, by using the table shown in FIG. 5 as the resolution correspondence table 166, the image forming apparatus 10 can estimate 300 dpi as the resolution of the output image when the output mode is "size priority (clarifies small characters)" and the proportion of small characters is high. On the other hand, when the output mode is "size priority (normal)," 300 dpi is not estimated as the resolution of the output image. This is the same when the output mode is "standard (normal)" or "standard (clarifies small characters)." As a result, when the output mode is "size priority (clarifies small characters)" or "standard (clarifies small characters)," and an image of a document with a high proportion of small characters is input, the image forming apparatus 10 estimates a higher resolution as the resolution of the output image. As a result, the image forming apparatus 10 can output a high-resolution image from an original document having a high ratio of small characters, thereby preventing small characters from being blurred in the output image.
[0085] Next, the operation of the resolution estimation process will be described with reference to FIG. 12. FIG. 12 is a graph showing the number of character rectangles in a string equivalent to 300 dpi, the number of character rectangles in a string equivalent to 200 dpi, and the number of character rectangles in a string equivalent to 150 dpi. The number of character rectangles in a string equivalent to 300 dpi is the number of character rectangles in a string for which 300 dpi is set as the resolution for outputting the characters corresponding to the character rectangle. The same applies to the number of character rectangles in a string equivalent to 200 dpi and the number of character rectangles in a string equivalent to 150 dpi. FIG. 12 shows that the total number of character rectangles (number of characters) contained in a string is 100, of which the number of character rectangles in a string equivalent to 300 dpi is 35, the number of character rectangles in a string equivalent to 200 dpi is 10, and the number of character rectangles in a string equivalent to 150 dpi is 55.
[0086] Assume that the character rectangle count ratio is 0.5. Image forming apparatus 10 calculates the ratio by adding the counts of character rectangles in ascending order of character size. Here, the ratio of the number of character rectangles (number of small characters) in a 300 dpi equivalent string is 0.35, which does not exceed 0.5. Therefore, image forming apparatus 10 does not estimate 300 dpi as the resolution of the output image. Furthermore, even if the number of character rectangles (number of medium-sized characters) in a 200 dpi equivalent string is added, the character ratio after the addition is 0.45, which does not exceed 0.5. Therefore, image forming apparatus 10 does not estimate 200 dpi as the resolution of the output image. If the number of character rectangles (number of large characters) in a 150 dpi equivalent string is added, the character ratio after the addition is 1.0, which exceeds 0.5. Therefore, image forming apparatus 10 estimates 150 dpi as the resolution of the output image.
[0087] Note that, when image forming apparatus 10 estimates 150 dpi, which is the smallest resolution among the possible resolutions of 150 dpi, 200 dpi, and 300 dpi, it may re-estimate the resolution depending on the number of characters (character rectangles) to be output at other resolutions. For example, when both of the following two conditions are met, image forming apparatus 10 estimates 200 dpi as the resolution of the output image. (1) The ratio of the total number of character rectangles in a string equivalent to 300 dpi to the total number of character rectangles in a string equivalent to 200 dpi is 0.3 or more (corresponding to a character rectangle ratio of 60%) (2) The ratio of the number of character rectangles in a string equivalent to 300 dpi to the sum of the number of character rectangles in a string equivalent to 300 dpi and the number of character rectangles in a string equivalent to 200 dpi is 0.6 or more. 12, the ratio in (1) is 0.45, and the ratio in (2) is 0.78 (=0.35 / 0.45). Therefore, in the example of Fig. 12, since (1) and (2) are satisfied, the image forming apparatus 10 re-estimates the resolution of the output image to be 200 dpi.
[0088] By performing the above-described process, when an image of a document containing many large characters and a relatively large number of small characters is input, the image forming apparatus 10 can estimate a high resolution as the resolution of the output image. Note that a method for re-estimating the resolution may be other than the method described above.
[0089] Next, the operation of classifying characters contained in an image will be described with reference to Fig. 13. Fig. 13(a) is a diagram showing that a character string E110, indicated by a dashed line, contains five character rectangles (C110, C111, C112, C113, and C114), indicated by dotted lines. Although the five character rectangles have different heights, image forming apparatus 10 uses the character string size calculated from the height of the character string as the character size for the character rectangles within the character string, thereby making the character sizes of the five character rectangles the same.
[0090] FIG. 13(b) shows the results of counting character rectangles (characters) for each character size. In FIG. 13(b), (1) indicates the integration range corresponding to a "medium" compression rate, (2) indicates the integration range corresponding to a "medium-high" compression rate, and (3) indicates the integration range corresponding to a "high" compression rate. The image forming apparatus 10 of this embodiment integrates the number of character rectangles (number of characters) for each integration range and compares the counts for each integration range. In the example of FIG. 13(b), the number of characters included in integration range (1) is the largest. Therefore, the image forming apparatus 10 determines the compression rate for the output image to be "medium."
[0091] Next, a method for adjusting the integration range will be described with reference to Figures 14 to 16. The integration range is adjusted by a developer of the image forming device 10 or the like by carrying out the following two procedures for an image (input image) read from a document on which a predetermined number of characters of a predetermined character size are printed in a predetermined font (for example, a document on which black characters are written on a white background). (Step 1) The developer of the image forming device 10 visually checks the image quality of the input image (confirmation image) that has been converted to a standard resolution (e.g., 200 dpi) and compressed at each compression rate, and determines the threshold value of the accumulation range based on visibility. (Step 2) The developer of the image forming apparatus 10 uses a program to detect the character size of the input image, and adjusts the integration range based on the detected character size.
[0092] First, (Step 1) will be described. Fig. 14 is a table in which "O" is entered when sufficient visibility is ensured for the confirmation image, and "X" is entered when visibility is not ensured. Such visibility is checked visually in advance by a developer of the image forming apparatus 10 for each font (for example, Mincho, Gothic, Roman, etc.).
[0093] For example, FIG. 14 is an example table showing the results of checking the visibility of characters in Mincho font. E120 in FIG. 14 indicates that when an image containing 10-point Mincho font characters is compressed at a "medium-high" compression rate, the visibility of the characters in the image is not ensured. E121 in FIG. 14 indicates that when an image containing 12-point Mincho font characters is compressed at a "medium-high" compression rate, the visibility of the characters in the image is ensured. Thus, even with the same font and compression rate, image quality differs depending on the character size. In the example in FIG. 14, 11 points are determined as the threshold for the integration range corresponding to the "medium-high" compression rate ((1) in FIG. 14), and 17 points are determined as the threshold for the integration range corresponding to the "high" compression rate ((2) in FIG. 14).
[0094] Even with the same compression rate and character size, there may be differences in visibility between Gothic and Mincho fonts. Therefore, visibility is checked for each font. Then, developers of the image forming device 10 comprehensively consider the threshold values of the integration range determined for each font and determine the threshold values of the integration range for the "medium-high" compression rate and the threshold values of the integration range for the "high" compression rate.
[0095] Next, (Step 2) will be explained. The image forming apparatus 10 sets the character size of characters included in a character string to a character size that corresponds to the height (character string size) of the character string. However, there are cases where the character sizes of characters included in different character strings are detected (calculated) as different sizes in the program, even though they are actually the same character size. This is due to the following character characteristics (character features). (i) Depending on the type of character (English characters, Japanese characters, etc.), there is a difference between the actual character size and the calculated character size. (ii) The height of the string varies depending on the type and combination of characters in the string. The above two character characteristics will be described in detail with reference to Fig. 15. It is assumed that all the characters shown in Fig. 15 are the same character size (for example, 16 points).
[0096] Let us now explain cause (i). Figures 15(a) and (b) show examples of character strings containing English letters. For English letters, the length from the ascender line to the descender line corresponds to the actual character size. In Figure 15(a), the actual character size ((1) in Figure 15(a)) is almost the same as the height of the character string area circumscribing the character rectangle included in the character string, so the program calculates a character string size that is close to the actual character size. On the other hand, in Figure 15(b), the height of the character string area circumscribing the character rectangle included in the character string is lower ((3) in Figure 15(b)) than the actual character size ((2) in Figure 15(b)). Therefore, the program calculates a character string size that is smaller than the actual character size.
[0097] Furthermore, as shown in Figure 15(c), in the case of Japanese characters, the character size corresponds to the size of the virtual body (for example, (4) in Figure 15(c)), but the character face is arranged smaller than the virtual body. Therefore, the program extracts the rectangle shown by the dotted line in Figure 15(c) as the character rectangle, and calculates the character size shown in (5) in Figure 15(c) as the character size. (5) in Figure 15(c) is smaller than (4).
[0098] In other words, even though the actual character sizes are the same in Figures 15(a), 15(b), and 15(c), the program sometimes calculates a character size that is almost the same as the actual character size, and sometimes calculates a character size that is smaller than the actual character size. This results in different character sizes being calculated depending on the type of characters contained in the string.
[0099] Next, we will explain cause (ii). Figure 15(d) shows the case where a string containing 16-point block letters (e.g., Arial) is combined with Japanese characters (16-point).
[0100] The first line in Figure 15(d) shows a combination of the English letter "+" and the Japanese character "kanji." If the first line only contained the English letter "+," the height of the string would be the height shown in (6), but because Japanese characters are included, the height of the string becomes the height shown in (7). The second line in Figure 15(d) shows a combination of the English letter "+123" and the Japanese character "kanji." If the second line only contained the English letter "+123," the height of the string would be the height shown in (8), but because Japanese characters are included, the height of the string becomes the height shown in (9). The third line in Figure 15(d) shows a combination of the English letter "+ghi" and the Japanese character "kanji." Because the English letter "g" is longer downward than the Japanese character, the height of the string becomes the height shown in (10), which is taller than the first and second lines. As a result, even if a character string contains 16-point characters, the height of the character string will differ between the first, second, and third lines.
[0101] Furthermore, even for the same type of characters (e.g., Japanese characters), the height of the character string varies depending on the font. For example, Figure 15(e) is a diagram showing E132, which indicates Japanese characters written in Gothic font ("Kanji: Kanji"), and E133, which indicates Japanese characters written in a different Gothic font from E132 ("Kanji: Kanji") side by side. Here, E132 and E133 have the same character size, but the height of the character string of E132 ((12) in Figure 15) is different from the height of the character string of E133 ((13) in Figure 15).
[0102] Furthermore, if there is a space or a change in font within a line of characters, the line of characters may be separated into different character strings. In this case, the separated character strings may have different heights. For example, as shown in FIG. 15(e), if there is a line of character string "abc defg," the character string that makes up the line is separated by a space C134 into character strings E134 and E135. Here, because there is a difference in the height of character strings E134 and E135 as shown in (14) of FIG. 15, character strings E134 and E135 are calculated to have different heights.
[0103] Due to the above (i) and (ii), even if two strings contain characters that are actually written with the same character size, the character string size calculated by the program may differ depending on the type and combination of characters. As a result, the number of different character height patterns increases, and the characters contained in each string are more likely to be counted as different sizes. Therefore, developers of the image forming device 10 adjust the accumulation range based on the character size calculated by the program so that when character rectangles are classified according to the character size calculated by the program, they are classified into the appropriate accumulation range.
[0104] Figure 16(a) shows a table in which character rectangles were extracted by a program from an image of a scanned document containing 88 characters in the font "Arial" printed in increments of 1 point from 5 point to 16 point, and the results were tabulated by character size calculated from the character rectangles. E140 in Figure 16(a) shows that while there are 88 characters whose actual character size is 15 points, there are 74 characters whose character size was calculated by the program as 15 points. E141 in Figure 16(a) shows that while there are 88 characters whose actual character size is 16 points, there are 0 characters whose character size was calculated by the program as 16 points. In this way, the program calculates a character size that differs from the actual character size.
[0105] FIG. 16(b) is a table showing the number of characters calculated in the program from an image of a document printed with different fonts, varying the character size and number of characters. Developers of the image forming device 10 compare the number of characters for each actual character size printed on the document with the number of characters calculated in the program, and estimate the character size range in the program in which each point size in the document is counted. The dashed-dotted line in FIG. 16(b) indicates the range of marking estimated to be counted for characters with a character size (3 to 10 points) corresponding to a "medium" compression rate in the integration range. Similarly, the dotted line in FIG. 16(b) indicates the range of marking for character sizes (11 to 16 points) corresponding to a "medium-high" compression rate in the integration range, and the solid line in FIG. 16(b) indicates the range of marking for character sizes (17 points or larger) corresponding to a "high" compression rate in the integration range. The integration range in FIG. 16(b) corresponds to the integration range based on the threshold value of the integration range determined visually, as shown in FIG.
[0106] The developer of the image forming device 10 adjusts the threshold of the integration range determined visually so that the compression rate determined by the character size calculated by the program is not judged to be on the low image quality side. In Figure 16(b), the integration range based on the threshold of the integration range determined visually and the marked range are almost the same, so the integration range is not adjusted. Note that the developer of the image forming device 10 adjusts the integration range if the integration range based on the threshold of the integration range and the marked range do not match.
[0107] In this way, even if characters are actually the same size, the impact of the program calculating them as different character sizes can be mitigated. Note that the developer of the image forming device 10 sets the integration range adjusted by the above procedure as the integration range when the resolution of the confirmation image (for example, 200 dpi) and the output mode is "standard," and determines integration ranges for other resolutions and other output modes by taking this integration range into consideration.
[0108] Next, examples of screens displayed on the display unit 140 will be described. FIG. 17(a) is an example of a home screen W100. The home screen displays buttons and the like for selecting functions provided by the image forming device 10. The user selects the function they wish to use via the home screen W100. The home screen W100 includes a simple scan button B100 for using the simple scan function. The simple scan function is a function that causes an image of an input document to be sent to another device or stored in the memory unit 160 of the image forming device 10 or another storage device (for example, a storage unit of a server or an external storage medium).
[0109] 17(b) is an example of a settings screen W110 that is displayed when a button B100 is selected from the home screen W100. The settings screen W110 includes a button B110 for automatically setting the compression rate of the output image. If the compression rate of the output image is not automatically set, the compression rate of the output image may be fixed to a specific compression rate (e.g., "medium-high") or may be selected by the user.
[0110] By selecting button B110, the user can have image forming apparatus 10 automatically determine the compression rate of the output image. Fig. 17(c) is an example of the settings screen W120 that appears when button B110 is selected. On settings screen W120, button B120 (the button corresponding to button B110 in Fig. 17(b)) is selected, indicating that the compression rate will be automatically set (E120 in Fig. 17(c)).
[0111] The setting screen may also include a details button (for example, button B112 in FIG. 17(b)). FIG. 18(a) is an example of a details screen W130 that is displayed when button B112 included in FIG. 17(b) is selected. The details screen is a screen that allows detailed settings of the simple scan function. The details screen W130 includes a button B130 for setting the output mode.
[0112] 18(b) is an example of a details screen W140 that is displayed when button B130 on the details screen W130 is selected. The details screen W140 includes an area E140 that includes buttons for selecting one of the output modes: "Size Priority (File Size Priority)," "Standard," and "Image Quality Priority." Furthermore, when "Size Priority" or "Standard" is selected, an area E142 is included that includes buttons for selecting either "Normal" or "Clear Small Text." The user can specify the desired output mode by selecting a button from area E140 or area E142.
[0113] If the user does not select a specific output mode, the image forming apparatus 10 may automatically select an output mode. The screens shown in Figures 17 and 18 are displayed before the main processing shown in Figure 8 is executed. The user can have the image forming apparatus 10 estimate the resolution of the output image, determine the compression rate of the output image, and specify the output mode via the screens shown in Figures 17 and 18.
[0114] The above-described embodiment may be modified as appropriate. For example, in the present embodiment, the device that determines the compression ratio is the image forming device 10, but the device may be realized by a device other than the image forming device 10. For example, an information processing device that does not include an image forming unit (for example, an image processing device or an image reading device such as a scanner) may be equipped with the resolution estimation unit 112 and the compression ratio determination unit 114, thereby making it possible to determine the compression ratio.
[0115] The number of types of compression ratios may be two, or may be four or more. The compression ratios may be expressed as "low," "medium," or "high," or may be expressed as numerical values such as "50%, "70%, or "85%."
[0116] Furthermore, when the document characteristic is "photograph," the compression rate may be determined according to the output mode, as shown in FIG. 7(d), or the compression rate may be uniquely determined (for example, a "high" compression rate) regardless of the output mode.
[0117] Furthermore, in the present embodiment, the integration range is set based on the output mode and the resolution of the output image, but the integration range may be set based only on the resolution of the output image.
[0118] In addition, when the count number of the accumulation range into which characters with large character sizes are classified is the largest and the count number of the accumulation range into which characters with small character sizes are classified is approximately the same (for example, when the difference in the count numbers is within a predetermined threshold), the control unit 100 may perform one of the following processes. (1) The control unit 100 sets the resolution of the output image to a large value and the compression rate to "high." (2) The control unit 100 sets the resolution of the output image to a low level and the compression rate to "low."
[0119] In the above-described embodiment, when extracting a character string, horizontally adjacent character rectangles are concatenated. This is because it is assumed that the characters in the document are typeset horizontally. However, because a document may be typeset vertically, the character string extraction unit 110 may also identify the direction of the character string when extracting the character string. In this case, the character string extraction unit 110 determines that the direction of the character string is horizontal if the longitudinal direction of the character string region is horizontal, and determines that the direction of the character string is vertical if the longitudinal direction of the character string region is vertical. Furthermore, when extracting the character string size in step S146 of FIG. 9 , the resolution estimation unit 112 converts the height of the character string region into a value in points if the character string direction is horizontal, and converts the width of the character string region into a value in points if the character string direction is vertical.
[0120] As described above, the image forming apparatus of this embodiment classifies characters contained in an image based on character size, and determines the compression rate according to the number of classified characters. This allows the image to be compressed using the optimal compression rate while ensuring the readability of characters of the most commonly used character size.
[0121] Here, depending on the type of character (font) contained in the image, the compression rate and character size can affect visibility. To address this issue, the image processing device of this embodiment classifies the characters contained in the image according to character size and determines the compression rate according to the classification result, thereby suppressing the influence of differences in character type on the determination of the compression rate.
[0122] When the compression rate is determined based solely on a single character size, such as the minimum character size, as in conventional technology, the compressed image may not be appropriate depending on the type of characters (font) contained in the image. For example, information loss occurs in documents containing fine print, resulting in an image of the document that is indistinguishable due to the font. Furthermore, document images that would otherwise require low resolution and high compression are processed to output at high image quality, resulting in insufficient file size reduction. To address these issues, the image forming apparatus of this embodiment determines the compression rate based on the range of character sizes most commonly used in documents (accumulation range). This allows the compression rate to be determined taking into consideration the character sizes of the characters contained in the document. Here, the accumulation range is determined taking into consideration character characteristics, allowing an appropriate compression rate to be selected according to the character characteristics.
[0123] Furthermore, the image forming apparatus of this embodiment determines (sets) the compression rate according to the document characteristics when using the scan function, etc., and can automatically determine an appropriate compression rate according to the document characteristics and character characteristics. This allows the image forming apparatus of this embodiment to avoid the loss of image information (especially character information) that occurs in scanned images when the compression rate is fixed, as occurs in ordinary image forming apparatuses, and also reduces the file size of the output image. In other words, the image forming apparatus of this embodiment can optimize the image quality and size of the output image. Furthermore, the user can have the image forming apparatus automatically determine an appropriate compression rate without having to configure detailed settings such as the resolution and compression rate of the output image.
[0124] [2. Second Embodiment] Next, a second embodiment will be described. The second embodiment is an embodiment in which processing for connecting character rectangles is performed in the compression rate determination processing of the first embodiment. In this embodiment, FIG. 10 of the first embodiment is replaced with FIG. 19. Note that the same processes are assigned the same reference numerals, and descriptions thereof will be omitted.
[0125] Depending on the character, the character rectangle extraction unit 108 included in the image forming apparatus 10 may extract multiple character rectangles from an image (pixels) representing one character. As a result, the pixels corresponding to one character are separated into multiple character rectangles, making it impossible for the image forming apparatus 10 to correctly count the number of characters. Generally, the larger the character size, the easier it is for the character to be separated. In other words, the larger the character size, the more likely it is that the character will be separated into multiple character rectangles. Therefore, in this embodiment, a process of connecting the separated character rectangles is performed in the compression rate determination process.
[0126] [2.1 Processing flow] The flow of the compression rate determination process of this embodiment will be described with reference to Fig. 19. In this embodiment, before executing the compression rate determination process described in the first embodiment, a process of concatenating character rectangles included in a character string is executed.
[0127] First, the compression rate determination unit 114 selects one character string (step S200). For example, the compression rate determination unit 114 reads one character string region information from the character string region information storage area 164. In the following description, the character string selected in step S200 will be referred to as a target character string.
[0128] Next, the compression rate determination unit 114 concatenates vertically adjacent character rectangles among the character rectangles included in the target character string (step S202). For example, the compression rate determination unit 114 performs the following process on the character rectangles included in the target character string. (1) The compression rate determination unit 114 selects one character rectangle, starting from the character rectangle with the top left position. (2) The compression rate determination unit 114 identifies another character rectangle that includes any position between the left end and the right end of the one character rectangle selected in (1). (3) If one or more other character rectangles are identified in (2), the compression rate determination unit 114 connects the character rectangle selected in (1) and the character rectangle identified in (2) as vertically adjacent character rectangles. (4) If not all character rectangles have been selected, the compression rate determination unit 114 returns to (1) and selects another character rectangle; if all character rectangles have been selected, the process in step S202 ends.
[0129] When concatenating multiple vertically adjacent character rectangles in (3), the compression rate determination unit 114 generates character rectangle information for character rectangles that circumscribe the multiple character rectangles and belong to the target character string, and stores the character rectangle information in the character rectangle information storage area 162. Furthermore, the compression rate determination unit 114 deletes the character rectangle information corresponding to the multiple character rectangles that were the subject of concatenation from the character rectangle information storage area 162.
[0130] Next, the compression ratio determination unit 114 assigns the left end position of the target character string to a reference position, which is a variable used to connect horizontally adjacent character rectangles (step S204), and identifies the closest character rectangle to the right of the reference position (step S206).
[0131] Next, the compression rate determination unit 114 sets a range (connected range) whose width is equal to the height of the target character string from the left end position of the character rectangle identified in step S206 (step S208). That is, the connected range is a range that includes the left end position of the character rectangle selected in step S206 to a position that is the same distance away as the height of the target character string.
[0132] Next, if there are multiple overlapping character rectangles in the concatenated range, the compression rate determination unit 114 concatenates the multiple character rectangles as horizontally adjacent character rectangles (step S210). At this time, the compression rate determination unit 114 generates new character rectangle information for character rectangles that circumscribe the multiple character rectangles and belong to the target character string, and stores this information in the character rectangle information storage area 162. Furthermore, the compression rate determination unit 114 deletes the character rectangle information corresponding to the multiple character rectangles that were the subject of concatenation from the character rectangle information storage area 162.
[0133] Next, the compression rate determination unit 114 assigns the right end position of the linked range set in step S208 to the reference position (step S212), and determines whether or not a character rectangle exists to the right of the reference position (step S214). If a character rectangle exists to the right of the reference position, the compression rate determination unit 114 returns to step S206 (step S214; No → step S206). On the other hand, if a character rectangle does not exist to the right of the reference position, the compression rate determination unit 114 determines whether or not all character strings have been selected (step S214; Yes → step S216). If all character strings have not been selected, the compression rate determination unit 114 returns to step S200 (step S216; No → step S200). On the other hand, if all character strings have been selected, the compression rate determination unit 114 executes the processes from step S172 onwards (step S216; Yes).
[0134] [2.2 Example of operation] An example of the operation of this embodiment will be described with reference to Fig. 20. Fig. 20(a) is a diagram showing character rectangles included in a character string E200 that includes the character "hado" (wave). As shown in Fig. 20(a), the character string E200 includes six character rectangles.
[0135] FIG. 20(b) shows the character rectangles obtained by concatenating vertically adjacent character rectangles included in the character string E200. In this embodiment, from the character rectangles shown in FIG. 20(a), character rectangle C204, character rectangle C205, character rectangle C206, and character rectangle C201 are selected in order from top to bottom. Here, character rectangles C204, C205, and character rectangle C206 do not have any vertically adjacent character rectangles. On the other hand, character rectangle C201 has character rectangles C202 and C203 as its vertically adjacent character rectangles. Therefore, character rectangles C201, C202, and C203 are concatenated to form character rectangle C207 in FIG. 20(b). In this way, as shown in (1) of FIG. 20(b), vertically adjacent character rectangles are concatenated based on the height of the character string. As a result, the vertically separated character portions (the "san" (water) character portion in the example of FIG. 20(a)) are concatenated.
[0136] FIG. 20C shows the character rectangles obtained by concatenating horizontally adjacent character rectangles included in the character string E200. In this embodiment, the reference position is set to the left end of the character string E200, and the closest character rectangle C207 is identified from the character rectangle located to the right of the reference position. Furthermore, a concatenated range E202 is set from the left end of the character rectangle C207, with a width equal to the height of the character string E200. Concatenated range E202 includes character rectangles C207 and C204. Therefore, character rectangles C207 and C204 are concatenated to form character rectangle C208. Furthermore, the reference position is set to the right end of character rectangle C208, and the closest character rectangle C205 is identified from the character rectangle located to the right of the reference position. Furthermore, a concatenated range E204 is set from the left end of character rectangle C205, with a width equal to the height of the character string E200. Concatenated range E204 includes character rectangle C205 and character rectangle C206. Therefore, character rectangle C205 and character rectangle C206 are concatenated to form character rectangle C209. In this way, as shown in (2) of FIG. 20(c), horizontally adjacent character rectangles are concatenated based on a width that is the same length as the height of character string E200. This concatenates (integrates) horizontally separated character parts (for example, the radicals and parts of a kanji character).
[0137] Figures 20(d) and 20(e) are examples of other character strings. In Figures 20(d) and 20(e), the dashed dotted lines indicate character string areas (character string rectangles), and the dotted lines indicate character rectangles.
[0138] 20(d) shows an example of image P210 that includes a character string E210 containing 18-point characters and a character string E212 containing 10-point characters. Character string E210 includes 13 character rectangles, and character string E212 includes 9 character rectangles. Therefore, compression rate determination unit 114 determines the compression rate by assuming that there are 13 18-point characters and 9 10-point characters.
[0139] Here, we will explain a case where 10-point characters are classified into an accumulation range corresponding to a "medium" compression rate, 18-point characters are classified into an accumulation range corresponding to a "high" compression rate, and no weighting is applied to the accumulated character count. In this case, since 18-point characters are the largest, the compression rate determination unit 114 determines the compression rate of the output image to be "high." As a result, mosquito noise may appear around the 10-point characters in the output image.
[0140] FIG. 20(e) shows the character string area and character rectangles after the process of concatenating character rectangles is performed on image P210 shown in FIG. 20(d). Character strings E214 and E216 in FIG. 20(e) correspond to character strings E210 and E214 in FIG. 20(d), respectively. In FIG. 20(e), the 18-point and 10-point characters each contain nine characters. Therefore, the compression rate determination unit 114 determines the compression rate of the output image to be "medium" by determining the compression rate on the high-image-quality side. By concatenating character rectangles in this way, a single character is not detected twice, the number of characters is counted more accurately, and an appropriate compression rate is determined. Furthermore, a character size close to the actual character size is detected.
[0141] In the above description, the connecting range is set after connecting vertically adjacent character rectangles, but the connecting range may be set first and then the vertically adjacent character rectangles may be connected. In this case, if there are no vertically separated character rectangles within the connecting range, the process of connecting the vertically adjacent character rectangles is omitted.
[0142] The above explanation is for the processing when the character string is oriented horizontally. When the character string is oriented vertically, the reference position is moved downward from the top of the character string, and the character rectangles separated horizontally are first concatenated. Next, a concatenation range of the vertical width of the character string size is set, and the vertical character rectangles that overlap the concatenation range are concatenated.
[0143] Image forming apparatus 10 may also connect character rectangles by methods other than those described above. For example, it may connect two consecutive character rectangles whose ratio of the width and height of the characters, the width of the same character string, or the ratio to the maximum width of the same character string is smaller than a predetermined ratio.
[0144] In this way, the image forming apparatus of this embodiment can obtain a more accurate value for the number of character rectangles (number of characters), and can appropriately determine the compression rate of the output image.
[0145] 3. Third Embodiment Next, a third embodiment will be described. In the third embodiment, the compression ratio is determined by executing processing according to the output mode in the compression ratio determination processing of the first embodiment. In this embodiment, FIG. 10 of the first embodiment is replaced with FIG. 21. Note that the same processes are denoted by the same reference numerals, and their explanations will be omitted.
[0146] The flow of the compression rate determination process in this embodiment will be described with reference to Fig. 21. In this embodiment, after executing the process in step S176, the compression rate determination unit 114 determines whether the output mode is size-priority (step S300). If the output mode is image quality-priority, the compression rate determination unit 114 identifies an accumulation range that includes characters of the minimum character size among the accumulation ranges (step S300; Yes → step S302).
[0147] On the other hand, if the output mode is not image quality priority, the compression rate determination unit 114 determines whether the output mode is size priority (step S300; No → step S304). If the output mode is size priority, the compression rate determination unit 114 omits the processing of step S178. In this case, the compression rate determination unit 114 does not perform weighting, but compares the count values of each loading range, and identifies the accumulation range with the largest count value (step S304; Yes → step S306). In this case, the compression rate determination unit 114 does not prioritize characters with small character sizes.
[0148] On the other hand, if the output mode is not size-priority (if the output mode is standard), the compression ratio determination unit 114 executes the processes of steps S178 and S180 (step S304; No->step S178->step S180).
[0149] Next, the compression rate determination unit 114 sets the compression rate corresponding to the integration range identified in step S302, step S306, or step S180 as the compression rate of the output image (step S182).
[0150] In this way, the image forming apparatus of this embodiment can determine an appropriate compression rate by switching the method for comparing the number of characters included in the accumulation range depending on the output mode.
[0151] [4. Modifications] The present invention is not limited to the above-described embodiments, and various modifications are possible. In other words, embodiments obtained by combining technical means that are appropriately modified within the scope of the gist of the present invention are also included in the technical scope of the present invention.
[0152] Although the above-described embodiments are described separately for convenience of explanation, they may be combined within the scope of technical feasibility. For example, the second embodiment and the third embodiment may be combined.
[0153] In the above-described embodiment, the determination of the compression rate is described as being performed by an image forming apparatus or an image processing apparatus. However, the determination may be performed by a device such as a server equipped with a resolution estimation unit and a compression rate determination unit. Furthermore, the server may be provided as a service by being installed on the Internet (cloud). In this case, the server estimates the resolution and determines the compression rate for a received image as an input image, converts the image to the resolution, and transmits the input image compressed using the compression rate as an output image to the sender of the image.
[0154] In addition, the programs that run on each device in the embodiments are programs that control the CPU, etc. (programs that make a computer function) so as to realize the functions of the above-described embodiments. Information handled by these devices is temporarily stored in a temporary storage device (e.g., RAM) during processing, and then stored in various storage devices such as ROMs (Read Only Memories) and HDDs, and is read, modified, and written by the CPU as needed.
[0155] Here, the recording medium for storing the program may be any of semiconductor media (e.g., ROM, non-volatile memory card, etc.), optical recording media / magneto-optical recording media (e.g., DVD (Digital Versatile Disc), MO (Magneto Optical Disc), MD (Mini Disc), CD (Compact Disc), BD (Blu-ray (registered trademark) Disc), etc.), magnetic recording media (e.g., magnetic tape, flexible disk, etc.), etc. Furthermore, not only are the functions of the above-described embodiments realized by executing the loaded program, but the functions of the present invention may also be realized by processing in cooperation with an operating system or other application programs, etc., based on instructions from the program.
[0156] Furthermore, when distributing the program on the market, the program can be stored on a portable recording medium and distributed, or transferred to a server computer connected via a network such as the Internet. In this case, the storage device of the server computer is of course included in the present invention. [Explanation of symbols]
[0157] 10 Image forming device 100 control section 102 Image processing section 104 Output mode setting section 106 Original characteristics determination unit 108 Character rectangle extraction part 110 String extraction part 112 Resolution Estimation Unit 114 Compression ratio determination unit 120 Image input unit 130 Image forming unit 140 Display section 150 Operation section 160 Storage section 162 Character rectangle information storage area 164 Character string area information storage area 166 Resolution Support Table 168 Character Rectangle Ratio Table 170 Accumulation Range Table 190 Communications Department
Claims
1. an input unit for inputting an image of a document; a compression rate determination unit that determines a compression rate when outputting the image; an output unit that outputs an output image obtained by compressing the image using the compression rate determined by the compression rate determination unit; Equipped with The compression ratio determination unit Obtaining the character size of each character included in the image; When a plurality of rectangles are extracted from pixels corresponding to one character, a process of connecting the plurality of rectangles is performed; classifying the characters into a predetermined range of character sizes according to the character sizes; The compression ratio is determined according to the number of classified characters.
1. An image processing device comprising:
2. further comprising a resolution estimation unit that estimates a resolution when the image is output; The image processing device according to claim 1 , wherein the compression rate determination unit sets the range of the character size based on the resolution estimated by the resolution estimation unit.
3. The compression ratio determination unit weighting the number of classified characters; The compression ratio is determined based on the range of character sizes that has the largest weighted value.
3. The image processing device according to claim 1, wherein the image processing device is a computer.
4. a document characteristic determination unit that determines whether the document characteristic is a document including characters; 4. The image processing apparatus according to claim 1, wherein the output unit outputs the output image compressed using a predetermined compression rate when the document does not contain characters.
5. The compression ratio determination unit Extracting a character string from the image; obtaining a character size of the character based on the height of the character string including the character; The rectangles located up to a position corresponding to a width having the same length as the height of the character string are connected together, The character size is obtained based on the rectangle after the concatenation.
5. The image processing device according to claim 1, wherein the image processing device is a computer.
6. The character is extracted as a rectangle circumscribing the pixels that make up the character, The compression ratio determination unit The rectangles adjacent in the vertical direction of the character string are connected.
6. The image processing device according to claim 5,
7. further comprising an output mode setting unit that sets an output mode; 3. The image processing device according to claim 2, wherein the compression rate determination unit sets the range of character sizes based on the resolution determined by the resolution estimation unit and the output mode set by the output mode setting unit.
8. the output mode is one of a first mode that prioritizes compression rate, a second mode that prioritizes character quality, and a third mode that balances compression rate and character quality; The compression ratio determination unit If the output mode is the first mode, determining a compression ratio based on the range of character sizes in which the number of classified characters is the largest; If the output mode is the second mode, the compression ratio is determined based on the range of character sizes into which the smallest character among the classified characters is classified. If the output mode is the third mode, weighting is performed on the number of classified characters, and a compression rate is determined based on the range of character sizes that has the largest weighted value among the weighted values; 8. The image processing device according to claim 7,
9. A control method for an image processing device, comprising: an input step of inputting an image of a manuscript; a compression rate determination step of determining a compression rate when outputting the image; an output step of compressing the image using the compression rate determined in the compression rate determination step and outputting the output image; Equipped with The compression ratio determination step Obtaining the character size of each character included in the image; When a plurality of rectangles are extracted from pixels corresponding to one character, a process of connecting the plurality of rectangles is performed; classifying the characters into a predetermined range of character sizes according to the character sizes; The compression ratio is determined according to the number of classified characters. A control method comprising:
10. The compression ratio determination step Extracting a character string from the image; obtaining a character size of the character based on the height of the character string including the character; The rectangles located up to a position corresponding to a width having the same length as the height of the character string are connected together, The character size is obtained based on the rectangle after the concatenation. The control method according to claim 9.
Citation Information
Patent Citations
Image reader
JP2005318146A
Image processing apparatus, image forming apparatus, image processing method, image processing program and recording medium recording the program
JP2008227661A
Document image generation server and program, and document browsing system
JP2011118517A
Image processing apparatus, image processing system, computer program and recording medium
JP2016051914A