Image processing device, image processing method, and program

By performing multi-stage morphological processing in the image processing device, identifying and correcting the vertical line missing areas caused by printing defects, the problem of insufficient character recognition accuracy in the prior art is solved, and higher character recognition accuracy is achieved.

JP7654369B2Active Publication Date: 2025-04-01CANON KK
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2020148078
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2019-09-06
Filing Date
2020-09-03
Publication Date
2025-04-01
Estimated Expiration
2040-09-03

AI Technical Summary

Technical Problem

In the prior art, when dealing with the missing areas of vertical lines caused by printing defects, it is difficult to accurately correct the missing characters, and may cause other areas to be flattened into black, affecting the accuracy of character recognition.

Method used

By performing multi-stage morphological processing in the image processing device, including white pixel expansion and contraction processes, multiple binary images are generated, thereby identifying and correcting the missing areas of vertical lines, ensuring the accuracy of character recognition.

Benefits of technology

It effectively corrects missing characters in the missing areas of vertical lines caused by printing defects, avoids other areas being flattened into black, and improves the accuracy of character recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007654369000001
    Figure 0007654369000001
  • Figure 0007654369000002
    Figure 0007654369000002
  • Figure 0007654369000003
    Figure 0007654369000003
Patent Text Reader

Abstract

To correct characters including vertical line missing areas (characters including missing vertical lines that are not printed due to printing defects) and prevent areas other than the vertical line missing areas from being painted out in black.SOLUTION: The present invention includes: generating a second binarized image by executing first morphology on a first binarized image, identifying a vertical line missing area on the basis of the second binarized image, generating a third binarized image by executing second morphology on the second binarized image under a condition different from the first morphology, acquiring pixel information of an area corresponding to the vertical line missing area in the third binary image; correcting an area corresponding to the vertical line missing area in the first binarized image by using the acquired pixel information; and generating a fourth binarized image.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to an image processing device, an image processing method, and a program for correcting an image. [Background technology]

[0002] Image processing techniques are commonly known that extract information such as date, company name, amount, and phone number (hereinafter referred to as "document information") from scanned images obtained by scanning documents such as forms and receipts. One example of a method for extracting document information is as follows. According to this method, first, a document is scanned to obtain a scanned image, and characters in the scanned image are recognized by OCR (Optical Character Recognition). Furthermore, document information is extracted by estimating item types such as date, company name, amount, and the position of characters corresponding to these items from information such as the string of recognized characters, positional relationship, character type, and format. The image processing technology described above makes it possible to automatically obtain document information corresponding to items such as dates, company names, and amounts contained in documents such as forms and receipts, thereby improving the productivity of administrative tasks such as accounting.

[0003] In order to extract document information with high accuracy from scanned images of documents such as forms and receipts, it is important to improve the accuracy of character recognition by OCR. Generally, to improve character recognition accuracy, image processing (binarization, noise removal, etc.) is performed on the scanned image to process it into an image in which characters are easier to recognize.

[0004] However, even with conventional image processing technology, it can be difficult to improve character recognition accuracy. For example, when characters are printed on a receipt using a receipt printer, white lines may appear perpendicular to the paper transport direction, resulting in missing characters or images (missing vertical lines). Missing vertical lines are mainly caused by poor printing due to foreign matter adhering (fusing) to the printing section of the receipt printer. In general receipt printers, characters are printed by transferring heat generated in the printing section to thermal paper (receipt paper), but the presence of foreign matter can impede the transfer of heat to the thermal paper. As a result, characters cannot be printed on the thermal paper directly below the foreign matter, resulting in poor printing due to missing vertical lines. It is very difficult to recognize characters that are missing due to missing vertical lines, so in order to recognize these characters, it is necessary to correct the missing characters.

