Image processing apparatus, binarization method, and program

The image processing device addresses the issue of white spots and distortions in conventional binarization by calculating multiple thresholds and performing local binarization, resulting in improved character readability and reduced noise in multivalued images.

JP2024115066APending Publication Date: 2024-08-26RICOH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2023020529
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-02-14
Publication Date
2024-08-26

AI Technical Summary

Technical Problem

Conventional image binarization techniques risk producing white spots and distortions when converting multivalued images to binary, especially affecting the readability of characters on dark or light backgrounds.

Method used

An image processing device that calculates N-1 thresholds based on overall and local image features, generating an N-valued image and then binarizes it to suppress white spots and improve character reproduction, using a method that includes a threshold calculation unit, N-ary conversion, and binarization unit.

Benefits of technology

The method effectively reduces white spots and enhances the readability of characters on both light and dark backgrounds by producing a binarized image with minimal noise and unnatural artifacts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024115066000001
    Figure 2024115066000001
Patent Text Reader

Abstract

To provide a technique to prevent white patches and binarize a multivalued image.SOLUTION: An image processing apparatus has: a threshold calculation unit that, based on the pixel value of an input image with the number of gradations M, calculates N-1 (M>N>2) first thresholds; an N-nary coding unit that compares the N-1 first thresholds with the pixel value of the input image and creates an N-nary image from the input image; and a binarization unit that, based on the pixel value for every local area of the input image and the gradation value for every local area of the N-nary image, creates a binarized image obtained by binarizing the input image.SELECTED DRAWING: Figure 10
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an image processing apparatus, a binarization method, and a program.

Background Art

[0002] When the image data read by an image processing apparatus using a scanner function is a multi-valued image. A multi-valued image is an image having pixel values of three or more gradations, such as a grayscale image or a color image, not just two pixel values of 1 and 0 that can be used like a black-and-white image. Although a multi-valued image has rich gradations that can be represented, on the other hand, characters or the like may be buried in a gray background, making it difficult for the user to read or reducing the accuracy of OCR (Optical Character Recognition / Reader) processing.

[0003] Techniques for binarizing multi-valued images are known (see, for example, Patent Document 1). Patent Document 1 discloses a technique for extracting a character region based on the luminance of each pixel, converting it into an m-valued image with m (m≧3 and m<n) gradations, and determining a threshold value for binarizing the character region according to whether a predetermined number of each pixel of the m-valued image exists for each gradation.

Summary of the Invention

Problems to be Solved by the Invention

[0004] However, in the conventional technique, there is a risk of white gaps occurring when binarizing. In the conventional technique, a procedure is followed in which a character region is extracted, only the character region is converted into an m-valued image, and then binarized. The region that is not extracted as the character region is assigned "0" as the background portion of the original document, and the region and the binarized character region are combined. Therefore, thick characters and white characters are reproduced in a state similar to outlined characters where only the vicinity of the character edge becomes "1" and the inside of the thick character and the background portion far from the character edge of the white character become "0".

[0005] In view of the above-mentioned problems, an object of the present invention is to provide a technique for binarizing a multi-valued image while suppressing blank areas. [Means for solving the problem]

[0006] The present invention provides an image processing device comprising: a threshold calculation unit that calculates N-1 (M>N>2) thresholds based on pixel values ​​of an input image having M gradations; an N-value conversion unit that compares the N-1 thresholds with the pixel values ​​of the input image to generate an N-valued image from the input image; and a binarization unit that generates a binary image by binarizing the input image based on the pixel values ​​of each local region of the input image and the gradation values ​​of each local region of the N-valued image. Effect of the Invention

[0007] It is possible to provide a technique for binarizing a multi-valued image while suppressing white spots. [Brief description of the drawings]

[0008] [Figure 1] 11A and 11B are diagrams for explaining a comparison of processing results of global binarization and adaptive binarization; [Diagram 2] FIG. 1 is a diagram illustrating an image processing device or an image processing system that is an example of a device that performs binarization processing. [Diagram 3] FIG. 2 illustrates an example of a hardware configuration of an image processing apparatus. [Figure 4] FIG. 2 is a functional block diagram of an example of image processing for generating a binary image (black and white image) from an input image. [Diagram 5] FIG. 11 is a functional block diagram of an example illustrating a function of a threshold calculation unit; [Figure 6] FIG. 11 is a diagram showing an example of a histogram created by a histogram creating unit. [Figure 7] FIG. 11 is a flowchart illustrating an example of a process in which a discrimination analysis unit determines three thresholds t0, t1, and t2. [Figure 8] FIG. 4 is a functional block diagram illustrating an example of a function of a binarization unit; [Figure 9]FIG. 2 is a diagram illustrating a pixel of interest and a local region. [Figure 10] FIG. 11 is a flowchart illustrating an example of a binarization process performed by an output unit. [Figure 11] FIG. 13 is a diagram illustrating condition 1. [Figure 12] FIG. 13 is a diagram showing an example of a four-valued image. [Figure 13] 13 is a diagram showing an example of a binary image obtained by binarizing the quaternary image of FIG. 12 using an existing technique. FIG. [Figure 14] 13 is a diagram showing an example of a binary image obtained by binarizing the four-valued image of FIG. 12 through the binarization process of this embodiment. FIG. [Figure 15] 13A shows an example of a four-valued image, (b) and (c) show binarized images obtained by adaptive binarization, and (d) shows a binarized image obtained by the binarization method of this embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0009] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An image processing device and a binarization method performed by the image processing device will be described below as an example of an embodiment of the present invention with reference to the drawings.

[0010] <Binarization type> First, we will briefly explain the types of binarization. There are global binarization and adaptive binarization. Global thresholding is a process of binarizing the entire image with the same threshold. There are two types of global thresholding: a method that uses a fixed threshold (simple binarization) and a method that uses a value calculated from the overall image features according to the image as the threshold (a typical example is binarization using discriminant analysis). Adaptive binarization is a process of binarizing a local region using the average value + offset value as a threshold, and binarizing with a different threshold value for each local region. The offset value may be a constant (e.g., 5 to 20 for 256 gradations) or may be determined as a ratio to the average value (e.g., 10%).

