Image reading apparatus, image reading method, and storage medium

The image reading device improves character recognition accuracy by using a control unit to set pixel-specific thresholds based on luminance values, effectively distinguishing background and text in binary images.

JP2026007659APending Publication Date: 2026-01-16SEIKO EPSON CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024107689
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2026-01-16

Smart Images

  • Figure 2026007659000001_ABST
    Figure 2026007659000001_ABST
Patent Text Reader

Abstract

To provide an image reading device, an image reading method, and a program capable of acquiring a binarized image in which a character is easily distinguished from a background.SOLUTION: The image reading apparatus includes a reading unit that reads a document and a control unit 70. The control unit 70 includes an image acquisition unit 81, a threshold value setting unit, and a binarization processing unit 88. The threshold setting unit performs threshold setting processing including second processing and third processing to set a threshold to be used for binarization processing for each pixel of the read image. The second processing sets a threshold for binarizing background pixels, which are pixels of a background image included in the read image, into white. The third processing sets a threshold value for binarizing character pixels, which are pixels of a character image included in the read image, into black. The binarization processing unit 88 generates a binarized image from the read image based on a threshold value set for each pixel. The threshold setting part sets a threshold determined on the basis of each luminance value of n * n pixels including the pixel as a pixel of interest to the pixel of interest.SELECTED DRAWING: Figure 6
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to an image reading device having a reading unit that reads a document, an image reading method, and a program. [Background technology]

[0002] For example, Patent Document 1 discloses an image processing device that employs a binarization processing method for binarizing image data of securities. This image processing device includes a binarization processing method determination unit and an image acquisition unit. The binarization processing method determination unit determines the binarization processing method based on image data of a portion of the securities. The image acquisition unit converts the image data of the entire securities into a binarized image based on the binarization processing method determined by the binarization processing method determination unit.

[0003] The binarization processing method determination unit determines whether the binarization processing method is the "threshold calculation method" or the "sharpness method." If the binarization processing method is the "threshold calculation method," the image acquisition unit calculates a threshold and acquires a binarized image from the grayscale data of the read image using that threshold. On the other hand, if the binarization processing method is the "sharpness method," the image acquisition unit performs sharpening image processing on the grayscale data of the read image and acquires a binarized image using a predetermined threshold.

[0004] This allows the image processing device to obtain an accurate binary image according to the security being used, such as a check, and from the binary image, it is possible to accurately obtain important text information written on the security, such as the account number, payment amount, payer, payee, and signature. [Prior art documents] [Patent documents]

[0005] [Patent Document 1] Japanese Patent Application Laid-Open No. 2004-127258 Summary of the Invention [Problem to be solved by the invention]

[0006] However, in order to improve the accuracy of recognizing character information in a binary image of a document such as a security obtained by an image reading device, it is desirable that the characters and the background be more easily distinguishable. [Means for solving the problem]

[0007] An image reading device that solves the above problem is an image reading device that reads a document that includes a background and text, and includes a reading unit that reads the document, and a control unit. The control unit includes an image acquisition unit that performs a first process to acquire a read image that includes a background image and a text image by having the reading unit read the document, a threshold setting unit that sets the threshold to be used in the binarization process for each pixel of the read image by performing a threshold setting process that includes a second process to set a threshold to be used in the binarization process for each pixel of the read image, and a binarization processing unit that generates a binary image from the read image based on the threshold set for each pixel, and the threshold setting process includes a process in which the threshold setting unit sets a threshold to the target pixel that is determined based on the luminance values ​​of each of n x n pixels that include the pixel as the target pixel.

[0008] An image reading method that solves the above problem is an image reading method for reading a document that includes a background and text, and includes a reading unit that reads the document, and a control unit, wherein the control unit performs a threshold setting process that includes: a first process of acquiring a read image that includes a background image and a text image by having the reading unit read the document; a second process of setting a threshold for binarizing background pixels, which are pixels of the background image included in the read image, into a first color, which is one of black and white; and a third process of setting a threshold for binarizing character pixels, which are pixels of a text image included in the read image, into a second color, which is the other of black and white, thereby setting the threshold to be used in the binarization process for each pixel of the read image, and generating a binary image from the read image based on the threshold set for each pixel, and wherein the threshold setting process includes a process of setting a threshold determined based on the luminance values ​​of each of n x n pixels that include the pixel as a target pixel, to the target pixel.

[0009] The program that solves the above problem is a program for a computer included in an image reading device that reads a document that includes a background and text, and causes the computer to execute an image reading process, wherein the program includes: an image acquisition unit of the computer performs a first process of acquiring a read image that includes a background image and a text image by having the reading unit read the document; a threshold setting unit of the computer performs a threshold setting process that includes a second process of setting a threshold for binarizing background pixels, which are pixels of the background image included in the read image, into a first color, which is one of black and white; and a third process of setting a threshold for binarizing character pixels, which are pixels of the text image included in the read image, into a second color, which is the other of black and white, thereby setting the threshold to be used in the binarization process for each pixel of the read image; and a binarization processing unit of the computer generates a binary image from the read image based on the threshold set for each pixel, and the threshold setting process includes a process of setting a threshold determined based on the luminance values ​​of n x n pixels that include the pixel as a target pixel to the target pixel. [Brief explanation of the drawings]

[0010] [Figure 1]FIG. 1 is a perspective view showing an image reading device according to an embodiment. [Figure 2] FIG. 2 is a schematic cross-sectional plan view showing the image reading device. [Figure 3] FIG. 3 is a schematic diagram showing a security as an original. [Figure 4] FIG. 4 is a schematic diagram showing a scanned image of a security. [Figure 5] FIG. 5 is a block diagram showing the electrical configuration of the image reading device and the host device. [Figure 6] FIG. 6 is a block diagram showing the functional configuration of the control unit. [Figure 7] FIG. 7 is a flowchart showing the main program. [Figure 8] FIG. 8 is a flowchart showing the edge intensity average calculation processing routine. [Figure 9] FIG. 9 is a flowchart showing a planar area threshold image generation processing routine. [Figure 10] FIG. 10 is a histogram showing the relationship between the luminance value and the number of pixels in a grayscale image. [Figure 11] FIG. 11 is a schematic diagram showing an edge-detected image. [Figure 12] FIG. 12 is a schematic diagram showing an edge-detected image in which edge regions have been separated. [Figure 13] FIG. 13 is a graph illustrating a method for calculating a threshold value in the edge area threshold value calculation process. [Figure 14] FIG. 14 is a schematic diagram showing an image for explaining the edge intensity average calculation process. [Figure 15] FIG. 15 is a schematic diagram showing an image for explaining the edge intensity average calculation process. [Figure 16] FIG. 16 is a schematic diagram showing an image for explaining the planar area threshold image generation process. [Figure 17] FIG. 17 is a schematic diagram showing a binarized image of a comparative example. [Figure 18] FIG. 18 is a schematic diagram showing a binarized image of the embodiment. DETAILED DESCRIPTION OF THE INVENTION

[0011] An example of an image reading device will be described below with reference to the drawings. The image reading device is, for example, a scanner that reads images such as characters and photographs printed on an original such as paper or film.

[0012] <Image reader> 1, the image reading device 11 includes a housing 12. The housing 12 includes a frame, a cover that covers the frame, etc. The housing 12 includes, for example, a first housing portion 13, a second housing portion 14, and a third housing portion 15 that are connected to each other.

[0013] The first housing part 13 is positioned so as to be sandwiched between the second housing part 14 and the third housing part 15. The second housing part 14 and the third housing part 15 are attached so as to be rotatable relative to the first housing part 13. When the second housing part 14 or the third housing part 15 is rotated, the inside of the housing 12 is exposed.

[0014] A transport path 16 is formed in the housing 12. The transport path 16 extends within the housing 12. The transport path 16 is a path along which the document M1 is transported. The transport path 16 is configured, for example, by a slit formed in the housing 12. In one example, the transport path 16 extends between the first housing part 13 and the second housing part 14, and also between the first housing part 13 and the third housing part 15.

[0015] A supply space 17 is formed in the housing 12. A stack of documents M1 before reading is set in the supply space 17. The supply space 17 is connected to the transport path 16. The documents M1 are supplied to the transport path 16 from the stack of documents set in the supply space 17.

[0016] A discharge space 18 is formed in the housing 12. The discharge space 18 accommodates the original M1 after reading. The discharge space 18 communicates with the transport path 16. The original M1 that has passed through the transport path 16 is discharged into the discharge space 18.

[0017] The image reading device 11 may have a partition plate 19 that divides the discharge space 18 in two. As an example, the partition plate 19 divides the discharge space 18 into a first storage space 20 and a second storage space 21. The first storage space 20 stores documents M1 that have been read correctly. The second storage space 21 stores documents M1 that have not been read correctly. The image reading device 11 may have a flap (not shown) that sorts the documents M1 that are discharged into the discharge space 18.

[0018] 2, the image reading device 11 includes a transport unit 23. The transport unit 23 is configured to transport the document M1 along the transport path 16. The transport unit 23 transports the document M1 from the supply space 17 toward the discharge space 18.

[0019] The transport unit 23 has a plurality of rollers. The plurality of rollers are arranged along the transport path 16. The transport unit 23 transports the document M1 from the upstream side to the downstream side of the transport path 16 by the plurality of rollers.

[0020] The transport unit 23 has a pick roller 24. The pick roller 24 is configured to supply the document M1 from the supply space 17 to the transport path 16. The pick roller 24 transports one document M1 that comes into contact with the pick roller 24 from the stack of documents set in the supply space 17 to the transport path 16.

[0021] The transport unit 23 has a transport roller 25. The transport roller 25 transports the document M1 supplied by the pick roller 24. The transport roller 25 is the roller located most upstream in the transport path 16. The transport roller 25 transports the document M1 along the transport path 16 by being driven to rotate.

[0022] The transport unit 23 has a separation roller 26. The separation roller 26 separates the documents M1 supplied by the pick roller 24 into individual sheets. The separation roller 26 faces the transport roller 25. The separation roller 26 separates the documents M1 into individual sheets, for example, by rotating so as to return the documents M1 from the transport path 16 to the supply space 17.

[0023] The transport unit 23 has one or more drive rollers 27. In one example, the transport unit 23 has a plurality of drive rollers 27. The plurality of drive rollers 27 are arranged along the transport path 16. The drive rollers 27 are driven to rotate, thereby transporting the document M1 along the transport path 16.