[0005] Patent Document 1 describes a method of making corrections based on pixel information adjacent to a missing vertical line area. For example, if the pixels on both sides of the missing vertical line area are black, the pixels in the area are changed to black pixels, but if the pixels on both sides are white, they are not changed, thereby correcting the missing characters. However, according to the method of Patent Document 1, the width of the vertical line missing area is considered to be a constant value and correction is performed, but the actual width of the vertical line missing area often varies by several pixels depending on the position. Therefore, there is a problem that the correction of missing characters may not be sufficient. This is because the pressure and contact area of ​​the printing part become unstable due to the contamination of the printing part with foreign matter, which causes the thermal conduction to the thermal paper to fluctuate, resulting in fluctuations of approximately tens to hundreds of microns (2 to 3 pixels in a 300 dpi scanned image).

[0006] Furthermore, Patent Document 2 describes a method for correcting missing characters by performing a combination of morphological dilation and erosion processes multiple times on a binarized scanned image. However, the method in Patent Document 2 has the problem that characters with a high density of black pixels, such as kanji characters, may appear crushed and pixel clusters with a narrower spacing than the width of the missing vertical line area may be combined, which may reduce the recognition accuracy of other characters and character strings. [Prior art documents] [Patent documents]

[0007] [Patent Document 1] JP 2010-114567 A [Patent Document 2] Japanese Patent Application Publication No. 1-266682 Summary of the Invention [Problem to be solved by the invention]

[0008] The present invention has an object to solve the above problems. [Means for solving the problem]

[0009] The present invention relates to An image processing device that generates a binary image to be subjected to character recognition processing, and executes a binarization process and a tilt correction process on a scanned image obtained by scanning a document, a first image acquisition means for acquiring a first binary image; a second image generation means for generating a second binary image by executing a first morphological process including a white pixel expansion process for expanding a white pixel area in the first binary image on the first binary image; A vertical histogram is generated at a position where the number of black pixels in the generated vertical histogram is equal to or less than a threshold value. Based on 、 Vertical line missing area Location a third image generating means for generating a third binary image by executing a second morphological process including a white pixel shrinking process for shrinking a white pixel area in the first binary image on the first binary image; Identified Vertical line missing area Location Corresponding to In the third binary image Pixel information of the region of, The above Identified Vertical line missing area Location Corresponding to Overwriting pixel information of the region in the first binary image By doing so, The binary image to be subjected to the character recognition process is and a fourth image generating means for generating a fourth binary image. Effect of the Invention

[0010] According to the present invention, it is possible to correct characters that include vertical line missing areas (characters that include vertical line-shaped missing parts that were not printed due to poor printing), while preventing areas other than the vertical line missing areas from being crushed black. [Brief description of the drawings]

[0011] [Figure 1] 1 is a diagram illustrating an information processing system according to an embodiment of the present invention. [Diagram 2] 5 is a flowchart showing a process for correcting an image with missing vertical lines according to the first embodiment. [Diagram 3] 4 is an example of a tilt-corrected binary image generated in the first embodiment. [Figure 4] 5 is a flowchart showing a vertical line missing area specifying process according to the first embodiment. [Diagram 5] 13 is an example of an image for identifying a vertical line missing region generated in the first embodiment. [Figure 6] 5 is a flowchart showing a correction secondary image generation process according to the first embodiment. [Figure 7] 4 is an example of a correction binary image generated in the first embodiment. [Figure 8] 11 is a flowchart showing a vertical line missing area merging process according to the first embodiment. [Figure 9] 4 is an example of a composite binary image generated in the first embodiment. [Figure 10] 10 is a flowchart showing a process for correcting an image with missing vertical lines according to the second embodiment. [Figure 11] 13 is a flowchart showing a process for correcting an image with missing vertical lines according to the third embodiment. [Figure 12] 13 is a flowchart showing a vertical line missing area merging process according to the third embodiment. [Figure 13] 13 is an example of a tilt-corrected binary image generated in the third embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0012] Hereinafter, an embodiment for carrying out the present invention will be described with reference to the drawings. However, the embodiment described below is merely an example of the present invention, and is not intended to limit the scope of the present invention. Furthermore, not all of the combinations of features described in the following embodiments are necessarily essential as means for solving the problems of the present invention.