[0011] Adaptive thresholding has the advantage of being able to binarize light characters or characters on a dark background without losing their color, but it has the disadvantage that defects such as white spaces that did not exist in the input image can occur due to threshold switching within the image.

[0012] For this reason, when converting a multi-value image into a binary image, there are problems in that black pixels remain around characters on a dark background, or the binary processing switch occurs within a background of uniform density, resulting in an image with a noticeable switch point and a very unnatural appearance.

[0013] Figure 1 is a diagram for explaining and comparing the processing results of simple binarization and adaptive binarization. Figure 1(a) shows an input image (multi-value image). The input image 110 includes an area 111 in which text is written on a dark background. Here, simple binarization is explained, but the problems with simple binarization are common to global binarization, even if the degree differs.

[0014] FIG. 1(b) shows the result 112 of simple binarization of region 111. With simple binarization, both the background and the characters become black, resulting in blurred characters. FIG. 1(c) shows the result 113 of adaptive binarization of region 111. With adaptive binarization, there is no blurred characters. However, even with the result 113, black pixels (gray) remain in the background, making the characters difficult to see.

[0015] It is possible to make black pixels in the background as shown in FIG. 1(c) white pixels by setting the offset value of adaptive binarization. However, for a specific input image as shown in FIG. 1(d), the processing result looks unnatural. In the input image 120 in FIG. 1(d), the character area is covered with a gray area that is larger than the character area. The case where this input image 120 is adaptively binarized is shown in FIG. 1(e) and (f). If the offset value is set so that the gray area of ​​the background becomes white, the intricate characters with a high density of black pixels are cut off, as shown in FIG. 1(e), and the readability is reduced. Conversely, if the offset value is set in a direction that increases the readability, the threshold is adaptively switched in the background with a uniform density, resulting in white gaps, and the binarized image looks unnatural, as shown in FIG. 1(f).

[0016] <Outline of the binarization process of this embodiment> Therefore, in the image processing device of this embodiment, when binarizing a multi-valued input image, A. "Calculate N-1 (M>N>2) thresholds based on the overall characteristics of an input image with M gradations, and generate an N-valued image by applying the N-1 thresholds to the input image, B. "Then, the image processing device generates a binarized image by binarizing the entire input image based on the features of each local region of the input image and the features of each local region of the N-valued image." B can reproduce light characters or characters on a dark background, and A generates an N-ary image without unnatural noise or white spaces, and the result is also reflected in B, so that the final output binary image can also have little noise or white spaces.

[0017] That is, the binarization method of this embodiment can simultaneously reproduce light characters or characters on a dark background and reduce the occurrence of noise and white spaces.

[0018] In this embodiment, the explanation will be given mainly on the assumption that M=256 and N=4, but by setting N=8, etc., binarization with even less occurrence of blank areas and the like is possible.

[0019] <Terminology> Binarization is the process of converting a multi-tone image into two colors, black and white (0,1). If there are two colors, 0 and 1 can be assigned to a color other than black and white.

[0020] The number of gradations M is the number of gradations of the input image, and in this embodiment, 256 gradations will be described as an example.

[0021] N-1 is the number of thresholds that is one less than N to create an N-ary image. In this embodiment, as an example, the N-ary image is a four-ary image.

[0022] A local region is a region including a predetermined number of pixels centered around a pixel of interest that is to be binarized. In this embodiment, the local region is, for example, a region of 7×7 pixels.

[0023] <Configuration example> FIG. 2 shows an image processing device 20 or an image processing system 100, which is an example of a device that performs binarization processing. The image processing device 20 in FIG. 2(a) is a device used by a user that has multiple different functions, for example, called a multifunction device or MFP (Multifunction Peripheral). The image processing device 20 has at least a scanner function. A scanner is a device or function that converts images, documents, etc. into digital still images for communication or recording. In this embodiment, the digital still images may be color or monochrome, but a multi-value image with higher gradation than binary can be generated. The digital still image may be a snapshot of a video.

[0024] In addition to the scanner function, the image processing device 20 may have a fax function, a print function, a copy function, etc. The image processing device 20 may be called an image forming device, a printing device, a printer, a scanner device, etc.

[0025] The image processing device 20 in Fig. 2(a) can, by itself, scan an original image to generate a multi-tone input image and perform binarization processing on the input image. The binarization processing is performed as a pre-processing for OCR, for example, but the binarization processing may be performed independently of OCR.

[0026] On the other hand, as shown in Fig. 2(b), the generation of the input image and the binarization process of this embodiment may be performed by different devices. Fig. 2(b) shows an example of an image processing system 100 in which an information processing device 40 performs the binarization process. This image processing system 100 includes an information processing device 40 and an image processing device 20. The information processing device 40 and the image processing device 20 are connected to each other so as to be able to communicate with each other via a LAN or Wi-Fi (registered trademark) within the facility, a USB cable, or the like.

[0027] When a user places an original document in the image processing device 20 and executes scanning, the image processing device 20 transmits a multi-tone input image to the information processing device 40 via the network N. The information processing device 40 receives the multi-tone input image generated by the image processing device 20 by scanning the original document, and can perform binarization processing on the input image.

[0028] 2(c), the binarization process may be executed as part of a workflow process. A workflow is a series of processes that are executed by combining a plurality of processes (e.g., scanning, saving to the cloud, or sending by email, etc.). For example, a service is known in which an information processing system 60 performs a predetermined process on image data generated by a device reading an original document, and then the image data is saved in the cloud or sent by email.

[0029] FIG. 2(c) shows an image processing system 100 that executes a workflow. The image processing system 100 has an information processing system 60 and an image processing device 20. The information processing device 40 may or may not be included in the image processing system 100. The information processing system 60 and the image processing device 20 are communicatively connected via a wide area network N1 such as the Internet. The image processing device 20 is placed in a facility such as a company, and is connected to a network N2 laid in the facility. The network N2 may be a LAN, Wi-Fi (registered trademark), wide area Ethernet (registered trademark), or a mobile phone network such as 4G, 5G, or 6G.