[0024] The transport unit 23 has one or more driven rollers 28. In one example, the transport unit 23 has a plurality of driven rollers 28. The transport unit 23 has the same number of driven rollers 28 as the drive rollers 27. The plurality of driven rollers 28 are arranged along the transport path 16. The driven rollers 28 face the drive roller 27. The driven rollers 28 are rotated in response to the drive roller 27, thereby transporting the document M1 along the transport path 16.

[0025] The image reading device 11 has one or more reading units 30. More specifically, the image reading device 11 has a first reading unit 31 and a second reading unit 32 as the reading units 30. The reading units 30 are configured to read an image of the original document M1. The reading unit 30 is disposed at a position along the transport path 16. The reading unit 30 reads the original document M1 transported along the transport path 16. The first reading unit 31 reads the first side M11 of the original document M1. The second reading unit 32 reads the second side M12.

[0026] The first reading unit 31 and the second reading unit 32 may read the original document M1 simultaneously or sequentially. That is, the first reading unit 31 and the second reading unit 32 may face each other on the conveying path 16, or may be arranged offset from each other. In one example, the first reading unit 31 is located upstream of the second reading unit 32 on the conveying path 16. Therefore, the first reading unit 31 reads the original document M1 before the second reading unit 32.

[0027] The first reading unit 31 and the second reading unit 32 each have a reading surface. The first reading unit 31 has a first reading surface 33. The second reading unit 32 has a second reading surface 34. A reading surface is a surface of the reading unit that faces the document M1. In one example, the first reading surface 33 faces the first surface M11. The second reading surface 34 faces the second surface M12.

[0028] The reading unit 30 is configured by a plurality of image sensors lined up in one direction. In one example, the reading unit 30 is configured by a plurality of image sensors lined up in the vertical direction. The reading unit is a so-called CISM.

[0029] The image reading device 11 may include a magnetic reading unit 35. The magnetic reading unit 35 is configured to read magnetic ink. The magnetic reading unit 35 is a so-called MICR. The magnetic reading unit 35 reads, for example, characters, symbols, etc. printed in magnetic ink from checks and other valuable securities. Therefore, in one example, the image reading device 11 is a scanner capable of reading checks and other valuable securities. A flap (not shown) may sort the document M1 based on the reading result of the magnetic reading unit 35.

[0030] The image reading device 11 has three or more nip sections that curve the original M1 in a wavy manner. For example, at a position upstream of the reading position, the first pressure roller 41 presses the original M1 against the pressure receiving section 38. At a first reading position downstream of the first pressure roller 41, the original M1 is pressed against the first reading section 31 by the second pressure roller 42. At a second reading position downstream of the first pressure roller 42, the original M1 is pressed against the second reading section 32 by the third pressure roller 43. This causes the original M1 to curve in a wavy manner, applying tension to the original M1. Applying tension to the original M1 smooths out wrinkles, folds, and the like that have occurred in the original M1. As a result, the first reading section 31 and the second reading section 32 can read the original M1 in a state where wrinkles, folds, and the like have been removed.

[0031] <Securities and their scanned images> With reference to Figure 3, a description will be given of a security to be read by the image reading device 11 and its read image GD(SD). The security 50 shown in Figure 3 is, for example, a check. The security 50 includes a background 51 and characters 52. The background 51 includes a background pattern 53 and a design 54 including figures and pictures. The characters 52 include printed characters 55 and handwritten characters 56. If the security 50, which is an example of a document, is a check, its size is 85 mm long x 185 mm wide, and its area is 15,725 square mm.

[0032] When character recognition is performed using the read image read by the image reading device 11 as is, the background 51 may get in the way and reduce the recognition accuracy of the characters 52. Therefore, in the image reading device 11 of this embodiment, the read image of the security 50 is converted into a binary image, and then character recognition is performed using the binary image.

[0033] In the cited document 1, a binarization process is performed using one of two methods: a threshold calculation method and a "sharpness method." However, the binarized image does not sufficiently distinguish between the background and the characters. For example, depending on the threshold, part of the background may turn black, which may blend in with the black of the characters, reducing the accuracy of character recognition. The image reading device 11 of this embodiment provides a processing method for generating a binarized image from a read image in which the background 51 and the characters 52 are more clearly distinguishable.

[0034] 4 is a grayscale image obtained by converting the color scanned image SD. The scanned image GD includes a background image 61 corresponding to the background 51 and a character image 62 corresponding to the character 52. The background image 61 includes a background pattern image 63 corresponding to the background pattern 53 and a design image 64 corresponding to the design 54. The character image 62 includes a printed character image 65 corresponding to the printed character 55 and a handwritten character image 66 corresponding to the handwritten character 56.

[0035] <Electrical configuration of image reading device 11> Next, the electrical configuration of the image reading device 11 will be described with reference to FIG. 5, the image reading device 11 includes a reading unit 30, a display unit 71, a drive unit 72, and a control unit 70. The control unit 70 includes a storage unit 73. The reading unit 30 includes a first reading unit 31 and a second reading unit 32.

[0036] The image reading device 11 is connected to a host device 100 so as to be able to communicate with the host device 100. The connection between the image reading device 11 and the host device 100 may be wired or wireless. The host device 100 may be a personal computer (PC), a smartphone, a mobile phone, or the like. More specifically, the control unit 70 of the image reading device 11 communicates with the host device 100.

[0037] The reading unit 30 reads an image of the security 50 along the transport path as it is transported by the drive unit 72 driving transport rollers, etc. The read image read by the reading unit 30 is stored in a predetermined storage area of ​​the storage unit 73. The control unit 70 performs various processes on the read image SD read from the storage unit 73 to generate a binary image BI (FIG. 18). The storage unit 73 stores a program PG that executes various processes, including the process of generating the binary image BI from the read image SD. The control unit 70 transmits image data such as the read image SD and the binary image BI read by the reading unit 30 from the object to be read, such as a security, to the host device 100.

[0038] The control unit 70 may include a computer including a microprocessor or the like. The computer may include a storage unit 73 (memory) including a RAM, a non-volatile memory, or the like. In other words, the storage unit 73 may be included in whole or in part in the control unit 70. The storage unit 73 stores the program PG.

[0039] The program PG includes the programs shown in the flowcharts of FIGS. 7 to 9. The control unit 70 is not limited to a system that performs all of its processing using software. For example, the control unit 70 may include a dedicated hardware circuit (e.g., an application-specific integrated circuit (ASIC)) that performs hardware processing for at least some of the processing it performs. That is, the control unit 70 may be configured as a circuit including one or more processors that operate according to a computer program (software), one or more dedicated hardware circuits that perform at least some of the various processes, or a combination thereof. The processor includes a CPU and memory such as RAM and ROM, and the memory stores program code or instructions configured to cause the CPU to perform processing. The memory, i.e., computer-readable medium, includes any available medium that can be accessed by a general-purpose or special-purpose computer.

[0040] The control unit 70 includes, for example, a CPU (Central Processing Unit). The control unit 70 is equipped with a computer including the CPU and a storage unit 73. The control unit 70 performs various processes to realize various functions of the image reading device 11 by the CPU executing a program PG.

[0041] The program PG includes the programs shown in the flowcharts of Figures 7 to 9. The flowchart shown in Figure 7 corresponds to a main program that causes the CPU to execute processing for generating a binarized image BI from a scanned image SD of a security. The main program includes a group of programs that perform various processes for generating a binarized image BI from the scanned image SD. Figures 8 and 9 are flowcharts showing two programs in the group of programs.

[0042] In detail, the main program shown in Fig. 7 includes an image acquisition program, an area separation program, an edge area threshold calculation program, a threshold calculation program, an edge intensity average calculation program, a flat area threshold image generation program, an edge area threshold image generation program, and a binarization processing program. The program shown in Fig. 8 is the edge intensity average calculation program. The program shown in Fig. 9 is the flat area threshold image generation program.

[0043] <Functional Configuration of Control Unit 70> Next, the functional configuration of the control unit 70 will be described. The control unit 70 has multiple functional units configured by the computer's CPU executing various programs stored in the storage unit 73. That is, the control unit 70 includes an image acquisition unit 81, a region separation unit 82, an edge region threshold calculation unit 83, a threshold calculation unit 84, an edge intensity average calculation unit 85, a planar region threshold image generation unit 86, an edge region threshold image generation unit 87, and a binarization processing unit 88. The edge region threshold calculation unit 83, the planar region threshold image generation unit 86, the edge region threshold image generation unit 87, etc. configure an example of a threshold setting unit.

[0044] These functional units that configure the control unit 70 will be described below with reference to FIGS. The image acquisition unit 81 is configured by a CPU that executes an image acquisition program. The image acquisition unit 81 acquires a read image SD read by the reading unit 30. The read image SD includes a background image 61 and a character image 62. The image acquisition unit 81 converts the R, G, and B values ​​of all pixels according to the resolution into luminance values ​​(density values). In other words, the read image SD acquired by the image acquisition unit 81 from the reading unit 30 is an RGB color image. The image acquisition unit 81 converts the read image SD, which is a color image, into a read image GD, which is a grayscale image. The image acquisition unit 81 performs a first process of acquiring a read image GD(SD), which includes the background image 61 and the character image 62, by having the reading unit 30 read the original M1. The image acquisition unit 81 converts the RGB pixel values ​​of the read image SD into luminance values, and then creates a luminance histogram H1 (see FIG. 10) for the read image GD, which is a grayscale image.

[0045] The image acquisition unit 81 may detect edge pixels E (see FIG. 11). Here, pixels forming the background image 61 are called plane pixels P, and pixels forming the character image 62 are called edge pixels E. The edge pixels E have a higher density than the plane pixels P. The image acquisition unit 81 calculates the density difference between a target pixel and its surrounding pixels for each pixel in the grayscale image to generate a frequency distribution of the density difference for each target pixel. The frequency of this frequency distribution is the number of pixels. The image acquisition unit 81 detects, as edge pixels E, target pixels that satisfy an edge pixel detection condition in which the density difference frequency distribution is biased toward a larger absolute value of the density difference. Target pixels that do not satisfy the pixel detection condition are determined to be plane pixels P (see FIG. 11). In this way, the image acquisition unit 81 detects edge pixels E from the grayscale image. That is, the image acquisition unit 81 detects edge pixels E and plane pixels P from the grayscale image. In this way, the image acquisition unit 81 acquires the edge-detected image EG shown in FIG. 10. This edge-detected image EG is used by the region separation unit 82. The processing executed by the image acquisition unit 81 corresponds to the first processing. That is, the first processing includes a process of reading the read image SD including the background image 61 and the character image 62.