[0013] <First embodiment> FIG. 1 is a diagram showing an information processing system according to an embodiment of the present invention. The information processing system includes a copying machine 100 and an information processing device 110 . The copier 100 has a scanner 101, a printer 102, and a copier-side communication unit 103. The scanner 101 scans a document and generates a scanned image. The printer 102 forms an image. The copier-side communication unit 103 communicates with an external device via a network.

[0014] The information processing device 110 has a CPU 111, a ROM 112, a RAM 113, a HDD 114, a display unit 115, an input unit 116, and a communication unit 117 on the information processing device side. The CPU 111 reads out a control program stored in the ROM 112 and executes various processes. The RAM 113 is used as a temporary storage area such as a main memory and a work area for the CPU 111. The HDD 114 stores various data, various programs, and the like. The functions and processes of the information processing device 110, which will be described later, are realized by the CPU 111 reading out a program stored in the ROM 112 or the HDD 114 and executing this program.

[0015] A communication unit 117 on the information processing device side performs communication processing with external devices via a network. A display unit 115 displays various information. An input unit 116 has a keyboard and a mouse, and accepts various operations by a user. The display unit 115 and the input unit 116 may be integrated into one unit, such as a touch panel. The display unit 115 may project an image using a projector, and the input unit 116 may recognize the position of a fingertip relative to the projected image using a camera.

[0016] In this embodiment, the scanner 101 of the copier 100 scans a document such as a receipt and generates a scanned original image (scanned image). The scanned image is then transmitted to the information processing device 110 by the communication unit 103 on the copier side. In the information processing device 110, the communication unit 117 on the information processing device side receives the scanned image and stores it in a storage unit such as an HDD 114. Note that in this embodiment, a vertical line missing area refers to a vertical line-shaped area where no printing is performed due to a printing defect of the printer.

[0017] FIG. 2 is a flowchart showing the process of correcting an image with missing vertical lines according to the first embodiment. In S201, the CPU 111 binarizes the scanned image that has been scanned by the scanner 101 of the copier 100 and stored in the HDD 114 by the CPU 111, generating a binary image A (binarization process). Here, the binarization process refers to a process of converting an image into two gradations of black and white. That is, pixels that are darker than the threshold value become black pixels, and pixels that are lighter than the threshold value become white pixels. In this embodiment, a method of determining a threshold value from a histogram of the entire scanned image is used as a method of generating a binary image. However, the specific method of the binarization process is not important as long as the image is converted into black and white with enough accuracy to allow subsequent character recognition.

[0018] Next, in S202, CPU 111 corrects the tilt of binary image A to generate tilt-corrected binary image B (tilt correction process). In order to accurately detect a vertical line missing area, an image without tilt is necessary. However, in reality, images are often tilted by several degrees during scanning, so tilt correction process for the image is required. In this embodiment, the positions of characters are identified from binary image A, and tilt is detected and corrected based on the positional relationship of each character to generate tilt-corrected binary image B. However, as long as correct tilt correction is possible, any method for tilt correction process is used. Then, CPU 111 stores tilt-corrected binary image B in RAM 113.

[0019] Fig. 3(a) shows an example of a binary image B generated in this embodiment. Fig. 3(b) and (c) show enlarged images of the characters "My Shop" and "Total" in the binary image B, respectively. As shown in FIG. 3(b), it can be seen that the character "pu" has missing characters. Also, as shown in FIG. 3(c), it can be seen that character missing also occurs in the characters "go" and "kei". Furthermore, as shown in FIG. 3(a), it can be seen that similar character missing (missing vertical lines) has occurred in the same vertical column in the scanned image 301. In this way, the position where the missing vertical lines occur (missing vertical line areas) is indefinite, but they are characterized by occurring in the same column.

[0020] Next, in S203, the CPU 111 identifies a vertical line missing region from the binary image B (vertical line missing region identifying process) Fig. 4 is a flowchart showing the details of the vertical line missing region identifying process executed in S203. In S401, the CPU 111 performs a first morphology process on the binary image B to generate an image C for identifying a vertical line missing region. Then, the CPU 111 stores the image C for identifying a vertical line missing region in the RAM 113. Note that the area of ​​the RAM 113 in which the image C for identifying a vertical line missing region is stored is different from the area of ​​the RAM 113 in which the binary image B is stored.