[0030] The information processing system 60 may be realized by one or more computers. The information processing system 60 may be realized by cloud computing, or may be realized by a single information processing device. Cloud computing refers to a form in which resources on a network are used without being aware of specific hardware resources. The information processing system 60 may exist on the Internet or on-premise.

[0031] The image processing device 20 and the information processing system 60 may execute a Web application. A Web application is an application that runs as a result of cooperation between a program written in a programming language (e.g., JavaScript (registered trademark)) that runs on a Web browser and a program on the Web server side. In contrast, an application that cannot be executed unless it is installed in the image processing device 20 is called a native application. In this embodiment, too, the application executed by the image processing device 20 may be a Web application or a native application.

[0032] The information processing system 60 generates screen information for displaying a screen of a Web application on the image processing device 20. The screen information is a program written in HTML, XML, a scripting language, CSS (Cascading Style Sheet), etc., where the structure of a Web page is mainly specified by HTML, the operation of the Web page is regulated by the scripting language, and the style of the Web page is specified by CSS.

[0033] 2(c), the image processing device 20 generates an input image using a scanner function, performs binarization processing, and transmits the image to the information processing system 60 via the networks N1 and N2. The information processing system 60 performs, for example, OCR processing, and transmits the image by email or stores it in the cloud.

[0034] Alternatively, the binarization process may be performed by the information processing system 60. The image processing device 20 generates an input image using a scanner function, and transmits the input image to the information processing system 60 via the networks N1 and N2. The information processing system 60 performs binarization process on the received input image, and executes the subsequent workflow.

[0035] The information processing device 40 can also accept execution of a workflow, and may also be used by a user to perform settings related to the workflow (such as license assignment and initial settings).

[0036] Furthermore, the input image on which the information processing device 40 in Fig. 2(b) or the information processing system 60 in Fig. 2(c) performs the binarization process does not have to be one scanned by the image processing device 20. For example, the image processing device 20 may be a digital camera or a smartphone, and the information processing device 40 or the information processing system 60 may perform the binarization process on an input image generated by these devices by capturing an image of a document or the like. Furthermore, the information processing device 40 or the information processing system 60 can perform the binarization process on any image on the network.

[0037] In the following description, unless otherwise specified, it is assumed that the image processing device 20 in FIG. 2(a) performs the binarization process.

[0038] <Hardware configuration example> Fig. 3 is a diagram showing an example of a hardware configuration of an image processing device 20 according to an embodiment of the present invention. As shown in Fig. 3, the image processing device 20 includes a controller 910, a short-range communication circuit 920, an engine control unit 930, an operation panel 940, and a network I / F 950. Here, the image processing device 20 may be an image forming device, an MFP, or a multifunction peripheral / product / printer.

[0039] Of these, the controller 910 has a CPU 901, which is the main part of the computer, a system memory (MEM-P) 902, a north bridge (NB) 903, a south bridge (SB) 904, an ASIC (Application Specific Integrated Circuit) 906, a local memory (MEM-C) 907, an HDD controller 908, and an HD 909, and is configured such that the NB 903 and the ASIC 906 are connected via an AGP (Accelerated Graphics Port) bus 921.

[0040] Of these, the CPU 901 controls the entire image processing device 20. The NB 903 is a bridge for connecting the CPU 901 with the MEM-P 902, the SB 904, and the AGP bus 921, and includes a memory controller for controlling reading and writing to the MEM-P 902, a PCI (Peripheral Component Interconnect) master, and an AGP target.

[0041] The MEM-P 902 is composed of a ROM 902a which is a memory for storing programs and data for implementing the various functions of the controller 910, and a RAM 902b which is used for developing the programs and data, and as a drawing memory during memory printing, etc. The programs stored in the RAM 902b may be provided by being recorded in a computer-readable recording medium such as a CD-ROM, CD-R, or DVD in the form of an installable or executable file.

[0042] The SB904 is a bridge for connecting the NB903 to a PCI device and a peripheral device. The ASIC906 is an IC (Integrated Circuit) for image processing purposes having hardware elements for image processing, and plays the role of a bridge connecting the AGP bus 921, the PCI bus 922, the HDD controller 908, and the MEM-C907. The ASIC906 is composed of a PCI target and an AGP master, an arbiter (ARB) that is the core of the ASIC906, a memory controller that controls the MEM-C907, a plurality of DMACs (Direct Memory Access Controllers) that rotate image data using hardware logic, and a PCI unit that transfers data between the scanner unit 931, the printer unit 932, and the fax unit 933 via the PCI bus 922. A USB (Universal Serial Bus) interface or an IEEE1394 (Institute of Electrical and Electronics Engineers 1394) interface may be connected to the ASIC906.

[0043] The short-distance communication circuit 920 has a card reader 920a for reading user authentication information and the like stored on an IC card or the like.

[0044] The operation panel 940 includes a touch panel 940a and a numeric keypad 940b for accepting input from a user. The touch panel 940a displays a setting screen for the image processing device 20 and the like.

[0045] <About the function> Next, the binarization function of the image processing device 20 will be described in detail with reference to Fig. 4. Fig. 4 is a functional block diagram showing image processing performed up to generating a binarized image (black and white image) from an input image. Note that the input image is an RGB image with 256 gradations of 8 bits per color, but it may be higher, such as 10 bits per color, or it may be lower.

[0046] The image processing device 20 has a smoothing unit 11, a gray processing unit 12, and a multi-value image processing unit 13. The multi-value image processing unit 13 also has a threshold calculation unit 14, an N-value conversion unit 15, and a binarization unit 16. Each of these functional units of the image processing device 20 is a function or means realized by the CPU 901 executing instructions included in one or more programs installed in the image processing device 20. Alternatively, each functional unit may be realized by an ASIC (Application Specific Integrated Circuit), a DSP (Digital Signal Processor), an FPGA (Field Programmable Gate Array), a hardware circuit module, or the like.