[0046] The region separation unit 82 is configured with a CPU that executes a region separation program. The region separation unit 82 executes a process of generating an edge region EA (see FIG. 12) by connecting portions determined to be edge pixels in the input image. That is, the region separation unit 82 separates an edge region EA, which is a region formed by connecting edge pixels E, in the edge-detected image EG (FIG. 11) input from the image acquisition unit 81. More specifically, the region separation unit 82 searches eight directions around the edge pixel E, and connects any identical edge pixels E. By performing this connection process for all edge pixels E, the edge region EA is separated. The region separation unit 82 also counts the number of pixels for each obtained edge region EA and stores the counted number in the storage unit 73.

[0047] The edge area threshold calculation unit 83 is configured by a CPU that executes an edge area threshold calculation program. The edge area threshold calculation unit 83 calculates a threshold for each edge area EA separated by the area separation unit 82. The threshold for the edge area EA is determined by creating a histogram H2 (FIG. 13) within the edge area EA, and setting the brightness value when the cumulative number of pixels from the side with the lowest brightness value reaches a certain value as the threshold Th1. This certain value is obtained by multiplying the total number of pixels in the edge area EA by a predetermined ratio. One example of the predetermined ratio is "0.4." The certain value is set to the total number of pixels in the edge area EA × 0.4. Instead of "0.4," the predetermined ratio may be another value within a range of, for example, 0.2 to 0.6, or a value outside this range may also be used.

[0048] The threshold calculation unit 84 is configured by a CPU that executes a threshold calculation program. The threshold calculation unit 84 calculates the first threshold GTh using the histogram H1 of the entire image shown in Fig. 10 and the degree of separation S obtained by a predetermined threshold selection process described below. The processing content of the predetermined threshold selection process is described below.

[0049] First, the mean mt and variance σ of the histogram H1 of the entire image 2 Next, determine the threshold T arbitrarily. In the range (first class) smaller than the threshold T (boundary value T) of the histogram H1, the mean m1 and variance σ1 2 In the range (second class) of histogram H1 greater than threshold T, the mean m2 and variance σ2 are calculated. 2 Ask for.

[0050] The intra-class variance σ is calculated from the following equation (1): w 2 Ask for.

[0051]

number

[0052] Here, ω1 is the number of pixels in the first class, and ω2 is the number of pixels in the second class. Furthermore, the inter-class variance σ b2 Ask for.

[0053]

number

[0054] Here, ω1 is the number of pixels in the first class, ω2 is the number of pixels in the second class, m1 is the mean of the first class, and m2 is the mean of the second class. The degree of separation S is calculated using the following formula (3).

[0055]

number

[0056] Next, a new threshold value T is set, and the degree of separation S is similarly calculated for the next threshold value T. When the degree of separation S is calculated for each threshold value T from 0 to 255, the threshold value T at which the degree of separation S is greatest among those threshold values ​​T is set as the first threshold value GTh. This first threshold value GTh is an example of the second determination value.

[0057] The edge intensity average calculation unit 85 is configured by a CPU that executes an edge intensity average calculation program. The edge intensity average calculation unit 85 obtains the edge intensity value of the pixel of interest. The variance of the brightness values ​​in an n×n range PR from the pixel of interest is calculated. The edge intensity average calculation unit 85 sets the calculated variance value as the edge intensity value. Here, as an example, n=5, and an example of calculating the variance of the brightness values ​​in a 5×5 range PR from the pixel of interest will be described.

[0058] The edge intensity average calculation unit 85 performs the 5x5 calculation as follows. For ease of explanation, the scanned image GD shown in FIG. 14 is assumed to be composed of 7x7 pixels as a whole. The smallest box in the figure represents one pixel. The numbers inside the pixels correspond to addresses. The horizontal direction is the row direction, and the vertical direction is the column direction. Starting from the top, the first column, second column, etc. are arranged, and starting from the left, the first row, second row, etc. are arranged. In the example shown in FIG. 14, the pixel at address "17" is the pixel of interest IP. All brightness values ​​in the 5x5 range PR centered on the pixel of interest IP are obtained, and the variance is calculated. This calculation is performed for all pixels by sequentially changing the pixel of interest IP.

[0059] Here, in order to shorten the calculation processing time, the edge intensity average calculation unit 85 may skip every other pixel in at least one of rows and columns when selecting a pixel of interest in calculating the edge intensity value. For example, as shown in FIG. 15, the edge intensity average calculation unit 85 may calculate the edge intensity value by selecting only pixels in even rows and even columns as the pixel of interest IP. In FIG. 14, candidate pixels CP for the pixel of interest IP that will be selected as the pixel of interest in the next calculation or later after the calculation of the current pixel of interest IP are indicated by a two-dot chain line. In this way, only pixels in even rows and even columns may be selected as the pixel of interest IP(CP).

[0060] In this case, when an n×n (for example, 5×5) range PR is acquired, such as address "9," some pixels in the range PR may fall outside the read image GD, as shown in Fig. 15. In this case, as shown in Fig. 15, for pixels in the range PR that fall outside the read image GD, the brightness values ​​of adjacent pixels may be copied and used.

[0061] In this way, the edge intensity average calculation unit 85 obtains the variance for each pixel of interest IP as the edge intensity value EI. That is, the edge intensity average calculation unit 85 calculates the edge intensity value EI for all pixels of the scanned image GD. After calculating the edge intensity values ​​EI for all pixels, the edge intensity average calculation unit 85 calculates the average value of the edge intensity values ​​EI. That is, the edge intensity average calculation unit 85 calculates the average edge intensity value EM, which is the average value of the edge intensity values ​​EI, by dividing the sum of the edge intensity values ​​EI for all pixels by the number of pixels.

[0062] 15, the edge intensity average calculation unit 85 selects only pixels in even rows and even columns as the target pixel IP and performs calculation processing. Therefore, the amount of calculation by the edge intensity average calculation unit 85 to calculate the edge intensity value EI for each pixel and the edge intensity average EM of the scanned image GD is reduced to about 1 / 4. Therefore, the calculation processing time required by the edge intensity average calculation unit 85 is reduced to about 1 / 4.

[0063] Furthermore, when the edge intensity average calculation unit 85 acquires the brightness values ​​of n×n (for example, 5×5), it calculates the square sum average std and average m (average of the sum) and stores them in the storage unit 73. This is because the planar area threshold image generation unit 86, which performs the next process, uses the square sum average std and average m of the brightness values ​​of n×n. Here, for the square sum average std, the edge intensity average calculation unit 85 adds up all the values ​​obtained by squaring the brightness values ​​of each pixel to calculate the number of pixels "n 2 (for example, "25"). The edge intensity average calculation unit 85 calculates the average by adding up the luminance values ​​of all pixels in an n×n (for example, 5×5) pixel array to obtain the average value of n 2 (For example, "25"). The process of reading out the n×n luminance values ​​from the memory unit 73 while sequentially changing the pixel of interest takes time. For this reason, this process is avoided from being performed separately by the edge intensity average calculation unit 85 and the planar area threshold image generation unit 86. When calculating the variance of the n×n luminance values, the edge intensity average calculation unit 85 calculates the square sum average std and the mean m together using the n×n luminance values ​​acquired at that time. This reduces the total processing time required from the start of reading the document to the generation of the binarized image BI (Figure 18).

[0064] The planar region threshold image generating unit 86 is configured by a CPU that executes a planar region threshold image generating program. The planar region threshold image generating unit 86 sets a threshold for each pixel of the entire image, thereby generating a planar region threshold image TI (see FIG. 16 ) in which a threshold is set for at least each pixel belonging to a planar region. In this embodiment, the planar region threshold image generating unit 86 sets thresholds not only for pixels in planar regions, but also for pixels in edge regions EA in this process.

[0065] The planar region threshold image generation unit 86 performs a process of calculating the threshold value Th to be set for all pixels of the scanned image GD using the first threshold value GTh calculated by the edge region threshold calculation unit 83 and the edge intensity average value EM calculated by the edge intensity average calculation unit 85. For all pixels of the scanned image GD, it sequentially determines whether the target pixel satisfies the following conditions (a) to (d), and if the condition is met, it determines the threshold value Th to be set when that condition is met. The determined threshold value Th is then set as the pixel value of the target pixel. By setting the threshold value Th for all pixels in this way, a planar region threshold image TI is generated.

[0066] Below, the conditions (a) to (d) and the threshold value Th to be set when each condition is met, as well as the calculation method when calculation is required to obtain the threshold value Th, will be described. (a) Determine whether a first condition, that is, the luminance value of the pixel of interest > Imax, is met. If this first condition is met, set the threshold value Th of the pixel of interest to "0" (Th=0). That is, set a threshold value Th that turns the pixel of interest white. Here, the constant Imax is an example of a first determination value. For example, Imax=200. The constant Imax is set to a high luminance value that can clearly determine that the pixel is a background pixel. The constant Imax may be a value within the range of 180≦Imax≦230. Of course, a value outside this range may be used as long as it is a high luminance value that can clearly determine that the pixel is a background pixel. Note that the process related to (a) corresponds to an example of a second process that sets a threshold value that binarizes background pixels into a first color (white), which is one of black and white.

[0067] (b) Determine whether or not the second condition that the luminance value of the target pixel > GTh and the edge intensity value < EM is satisfied. Here, GTh is an example of the second determination value and is the aforementioned first threshold value GTh calculated by the threshold calculation unit 84. The edge intensity value is the aforementioned edge intensity value EI calculated by the edge intensity average calculation unit 85. EM is the aforementioned edge intensity average value EM calculated by the edge intensity average calculation unit 85. That is, the control unit 70 determines whether or not the second condition that the luminance value BV of the target pixel is greater than the threshold value GTh and the edge intensity value EI is less than the edge intensity average value EM is satisfied. According to this second condition, it is determined whether or not the target pixel can be regarded as a background pixel with a high probability. When this second condition is satisfied, the threshold value Th of the target pixel is set to "0" (Th = 0). That is, the threshold value Th for making the target pixel white is set. Note that the process according to (b) corresponds to an example of the second process of setting a threshold value for binarizing a background pixel into the first color (white) which is one of black and white.