[0021] Here, in this embodiment, as the first morphology processing, in consideration of the variation in the vertical line missing area width as described above, in order to obtain a wider vertical line missing area width, a white pixel expansion process (expansion process to expand the white pixel area) is performed by morphology processing. For example, a white pixel in the binary image B is detected, and the surrounding 8 pixels are made white, thereby expanding the white pixel area. Note that the number of pixels by which the white pixels are expanded (or the number of times they are expanded) is arbitrary, but it is preferable to select the number of expansions so that the strokes of the characters do not completely disappear. Even if the position of the vertical line missing area is shifted between the upper and lower parts of the document due to the influence of noise, etc., the vertical line missing area is expanded by the first morphology processing, so that the vertical line missing area can be easily specified. Note that the first morphology processing may be used in combination with other image processing, such as performing a white pixel contraction process after performing a white pixel expansion process several times, so that isolated point noise can be removed at the same time. For example, performing the white pixel expansion process twice will remove the noise of small black pixel chunks, but it will also make the stroke width of the characters thinner. Therefore, by subsequently performing the white pixel contraction process (i.e., the black pixel expansion process), the stroke width of the characters can be made thicker. 5(a) is an example of a vertical line missing region identifying image C generated by the first morphology process. The positions of vertical line missing regions 501 to 509 are filled with white pixels.

[0022] In S402, the CPU 111 performs vertical projection (that is, counts the number of black pixels) on the image C for specifying a vertical line missing area, and generates a projection histogram D. FIG. 5(b) is an example of the projected histogram D.

[0023] In S403, the CPU 111 identifies vertical line missing positions 511-519 based on the positions in the projection histogram D where the number of black pixels is equal to or less than a threshold value. Then, the CPU 111 acquires position information (X) of the vertical line missing regions 501-509 in the vertical line missing region identification image C that correspond to the vertical line missing positions 511-519 in the projection histogram. In this embodiment, the threshold value of the number of black pixels for identifying the position of the vertical line missing in the projected histogram D is set to 0. However, other threshold values ​​may be used as long as they can identify the vertical line missing region.

[0024] Next, in S404, the CPU 111 stores the position information X of the vertical line missing regions 501 to 509 in the RAM 113. Note that in this embodiment, the regions 501 and 509 are also treated as vertical line missing regions, but since they are regions that exist on both the left and right ends of the image, they may be determined to be blank spaces and excluded from the vertical line missing regions.

[0025] 2, in S204, the CPU 111 generates a correction binary image E using the binary image B (correction binary image generation process). FIG 6 is a flowchart showing the details of the correction binary image generation process executed in S204. In S601, the CPU 111 performs a second morphology process on the binary image B under conditions different from those of the first morphology process performed in S401, and generates a binary image E for correction.

[0026] In this embodiment, the second morphological process is a contraction process of white pixels (a process of expanding black pixel regions) by morphological processing in order to fill missing character portions included in the regions of the binary image B corresponding to the vertical line missing regions 501 to 509. However, as long as it is possible to fill missing character portions in the vertical line missing regions, the second morphological process may be a combination of morphological expansion and contraction processes, or may be used in combination with other image processing.

[0027] 7(a) is an example of a correction binary image E generated by performing the second morphology processing on the binary image B. In the correction binary image E, missing character portions are filled in areas 701-709 at positions corresponding to the vertical line missing areas 501-509, but at the same time, since the second morphology processing is performed on the entire binary image B, image defects may occur due to shrinkage processing of white pixels in places other than the vertical line missing areas.