[0047] The smoothing unit 11 smoothes the input image using a spatial filter. Smoothing filters include an averaging filter, a Gaussian filter, a median filter, a maximum value filter, and a minimum value filter, and these may be used appropriately. Smoothing has the effect of reducing the influence of noise and reducing the number of black dots remaining after binarization.

[0048] The gray processing unit 12 converts the input image (RGB image) into a gray image (8 bit, 256 gradations) using a conversion formula from RGB to luminance. The gray processing unit 12 converts into a gray image using, for example, a conversion formula for YCbCr to Y signals used in JPEG. Since 0 corresponds to black and 255 corresponds to white in the luminance Y, the gray processing unit 12 inverts black and white to convert into an image signal where 0 corresponds to white and 255 corresponds to black. This processing is for the convenience of subsequent processing.

[0049] The multi-value image processor 13 converts the 8-bit, 256-level gray image after graying into a 1-bit, 2-level black-and-white image and outputs it. In this embodiment, the conversion is explained as a black-and-white image in which 0 is white and 1 is black, but if black-and-white inversion is not performed in the previous stage (gray processor 12), the data logic in the following explanation will all be reversed.

[0050] The threshold calculation unit 14 calculates three thresholds (in the case of a four-valued image, N=4, so N-1=3) from the overall image characteristics of the input image. The method of calculating the thresholds will be described later.

[0051] The N-value conversion unit 15 converts each pixel value from 256 gradations to 4 gradations (four-valued image) by applying the three thresholds calculated by the threshold calculation unit 14.

[0052] The binarization unit 16 converts the binarization result of the pixel of interest into 0 or 1 based on the features of the local region of the gray image and the features of the local region of the quaternary image, and outputs the binarization result. The binarization unit 16 repeatedly performs the same process by shifting the position of the pixel of interest in the gray image or the quaternary image by one pixel at a time.

[0053] <<Calculating the threshold>> Next, a method of calculating a threshold value performed by the threshold value calculation unit 14 will be described with reference to Fig. 5 to Fig. 7. Fig. 5 is a functional block diagram illustrating the function of the threshold value calculation unit 14. The threshold value calculation unit 14 has a histogram creation unit 21 and a discrimination analysis unit 22.

[0054] The histogram creation unit 21 creates a frequency (histogram) for each gradation of the input image. An example of the histogram is shown in FIG. 6. Creating the histogram makes it easier for the discriminant analysis unit 22 to calculate the three thresholds. The discriminant analysis unit 22 calculates the three thresholds by performing a predetermined process on the histogram. Details will be described with reference to FIG. 7.

[0055] Fig. 6 is an example of a histogram created by the histogram creation unit 21. As shown in Fig. 6, the horizontal axis indicates pixel values ​​(0 to 256), and the vertical axis indicates the frequency (number of pixels for each pixel value). The discrimination analysis unit 22 can easily detect a minimum value or a value near a minimum value of the histogram as a threshold, which makes it easier for the N-value conversion unit 15 to convert similar pixel values ​​into four values ​​with the same gradation value. Fig. 6 shows thresholds t0, t1, and t2 (an example of a first threshold) determined by the discrimination analysis unit 22.

[0056] Fig. 7 is a flowchart illustrating the process of determining three thresholds t0, t1, and t2 by the discriminant analysis unit 22. Fig. 7 shows the loop process of the discriminant analysis unit 22 shown in Fig. 5. The discriminant analysis unit 22 performs the discriminant analysis method for calculating the three thresholds three times by changing the reference range of the histogram.

[0057] The discriminant analysis method is a method to find the threshold value that maximizes the degree of separation. The degree of separation is calculated using the between-class variance and the within-class variance. Discriminant analysis method will be described later.

[0058] First, in the first loop, the discriminant analysis unit 22 applies the discriminant analysis method within the range of gradation values ​​[0, 255], that is, over the entire histogram, to calculate a threshold value t1 (S1).

[0059] In the second loop, the discriminant analysis unit 22 applies the discriminant analysis method to the partial histogram within the range of gradation values ​​[0, t1-1], that is, on the white side, to calculate the threshold value t0 (S2).

[0060] In the third loop, the discriminant analysis unit 22 applies the discriminant analysis method to the partial histogram within the range of gradation values ​​[t1, 255], that is, on the black side, to calculate the threshold value t2 (S3).

[0061] <<Discriminant analysis method>> The discriminant analysis method will be described. It is assumed that the discriminant analysis unit 22 determines the threshold value t from 0≦t≦255. The range of 0≦t is set as the white class, the number of pixels is ω1, the average is m1, and the variance is δ1. Similarly, the range of t≦255 is set as the black class, the number of pixels is ω2, the average is m2, and the variance is δ2. Then, the number of pixels of the entire image is set as ω t , the average is m t , variance is δ t Let us assume that.

[0062] The within-class variance is defined by equation (1).

number

number

number

number

number

[0063] <Quaternary Threshold> Next, the four-value processing will be described. The N-value conversion unit 15 uses thresholds t0, t1, and t2 to four-value the 256-level gray image as follows. (i) If the pixel value of the pixel of interest on the grayscale image is within the range of [0, t0-1], the N-value conversion unit 15 converts the gradation value of the pixel of interest after four-value conversion to 0. (ii) If the pixel value of the pixel of interest on the grayscale image is within the range of [t0, t1-1], the N-value conversion unit 15 converts the gradation value of the pixel of interest after four-value conversion to 1. (iii) If the pixel value of the pixel of interest on the grayscale image is within the range of [t1, t2-1], the N-value conversion unit 15 converts the gradation value of the pixel of interest after four-value conversion to 2. (iv) If the pixel value of the pixel of interest on the grayscale image is within the range of [t2, 255], the N-value conversion unit 15 converts the gradation value of the pixel of interest after four-value conversion to 3.

[0064] Here, we will explain the case where the thresholds calculated by the discriminant analysis method are applied as is, but the N-value conversion unit 15 may add a constant offset value to the thresholds t0 to t2 and then convert them to four values, as is commonly done.