[0068] (c) Determine whether or not the third condition that the luminance value of the target pixel > Vmin is satisfied. Here, the constant Vmin is an example of the third determination value and is a value represented by the product of the first threshold value GTh and the constant Cm. Vmin = GTh * Cm. Note that the symbol "*" is an arithmetic symbol representing a product. As an example, the constant Cm = 0.4. This constant Cm is set to a value that can set Vmin as a relatively low luminance value such that most pixels with a luminance value below Vmin can be character pixels. The constant Vmin which is an example of the third determination value is a value that is Cmin times the first threshold value GTh which is an example of the second determination value. When this third condition is satisfied, the threshold value Th of the target pixel is set to "255" (Th = 255). That is, the threshold value Th for making the target pixel black is set. The constant Cm may be, for example, a value within the range of 0.2 ≤ Cm ≤ 0.6. Of course, as long as Vmin can be set as a relatively low luminance value such that most pixels with a luminance value below Vmin can be character pixels, the constant Cm may be a value outside this range. Note that the process according to (c) corresponds to an example of the third process of setting a threshold value for binarizing a character pixel into the second color (black) which is the other of black and white.

[0069] (d) For pixels that do not satisfy any of the conditions (a), (b), or (c), the standard deviation t is calculated based on the n×n luminance values ​​of the pixel of interest. The planar region threshold image generation unit 86 uses the standard deviation t and the mean m to calculate the threshold value Th using the formula Th=t+m*cf. Here, cf is a constant, and is, for example, a value within the range of 0.5≦cf≦1.2. For example, cf=0.8 may be used. The constant cf may also be a value outside the above range. The planar region threshold image generation unit 86 calculates the standard deviation t by reading the square sum mean std and the mean m based on the n×n luminance values ​​from the storage unit 73 and using them.

[0070] Therefore, the planar region threshold image generating unit 86 does not need to access the storage unit 73 and read out the n×n luminance values ​​that the edge intensity average calculating unit 85 used to calculate the edge intensity value EI. In other words, the edge intensity average calculating unit 85 and the planar region threshold image generating unit 86 do not need to separately read the pixel values ​​of the n×n pixels. The process of reading the n×n luminance values ​​of all pixels centered on the pixel of interest only needs to be done once. This allows the control unit 70 to reduce the calculation time required to set the threshold value Th for all pixels.

[0071] The planar area threshold image generating unit 86 obtains the standard deviation t by the following process. t=√{m^2*abs(std-m^2) / nP} Here, std is the mean sum of squares, and nP is a constant. In the above formula, the operator symbol "^" indicates exponentiation, and "abs" indicates absolute value.

[0072] FIG. 16 shows a threshold image TI in which the threshold value Th determined by the above processes (a) to (d) is set. In FIG. 16, the threshold value Th for each pixel determined by the above processes (a), (b), (c), and (d) are indicated as "a," "b," "c," and "d," respectively. The planar region threshold image generation unit 86 performs the above processes (a) to (d) on the pixels in the even-numbered columns EC. The above processes (a) to (d) are not performed on the pixels in the odd-numbered columns OC. The threshold value set for the pixels in the even-numbered columns EC is copied for the pixels in the odd-numbered columns OC. In FIG. 16, the arrow mark "↑" indicates that the same value as the threshold value of the adjacent pixel indicated by the arrow is copied as the threshold value Th.

[0073] As shown in FIG. 16, for pixels that fall under the processing (d), the planar region threshold image generation unit 86 also sets the same threshold value to the pixel adjacent to this pixel (the next pixel in address order). This skips the processing of the next pixel. Also, only the even-numbered columns EC are processed, and the odd-numbered columns OC copy the value of the even-numbered column EC immediately above. In this way, the planar region threshold image generation unit 86 creates a threshold image TI.

[0074] The edge area threshold image generation unit 87 is configured by a CPU that executes an edge area threshold image generation program. The edge area threshold image generation unit 87 compares the threshold value Th1 of the edge area EA calculated by the edge area threshold calculation unit 83 with the threshold value Th of the threshold image TI generated by the planar area threshold image generation unit 86. The edge area threshold image generation unit 87 updates the threshold image TI by resetting the larger of the compared values ​​as the threshold value Th. In this way, the threshold value Th is set for each pixel for all pixels.

[0075] The binarization processing unit 88 is configured by a CPU that executes a binarization processing program. The binarization processing unit 88 generates a binarized image by binarizing each pixel using the threshold value Th set in the threshold image TI.

[0076] <Operation of the embodiment> Next, the operation of the image reading device 11 will be described. The user places a security 50 such as a check on the image reading device 11. The user causes the image reading device 11 to read the image of the security 50. The image reading device 11 reads the image of the security 50.

[0077] The user issues a command to execute a scan by operating the host device 100 or the image reading device 11. Upon receiving the scan command, the control unit 70 starts reading the document M1 that has been set.

[0078] The control unit 70 transports the original M1 by controlling the driving of the drive unit 72. When the second reading resolution is designated, the control unit 70 transports the original M1 at high speed. The reading unit 30 reads the document M1 while it is being transported at the reading position. The reading unit 30 outputs a read image SD obtained by reading the document M1. The control unit 70 stores the read image SD in a predetermined storage area of ​​the storage unit 73. The read image SD is, for example, a color image. The control unit 70 converts the read image SD into a read image GD consisting of a grayscale image. In this way, the image acquisition unit 81 acquires the read image GD.

[0079] The processing performed by the control unit 70 when it executes the program PG will be described below with reference to the flowchart shown in FIG. In step S11, the control unit 70 generates a histogram. Specifically, the image acquisition unit 81 generates a histogram H1 shown in FIG.

[0080] In step S12, the control unit 70 executes a region separation process. In step S13, the control unit 70 calculates an edge region threshold value. In step S14, the control unit 70 calculates a threshold value.

[0081] In step S15, the control unit 70 calculates the average edge strength. In step S16, the control unit 70 generates a planar area threshold image TI. In step S17, the control unit 70 modifies the edge threshold value.

[0082] In step S18, the control unit 70 executes binarization processing, that is, the control unit 70 generates a binarized image using a threshold value Th. The control unit 70 executes the edge intensity average calculation process in step S15 in detail as follows, based on the flowchart shown in FIG.

[0083] First, in step S21, the control unit 70 selects a pixel of interest in an even-numbered row and an even-numbered column. In step S22, the control unit 70 calculates the edge intensity value of the pixel of interest. That is, the control unit 70 calculates the variance using the luminance values ​​of n×n pixels centered around the pixel of interest, and sets the variance as the edge intensity value. The control unit 70 sets the calculated edge intensity value for the pixel of interest.

[0084] In step S23, the control unit 70 applies an edge strength value to each of the pixels to the right, below, and below right of the pixel of interest. That is, the control unit 70 sets the same edge strength value as that of the pixel of interest to each of the pixels adjacent to the pixel of interest that are located to the right, below, and below right of the pixel of interest.

[0085] In step S24, the control unit 70 calculates the square sum average and the mean, and stores them in the storage unit 73. That is, the control unit 70 calculates the square sum average std and the mean m using the luminance values ​​of the n×n pixels read in to calculate the variance in step S22. The control unit 70 calculates the sum of the squares of the luminance values ​​of the n×n pixels by multiplying the sum of the squares of the luminance values ​​of the n×n pixels by the number of pixels n. 2 The control unit 70 calculates the square sum average std by dividing the sum of the luminance values ​​of the n×n pixels by the number of pixels n 2 The control unit 70 calculates the average m by dividing the sum of squares std by the mean m. The control unit 70 stores the calculated mean sum of squares std and the mean m in the storage unit 73 for use in subsequent processing.

[0086] In step S25, the control unit 70 determines whether or not all the target pixels have been processed. If all the target pixels have not been processed, the process returns to step S21, and the next target pixel is selected.

[0087] In this way, the processing of steps S22 to S24 is executed for the next pixel of interest. Then, in step S25, the pixel of interest is changed to the next pixel of interest, and the processing of steps S22 to S24 is executed until all pixels of interest have been processed. When the processing of steps S22 to S24 has been completed for all pixels of interest that should have been selected in step S21, the determination in step S25 is affirmative, and the process proceeds to step S26.

[0088] In step S26, the control unit 70 calculates the edge intensity average value. That is, the edge intensity average calculation unit 85 calculates the edge intensity average value EM, which is the average of the edge intensity values ​​EI, by dividing the sum of the edge intensity values ​​EI of all pixels by the number of pixels. Then, the control unit 70 ends this routine.

[0089] The control unit 70 executes the planar region threshold image generation process in step S16 in detail as follows, based on the flowchart shown in Fig. 9. A threshold value Th is set for each pixel of all pixels in the scanned image GD. That is, the planar region threshold image generation unit 86 of the control unit 70 sets the threshold value Th for each pixel by sequentially determining whether the target pixel satisfies the conditions (a) to (d) described above. The planar region threshold image generation unit 86 may select all pixels as the target pixel in sequence, but here we will explain an example in which a pixel in an even-numbered column is selected.

[0090] First, in step S31, a pixel of interest in an even-numbered column is selected. In step S32, the control unit 70 determines whether the luminance value BV of the pixel of interest is greater than IMax. IMax is, for example, 200. When the luminance value of the pixel of interest is greater than IMax, IMax is set to a value that allows the pixel of interest to be clearly considered a background pixel. If BV>IMax holds, the control unit 70 proceeds to step S33; if BV>IMax does not hold, the control unit 70 proceeds to step S34.

[0091] In step S33, the control unit 70 sets the threshold Th = 0 for the target pixel. This threshold Th = 0 is a threshold that can turn the target pixel white through binarization processing. In step S34, the control unit 70 determines whether the luminance value BV of the target pixel is greater than GTh and the edge intensity value EI is less than EM. Here, GTh is the threshold GTh, and EM is the average edge intensity value EM. That is, the control unit 70 determines whether the luminance value BV of the target pixel satisfies the second condition that it is greater than the threshold GTh and the edge intensity value EI is less than the average edge intensity value EM. The target pixels that satisfy this second condition can be regarded as background pixels with a high probability. When the second condition BV > GTh and EI < EM holds, the control unit 70 proceeds to step S35; when the second condition does not hold, the control unit 70 proceeds to step S36.