[0028] FIG. 7(b) and (c) are enlarged images of a part of the binary image E for correction. For example, like the character "プ" shown in FIG. 7(b), there are parts where the missing characters in the vertical line missing area as seen in FIG. 3(b) are filled and corrected to be connected. In FIG. 7(c) as well, the missing character parts in the vertical line missing area are corrected, but at the same time, black pixels in places that should not be connected may be connected. For example, between "言" and "十" in the character "計" in FIG. 7(c), they are connected. That is, due to the shrinkage process of white pixels (expansion process of black pixels), black pixels in places that should not be connected are connected, and pixel defects occur. When such image defects occur, the character recognition accuracy decreases, so it is necessary to correct the characters in the vertical line missing area without causing image defects.

[0029] Next, in S602, the CPU 111 stores the binary image E for correction generated in S601 in the RAM 113. Note that the area of the RAM 113 where the binary image E for correction is stored is different from the area of the RAM 113 where the binary image B and the like are stored.

[0030] Next, returning again to the flowchart of FIG. 2, in S205, the CPU 111 synthesizes the pixel information Y of the areas 701 to 709 at the positions corresponding to the vertical line missing areas 501 to 509 in the binary image E for correction into the binary image B. Thereby, the missing characters in the binary image B are corrected (vertical line missing area synthesis process). FIG. 8 is a flowchart showing the detailed process of the vertical line missing area synthesis process executed in S205.

[0031] In S801, the CPU 111 acquires the position information X of the vertical line missing areas 501 to 509 stored in the RAM 113, the binary image B, and the data of the binary image E for correction, and stores them in the register. Next, in S802, the CPU 111 extracts the pixel information Y of the areas 701 to 709 at the positions corresponding to the position information X of the vertical line missing areas 501 to 509 from the binary image E for correction using the above data.

[0032] Next, in S803, the CPU 111 overwrites pixel information at positions in the binary image B corresponding to the position information X of the vertical line missing regions 501-509 with pixel information Y of the regions 701-709 extracted from the correction binary image E, thereby generating a composite binary image F. Note that the generation of the composite binary image F is not limited to the overwriting process of pixel values, and other processes such as bit operation and composition may also be used.

[0033] Fig. 9(a) is an example of a composite binary image F overwritten with pixel information Y of vertical line filling regions 701 to 709. Fig. 9(b) and (c) are images in which a part of the composite binary image F is enlarged. In Figures 9(b) and (c), it can be seen that the missing vertical lines that existed in binary image B as seen in Figures 3(b) and (c) have been corrected. In addition, in Figure 9(c), it can be seen that the joining of characters and crushed black as seen in Figure 7(c) have not occurred.

[0034] As described above, according to this embodiment, it is possible to correct characters missing due to missing vertical lines, and to prevent areas other than the missing vertical lines from being crushed black.

[0035] <Second embodiment> As described above, the width of the vertical line missing area is not constant and varies depending on the position, but depending on the scanned image, a fairly wide area may be missing. Therefore, if the scanned image contains an area with an extremely wide vertical line missing area, the method according to the first embodiment may not be able to sufficiently correct the missing characters in that area. Therefore, in this embodiment, the maximum width of the vertical line missing area is calculated, and the conditions of the second morphology processing are determined so that sufficient correction can be performed even at the maximum width, thereby achieving sufficient correction in all vertical line missing areas. In the following, differences from the first embodiment will be mainly described, and parts that are not particularly described have the same configurations and processes as the first embodiment.

[0036] FIG. 10 is a flowchart of a correction process for an image with missing vertical lines according to the second embodiment. The processing from S1001 to S1003 is similar to the processing from S201 to S203 in the first embodiment shown in the flowchart of FIG. In this embodiment, in S1004, the CPU 111 calculates the width of each vertical line missing area identified in S1003. Next, in S1005, CPU 111 specifies the maximum value from among the widths of the vertical line missing areas calculated in S1004, and stores the maximum value in a register. Note that in the example of Fig. 5A, areas 501 and 509 are areas that exist on both the left and right ends of the image, and are therefore determined to be blank spaces and excluded from the target. In other words, the maximum width is specified from among areas 502 to 508.