[0065] <Binarization> Next, the binarization process will be described with reference to Fig. 8 to Fig. 11. Fig. 8 is a functional block diagram illustrating the function of the binarization unit 16. The binarization unit 16 has an average value calculation unit 31, a minimum value calculation unit 32, a pixel number counting unit 33, and an output unit 34. A gray image with 256 gradations is input to the average value calculation unit 31 and the minimum value calculation unit 32. A four-valued image with four gradations is input to the pixel number counting unit 33.

[0066] 9 is a diagram for explaining a pixel of interest and a local region. In this embodiment, the local region is a 7×7 pixel area centered on the pixel of interest. The 7×7 local region is just an example, and the local region may be smaller or larger.

[0067] The average value calculation unit 31 refers to a local area (7×7 pixels) of a 256-level gray image and calculates the average value of 49 pixels.

[0068] The minimum value calculation unit 32 refers to a local region (7 x 7 pixels) of the input image and finds the minimum value of 49 pixels. The difference between the average value and the minimum value is used to determine the presence or absence of an edge. An edge is the boundary between a bright part (white) and a dark part (black) in an image.

[0069] The pixel number counting unit 33 refers to a local region (7 × 7 pixels) of the input image with four gradations, and counts the number of pixels for each gradation of 0, 1, 2, and 3. The number of pixels with gradation value 0 is cnt0, the number of pixels with gradation value 1 is cnt1, the number of pixels with gradation value 2 is cnt2, and the number of pixels with gradation value 3 is cnt3.

[0070] 10 to 15 are diagrams illustrating the binarization flow and conditions 1 to 3. Conditions 1 to 3 are conditions for determining whether a pixel of interest in a gray image should be converted to 0 or 1. Conditions 1 to 3 will be described in detail later.

[0071] 10 is a flow chart illustrating the binarization process performed by the output unit 34. The output unit 34 determines whether or not Condition 1 (an example of the first condition) is satisfied (S11).

[0072] If the determination in step S11 is Yes, the output unit 34 performs binarization using binarization method 1 (S12). Binarization method 1 will be described later.

[0073] If the determination in step S11 is No, the output unit 34 determines whether or not Condition 2 (an example of the second condition) is satisfied (S13).

[0074] If the determination in step S13 is Yes, the output unit 34 performs binarization using binarization method 2 (S14). Binarization method 2 will be described later.

[0075] If the determination in step S13 is No, the output unit 34 determines whether or not Condition 3 (an example of a third condition) is satisfied (S15).

[0076] If the determination in step S15 is Yes, the output unit 34 performs binarization using binarization method 3 (S16). Binarization method 3 will be described later.

[0077] If the determination in step S15 is No, the output unit 34 performs binarization using binarization method 4 (S17). Binarization method 4 will be described later.

[0078] In FIG. 10, condition 3 is judged after condition 2, but condition 3 may be judged before condition 2.

[0079] <Regarding Condition 1> FIG. 11 is a diagram illustrating condition 1. Condition 1 is that the count result of the gradation value that is the same as the gradation value of the pixel of interest in the quaternary valued image is 2 or less, and that only two of cnt0, cnt1, cnt2, and cnt3 have a value of 1 or more (there are only two types of gradation values ​​within the local region). In other words, there are only pixels with the same gradation around the pixel of interest (within the local region), and there is a maximum of one pixel around that has the same gradation value as the pixel of interest. Therefore, condition 1 is a condition for detecting isolated point noise.

[0080] Note that the count result of the same gradation value as the gradation value of the pixel of interest is 2 (an example of the second threshold) or less is just an example, and this threshold may be 3, etc. Also, the threshold is set to 2 when the local region is 49 pixels, and if the local region is wider, the threshold used for comparison with the count result of the same gradation value as the pixel of interest will be larger. If the local region is narrower, the threshold used for comparison with the count result of the same gradation value as the pixel of interest will be smaller.

[0081] 11A, the count result of the number of pixels having the same gradation value as the pixel of interest 91 (gradation value 1) is 2. Additionally, cnt0 = 47, cnt1 = 2, cnt2 = 0, and cnt3 = 0. Therefore, the local region in FIG.

[0082] 11B, the count result of the number of pixels having the same gradation value as the pixel of interest 92 (gradation value 2) is 1. Additionally, cnt0 = 0, cnt1 = 0, cnt2 = 1, and cnt3 = 48. Therefore, the local region in FIG. 11B satisfies condition 1.

[0083] If condition 1 is satisfied, the output unit 34 performs binarization using binarization method 1. Binarization method 1 is a process in which if the value of another gradation different from that of the target pixel in the quaternary valued image is 0 or 1, the binarization result of the target pixel is set to 0, and if it is 2 or 3, the binarization result is set to 1. In other words, the output unit 34 binarizes the target pixel of the quaternary valued image so that the gradation value of the target pixel is the same as that of the surrounding pixels. Since the number of pixels with the same gradation as the target pixel is 2 or less, the target pixel is unified to the gradation value that is greater within the local region. This enables the output unit 34 to eliminate isolated point noise.

[0084] Fig. 11(c) is a binarized image obtained by binarizing the quaternary image in Fig. 11(a) using binarization method 1. In Fig. 11(a), the other gradation value different from that of the pixel of interest 91 is 0, so in Fig. 11(c), the binarization result of the pixel of interest 91 is 0. Note that the local region in Fig. 11(c) shows a state in which the pixel just below the pixel of interest 91 has been similarly binarized in the next process.

[0085] Fig. 11(d) is a binary image obtained by binarizing the four-valued image of Fig. 11(b) using binarization method 1. In Fig. 11(b), the other gradation value different from that of the pixel of interest 92 is 3, so in Fig. 11(d), the binarization result of the pixel of interest 92 is 1.

[0086] <Regarding condition 2> Condition 2 is that (i) the gradation value of the pixel of interest in the four-valued image is 1 (an example of a first predetermined value), and (ii) the absolute value of the difference between the average value and the minimum value of the local region in the gray image is equal to or greater than a threshold value (an example of a third threshold value). Note that this threshold value may be, for example, 10, but it may also be less than 10 or greater than 10.