[0092] In step S35, the control unit 70 sets the threshold Th = 0 for the target pixel. This threshold Th = 0 is a threshold that can turn the target pixel white through binarization processing. In step S36, the control unit 70 determines whether the luminance value BV of the target pixel is greater than VMin. Here, VMin is a value that is a constant multiple of the first threshold GTh. The constant may be, for example, a value of 0.2 or more and 0.6 or less. When BV > VMin holds, the process proceeds to step S37; when BV > VMin does not hold, the process proceeds to step S38.

[0093] In step S37, the control unit 70 sets the threshold Th = 255 for the target pixel. This threshold Th = 255 is a threshold that can turn the target pixel black through binarization processing. In step S38, the control unit 70 sets the threshold Th = t + m * cf. That is, the control unit 70 calculates the threshold Th using the standard deviation t and the average m based on the luminance values of n × n. At this time, the control unit 70 reads the quadratic mean std and the average m used for calculating the standard deviation t from the storage unit 73.

[0094] In step S39, the control unit 70 determines whether all target pixels have been processed. If not, the process returns to step S31, where the next target pixel is selected. The control unit 70 selects pixels in the even-numbered columns as target pixels in order. Note that if the threshold value Th is set by the process of step S38, that is, if the threshold value Th is set because the condition (d) above is met, the control unit 70 sets the same threshold value Th for the pixel next to the target pixel (see FIG. 16). In this case, in step S31, the control unit 70 skips the next pixel and selects the pixel immediately following it as the target pixel.

[0095] In this way, the control unit 70 sequentially executes the processes of steps S32 to S38 for the next pixel of interest until the threshold value Th is determined. Then, in step S39, the control unit 70 changes to the next pixel of interest and similarly executes the processes of steps S32 to S38 until all pixels of interest have been determined. Then, when the control unit 70 has finished setting the threshold value Th for the last pixel of interest, the determination in step S39 is affirmative, and the control unit 70 ends this routine. In this way, the planar region threshold image generation unit 86 of the control unit 70 generates the planar region threshold image TI shown in FIG.

[0096] 16, the control unit 70 executes an edge threshold correction process in step S17. That is, the control unit 70 compares the threshold value Th1 of the edge area EA calculated in step S13 with the threshold value Th set for the corresponding pixel in the planar area threshold image TI. The control unit 70 updates the threshold value Th to the larger of the two threshold values ​​Th1 and Th. That is, when the control unit 70 determines that the threshold value Th1 is larger than the threshold value Th, the control unit 70 updates (corrects) the planar area threshold image TI by rewriting the threshold value Th of the corresponding pixel in the planar area threshold image TI with the threshold value Th1. The control unit 70 generates a threshold image through this update process (correction process).

[0097] The control unit 70 generates a binary image BI by performing binarization processing on the scanned image GD using the threshold value Th set for each pixel that makes up the threshold image. In this way, the image scanning device 11 continuously scans multiple standard-sized documents M1, such as checks, using the scanning unit 30. Processing from the start of scanning to the generation of the binary image BI is performed at high speed. As a result, the image scanning device 11 outputs the binary image BI at a processing speed of 60 to 100 sheets per minute. When checks are scanned continuously, binary images BI of checks in which the characters are easily distinguishable from the background can be obtained at high speed. This allows for accurate and fast recognition of the character information on the checks.

[0098] Fig. 17 shows a binarized image BIC of a comparative example, and Fig. 18 shows a binarized image of this embodiment. Note that the binarized images BIC and BI shown in Figs. 17 and 18 include a background image 91 corresponding to the background and a character image 92 corresponding to the characters. The background image 91 includes a background pattern image 93 corresponding to the background pattern 53 and a design image 94 corresponding to the design 54. The character image 92 includes a printed character image 95 corresponding to the printed character 55 and a handwritten character image 96 corresponding to the handwritten character 56.

[0099] 17, part of the design image 94 in the background image 91 is black. Therefore, part of the printed character image 95 and part of the handwritten character image 96 cannot be recognized due to the black part of the design image 94.

[0100] In contrast, in the binarized image BI of the embodiment shown in FIG. 18, the black areas are significantly reduced in the pattern image 94 of the background image 91. In other words, in the binarized image BI, binarization processing is performed such that the pattern image 94 of the background image 91 appears gray overall. Therefore, the black areas are significantly reduced in . At least, a portion of is black. As such, the entire printed character image 95 and the entire handwritten character image 96 can be recognized without being obstructed by the black portions of the pattern image 94. Therefore, when character recognition is performed on a scanned image of a negotiable instrument such as a check using the image reading device 11, characters can be recognized with high recognition accuracy.

[0101] Here, we will explain how to verify that the binary check image BI is an image in which the characters are easily recognizable. Document M1 shown in Figure 3 is a check with overlapping areas where the characters and background overlap. The binary check image BI contains multiple overlapping areas of 1 square millimeter that satisfy the following conditions: An overlapping area is an area where the characters and background are adjacent. Therefore, an overlapping area contains pixels from the character area (including the area where the characters and background overlap) and pixels from areas of only the background.

[0102] The average luminance value of a 1 mm2 area in the background of the check (document M1) can be confirmed by measuring the color of the check with a colorimeter. Alternatively, an image of the check photographed with a camera can be displayed on a display, and the display data can be measured with a colorimeter.

[0103] The average brightness value of the 1 square millimeter overlap region of the binary image BI can be confirmed, for example, by printing the binary image BI in grayscale on white paper and checking the brightness value of the image data read by a scanner, or by measuring the color with a colorimeter.One example of a colorimeter is a colorimeter equipped with an etalon, which can be used to measure the color of a check image or the binary image BI displayed on a display.

[0104] In the 1 square millimeter overlap area on the check shown in Figure 3, the first average brightness value, which is the average brightness value of the character area, is BV1, and the second average brightness value, which is the average brightness value of the background area, is BV2. The difference Δ1 between these average brightness values ​​BV1 and BV2 is expressed as Δ1 = abs(BV1 - BV2).

[0105] In the 1 square millimeter overlap region of the binarized image BI shown in Figure 18, the third average luminance value, which is the average luminance value of the character region, is BV3, and the fourth average luminance value, which is the average luminance value of the background region, is BV4. The difference Δ2 between these average luminance values ​​BV3 and BV4 is expressed as Δ2 = abs(BV3 - BV4). Note that the average luminance values ​​BV1 and BV2 obtained from the check and the average luminance values ​​BV3 and BV4 obtained from the binarized image BI shown in Figure 18 must be compared at the same gradation value. For this reason, in this example, the comparison is made at 256 gradations.

[0106] The difference between the differences Δ1 and Δ2 obtained from the corresponding overlapping areas in the same position on the check and the binarized image BI is expressed as abs(Δ1-Δ2). The expression abs(Δ1-Δ2) that represents this difference is used as a criterion for evaluating whether the binarized check image BI is an image in which characters are easy to recognize.

[0107] In the binarized image BI of this embodiment, in which characters are easily recognized, there are multiple overlapping areas of 1 square millimeter that satisfy the difference abs(Δ1-Δ2) shown in the above formula of 50 or more. For example, the number n of overlapping areas arbitrarily selected from the binarized image BI is assumed to be 10. In this case, in the binarized image BI of the embodiment shown in FIG. 18, there are eight or more overlapping areas that satisfy abs(Δ1-Δ2)≧50. In contrast, in the binarized image BIC of the comparative example shown in FIG. 17, there is one or less overlapping areas (0 or 1) that satisfy abs(Δ1-Δ2)≧50.

[0108] The evaluation can be made in roughly the same way even when n exceeds 10. That is, in the binarized image BI of this embodiment, of n overlapping areas selected arbitrarily, 80% or more of the total overlapping areas satisfy abs(Δ1-Δ2) ≧ 50. In contrast, in the binarized image BIC of the comparative example, the number of overlapping areas that satisfy abs(Δ1-Δ2) ≧ 50 is less than 20%, and in particular less than 10%. The percentage of overlapping areas in the binarized image BIC that satisfy abs(Δ1-Δ2) ≧ 50 varies slightly depending on the type of check and the model of the existing image reading device used to read the check, but even when this type of variation is taken into account, the percentage of overlapping areas that satisfy abs(Δ1-Δ2) ≧ 50 in the binarized image BIC is still less than 20%.

[0109] Alternatively, the following evaluation method may be used instead of the above evaluation method. The average luminance value L1 of a predetermined area A1 in the character area of ​​a check and the average luminance value B1 of a predetermined area A2 in the background area of ​​the check are calculated using the measurement results obtained by measuring the color of the check with a colorimeter. The predetermined areas A1 and A2 have a predetermined area. This predetermined area may be, for example, 0.1 square mm, 1 square mm, 10 square mm, or any other arbitrary area. Using the calculation results, the difference in luminance between the character area and background area before binarization can be considered to be abs(L1-B1).

[0110] The average luminance value L2 of the predetermined area A1 in the character area of ​​the binarized check image BI after binarization processing, and the average luminance value B2 of the predetermined area A2 in the background area of ​​the binarized image BI are calculated using the measurement results obtained by colorimetry using a colorimeter, or the data after binarization processing. When measuring colors using a colorimeter, the display data displayed on a display is measured using, for example, a colorimeter equipped with an etalon. The predetermined areas A1 and A2 have a predetermined area, which may be, for example, 0.1 square mm, 1 square mm, 10 square mm, or any other arbitrary area. Using the calculation results, the difference in luminance between the character area and background area after binarization processing can be considered as abs(L2 - B2).

[0111] In the binarized image BI of this embodiment, among, for example, 10 pairs (n=10) of arbitrarily selected predetermined regions A1 and A2, there are a plurality of pairs of A1 and A2 for which abs(abs(L1-B1)-abs(L2-B2))≧50. That is, in the binarized image BI of this embodiment, among n pairs of arbitrarily selected predetermined regions A1 and A2, 80% or more of the pairs of predetermined regions A1 and A2 satisfy abs(abs(L1-B1)-abs(L2-B2))≧50. In contrast, in the binarized image BIC of the comparative example, when n is 10 pairs, there is one or less (0 or 1) pairs of A1 and A2 for which abs(abs(L1-B1)-abs(L2-B2))≧50. That is, in the binarized image BIC of the comparative example, pairs of A1 and A2 that satisfy abs(abs(L1-B1)-abs(L2-B2))≧50 account for less than 20% of the total.