[0037] Next, in S1006, the CPU 111 performs a correction image generation process. Here, in the correction image generation process of this embodiment, as in the first embodiment, a morphological contraction process (a process for expanding a black pixel area) is performed as a second morphological process in order to fill in the vertical line missing area. However, the morphological contraction process performed in this embodiment is performed under conditions that allow sufficient correction even for the maximum width of the vertical line missing area identified in S1005. Furthermore, by determining appropriate morphology conditions for each vertical line missing region based on the width of the vertical line missing region and generating each corrected image, it is possible to perform more accurate correction of the vertical line missing region.

[0038] As described above, according to this embodiment, even if an area with an extremely wide vertical line missing width exists in a scanned image, it is possible to accurately correct the vertical line missing area.

[0039] <Third embodiment> In the above embodiment, the description is based on the assumption that the scanned image contains a relatively large number of characters, but depending on the type of scanned image, the number of characters in the scanned image may be extremely small. In a scanned image with a small number of characters, particularly when the number of characters in the vertical line direction is small, the white pixel areas between the characters may be recognized as vertical line missing areas. Even for scanned images with such a small number of characters, there is usually no problem in recognizing the spaces between characters as vertical line missing areas and performing correction processing. However, when the spaces between characters are extremely narrow, the characters on both sides of the vertical line missing area may end up being combined.

[0040] FIG. 13(a) shows an example of a binary image B after tilt correction used in this embodiment. Figures 13(b) and (c) are enlarged views of a portion of Figure 13(a). The area 1301 between "3" and "5" in Figure 13(b) and between "0" and "0" in Figure 13(c) is erroneously recognized as a vertical line missing area because no characters exist over the entire vertical direction. And because the interval between the erroneously recognized vertical line missing areas 1301 is narrow, if the correction process according to the first or second embodiment is performed, there is a risk that the two characters "3" and "5" and the two characters "0" and "0" will be combined, respectively.

[0041] Therefore, in this embodiment, pixel blocks on both sides of an area determined to be a vertical line missing area are evaluated individually to determine whether each pixel block can be recognized as a character. If the pixel blocks on both sides can be recognized as characters, the pixel blocks on both sides can be determined to be separate characters. In other words, the vertical line missing area is determined to be an area between normal characters, and correction processing is not required. This prevents characters on both sides of the vertical line missing area from being erroneously combined by correction processing. Note that characters here are elements that represent items such as dates, company names, amounts, and telephone numbers drawn on documents such as forms, and also include numbers and symbols. In the following, differences from the first embodiment will be mainly described, and parts that are not particularly described have the same configurations and processes as the first embodiment.

[0042] FIG. 11 is a flowchart of the vertical line missing image correction process according to this embodiment. The processing from S1101 to S1103 is similar to the processing from S201 to S203 in the first embodiment shown in FIG.

[0043] When the vertical line missing area identification process is performed in S1103, in S1104, the CPU 111 calculates character information, which is information related to the number of characters in the scanned image, from the binary image B'. Here, the character information is information that serves as a criterion for determining whether the number of characters in the scanned image is extremely small, such as the total number of black pixels, the total number of characters, the total number of lines, and character spacing in the binary image. In this embodiment, whether the number of characters is extremely small is determined based on whether the calculated total number of black pixels is smaller than a predetermined threshold. However, as long as it is possible to determine whether the number of characters in the scanned image is extremely small, a criterion other than the total number of black pixels, such as the character information exemplified above, may be used as the criterion, or these criteria may be used in combination.

[0044] Next, in S1105, the CPU 111 determines whether or not information related to the number of characters in the scanned image satisfies a predetermined condition (in this embodiment, whether or not the total number of black pixels is equal to or greater than a predetermined threshold value). If the total number of black pixels is equal to or greater than the threshold, that is, if there are sufficient characters in the binary image B' (Yes in S1105), the process proceeds to S1106 and executes the same process as in the first embodiment. If the total number of black pixels is less than the threshold (No in S1105), the process proceeds to S1108.