[0087] Condition 2 (i) requires that the pixel of interest be relatively light, but it is not just light; condition (ii) is also used to exclude pixels of interest that do not want to be converted to black. Condition 2 (ii) is a condition for not showing noise-like things on a white background that you do not want to show in black as a binarization result (the absolute value of the difference between the average value and the minimum value does not exceed a threshold value (e.g. 10 or more)). An example of such noise-like things is an edge with a relatively gradual change in density. For example, if there is a line in a scanned paper document, the trace of the line corresponds to this (excluded by condition 2).

[0088] In other words, condition 2 is a condition for converting edges that are noticeable to a certain degree but cannot be called noise to black. Therefore, condition 2 makes it possible to convert edges with relatively gradual density changes to 0 (noise removal), and to convert edges that are not noticeable to a certain degree to 1.

[0089] If condition 2 is met, the output unit 34 binarizes the gray image using binarization method 2. Binarization method 2 is adaptive binarization. Adaptive binarization binarizes a pixel of interest using an offset value given by the average value + a constant as a threshold. Note that the threshold value of binarization method 2 is a relatively small value compared to condition 3 described below, in order to convert non-noise edges to black (for example, to improve the reproducibility of light characters on a white background).

[0090] <Regarding condition 3> Condition 3 is that in the four-value image, the gradation value of the pixel of interest is 2 (an example of the second predetermined value).

[0091] Condition 3 is a condition for binarizing, for example, an originally white pixel (eg, white background) on a gray background to 0.

[0092] If condition 3 is satisfied, the output unit 34 binarizes the gray image using binarization method 3. Binarization method 3 is also adaptive binarization. The threshold value applied in binarization method 3 is set to a larger value than in binarization method 2 in order to improve the reproducibility of white characters. As described above, the offset value applied in binarization method 2 is set to a relatively small value in order to improve the reproducibility of light characters on a white background (which we would like to convert to black).

[0093] <If conditions 1 to 3 are not met> If the pixel of interest does not meet any of the conditions 1 to 3, the output unit 34 binarizes it using the binarization method 4. An example of a case where the pixel of interest does not meet any of the conditions 1 to 3 (i.e., the pixel is not isolated point noise, is not a fairly noticeable edge, and is not a gray background) is when all pixels in a local area in the four-value image have the same gradation value.

[0094] In binarization method 4, if the gradation value of the pixel of interest in the four-valued image is 0 or 1, the binarization result is 0, and if it is 2 or 3, the binarization result is 1. This process corresponds to binarizing the pixel value of the pixel of interest to a value that is uniquely determined for the gradation value in the local region. In other words, a pixel of interest that does not meet conditions 1 to 3 is forcibly converted to 1 or 0. Binarization method 4 generates a binarized image that is the same as binarizing a gray image using threshold value t1 calculated by discriminant analysis.

[0095] <Effects of binarization according to conditions 2 and 3> Fig. 12 shows an example of a quaternary valued image, and Fig. 13 shows a binarized image obtained by binarizing the quaternary valued image of Fig. 12 using existing technology. In the case of a quaternary valued image like Fig. 12, if binarization is performed using only discriminant analysis, which is an existing binarization technology (i.e., binarizing all pixels using threshold value t1), the binarized image shown in Fig. 13 will result. The binarization result in Fig. 13 has the following defects. The light portion 130 in FIG. 12(a) is binarized to white pixels, and the character (the number "60") becomes unclear as shown in FIG. 13(a). In Fig. 12(b), the entire character is light, so when it is binarized, the entire character becomes white pixels (the character is deleted), as shown in Fig. 13(b). Since the background in Fig. 12(c) and (d) is dark, when the images are binarized, the pixels become all black, as shown in Fig. 13(c) and (d).

[0096] In contrast, Fig. 14 shows a binarized image obtained by binarizing the quaternary image of Fig. 12 using the binarization method of this embodiment. First, the light part 130 of Fig. 12(a) is reproduced as black in Fig. 14(a) due to the effect of binarization according to condition 2. That is, the pixel of interest with a gradation value of 1 (light part 130) in the quaternary image of Fig. 12(a) satisfies condition 2 because it is surrounded by black pixels. The threshold value of binarization method 2 is relatively low, so the pixel of interest with a gradation value of 1 becomes 1 (black) in the binarization process.

[0097] Similarly, in Figure 14(b), the light characters (tone value 1) are reproduced clearly in black due to the effect of binarization in accordance with condition 2. The pixel of interest with a tone value of 1 in the quaternary valued image in Figure 12(b) (the pixel corresponding to the number 60) satisfies condition 2 because it is surrounded by white background. The threshold value for binarization method 2 is relatively low, so the pixel of interest with a tone value of 1 becomes 1 (black) in the binarization process.

[0098] The reason why the characters in Fig. 14(c) are reproduced without being blurred is due to the effect of binarization in accordance with condition 3. That is, the pixel of interest in the quaternary-valued image in Fig. 12(c) with a gradation value of 2 (background of the characters) satisfies condition 3. Because the threshold value of binarization method 3 is relatively high, the pixel of interest with a gradation value of 2 becomes 0 (white) in the binarization process. Note that in the quaternary-valued image in Fig. 12(c), pixels with only a gradation value of 2 as a pixel of interest (for example, pixels near corner 131) become black in adaptive binarization, just like in Fig. 13(c).

[0099] Figure 14(c) is an example of binarization of characters on a dark background, and the binarized image is a white outlined character, so it can be said that white holes have occurred. However, characters on a dark background are rare in binarization processing. Also, of course, in terms of readability, this is far better than the blurred and unreadable character shown in Figure 13(c).

[0100] The reason why the characters in Figure 14(d) are reproduced without being blurred is due to the effect of binarization in accordance with condition 3. That is, the pixel of interest with a gradation value of 2 in the quaternary valued image in Figure 12(d) satisfies condition 3. Because the threshold value of binarization method 3 is relatively high, a pixel of interest with a gradation value of 2 becomes 0 (white) in the binarization process. A pixel of interest with a gradation value of 3 in the quaternary valued image (the background of the number 60) does not meet conditions 1 to 3, so becomes black in binarization method 4.