[0112] <Effects of the embodiment> According to this embodiment, the following effects can be obtained. (1) An image reading device 11 that reads an original M1 including a background 51 and characters 52 includes a reading unit 30 that reads the original M1 and a control unit 70. The control unit 70 includes an image acquisition unit 81, a threshold setting unit, and a binarization processing unit 88. The threshold setting unit performs a threshold setting process that includes a second process and a third process, thereby setting a threshold Th used in the binarization process for each pixel of the read image GD. The second process sets a threshold Th that binarizes background pixels, which are pixels of a background image included in the read image GD, into a first color, which is one of black and white. The third process sets a threshold Th that binarizes character pixels, which are pixels of a character image included in the read image GD, into a second color, which is the other color of black and white. The binarization processing unit 88 generates a binarized image BI from the read image GD based on the threshold Th set for each pixel. The threshold setting process includes a process in which a threshold setting unit sets a threshold value Th, which is determined based on the luminance values ​​of each of the n×n pixels including the pixel as the pixel of interest, to the pixel of interest. With this configuration, an appropriate threshold value Th is set for each pixel of the scanned image GD, so that a binarized image BI in which characters can be easily distinguished from the background can be obtained.

[0113] (2) The planar region threshold image generation unit 86 included in the threshold setting unit sets a threshold value Th for the pixel of interest based on the standard deviation and average determined from the luminance values ​​of each of the n×n pixels (n is a natural number equal to or greater than 2) including the pixel of interest. With this configuration, the threshold value Th based on the standard deviation and average is set for each pixel of the scanned image GD, so that a binarized image BI can be obtained in which characters can be easily distinguished from the background.

[0114] (3) The first color is white and the second color is black. A predetermined luminance value that can be regarded as a background pixel is set as a first judgment value. As one of the second processes, a planar region threshold image generation unit 86 included in the threshold setting unit sets a threshold Th that binarizes pixels that have a luminance value greater than the first judgment value and that satisfy the first condition to white.

[0115] According to this configuration, an appropriate threshold value Th is set for each pixel of the scanned image GD, so that a binarized image BI in which characters are easily distinguishable from the background can be obtained. (4) The threshold calculation unit 84 included in the control unit 70 changes a boundary value (threshold T) of brightness values ​​in the histogram H1 of the scanned image GD, and classifies pixels having brightness values ​​equal to or less than the boundary value as a first class, and pixels having brightness values ​​greater than the boundary value as a second class. The control unit 70 sets the boundary value (threshold T) at which the degree of separation S, which is the ratio of the intra-class variance of the first class to the inter-class variance between the first and second classes, becomes the second judgment value (first threshold GTh). As part of the second process, the planar region threshold image generation unit 86 constituting the threshold setting unit sets a threshold Th for binarizing pixels having brightness values ​​greater than the second judgment value, which satisfies the second condition, to white. With this configuration, an appropriate threshold Th is set for each pixel of the scanned image GD, thereby enabling a binarized image BI in which characters are easily distinguished from the background to be obtained.

[0116] (5) As one of the third processes, the planar area threshold image generation unit 86, which constitutes the threshold setting unit, sets a threshold Th at which pixels that satisfy the third condition, i.e., have a brightness value greater than a predetermined value Cm times the second judgment value (where 0.2≦Cm≦0.6), are binarized to black.

[0117] According to this configuration, an appropriate threshold value Th is set for each pixel of the scanned image GD, so that a binarized image BI in which characters are easily distinguishable from the background can be obtained. (6) The control unit 70 calculates n pixels in the range of n×n pixels, each of which is a pixel of interest in the scanned image GD. 2 The image processing unit 80 includes an edge intensity average calculation unit 85 that calculates an edge intensity value EI as a variance based on the luminance values ​​of pixels and calculates an edge intensity average value EM that is the average of the edge intensity values ​​EI. The planar region threshold image generation unit 86 that constitutes the threshold setting unit includes, as a second condition, that the edge intensity value EI is less than the edge intensity average value EM, in addition to or instead of having a luminance value greater than the second judgment value (first threshold value GTh).

[0118] According to this configuration, an appropriate threshold value Th is set for each pixel of the scanned image GD, so that a binarized image BI in which characters are easily distinguishable from the background can be obtained. (7) The edge intensity average calculation unit 85 selects pixels in even-numbered columns and even-numbered rows of the scanned image GD as pixels of interest. This configuration reduces the number of pixels to be processed without processing all pixels of the scanned image GD, improving throughput from the start of scanning the document M1 to the output of the binarized image BI.

[0119] (8) The image reading device 11 includes a memory unit 73 that stores the read image GD. The threshold setting unit includes a planar region threshold image generation unit 86 that generates a planar region threshold image TI, whose pixel value is a threshold Th set for each pixel. The edge intensity average calculation unit 85 calculates the average and root-sum average of the n×n luminance values ​​when reading each luminance value of n×n pixels from the memory unit 73, and stores the calculated values ​​in the memory unit 73. The planar region threshold image generation unit 86 sets the threshold Th based on the luminance values ​​of the n×n pixels, based on the average and root-sum average read from the memory unit 73. This configuration significantly reduces the number of accesses to the memory unit 73, thereby shortening processing time. This further improves throughput from the start of reading the original M1 to the output of the binarized image BI.

[0120] (9) The edge intensity average calculation unit 85 assigns the same edge intensity value EI as that of the pixel of interest to one or more pixels adjacent to the pixel of interest. According to this configuration, the edge intensity value EI can be set even if the calculation process of the edge intensity value EI for one or more pixels adjacent to the pixel of interest is omitted, thereby improving the throughput and the quality of the binarized image BI.

[0121] (10) When the reading unit 30 continuously reads standard-sized checks as the original documents M1, it is configured to be able to output the binary image BI at a processing speed of 60 to 100 sheets per minute. With this configuration, when checks are continuously read, binary images BI of the checks can be obtained at high speed, with the characters easily distinguishable from the background. This allows for accurate and fast recognition of the character information on the checks.

[0122] (11) The control unit 70 includes a CPU and a storage unit 73. The CPU executes a program stored in the storage unit 73 to perform processing including the first processing and threshold setting processing. With this configuration, the image reading device 11 uses the CPU to perform processing from obtaining the scanned image GD to generating the binary image BI. For example, the image reading device 11 does not need to exchange data with an external host device 100 (such as a PC) until generating the binary image BI, thereby improving throughput.

[0123] (12) The threshold setting unit includes an edge region threshold calculation unit 83 that, as one of the third processes, sets a threshold value Th1 for pixels in an edge region, which is a region where character pixels are consecutive. The edge region threshold calculation unit 83 sets the brightness value when the cumulative number of pixels from the low brightness value side in a histogram based on the brightness values ​​of the pixels in the edge region reaches a predetermined ratio to the total number of pixels in the edge region as the threshold value Th1. The threshold setting unit updates the threshold value Th of the pixel of interest to the larger of the threshold value Th determined based on the brightness values ​​of each of the n×n pixels and the threshold value Th1 set by the edge region threshold calculation unit 83. This configuration makes it possible to update the threshold value Th of pixels in the edge region (character region) to a more appropriate value. Therefore, a binarized image BI can be obtained in which characters are more easily distinguished from the background.

[0124] (13) The image reading method includes a reading unit 30 that reads an original M1 and a control unit 70, and the control unit 70 performs the following steps (S1) to (S3). (S1) A first process is performed to obtain a read image GD including a background image and a character image by causing the reading unit 30 to read the original M1. (S2) A threshold value setting process is performed that includes a second process of setting a threshold value Th for binarizing background pixels, which are pixels of a background image included in the read image GD, into a first color, which is one of black and white, and a third process of setting a threshold value Th for binarizing character pixels, which are pixels of a character image included in the read image GD, into a second color, which is the other of black and white, thereby setting a threshold value Th to be used in the binarization process for each pixel of the read image GD. (S3) Generating a binarized image BI from the read image GD based on a threshold value Th set for each pixel. In the above (S2), the threshold setting process includes a process of setting a threshold value Th, which is determined based on the luminance values ​​of n×n pixels including the pixel as the pixel of interest, to the pixel of interest. According to this method, an appropriate threshold value Th is set for each pixel of the scanned image GD, so that a binarized image BI can be obtained in which characters are easily distinguished from the background.

[0125] (15) The program PG includes the following steps (P1) to (P3) for execution by a computer. (P1) an image acquisition unit of the computer performs a first process of acquiring a read image GD including a background image and a character image by causing the reading unit 30 to read an original M1; (P2) A threshold setting unit of the computer performs threshold setting processing including a second processing for setting a threshold value Th for binarizing background pixels, which are pixels of a background image included in the read image GD, into a first color, which is one of black and white, and a third processing for setting a threshold value Th for binarizing character pixels, which are pixels of a character image included in the read image GD, into a second color, which is the other of black and white, thereby setting a threshold value Th to be used in the binarization processing for each pixel of the read image GD; (P3) A binarization processing unit 88 of the computer generates a binarized image BI from the read image GD based on a threshold value Th set for each pixel; In the above (P2), the threshold setting process includes a process of setting a threshold value Th, which is determined based on the luminance values ​​of n×n pixels including the pixel as the pixel of interest, to the pixel of interest. According to this program, an appropriate threshold value Th is set for each pixel of the scanned image GD, so that a binarized image BI in which characters are easily distinguishable from the background can be obtained.

[0126] <Example of change> The above embodiment can be modified to the following modified examples. Furthermore, further modified examples can be formed by appropriately combining the above embodiment and the modified examples shown below, or by appropriately combining the modified examples shown below.

[0127] In the above embodiment, n = 5 in n × n (where n is a natural number greater than or equal to 2), but n may be 2 or greater. Furthermore, n may be an odd number that allows the pixel of interest to be positioned at the center of the n × n range. Even if the pixel of interest cannot be positioned at the center of the n × n range, n may be an even number because it can be positioned closest to the center compared to other pixels. If n is an even number, multiple pixels will be closest to the center of the range, but a threshold value for the pixel of interest can be set. n may be, for example, any one of 2, 3, 4, 6, 7, 8, 9, 10, or 11. While n may be any other value, if it is too large, the increased calculation load may easily cause a decrease in throughput. Therefore, an appropriate value may be selected according to the performance of the image reading device 11, such as the processing speed.