[0045] In S 1108 , the CPU 111 extracts the character region from the binary image B′, and stores it in the RAM 113 . Next, in S1109, CPU 111 executes character recognition processing for each extracted character region and calculates reliability. Here, reliability in this embodiment is a numerical value (0 to 255) of the degree of match between the feature amount of the character that is the target of character recognition processing and the feature amount of the character in the OCR result. The lower this numerical value, the more reliable the result of the character recognition processing is. Note that the reliability can be expressed in any way as long as it allows an objective comparison of the likelihood of the result of the character recognition processing for each character.

[0046] In S1110, the CPU 111 generates a correction binary image E' by correcting the vertical line missing area using the binary image B' (correction image generation process). Note that this process is similar to the process of S204 in the first embodiment shown in FIG. 2. In S1111, the CPU 111 extracts pixel information Y of an area in the correction binary image E at a position corresponding to the vertical line missing area, and synthesizes the extracted pixel information with the binary image B (vertical line missing area synthesis process). However, if it is determined that the pixel blocks on both sides adjacent to the vertical line missing area are individual characters, the vertical line missing area is excluded from the synthesis process.

[0047] FIG. 12 is a flowchart showing the details of the vertical line missing area merging process executed in S1111. In S1201, the CPU 111 obtains the position information X of the vertical line missing region, the binary image B, and the correction binary image E stored in the RAM 113, and stores them in a register. Note that this process is similar to the process of S801 in the first embodiment shown in FIG.

[0048] Next, in the loop from S1202 to S1209, the CPU 111 overwrites each vertical line missing area if it meets a predetermined condition. Whether or not each vertical line missing area meets the predetermined condition is determined based on each item from S1203 to S1206. Then, if it is determined to overwrite, in S1207 and S1208, the CPU 111 extracts pixel information Y at a position corresponding to the vertical line filling area in the correction binary image E, and overwrites and combines it at the corresponding position in the binary image B. Note that the processes of S1207 and S1208 are similar to the processes of S802 and S803 in the first embodiment shown in FIG.

[0049] First, in S1203, the CPU 111 determines whether or not the pixel blocks on both sides of the vertical line missing region are likely to be individual characters. Here, characters include not only general characters, but also numbers and symbols. If it is determined that the character is a character (Yes in S1203), the process proceeds to S1204. If it is determined that the character is not a character (No in S1203), the process proceeds to S1207.

[0050] For example, in the case of binary image B in Fig. 13(a), character recognition processing is performed on black pixel blocks 1311 and 1312 on both sides adjacent to vertical line missing region 1301 in Fig. 13(b). As a result of character recognition processing, it is assumed that the characters "3" and "5" are obtained as candidates, respectively. Furthermore, as a result of character recognition processing on black pixel blocks 1321 and 1322 on both sides adjacent to vertical line missing region 1301 in Fig. 13(c), it is assumed that the characters "0" and "0" are obtained as candidates, respectively. If a candidate character is obtained as a character recognition result, it is determined to be a character.

[0051] Next, the CPU 111 determines whether or not the character determined in S1203 is likely to be an independent character, based on each of the conditions in S1204 to S1206. First, in S1204, CPU 111 evaluates whether the reliability of the character recognition results of the pixel blocks on both sides adjacent to the vertical line missing region is lower than a predetermined threshold. If the reliability is lower than the threshold (Yes in S1204), the process proceeds to S1205. If the reliability is equal to or higher than the threshold (No in S1204), each pixel block is likely to be a single character, and the process returns to S1202 and does not perform overwriting in the vertical line missing region. Then, the process proceeds to the next vertical line missing region.

[0052] In S1205, CPU 111 evaluates whether the size of each black pixel block adjacent to the vertical line missing area is outside the range of character sizes for typical documents. If it is outside the range of typical character sizes (Yes in S1205), the process proceeds to S1206. If the character size is within the range of typical sizes (No in S1205), the process returns to S1202 and no overwriting is performed in the vertical line missing area. Then, the process proceeds to the next vertical line missing area. In this embodiment, a typical character size is evaluated as being 20 to 100 pixels. However, the user may specify a range of character sizes.