[0101] In this embodiment, the N-value conversion is explained as four-value conversion with N=4, but if N=8, for example, the number of conditions will increase in Fig. 10, and the number of conditional branches will also increase. This increases the possibility that Fig. 14(c) can be made closer to the binarization results in Fig. 14(a) and (b) if the conditions and the binarization process according to the conditions can be made appropriate.

[0102] <Effects of binarization when conditions 1 to 3 are not met> With reference to FIG. 15, the effect of binarization method 4, which is performed when none of conditions 1 to 3 is met, will be described. FIG. 15(a) is an example of a quaternary valued image. When adaptive binarization, which is binarization applied when condition 2 or condition 3 is met, is applied to the quaternary valued image of FIG. 15(a), the binarization results are as shown in FIG. 15(b) and (c). Both FIG. 15(b) and (c) are binarization results using adaptive binarization, but the offset values ​​reflected in the threshold are different. In either case, noise appears, the background becomes non-uniform, and white spaces occur inside characters.

[0103] On the other hand, Fig. 15(d) shows the binarization result by binarization method 4 of this embodiment. In Fig. 15(d), the background is uniform and no white space occurs inside the characters. This is the effect of applying binarization equivalent to the discriminant analysis method when none of conditions 1 to 3 is met.

[0104] <Major Effects> The binarization method of this embodiment can simultaneously reproduce light characters or characters on a dark background and reduce the occurrence of noise and white areas.

[0105] <Other application examples> The above describes the best mode for carrying out the present invention using examples, but the present invention is not limited to these examples in any way, and various modifications and substitutions can be made within the scope that does not deviate from the gist of the present invention.

[0106] The configuration example in Fig. 4 etc. is divided according to main functions to facilitate understanding of the processing by the image processing device 20. The method of division or names of the processing units does not limit the present invention. The processing of the image processing device 20 can be divided into more processing units depending on the processing contents. Also, it can be divided so that one processing unit includes more processes.

[0107] Each function of the above-described embodiments can be realized by one or more processing circuits. Here, the term "processing circuit" in this specification includes a processor programmed to execute each function by software, such as a processor implemented by an electronic circuit, and a device such as an ASIC (Application Specific Integrated Circuit), a DSP (Digital Signal Processor), an FPGA (Field Programmable Gate Array), or a conventional circuit module designed to execute each function described above. <Additional Notes> [Claim 1] a threshold calculation unit that calculates N-1 (M>N>2) first thresholds based on pixel values ​​of an input image with M gradations; an N-value conversion unit that compares pixel values ​​of the input image with N-1 first thresholds to generate an N-value image from the input image; a binarization unit that generates a binarized image by binarizing the input image based on pixel values ​​of each local region of the input image and gradation values ​​of each local region of the N-ary image; 13. An image processing device comprising: [Claim 2] In the N-ary image, if a count result of pixel values ​​that are the same as the gradation value of the pixel of interest within a local region centered on the pixel of interest is equal to or less than a second threshold value, and if a first condition is satisfied that there are only two types of gradation values ​​within the local region, 2. The image processing device according to claim 1, wherein the binarization section binarizes the pixel of interest of the N-ary image according to another gradation value different from the gradation value of the pixel of interest. [Claim 3] If a second condition is satisfied, that is, the gradation value of the pixel of interest in the N-ary image is a first predetermined value, and the input image has an edge with a predetermined strength or more, The image processing device according to claim 2 , wherein the binarization unit binarizes the input image by adaptive binarization. [Claim 4] When a third condition is satisfied, that is, the gradation value of the pixel of interest in the N-ary image is a second predetermined value, 4. The image processing device according to claim 2, wherein the binarization unit binarizes the input image by adaptive binarization. [Claim 5] In the N-ary image, a count result of pixel values ​​that are the same as the gradation value of the pixel of interest within a local region centered on the pixel of interest is equal to or less than a second threshold value, and the first condition that there are only two types of gradation values ​​within the local region is not satisfied, The second condition that the gradation value of the pixel of interest in the N-ary image is a first predetermined value and that the input image has an edge with a predetermined strength or more is not satisfied, If the third condition that the gradation value of the pixel of interest in the N-ary image is a second predetermined value is not satisfied, 2. The image processing apparatus according to claim 1, wherein the binarization unit binarizes a pixel of interest of the N-ary image into a value that is uniquely determined for a gradation value within the local region. [Claim 6] if a second condition is not satisfied, that is, the gradation value of the pixel of interest in the N-ary image is a first predetermined value and the input image has an edge of a predetermined strength or more, it is determined that the density change in the local region of the input image is more gradual than a predetermined value; Furthermore, if the third condition that the gradation value of the pixel of interest in the N-ary image is a second predetermined value is not satisfied, 3. The image processing apparatus according to claim 2, wherein the binarization unit binarizes a pixel of interest of the N-ary image into a value that is uniquely determined for a gradation value within the local region. [Claim 7] If a second condition is satisfied, that is, the gradation value of a pixel of interest in the N-ary image is a first predetermined value, and an edge having a predetermined strength or more is present in the input image, it is determined that an edge is present in the local region; 3. The image processing device according to claim 2, wherein the binarization unit binarizes the input image by performing adaptive binarization on the local region of the input image. [Claim 8] 8. The image processing device according to claim 1, wherein the threshold calculation section creates a histogram of gradation values ​​and detects a value in the vicinity of a minimum value of the histogram as the first threshold. [Claim 9] 9. The image processing device according to claim 8, wherein the threshold calculation unit calculates a plurality of the first thresholds by applying a discriminant analysis method while changing a reference range of the histogram. [Claim 10] In the N-ary image, if a count result of the gradation value that is the same as the gradation value of the pixel of interest in a local region centered on the pixel of interest is equal to or less than a second threshold value, and if a first condition that there are only two types of gradation values ​​in the local region is satisfied, the binarization unit binarizes the pixel of interest according to another gradation value different from the gradation value of the pixel of interest; If the first condition is not satisfied, and a second condition is satisfied in which the gradation value of the pixel of interest in the N-ary image is a first predetermined value, and the absolute value of the difference between the average value and the minimum value in a local region centered on the pixel of interest in the input image is equal to or greater than a third threshold value, the binarization unit binarizes the input image by adaptive binarization; If the second condition is not satisfied, and a third condition is satisfied that the gradation value of the pixel of interest in the N-ary image is a second predetermined value, the binarization unit binarizes the input image by adaptive binarization; If the first condition, the second condition, and the third condition are not satisfied, 2. The image processing device according to claim 1, wherein the binarization unit binarizes the pixel value of the pixel of interest into a value that is uniquely determined with respect to the gradation values ​​in the local region. [Explanation of symbols]