[0128] The control unit 70 determines in step S16 whether the planar region threshold image generation unit 86, which performs the planar region threshold image generation process, satisfies the conditions (a) to (d) described above for the target pixel in the process of sequentially determining whether the target pixel satisfies the conditions described above for (a) to (d). The target pixel to be selected as the target pixel is not limited to an even column, and may be a pixel in an even column and an even row, as in Figure 8.

[0129] In the above embodiment, a binary image BI was generated from the scanned image GD so that the background pixels were the first color, white, and the character pixels were the second color, black. However, a binary image BI may also be generated so that the first color is black and the second color is white.

[0130] · In the process of (a) above, the threshold value for binarization to white is not limited to Th = 0. The threshold value for binarization to white may be a value greater than 0 and not exceeding the first threshold value GTh. · In the process of (b) above, the threshold value for binarization to white is not limited to Th = 0. The threshold value for binarization to white may be a value greater than 0 and not exceeding the first threshold value GTh.

[0131] · Instead of the second condition in the process of (b) that the luminance value BV of the pixel of interest > GTh and the edge intensity value EI < EM, only one of them may be used as the condition. That is, the second condition may be that the luminance value BV of the pixel of interest > GTh holds, or the edge intensity value EI < EM holds.

[0132] · The edge intensity average calculation unit 85 selects the pixels in the even columns and even rows of the read image GD as the pixels of interest, but it may also select only the even columns or only the even rows as the pixels of interest. Also, the edge intensity average calculation unit 85 may select the pixels in the odd columns and odd rows of the read image GD as the pixels of interest, or may select only the odd columns or only the odd rows as the pixels of interest.

[0133] · The downsampling process for the columns and rows of the read image GD was performed to shorten the processing time, but the downsampling process may not be performed. · The image reading device 11 may be provided as a part of a multifunction device having a scanner, a printing function, and a copying function. It may also be provided with an automatic document feeder (auto sheet feeder) for automatically feeding the document.

[0134] The program PG shown in the flowcharts of FIGS. 7 to 9 may be executed by the computer of the host device 100. More specifically, the program PG shown in the flowcharts of FIGS. 7 to 9 may be included in a scan driver program or an application program for adding functions that is installed in the computer of the host device 100. When the computer of the host device 100 executes this program PG, for example, the scan driver (reading control device) may be configured to include at least some of the units 81 to 88 shown in FIG. 6, which are made up of software. The units 81 to 88 shown in FIG. 6 may be configured to be included only in the host device 100, or may be configured to be included separately in both the image reading device 11 and the host device 100.

[0135] The image reading device 11 is not limited to a configuration having a function of reading securities, and may be a sheet-feed type image reading device 11 or a flatbed type image reading device 11. The image sensor constituting the reading unit 30 may be a CMOS image sensor, a MOS (Metal Oxide Semiconductor) image sensor, or a CCD (Charge Coupled Device) image sensor.

[0136] The image sensor that constitutes the reading unit 30 may be a linear image sensor or an area image sensor. Each functional unit in the control unit 70 is not limited to being realized by a CPU, but may be realized in hardware using electronic circuits such as an ASIC (application specific integrated circuit) and an FPGA (field-programmable gate array), or may be realized in both software and hardware.

[0137] The material of the document is not limited to paper, but may be a resin film, a resin sheet, a metal film, or foil. <Additional Notes> The technical concepts and effects that can be understood from the above-described embodiment and modified examples will be described below.

[0138] (A) An image reading device is an image reading device that reads a document including a background and text, and has a reading unit that reads the document, and a control unit, wherein the control unit includes an image acquisition unit that performs a first process that acquires a read image including a background image and a text image by having the reading unit read the document, a threshold setting unit that sets the threshold to be used in the binarization process for each pixel of the read image by performing a threshold setting process that includes a second process that sets a threshold to be used in the binarization process for each pixel of the read image, and a binarization processing unit that generates a binary image from the read image based on the threshold set for each pixel, and wherein the threshold setting process includes a process in which the threshold setting unit sets a threshold to the target pixel that is determined based on the luminance values ​​of each of n x n pixels that include the pixel as the target pixel. According to this configuration, an appropriate threshold value is set for each pixel of the scanned image, so that a binarized image can be obtained in which characters are easily distinguished from the background.

[0139] (B) In the image reading device described in (A) above, the threshold setting unit may set the threshold for the target pixel based on a standard deviation and an average determined from the luminance values ​​of n×n pixels (n is a natural number equal to or greater than 2) including the target pixel. With this configuration, a threshold based on the standard deviation and the average is set for each pixel of the read image, making it possible to obtain a binarized image in which characters are easily distinguished from the background.

[0140] (C) In the image reading device described in (B) above, the first color may be white, the second color may be black, a predetermined luminance value that can be regarded as the background pixel may be set as a first determination value, and the threshold setting unit may set, as one of the second processes, the threshold value by which the pixel having a luminance value greater than the first determination value and satisfying a first condition is binarized to white. With this configuration, an appropriate threshold value is set for each pixel of the read image, making it possible to obtain a binarized image in which characters are easily distinguished from the background.

[0141] (D) In ​​the image reading device described in (C) above, the control unit may change a boundary value of brightness values ​​in a histogram of the read image, classifying a group of pixels having a brightness value equal to or less than the boundary value as a first class and a group of pixels having a brightness value greater than the boundary value as a second class, and may set the boundary value at which a degree of separation, which is the ratio of the intra-class variance of the first class to the inter-class variance between the first class and the second class, is maximized as a second judgment value, and the threshold setting unit may set, as one of the second processes, the threshold for binarizing pixels having a brightness value greater than the second judgment value and satisfying a second condition to white. With this configuration, an appropriate threshold is set for each pixel of the read image, making it possible to obtain a binarized image in which characters are easily distinguished from the background.

[0142] (E) In the image reading device described in (D) above, the threshold setting unit may, as one of the third processes, set the threshold to binarize the pixel, which satisfies a third condition, having a luminance value greater than a predetermined value Cm times the second judgment value (where 0.2≦Cm≦0.6), to black. With this configuration, an appropriate threshold is set for each pixel of the read image, making it possible to obtain a binarized image in which characters are easily distinguished from the background.

[0143] (F) In the image reading device according to (D) or (E), the control unit reads n pixels in a range of n×n pixels, each of which is a pixel of interest. 2and an edge intensity average calculation unit that calculates an edge intensity value based on the luminance values ​​of pixels and calculates an edge intensity average value that is an average of the edge intensity values, and the threshold setting unit may include, in the second condition, that the edge intensity value is less than the edge intensity average value in addition to or instead of having a luminance value greater than the second determination value. With this configuration, an appropriate threshold is set for each pixel of the scanned image, so that a binarized image in which characters can be easily distinguished from the background can be obtained.

[0144] (G) In the image reading device described in (F) above, the edge intensity average calculation unit may select pixels in even-numbered columns and even-numbered rows of the read image as the target pixels. With this configuration, the number of pixels to be processed can be reduced without processing all pixels of the read image, improving throughput from the start of reading the document to the output of a binary image.

[0145] (H) The image reading device described in (G) above may include a memory unit for storing the read image, the threshold setting unit including a planar area threshold image generation unit for generating a planar area threshold image having pixel values ​​equal to the threshold set for each pixel, the edge intensity average calculation unit calculating an average and root-sum average of the n×n luminance values ​​when reading the luminance values ​​of the n×n pixels from the memory unit, and storing the average and root-sum average of the n×n luminance values ​​in the memory unit, and the planar area threshold image generation unit setting the threshold determined based on the luminance values ​​of the n×n pixels based on the average and root-sum average read from the memory unit. This configuration significantly reduces the number of accesses to the memory unit, thereby shortening processing time. This further improves throughput from the start of reading the document to the output of a binary image.

[0146] (I) In the image reading device described in (G) or (H) above, the edge intensity average calculation unit may assign the same edge intensity value as the pixel of interest to one or more pixels among the pixels adjacent to the pixel of interest. With this configuration, edge intensity values ​​can be set even if the calculation process for edge intensity values ​​for one or more pixels adjacent to the pixel of interest is omitted. This can improve throughput and the quality of binarized images.

[0147] (J) The image reading device according to any one of (G) to (I) above, and also according to any one of claims 7 to 9, is characterized in that the reading unit is configured to output the binary images at a processing speed of 60 to 100 sheets per minute when continuously reading standard-sized checks as the original documents. With this configuration, when continuously reading checks, binary images of checks in which the characters are easily distinguishable from the background can be obtained at high speed. This allows for accurate and fast recognition of the character information on checks.

[0148] (K) In the image reading device described in any one of (A) to (J) above, the threshold setting unit includes an edge region threshold calculation unit that sets a threshold for the pixels in an edge region, which is a region where the character pixels are continuous, as one of the third processes. The edge region threshold calculation unit sets the threshold as a brightness value when a cumulative number of pixels from the lower brightness value side in a histogram based on the brightness values ​​of the pixels in the edge region reaches a predetermined ratio to the total number of pixels in the edge region. The threshold setting unit may update the threshold for the target pixel to the larger of the threshold determined based on the brightness values ​​of each of the n×n pixels and the threshold set by the edge region threshold calculation unit. This configuration allows the threshold for pixels in the edge region (character region) to be updated to a more appropriate value. This makes it possible to obtain a binarized image in which characters are more easily distinguished from the background.

[0149] (L) In the image reading device described in any one of (A) to (K) above, the control unit may include a CPU and a storage unit, and the CPU may perform processing including the first processing and the threshold setting processing by executing a program stored in the storage unit. With this configuration, the image reading device performs processing from obtaining a read image to generating a binary image using the CPU. For example, the image reading device does not need to exchange data with an external host device (such as a PC) until generating a binary image, thereby improving throughput.