[0053] In S1206, the CPU 111 evaluates whether or not the aspect ratio of the character adjacent to the vertical line missing region is outside the range of a general character. If it is outside the range of typical character aspect ratios (Yes in S1206), the process proceeds to S1207. If it is within the range of typical character aspect ratios (No in S1206), the process returns to S1202 and no overwriting is performed in the vertical line missing area. Then, the process proceeds to the next vertical line missing area. Note that in this embodiment, the aspect ratio of a character is defined as character height / character width, and a typical character aspect ratio range is evaluated as 0.7 to 1.5. However, the user may specify the range of the character aspect ratio.

[0054] As described above, according to this embodiment, even when the number of characters in a scanned image is small and the spacing between characters is extremely narrow, accurate correction of vertical line missing areas can be achieved.

[0055] <Other Examples> The present invention can also be realized by supplying a program that realizes one or more functions of the above-mentioned embodiments to a system or device via a network or a storage medium, and having one or more processors in the computer of the system or device read and execute the program. It can also be realized by a circuit (e.g., ASIC) that realizes one or more functions. The present invention can also be applied to a system composed of multiple devices, or to an apparatus composed of a single device. The present invention is not limited to the above-mentioned embodiment, and various modifications are possible based on the spirit of the present invention, and are not excluded from the scope of the present invention. In other words, the present invention includes all configurations that combine the above-mentioned embodiments and their modifications. [Explanation of symbols]

[0056] 100 Copier 101 Scanner 110 Information processing device

Claims

1. An image processing device that generates a binary image to be subjected to character recognition processing, a first image acquisition means for acquiring a first binary image by performing a binarization process and a skew correction process on a scanned image obtained by scanning a document; a second image generating means for generating a second binary image by executing a first morphological process including a white pixel expansion process for expanding a white pixel area in the first binary image on the first binary image; a specifying means for generating a vertical histogram in the second binary image and specifying a position of a vertical line missing region based on a position in the generated vertical histogram where the number of black pixels is equal to or smaller than a threshold value; a third image generating means for generating a third binary image by executing a second morphological process including a white pixel shrinking process for shrinking a white pixel area in the first binary image on the first binary image; a fourth image generating means for generating a fourth binary image as a binary image to be subjected to the character recognition processing by overwriting pixel information of an area in the third binary image corresponding to the position of the specified vertical line missing area onto pixel information of an area in the first binary image corresponding to the position of the specified vertical line missing area; 13. An image processing device comprising:

2. 1. An image processing method for generating a binary image to be subjected to character recognition processing, comprising the steps of: a first image acquisition step of acquiring a first binary image by performing a binarization process and a skew correction process on a scanned image obtained by scanning a document; a second image generating step of generating a second binary image by performing a first morphological process including a white pixel expansion process for expanding a white pixel area in the first binary image on the first binary image; a step of generating a vertical histogram in the second binary image, and identifying a position of a vertical line missing region based on a position in the generated vertical histogram where the number of black pixels is equal to or smaller than a threshold value; a third image generating step of generating a third binary image by performing a second morphological process on the first binary image, the second morphological process including a white pixel shrinking process for shrinking a white pixel area in the first binary image; a fourth image generating step of generating a fourth binary image as a binary image to be subjected to the character recognition processing by overwriting pixel information of an area in the third binary image corresponding to the position of the specified vertical line missing area onto pixel information of an area in the first binary image corresponding to the position of the specified vertical line missing area; 13. An image processing method comprising:

3. A program for causing a computer to function as each of the means of the image processing apparatus according to claim 1.

Citation Information

Patent Citations

  • Original reader

    JP1989266682A

  • Defect inspection device

    JP1993280958A

  • Pattern inspecting method and device therefor

    JP2000028543A

  • Linear defect detector, semiconductor substrate manufacturing device, linear defect detection method, semiconductor substrate manufacturing method, program for causing computer to function as the detector or the manufacturing device, and storage medium for storing the program therein

    JP2008134196A

  • Image reader having dirt detecting function

    JP2010114567A