[0108] 11 Smoothing section 12 Gray processing section 13 Multi-value image processing section 14 Threshold calculation unit 15 N-value conversion section 16 Binarization section [Prior art documents] [Patent documents]

[0109] [Patent Document 1] JP 2005-072858 A

Claims

1. a threshold calculation unit that calculates N-1 (M>N>2) first thresholds based on pixel values ​​of an input image with M gradations; an N-value conversion unit that compares pixel values ​​of the input image with N-1 first thresholds to generate an N-value image from the input image; a binarization unit that generates a binarized image by binarizing the input image based on pixel values ​​of each local region of the input image and gradation values ​​of each local region of the N-ary image; 13. An image processing device comprising:

2. In the N-ary image, a count result of pixel values ​​that are the same as the gradation value of the pixel of interest within a local region centered on the pixel of interest is equal to or less than a second threshold value, and a first condition is satisfied in which only two types of gradation values ​​exist within the local region. The image processing device according to claim 1 , wherein the binarization section binarizes the pixel of interest of the N-ary image according to another gradation value different from the gradation value of the pixel of interest.

3. When a second condition is satisfied, that is, the gradation value of the pixel of interest in the N-ary image is a first predetermined value, and the input image has an edge having a predetermined strength or more, The image processing device according to claim 2 , wherein the binarization unit binarizes the input image by adaptive binarization.

4. When a third condition is satisfied, that is, the gradation value of the pixel of interest in the N-ary image is a second predetermined value, The image processing device according to claim 2 , wherein the binarization unit binarizes the input image by adaptive binarization.

5. In the N-ary image, a count result of pixel values ​​that are the same as the gradation value of the pixel of interest within a local region centered on the pixel of interest is equal to or less than a second threshold value, and the first condition that there are only two types of gradation values ​​within the local region is not satisfied, a second condition that the gradation value of the pixel of interest in the N-ary image is a first predetermined value and that the input image has an edge having a predetermined strength or more is not satisfied; If the third condition that the gradation value of the pixel of interest in the N-ary image is a second predetermined value is not satisfied, 2 . The image processing apparatus according to claim 1 , wherein the binarization unit binarizes a pixel of interest of the N-ary image into a value that is uniquely determined for a gradation value within the local region.

6. if a second condition is not satisfied, that is, the gradation value of the pixel of interest in the N-ary image is a first predetermined value and the input image has an edge of a predetermined strength or more, it is determined that a density change in a local region of the input image is more gradual than a predetermined value; Furthermore, if the third condition that the gradation value of the pixel of interest in the N-ary image is a second predetermined value is not satisfied, 3 . The image processing apparatus according to claim 2 , wherein the binarization unit binarizes a pixel of interest of the N-ary image into a value that is uniquely determined for a gradation value within the local region.

7. If a second condition is satisfied, that is, the gradation value of a pixel of interest in the N-ary image is a first predetermined value, and an edge having a predetermined strength or more is present in the input image, it is determined that an edge is present in the local region; The image processing apparatus according to claim 2 , wherein the binarization unit binarizes the input image by performing adaptive binarization on the local region of the input image.

8. 2 . The image processing apparatus according to claim 1 , wherein the threshold calculation section creates a histogram of gradation values ​​and detects a value in the vicinity of a minimum value of the histogram as the first threshold value.

9. The image processing apparatus according to claim 8 , wherein the threshold calculation section calculates a plurality of the first thresholds by applying a discriminant analysis method while changing a reference range of the histogram.

10. In the N-ary image, a count result of the gradation value that is the same as the gradation value of the pixel of interest in a local region centered on the pixel of interest is equal to or less than a second threshold value, and a first condition is satisfied in which there are only two types of gradation values ​​in the local region. the binarization unit binarizes the pixel of interest according to another gradation value different from the gradation value of the pixel of interest; If the first condition is not satisfied, but a second condition is satisfied in which the gradation value of the pixel of interest in the N-ary image is a first predetermined value, and the absolute value of the difference between the average value and the minimum value in a local region centered on the pixel of interest in the input image is equal to or greater than a third threshold value, the binarization unit binarizes the input image by adaptive binarization; If the second condition is not satisfied, and a third condition is satisfied that the gradation value of the pixel of interest in the N-ary image is a second predetermined value, the binarization unit binarizes the input image by adaptive binarization; If the first condition, the second condition, and the third condition are not satisfied, 2 . The image processing apparatus according to claim 1 , wherein the binarization unit binarizes the pixel value of the pixel of interest into a value that is uniquely determined with respect to the gradation value within the local region.

11. A binarization method performed by an image processing device, comprising: A process of calculating N-1 (M>N>2) first threshold values ​​based on pixel values ​​of an input image with M gradations; A process of comparing pixel values ​​of the input image with N-1 first thresholds to generate an N-ary image from the input image; A process of generating a binary image by binarizing the input image based on pixel values ​​of each local region of the input image and gradation values ​​of each local region of the N-ary image; The binarization method to perform.

12. An information processing device, a threshold calculation unit that calculates N-1 (M>N>2) first thresholds based on pixel values ​​of an input image with M gradations; an N-value conversion unit that compares pixel values ​​of the input image with N-1 first thresholds to generate an N-value image from the input image; a binarization unit that generates a binary image by binarizing the input image based on pixel values ​​of each local region of the input image and gradation values ​​of each local region of the N-ary image; A program to function as a

Citation Information

Patent Citations

  • Image processor

    JP1997270917A

  • Image processing apparatus

    JP2005072858A