[0150] (M) An image reading method for reading an original document including a background and text, the method comprising: a reading unit for reading the original document; and a control unit, wherein the control unit performs a first process of acquiring an original document including a background image and a text image by causing the reading unit to read the original document; a second process of setting a threshold for binarizing background pixels of the background image included in the original document into a first color, which is one of black and white; and a third process of setting a threshold for binarizing character pixels of the text image included in the original document into a second color, which is the other of black and white, thereby setting the threshold for each pixel of the original document to be used in the binarization process; and generating a binarized image from the original document based on the threshold for each pixel, wherein the threshold setting process includes a process of setting a threshold for a target pixel that is determined based on the luminance value of each of n×n pixels including the target pixel. According to this method, an appropriate threshold is set for each pixel of the original document, thereby obtaining a binarized image in which text is easily distinguished from the background.

[0151] (N) A program for executing an image reading process by a computer included in an image reading device that reads a document including a background and text, the program including: an image acquisition unit of the computer performs a first process of acquiring a read image including a background image and a text image by having the reading unit read the document; a threshold setting unit of the computer performs a threshold setting process including a second process of setting a threshold for binarizing background pixels, which are pixels of a background image included in the read image, into a first color, which is one of black and white, and a third process of setting a threshold for binarizing character pixels, which are pixels of a text image included in the read image, into a second color, which is the other of black and white, thereby setting the threshold to be used in the binarization process for each pixel of the read image; and a binarization processing unit of the computer generates a binarized image from the read image based on the threshold set for each pixel, and the threshold setting process includes a process of setting a threshold determined based on the luminance values ​​of n×n pixels including the pixel as a target pixel to the target pixel. According to this program, an appropriate threshold value is set for each pixel of the scanned image, so that a binarized image can be obtained in which characters are easily distinguished from the background. [Explanation of symbols]

[0152] 11...image reading device, 12...casing, 13...first housing part, 14...second housing part, 15...third housing part, 16...conveying path, 17...supply space, 18...discharge space, 19...partition plate, 20...first storage space, 21...second storage space, 23...conveying section, 24...pick roller, 25...conveying roller, 26...separation roller, 27...drive roller, 28...followed roller, 30...reading section, 31...first reading section, 32...second reading section, 33...first reading surface, 34...second reading surface, 35...magnetic reading section, 38...pressure receiving section, 41...first pressure roller, 42... Second pressure roller, 43...third pressure roller, 50...securities, 51...background, 52...character, 53...background pattern, 54...design, 56...printed character, 57...handwritten character, 61...background image, 62...character image, 63...background pattern area, 64...design area, 65...printed character area, 67...handwritten character area, 70...control unit, 71...display unit, 72...drive unit, 73...storage unit, 81...image acquisition unit, 82...area separation unit, 83...edge area threshold calculation unit, 84...threshold calculation unit, 85...edge intensity average calculation unit, 86...plane area threshold image generation unit, 87...edge Area threshold image generation unit, 88...binarization processing unit, 91...background image, 92...character image, 93...background pattern image, 94...pattern image, 95...printed character image, 96...handwritten character image, 100...host device, M1...original, M11...first side, M12...second side, SD...read image, GD...read image, PG...program, BIC...binarized image (comparative example), BI...binarized image, H1...histogram, H2...histogram, Th1...threshold, IP...pixel of interest, PR...range, CP...pixel of candidate for pixel of interest, BV...luminance value, BV1...first average luminance value, BV2...second average brightness value, cf...constant, Cm...constant, EI...edge intensity value, EM...average edge intensity value, GTh...first threshold, Imax...constant, m...mean, m1...mean, m2...mean, n2...number of pixels, std...mean sum of squares, t...standard deviation, T...threshold, E...edge pixel, EA...edge region, EG...edge detected image, Th...threshold, TI...plane region threshold image (threshold image), σ2...variance, σ12...variance, σ22...variance, σb2...inter-class variance, σw2...intra-class variance, mt...mean, P...plane pixel, S...separation, Vmin...constant.

Claims

1. An image reading device that reads a document including a background and characters, a reading unit that reads the document; a control unit; The control unit an image acquisition unit that performs a first process to acquire a read image including a background image and a character image by causing the reading unit to read the document; a threshold setting unit that performs threshold setting processing including a second processing for setting a threshold for binarizing background pixels, which are pixels of a background image included in the read image, into a first color, which is one of black and white, and a third processing for setting a threshold for binarizing character pixels, which are pixels of a character image included in the read image, into a second color, which is the other of black and white, to set the threshold used in the binarization processing for each pixel of the read image; a binarization processing unit that generates a binarized image from the read image based on the threshold value set for each of the pixels, The image reading device, wherein the threshold setting process includes a process in which the threshold setting unit sets a threshold determined based on the luminance values ​​of n×n pixels including the pixel as a pixel of interest to the pixel of interest.

2. 2. The image reading device of claim 1, An image reading device characterized in that the threshold setting unit sets the threshold for the target pixel based on a standard deviation and average determined from the luminance values ​​of n x n pixels (where n is a natural number greater than or equal to 2) including the target pixel.

3. 3. The image reading device of claim 2, the first color is white and the second color is black; a predetermined luminance value that can be regarded as a background pixel is set as a first determination value; The image reading device is characterized in that, as one of the second processes, the threshold setting unit sets the threshold that binarizes the pixel, which satisfies the first condition of having a luminance value greater than the first judgment value, to white.

4. 4. The image reading device of claim 3, the control unit changes a boundary value of brightness values ​​in the histogram of the read image and classifies a pixel group having a brightness value equal to or less than the boundary value as a first class, and a pixel group having a brightness value greater than the boundary value as a second class, a boundary value at which a degree of separation, which is a ratio of an intra-class variance of the first class to an inter-class variance between the first class and the second class, is maximized, as a second judgment value; The image reading device is characterized in that, as one of the second processes, the threshold setting unit sets the threshold to binarize the pixel to white for which the second condition is met, that is, the pixel has a luminance value greater than the second judgment value.

5. 5. The image reading device of claim 4, The image reading device is characterized in that, as one of the third processes, the threshold setting unit sets the threshold to binarize the pixel to black for which a third condition is met, that is, the pixel has a brightness value greater than a predetermined value Cm times the second judgment value (where 0.2≦Cm≦0.6).

6. 5. The image reading device according to claim 4, The control unit selects n pixels in a range of n×n pixels, each of which is a pixel of interest in the read image. 2 an edge intensity average calculation unit that calculates a variance as an edge intensity value based on the luminance values ​​of the pixels and calculates an edge intensity average value that is an average of the edge intensity values; An image reading device characterized in that the threshold setting unit includes in the second condition that the edge strength value is less than the average edge strength value, in addition to or instead of having a brightness value greater than the second judgment value.

7. 7. The image reading device according to claim 6, The image reading device according to claim 1, wherein the edge intensity average calculation unit selects pixels in even-numbered columns and even-numbered rows of the read image as the target pixels.

8. 8. The image reading device according to claim 7, a storage unit for storing the scanned image; the threshold setting unit includes a planar region threshold image generating unit that generates a planar region threshold image having pixel values ​​that are the thresholds set for pixels; the edge intensity average calculation unit calculates an average and a root-sum average of the n×n luminance values ​​when reading out the luminance values ​​of the n×n pixels from the storage unit, and stores the average and root-sum average of the n×n luminance values ​​in the storage unit; The image reading device is characterized in that the planar region threshold image generation unit sets the threshold determined based on the luminance values ​​of the n×n pixels based on the average and the square sum average read out from the storage unit.

9. 8. The image reading device according to claim 7, The image reading device is characterized in that the edge intensity average calculation unit assigns the same edge intensity value as that of the pixel of interest to one or more pixels among pixels adjacent to the pixel of interest.

10. 10. The image reading device according to claim 7, An image reading device characterized in that the reading unit is configured to be able to output the binarized images at a processing speed of 60 to 100 sheets per minute when continuously reading standard-sized checks as the original documents.

11. 2. The image reading device according to claim 1, The control unit includes a CPU and a storage unit, The image reading device is characterized in that the CPU performs processes including the first process and the threshold setting process by executing a program stored in the storage unit.

12. 2. The image reading device according to claim 1, the threshold setting unit includes an edge region threshold calculation unit that sets a threshold for the pixels in an edge region, which is a region where the character pixels are continuous, as one of the third processes; the edge region threshold calculation unit sets, as the threshold, a brightness value at which a cumulative number of pixels from a smaller brightness value side in a histogram based on brightness values ​​of the pixels in the edge region reaches a predetermined ratio to a total number of pixels in the edge region; an edge region threshold calculation unit that calculates a pixel value based on the brightness values ​​of the n×n pixels and updates the threshold value of the pixel of interest to the larger of the threshold value determined based on the brightness values ​​of the n×n pixels and the threshold value set by the edge region threshold calculation unit;

13. An image reading method for reading a document including a background and characters, comprising: a reading unit that reads the document; a control unit; The control unit performing a first process of acquiring a read image including a background image and a character image by causing the reading unit to read the document; a second process for setting a threshold value for binarizing background pixels, which are pixels of a background image included in the read image, into a first color, which is one of black and white, and a third process for setting a threshold value for binarizing character pixels, which are pixels of a character image included in the read image, into a second color, which is the other of black and white, thereby setting the threshold value used in the binarization process for each pixel of the read image; generating a binarized image from the read image based on the threshold value set for each of the pixels; The image reading method according to claim 1, wherein the threshold value setting process includes a process of setting a threshold value determined based on the luminance values ​​of n×n pixels including the pixel as a pixel of interest to the pixel of interest.

14. A program for executing an image reading process by a computer included in an image reading device that reads a document including a background and characters, an image acquisition unit of the computer performs a first process of acquiring a read image including a background image and a character image by causing a reading unit to read the document; a threshold setting unit of the computer performs threshold setting processing including a second processing for setting a threshold for binarizing background pixels, which are pixels of a background image included in the read image, into a first color, which is one of black and white, and a third processing for setting a threshold for binarizing character pixels, which are pixels of a character image included in the read image, into a second color, which is the other of black and white, thereby setting the threshold used in the binarization processing for each pixel of the read image; a binarization processing unit of the computer generating a binarized image from the read image based on the threshold value set for each of the pixels; Execute The threshold setting process includes a process of setting a threshold determined based on the luminance values ​​of n×n pixels including the pixel as a pixel of interest to the pixel of interest.

Citation Information

Patent Citations

  • Image processing device and image processing method for security

    JP2004127258A