Image processing apparatus, image processing method, and image processing program
The image processing device enhances character string recognition accuracy by using a combination of character string and single character recognition units to correct string boundaries, addressing issues with long strings and unintended characters.
Patent Information
- Application Number
- JP2023024825
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2024-09-02
- Estimated Expiration
- 2043-02-21
AI Technical Summary
Existing character recognition systems struggle with accurately recognizing the ends of long character strings and incorrectly incorporating unintended characters, leading to decreased accuracy in OCR processing.
An image processing device that includes a character string recognition unit, a single character recognition unit, and a correction processing unit to recognize and correct character strings by expanding or adjusting the boundaries based on the recognition results of both units.
Improves the accuracy of character string recognition by appropriately including all characters within the string boundaries, thereby enhancing the precision of subsequent OCR processing.
Smart Images

Figure 2024118511000001
Abstract
Description
[Technical field]
[0001] The present disclosure relates to a technique for performing image processing such as character recognition on an image. [Background technology]
[0002] Conventionally, there are known techniques for extracting character strings from images of documents such as documents and slips. For example, a character recognition device is known that judges whether a rectangle is valid or invalid based on a set reference value, sets the line direction based on the result of an area discrimination process, divides line rectangles extracted from valid rectangles into one-character units, and performs character recognition by comparing image features of the extracted characters with character features in a pattern dictionary (see, for example, Patent Document 1). [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2003-256772 A Summary of the Invention [Problem to be solved by the invention]
[0004] For example, when a character string to be recognized from an image is long, a problem may occur in which the ends of the character string (starting character, ending character, etc.) cannot be properly recognized. In this case, a method can be considered in which the range recognized as the character string (character string rectangle) is expanded to an appropriate position while searching for pixels around the ends of the character string, but this increases the processing load. Also, when unintended characters (table lines, illustrations, etc.) exist around the ends of the character string, there is a problem in that these characters are captured as part of the character string. If the character string cannot be properly detected, the accuracy of the character recognition process (OCR) for the character string decreases.
[0005] An object of the present disclosure is to provide an image processing device, an image processing method, and an image processing program capable of appropriately recognizing a character string in an input image. [Means for solving the problem]
[0006] An image processing device according to one aspect of the present disclosure includes a character string recognition processing unit that recognizes a character string composed of a plurality of characters from an image, a single-character recognition processing unit that recognizes characters on a character-by-character basis from the image, and a correction processing unit that corrects the character string recognized by the character string recognition processing unit based on a recognition result by the character string recognition processing unit and a recognition result by the single-character recognition processing unit.
[0007] An image processing method according to another aspect of the present disclosure is a method executed by one or more processors to perform a string recognition process to recognize a string of characters composed of a plurality of characters from an image, perform a single character recognition process to recognize characters on a character-by-character basis from the image, and correct the string recognized by the string recognition process based on the recognition result of the string recognition process and the recognition result of the single character recognition process.
[0008] An image processing program according to another aspect of the present disclosure is a program for causing one or more processors to execute the following: performing a string recognition process to recognize a string of characters composed of a plurality of characters from an image; performing a single character recognition process to recognize characters on a character-by-character basis from the image; and correcting the string recognized by the string recognition process based on the recognition result of the string recognition process and the recognition result of the single character recognition process. Effect of the Invention
[0009] According to the present disclosure, it is possible to provide an image processing device, an image processing method, and an image processing program capable of appropriately recognizing a character string in an input image. [Brief description of the drawings]
[0010] [Figure 1] FIG. 1 is a functional block diagram showing a configuration of an image processing device according to an embodiment of the present disclosure. [Diagram 2] FIG. 2 is a diagram illustrating an example of an input image (quote) according to an embodiment of the present disclosure. [Diagram 3] FIG. 3 is a diagram illustrating an example of a character string recognition result of an input image according to an embodiment of the present disclosure. [Figure 4A] FIG. 4A is a diagram illustrating an example of an input image according to an embodiment of the present disclosure. [Figure 4B] FIG. 4B is a diagram illustrating an example of a character string recognition result of an input image according to an embodiment of the present disclosure. [Diagram 5] FIG. 5 is a diagram illustrating an example of a one-character recognition result of an input image according to an embodiment of the present disclosure. [Figure 6A] FIG. 6A is a diagram illustrating an example of the character string correction process according to an embodiment of the present disclosure. [Figure 6B] FIG. 6B is a diagram illustrating an example of the character string correction process according to an embodiment of the present disclosure. [Figure 6C] FIG. 6C is a diagram illustrating an example of the character string correction process according to an embodiment of the present disclosure. [Figure 7A] FIG. 7A is a diagram illustrating an example of the character string correction process according to an embodiment of the present disclosure. [Figure 7B] FIG. 7B is a diagram illustrating an example of the character string correction process according to an embodiment of the present disclosure. [Figure 7C] FIG. 7C is a diagram illustrating an example of the character string correction process according to an embodiment of the present disclosure. [Figure 8A] FIG. 8A is a diagram illustrating an example of the character string correction process according to an embodiment of the present disclosure. [Figure 8B] FIG. 8B is a diagram illustrating an example of the character string correction process according to an embodiment of the present disclosure. [Figure 8C] FIG. 8C is a diagram illustrating an example of the character string correction process according to an embodiment of the present disclosure. [Figure 8D] FIG. 8D is a diagram illustrating an example of the character string correction process according to an embodiment of the present disclosure. [Figure 9A] FIG. 9A is a diagram illustrating an example of the character string correction process according to an embodiment of the present disclosure. [Figure 9B] FIG. 9B is a diagram illustrating an example of the character string correction process according to an embodiment of the present disclosure. [Figure 9C]FIG. 9C is a diagram illustrating an example of the character string correction process according to an embodiment of the present disclosure. [Figure 9D] FIG. 9D is a diagram illustrating an example of the character string correction process according to an embodiment of the present disclosure. [Figure 9E] FIG. 9E is a diagram illustrating an example of the character string correction process according to an embodiment of the present disclosure. [Figure 10] FIG. 10 is a flowchart showing an example of a procedure of image processing executed in the image processing device according to an embodiment of the present disclosure. [Figure 11] FIG. 11 is a flowchart showing an example of a procedure of image processing (character string correction processing) executed in the image processing device according to the embodiment of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0011] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. Note that the following embodiments are examples of the present disclosure and are not intended to limit the technical scope of the present disclosure.
[0012] [Image processing device 1] 1 is a block diagram showing a configuration of an image processing device 1 according to an embodiment of the present disclosure. The image processing device 1 recognizes character strings (document parts) included in an input image (image data), performs a well-known character recognition process (OCR process) on the recognized character string, and outputs the character recognition result.
[0013] 1, the image processing device 1 includes a control unit 11, a storage unit 12, an operation display unit 13, and a communication unit 14. The image processing device 1 may be one or more cloud servers, or one or more physical servers.
[0014] The communication unit 14 is a communication interface for connecting the image processing device 1 to a network N1 by wire or wirelessly and for executing data communication with an external device (such as the operation terminal 2) via the network N1 in accordance with a predetermined communication protocol. The network N1 is formed of, for example, the Internet, a LAN, or the like.
[0015] The operation display unit 13 is a user interface that includes a display unit, such as a liquid crystal display or an organic EL display, that displays various information, and an operation unit, such as a mouse, a keyboard, or a touch panel, that accepts operations.
[0016] The storage unit 12 is a non-volatile storage unit such as an HDD (Hard Disk Drive), an SSD (Solid State Drive), or a flash memory that stores various information. The storage unit 12 stores a control program such as an image processing program (an example of an image processing program of the present disclosure) for causing the control unit 11 to execute image processing (see Figs. 10 and 11) described below. For example, the image processing program is non-temporarily recorded on a computer-readable recording medium such as a CD or a DVD, and is read by a reading device (not shown) such as a CD drive or a DVD drive provided in the image processing device 1 and stored in the storage unit 12. The image processing program may be distributed from a cloud server and stored in the storage unit 12.
[0017] The storage unit 12 also stores image data (scanned data, etc.) of documents and the like acquired from an external device (such as the operation terminal 2).
[0018] FIG. 2 shows an estimate as an example of a document. As shown in FIG. 2, an estimate includes a plurality of items such as a document classification ("estimate"), an issue date, a destination, an estimater's contact information, an estimated amount, a product name, a quantity, a standard price, a discount amount, a subtotal, a consumption tax, and a total amount. A user scans the estimate on an operation terminal 2 and uploads image data (input image) to the image processing device 1. The user may upload image data photographed by an operation terminal 2 having a camera function to the image processing device 1 via a network, or may upload image data from an information terminal different from the operation terminal 2 to the image processing device 1 via a network. When the control unit 11 acquires image data of the estimate, it stores the image data in the storage unit 12. As another embodiment, the control unit 11 may acquire a document file of the estimate created on the operation terminal 2 and store the document file in the storage unit 12.
[0019] The control unit 11 has control devices such as a CPU, a ROM, and a RAM. The CPU is a processor that executes various arithmetic operations. The ROM stores in advance control programs such as a BIOS and an OS for causing the CPU to execute various processes. The RAM stores various information and is used as a temporary storage memory (work area) for the various processes executed by the CPU. The control unit 11 controls the image processing device 1 by executing, by the CPU, various control programs that are stored in advance in the ROM or the storage unit 12.
[0020] When the control unit 11 acquires image data of a document, it performs preprocessing such as resolution conversion processing, skew correction processing, and background removal processing on the image data, and then performs character string (document part) recognition processing (extraction processing). For example, the control unit 11 recognizes each part such as character strings, tables, illustrations, and seals as rectangular areas of objects in the image data on which the preprocessing has been performed. Furthermore, after performing document part recognition processing, the control unit 11 performs character recognition processing (OCR processing) on the entire image data (entire image). Furthermore, the control unit 11 uses the result of the OCR processing to integrate the character data into character strings (wordization).
[0021] For example, in image data P1 of an estimate shown in Fig. 3, the control unit 11 recognizes character strings using an object recognition processing AI. The control unit 11 sets character string rectangles indicating the range of each recognized character string in the image data P1. In Fig. 3, a rectangular frame is an example of a character string rectangle. When a character string is properly recognized, multiple characters from the start character to the end character of each character string will fit within the character string rectangle, as shown in Fig. 3.
[0022] Here, in the conventional technology, for example, when a character string is long in a document image, a problem may occur in which the ends of the character string (such as a start character and a end character) cannot be properly recognized. The following description will be given by taking the document shown in FIG. 4A as an example. In the conventional system, when the document shown in FIG. 4A is recognized as a character string, a character string rectangle K1 can be properly set for a relatively short document (see FIG. 4B). In contrast, when the document is long, the start character ("go") and the end character ("su", ".") cannot be properly recognized, and the character string is extracted with the characters at the ends missing. In this case, when an attempt is made to correct the character string rectangle, the processing load increases because the character string rectangle must be expanded to an appropriate position while searching for pixels around the ends of the character string, and when unintended characters (such as table lines and illustrations) exist around the ends of the character string, these characters may be captured as the character string. In response to this, the image processing device 1 according to the present disclosure is capable of properly recognizing character strings in an input image as shown below.
[0023] Specifically, as shown in Fig. 1, the control unit 11 includes various processing units such as an acquisition processing unit 111, a character string recognition processing unit 112, a single character recognition processing unit 113, and a correction processing unit 114. The control unit 11 functions as the various processing units by executing various processes according to the image processing program. Some or all of the processing units included in the control unit 11 may be configured with electronic circuits. The image processing program may be a program for causing a plurality of processors to function as the various processing units.
[0024] The acquisition processing unit 111 acquires an input image. Specifically, the acquisition processing unit 111 acquires an image (input data) to be character recognized from the operation terminal 2. For example, the acquisition processing unit 111 acquires image data of various document images such as an estimate illustrated in FIG.
[0025] The character string recognition processing unit 112 executes a recognition process of document parts in the input image acquired by the acquisition processing unit 111. Specifically, the character string recognition processing unit 112 executes a character string recognition process for recognizing a character string consisting of a plurality of characters from the input image. The character string recognition processing unit 112 also sets a character string rectangle corresponding to the recognized character string. That is, the character string recognition processing unit 112 recognizes a group of a plurality of characters as a character string rectangle. For example, in the input image shown in FIG. 4A, the character string recognition processing unit 112 sets a plurality of character string rectangles K1 corresponding to each character string. As shown in FIG. 4B, for the long sentence "The sales terms applied to your order are based on our sales terms valid at the time of your order", a character string rectangle K1 is set in which the start character ("go") and the end characters ("su", ".") are missing.
[0026] The single character recognition processing unit 113 executes single character recognition processing to recognize characters on a character-by-character basis in the input image acquired by the acquisition processing unit 111. The single character recognition processing unit 113 also sets single character rectangles corresponding to the recognized characters. That is, the single character recognition processing unit 113 recognizes the smallest unit of a character as a character string rectangle. For example, as shown in Fig. 5, the single character recognition processing unit 113 sets multiple single character rectangles K2 corresponding to each character.
[0027] The correction processing unit 114 executes a process (character string correction process) to correct a character string when a character not included in the character string recognized by the character string recognition processing unit 112 exists. Specifically, the correction processing unit 114 corrects the character string (character string rectangle K1) recognized by the character string recognition processing unit 112 based on the recognition result by the character string recognition processing unit 112 and the recognition result by the one-character recognition processing unit 113. For example, when the one-character rectangle K2 overlaps with the end of the character string rectangle K1 in the longitudinal direction, the correction processing unit 114 extends the end of the character string rectangle K1 to the end of the one-character rectangle K2. Also, when the one-character rectangle K2 is disposed in the longitudinal vicinity of the end of the character string rectangle K1, the correction processing unit 114 extends the end of the character string rectangle K1 to the end of the one-character rectangle K2. That is, when a character not included in the character string recognized by the character string recognition processing unit 112 exists, the correction processing unit 114 corrects the range of the character string so that the character is included in the character string.
[0028] In the example shown in Fig. 6A, the one-character rectangle K2 "go" overlaps the left end of the character string rectangle K1 in the longitudinal direction, and the one-character rectangle K2 "su" overlaps the right end of the character string rectangle K1 in the longitudinal direction. In this case, as shown in Fig. 6B, the correction processor 114 expands the left end of the character string rectangle K1 to a position that includes "go" and expands the right end of the character string rectangle K1 to a position that includes "su."
[0029] Furthermore, as shown in Fig. 6B, after the right end of the character string rectangle K1 is expanded, a one-character rectangle K2 of "." exists in the longitudinal vicinity of the right end (next to "su"). As shown in Fig. 6C, the correction processing unit 114 further expands the right end of the character string rectangle K1 to a position that includes "."
[0030] Other examples are shown in Figures 7A to 7C. Figure 7A shows a character string rectangle K1 of a character string recognized from a table image partitioned by ruled lines. In a conventional system, when an expansion process is performed on the character string rectangle K1 shown in Figure 7A, if the ruled lines of the table image are similar to the color of the character, the character string rectangle K1 is expanded to a range including the ruled lines (see Figure 7B). In this case, when the range of the character string rectangle K1 is subjected to OCR processing, an unintended character is recognized at the beginning of the original character string, as shown in Figure 7C.
[0031] In this regard, in the embodiment of the present disclosure, the character string recognition processing unit 112 recognizes a character string and sets a character string rectangle K1 (see FIG. 8A), and the single character recognition processing unit 113 recognizes each character and sets a single character rectangle K2 (see FIG. 8B). Then, when an end (here, the left end) of the character string rectangle K1 overlaps with the single character rectangle K2 (see FIG. 8C), the correction processing unit 114 expands the left end of the character string rectangle K1 that overlaps with the single character rectangle K2 (the letter "W") to a position that includes the letter "W" as shown in FIG. 8D.
[0032] In this way, when a character recognized by the single character recognition processing unit 113 overlaps with a character string recognized by the character string recognition processing unit 112, or when the character exists in the vicinity of the character string, the correction processing unit 114 corrects the range of the character string (character string rectangle K1) so that the character is included in the character string. This makes it possible to properly extract the character string from the image.
[0033] Note that "nearby" is not limited to the case where the character string rectangle K1 and the one-character rectangle K2 are adjacent (meaning "adjacent"), but also includes the case where the distance between the character string rectangle K1 and the one-character rectangle K2 is less than a predetermined distance. The predetermined distance may be set to the width of the one-character rectangle K2, for example, or may be set according to the width of the character string rectangle K1 (e.g., the larger the width of the character string rectangle K1, the larger the predetermined distance).
[0034] In the example shown in FIG. 8D, since the distance L1 from the left end of the character string rectangle K1 to the one-character rectangle K2 of the character “.” is equal to or greater than a predetermined distance, the correction processing unit 114 does not expand the character string rectangle K1 up to the position where the character “.” is included. That is, when the distance between the one-character rectangle K2 overlapping the longitudinal end of the character string rectangle K1 or the one-character rectangle K2 arranged in the vicinity of the longitudinal direction of the end of the character string rectangle K1 and another one-character rectangle K2 adjacent in the longitudinal direction is less than the predetermined distance, the correction processing unit 114 expands the end of the character string rectangle K1 to the end of another one-character rectangle, and when the distance is equal to or greater than the predetermined distance, the correction processing unit 114 expands the end of the character string rectangle K1 to the end of the one-character rectangle K2 (does not expand up to the end of another one-character rectangle K2). Thereby, it is possible to prevent an unintended character from being recognized as one character string.
[0035] FIGS. 9A to 9E show still other examples. FIG. 9A shows an input image, and FIG. 9B shows a character string rectangle K1 of a character string recognized from the input image. For example, as shown in FIG. 9B, when the height of the character “total” and the height of the character “7 points” are different from each other, the character string rectangle K1 may be set in accordance with the character with the lower height (“7 points”). In the present embodiment, the one-character recognition processing unit 113 recognizes each character of “total 7 points” and sets a one-character rectangle K2 (see FIG. 9C). Further, the one-character recognition processing unit 113 sets a one-character rectangle K2 that matches the width and height for each character.
[0036] As a result of the character string recognition processing unit 112 recognizing the character string and the one-character recognition processing unit 113 recognizing each character in units of one character, when the one-character rectangle K2 overlaps the character string rectangle K1 in the height direction as shown in FIG. 9D, the correction processing unit 114 expands the upper end (upper side) of the character string rectangle K1 upward to the position where the characters “total” and “count” overlapping the character string rectangle K1 are included (see FIG. 9E). That is, when the one-character rectangle K2 overlaps the end of the character string rectangle K1 in the short side direction, the correction processing unit 114 expands the end of the character string rectangle K1 to the end of the one-character rectangle K2. In this way, the correction direction (expansion direction) of the character string rectangle K1 may be the longitudinal direction (the direction in which the characters are arranged) or the short side direction (the direction orthogonal to the direction in which the characters are arranged).
[0037] As described above, when the control unit 11 acquires an input image, it executes a process of recognizing a character string from the input image (character string recognition process), a process of recognizing characters one character at a time from the input image (single character recognition process), and a process of correcting the character string (character string correction process) when a character not included in the recognized character string exists (a character overlapping the character string, a character adjacent to the character string). The control unit 11 may execute the character string recognition process and the single character recognition process in any order, or may execute both processes in parallel.
[0038] The control unit 11 may display the result of the character string recognition process (character string rectangle K1) and the result of the single character recognition process (single character rectangle K2) on the image. This allows the user to understand the recognition status of the character string and the character. The control unit 11 may also execute the character string correction process in response to a user's correction instruction operation.
[0039] The control unit 11 executes existing OCR processing for each of character strings that do not require character string correction processing and character strings that have undergone character string correction processing, and outputs OCR results (character recognition results). Note that the OCR processing includes pre-processing (processing such as background removal, inversion, line removal, seal removal, and italic correction) that improves the accuracy of the OCR.
[0040] [Operation terminal 2] 1, the operation terminal 2 includes a control unit 21, a storage unit 22, an operation display unit 23, and a communication unit 24. The operation terminal 2 is, for example, an image forming device or a multifunction peripheral equipped with an image forming function (e.g., a scanning function). Note that the operation terminal 2 may be, for example, a personal computer, a smartphone, a tablet terminal, or the like.
[0041] The communication unit 24 is a communication interface for connecting the operation terminal 2 to the network N1 in a wired or wireless manner and for executing data communication with an external device such as the image processing device 1 via the network N1 in accordance with a predetermined communication protocol.
[0042] The operation display unit 23 is a user interface that includes a display unit such as a liquid crystal display or an organic EL display that displays information such as various web pages, and an operation unit such as a mouse, keyboard, or touch panel that accepts operations.
[0043] The storage unit 22 is a non-volatile storage unit such as an HDD, SSD, or flash memory that stores various types of information. The storage unit 22 stores a control program that causes the control unit 21 to execute various processes. For example, the control program is non-temporarily recorded on a computer-readable recording medium such as a CD or DVD, and is read by a reading device (not shown) such as a CD drive or DVD drive provided in the operation terminal 2 and stored in the storage unit 22. The control program may be distributed from a cloud server or the image processing device 1 and stored in the storage unit 22.
[0044] The control unit 21 has control devices such as a CPU, a ROM, and a RAM. The CPU is a processor that executes various arithmetic operations. The ROM is a non-volatile storage unit in which control programs such as a BIOS and an OS for causing the CPU to execute various processes are stored in advance. The RAM is a volatile or non-volatile storage unit that stores various information, and is used as a temporary storage memory (work area) for various processes executed by the CPU. The control unit 21 controls the operation terminal 2 by executing, by the CPU, various control programs stored in advance in the ROM or the storage unit 22. Note that some or all of the processing units included in the control unit 21 may be configured with electronic circuits.
[0045] Specifically, the control unit 21 executes various processes according to the control programs stored in the storage unit 22. For example, the control unit 21 transmits image data generated by scanning paper forms such as estimates, purchase orders, invoices, and delivery notes to the image processing device 1. The control unit 21 also creates a document file of the form based on a user's operation using a word processing application or the like, and transmits the document file to the image processing device 1 as image data.
[0046] As another embodiment, the control unit 21 may execute a browser process for causing the operation display unit 23 to display a web page provided from the image processing device 1 via the network N1, and inputting an operation on the operation display unit 23 to the image processing device 1. In this case, the control unit 21 executes an upload process of the image data on the web page.
[0047] Furthermore, the control unit 21 displays the character recognition result (OCR result) by the image processing device 1. The operation terminal 2 may include each processing unit of the image processing device 1. In this case, the operation terminal 2 executes each of the above-mentioned processes on the input image. For example, the operation terminal 2 may acquire (download) and execute an image processing program for executing the image processing described below.
[0048] [Image processing] FIG. 10 is a flowchart showing an example of a procedure of image processing executed in the image processing device 1.
[0049] The present disclosure can be understood as an image processing method (image processing method of the present disclosure) that executes one or more steps included in the image processing. One or more steps included in the image processing described here may be omitted as appropriate. The steps in the image processing may be executed in a different order as long as the same action and effect is achieved. Furthermore, although an example is described here in which the control unit 11 of the image processing device 1 executes each step in the image processing, in other embodiments, one or more processors may execute each step in the image processing in a distributed manner. Furthermore, when the control unit 11 acquires image data of an input image from an external device (such as the operation terminal 2), it is possible to execute the image processing for each piece of image data in parallel.
[0050] In step S1, the control unit 11 acquires an input image. For example, the control unit 11 acquires image data of a document image (quote) shown in Fig. 2. After acquiring the input image, the control unit 11 proceeds to steps S21 and S22, and executes the processes of steps S21 and S22 in parallel.
[0051] In step S21, the control unit 11 executes a character string recognition process for recognizing a character string consisting of a plurality of characters in the input image. The control unit 11 also sets character string rectangles corresponding to the recognized character string. For example, in the input image shown in FIG. 4A, the control unit 11 sets a plurality of character string rectangles K1 corresponding to each character string.
[0052] In step S22, the control unit 11 executes a one-character recognition process for recognizing characters in units of one character in the input image. The control unit 11 also sets one-character rectangles corresponding to the recognized characters. For example, as shown in FIG. 5, the control unit 11 sets a plurality of one-character rectangles K2 corresponding to each character.
[0053] When the processes of steps S21 and S22 are completed, the control unit 11 acquires the recognition result of the character string recognition process (see FIG. 4B) and the recognition result of the single character recognition process (see FIG. 5).
[0054] In step S3, the control unit 11 determines whether or not the recognized character string includes any characters that are not included. Specifically, the control unit 11 determines whether or not a one-character rectangle K2 that overlaps with an end of the character string rectangle K1 exists. The control unit 11 also determines whether or not a one-character rectangle K2 exists near an end of the character string rectangle K1. If the control unit 11 determines that the recognized character string includes any characters that are not included (S3: Yes), it shifts the process to step S4. On the other hand, if the control unit 11 determines that the recognized character string includes no characters that are not included (S3: No), it shifts the process to step S5.
[0055] In step S4, the control unit 11 executes a character string correction process. A specific example of the character string correction process is shown in FIG.
[0056] In the character string correction process, in step S41, the control unit 11 calculates the number of characters (the number of one-character rectangles) of one-character rectangles K2 in a character string rectangle K1.
[0057] In step S42, the control unit 11 determines whether the calculated number of characters is 0. If the calculated number of characters is not 0 (is one or more characters) (S42: No), the control unit 11 shifts the process to step S43. On the other hand, if the calculated number of characters is 0 (S42: Yes), the control unit 11 ends the character string correction process and shifts the process to step S5 (see FIG. 10).
[0058] In step S43, the control unit 11 determines whether the calculated number of characters is two or more. If the calculated number of characters is two or more (S43: Yes), the control unit 11 shifts the process to step S44. On the other hand, if the calculated number of characters is one character (S43: No), the control unit 11 shifts the process to step S431.
[0059] In step S44, the control unit 11 identifies (confirms) the arrangement direction and character spacing of the one-character rectangle K2 in the character string rectangle K1. For example, the control unit 11 confirms whether the multiple characters are arranged horizontally (horizontally written) or vertically (vertically written). The control unit 11 also confirms the spacing between the multiple characters. After step S44, the control unit 11 transitions the process to step S45.
[0060] In step S431, the control unit 11 specifies (confirms) the character size. The character size is used as a determination distance for determining the distance between adjacent characters in step S45. After step S431, the control unit 11 shifts the process to step S45.
[0061] In step S45, the control unit 11 expands the character string. For example, the control unit 11 expands the character string rectangle K1 when the character (one character rectangle K2) resulting from the single character recognition is aligned in the direction confirmed in step S44 and the character spacing is less than a predetermined distance. In addition, when the number of characters in the character string rectangle K1 is one, the control unit 11 expands the character string rectangle K1 when the character spacing is less than the distance of the character size.
[0062] In step S46, the control unit 11 combines the character strings. The control unit 11 executes the combining process when it is necessary to combine the character strings. Note that, when it is not necessary to combine the character strings, the control unit 11 skips step S46 and moves the process to step S47.
[0063] In step S47, the control unit 11 reduces the character string rectangle K1. For example, when the height of each character (one-character rectangle K2) in the character string rectangle K1 is lower than the height of the character string rectangle K1, the control unit 11 executes a process to reduce the height of the character string rectangle K1 to the height of the one-character rectangle K2. Also, when there is a space between an end of the character string rectangle K1 and a character (one-character rectangle K2) adjacent to the end, the control unit 11 executes a process to reduce the horizontal width of the character string rectangle K1. The control unit 11 executes the reduction process when it is necessary to reduce the character string. Note that when it is not necessary to reduce the character string, the control unit 11 skips step S47, ends the character string correction process, and transitions the process to step S5 (see FIG. 10).
[0064] When the control unit 11 finishes the character string correction process, it executes OCR processing in step S5. Specifically, if there is a character not included in the recognized character string (S3: Yes), the control unit 11 executes OCR processing on the character string rectangle K1 (see Figs. 6C, 8D, and 9E) corrected by the character string correction process and outputs the OCR result. On the other hand, if there is no character not included in the recognized character string (S3: No), the control unit 11 executes OCR processing on the character string rectangle K1 recognized in step S21 and outputs the OCR result.
[0065] As described above, the image processing device 1 according to this embodiment executes character string recognition processing for recognizing a character string consisting of a plurality of characters from an image, and single character recognition processing for recognizing characters on a character-by-character basis from the image, and corrects the character string recognized by the character string recognition processing based on the recognition result by the character string recognition processing and the recognition result by the single character recognition processing.
[0066] In addition, in the character string recognition process, the image processing device 1 sets a character string rectangle corresponding to the recognized character string, and in the single character recognition process, sets a single character rectangle corresponding to the recognized character, and when the single character rectangle overlaps with the longitudinal end of the character string rectangle, extends the end of the character string rectangle to the end of the single character rectangle.
[0067] According to the above configuration, even if the end of a long character string (character string rectangle K1) cannot be properly recognized as shown in Fig. 4B, the character string rectangle K1 can be corrected to a proper position by using a one-character rectangle K2 recognized by a one-character recognition process. This makes it possible to properly recognize the character string in the input image, thereby improving the accuracy of the subsequent OCR process.
[0068] The image processing device 1 can improve the recognition accuracy of the character string recognition process and the single character recognition process by executing machine learning on the character string rectangle setting process and the single character string rectangle setting process. The image processing device 1 may also generate a trained model for the character string recognition process and a trained model for the single character recognition process.
[0069] In the above-described embodiment, the image processing device 1 alone corresponds to the image processing device according to the present disclosure, but the image processing device according to the present disclosure may be configured as a single operation terminal 2. In addition, the present disclosure may be configured as an image processing system including the image processing device 1 and the operation terminal 2. For example, the components of the image processing device 1 and the operation terminal 2 may cooperate to share and execute the image processing.
[0070] [Disclosure Note] The following will provide an outline of the disclosure extracted from the above-described embodiment. Note that the configurations and processing functions described in the following supplementary notes can be selected and combined in any desired manner.
[0071] <Appendix 1> a character string recognition processing unit that recognizes a character string composed of a plurality of characters from an image; a character recognition processing unit for recognizing characters on a character-by-character basis from the image; a correction processing unit that corrects the character string recognized by the character string recognition processing unit based on a recognition result by the character string recognition processing unit and a recognition result by the single character recognition processing unit; An image processing device comprising:
[0072] <Appendix 2> the character string recognition processing unit sets a character string rectangle corresponding to the recognized character string; the one-character recognition processing unit sets a one-character rectangle corresponding to the recognized character; when the one-character rectangle overlaps an end of the character string rectangle in a longitudinal direction, the correction processing unit extends the end of the character string rectangle to an end of the one-character rectangle. 2. An image processing device as described in claim 1.
[0073] <Appendix 3> the character string recognition processing unit sets a character string rectangle corresponding to the recognized character string; the one-character recognition processing unit sets a one-character rectangle corresponding to the recognized character; when the one-character rectangle is disposed in the longitudinal vicinity of an end of the character string rectangle, the correction processing unit extends the end of the character string rectangle to the end of the one-character rectangle. 3. An image processing device according to claim 1 or 2.
[0074] <Appendix 4> when a distance between the one-character rectangle that overlaps with an end portion in the longitudinal direction of the character string rectangle or between the one-character rectangle that is arranged in the longitudinal vicinity of the end portion of the character string rectangle and another one-character rectangle adjacent in the longitudinal direction is less than a predetermined distance, the correction processing unit extends the end portion of the character string rectangle to the end portion of the other one-character rectangle, When the distance is equal to or greater than a predetermined distance, the correction processing unit extends an end of the character string rectangle to an end of the one-character rectangle. 4. The image processing device according to claim 1,
[0075] <Appendix 5> the character string recognition processing unit sets a character string rectangle corresponding to the recognized character string; the one-character recognition processing unit sets a one-character rectangle corresponding to the recognized character; when the one-character rectangle overlaps an end of the character string rectangle in a short side direction, the correction processing unit extends the end of the character string rectangle to an end of the one-character rectangle. 5. The image processing device according to claim 1,
[0076] <Appendix 6> displaying the character string rectangle and the one-character rectangle on the image displayed on a display screen; 6. The image processing device according to claim 1,
[0077] <Appendix 7> performing character recognition processing on the character string corrected by the correction processing unit; 7. The image processing device according to claim 1, [Explanation of symbols]
[0078] 1: Image processing device 2: Operation terminal 11: Control section 111: Acquisition processing unit 112: Character string recognition processing unit 113:1 Character recognition processing section 114: Correction processing unit K1: String rectangle K2: 1 text rectangle
Claims
1. a character string recognition processing unit that recognizes a character string composed of a plurality of characters from an image; a character recognition processing unit for recognizing characters on a character-by-character basis from the image; a correction processing unit that corrects the character string recognized by the character string recognition processing unit based on a recognition result by the character string recognition processing unit and a recognition result by the single character recognition processing unit; An image processing device comprising:
2. the character string recognition processing unit sets a character string rectangle corresponding to the recognized character string; the single character recognition processing unit sets a single character rectangle corresponding to the recognized character; when the one-character rectangle overlaps an end of the character string rectangle in a longitudinal direction, the correction processing unit extends the end of the character string rectangle to an end of the one-character rectangle. The image processing device according to claim 1 .
3. the character string recognition processing unit sets a character string rectangle corresponding to the recognized character string; the single character recognition processing unit sets a single character rectangle corresponding to the recognized character; when the one-character rectangle is disposed in the longitudinal vicinity of an end of the character string rectangle, the correction processing unit extends the end of the character string rectangle to the end of the one-character rectangle. The image processing device according to claim 1 .
4. when a distance between the one-character rectangle that overlaps with an end portion in the longitudinal direction of the character string rectangle or the one-character rectangle that is arranged in the longitudinal vicinity of the end portion of the character string rectangle and another one-character rectangle adjacent in the longitudinal direction is less than a predetermined distance, the correction processing unit extends the end portion of the character string rectangle to the end portion of the other one-character rectangle, When the distance is equal to or greater than a predetermined distance, the correction processing unit extends an end of the character string rectangle to an end of the one-character rectangle.
4. The image processing device according to claim 2 or 3.
5. the character string recognition processing unit sets a character string rectangle corresponding to the recognized character string; the single character recognition processing unit sets a single character rectangle corresponding to the recognized character; when the one-character rectangle overlaps an end portion of the character string rectangle in a short side direction, the correction processing unit extends the end portion of the character string rectangle to an end portion of the one-character rectangle. The image processing device according to claim 1 .
6. displaying the character string rectangle and the one-character rectangle on the image displayed on a display screen; 4. The image processing device according to claim 2 or 3.
7. performing character recognition processing on the character string corrected by the correction processing unit; The image processing device according to claim 1 .
8. Executing a character string recognition process to recognize a character string composed of a plurality of characters from an image; executing a character recognition process for recognizing characters on a character-by-character basis from the image; correcting the character string recognized by the character string recognition process based on a recognition result of the character string recognition process and a recognition result of the single character recognition process; An image processing method executed by one or more processors.
9. Executing a character string recognition process to recognize a character string composed of a plurality of characters from an image; executing a character recognition process for recognizing characters on a character-by-character basis from the image; correcting the character string recognized by the character string recognition process based on a recognition result of the character string recognition process and a recognition result of the single character recognition process; An image processing program for causing one or more processors to execute the above.
Citation Information
Patent Citations
Character recognizing device
JP1989061887A
Device and method for extracting character string area
JP1996161421A
Method and device for table recognition
JP2000090195A
Character recognition device, character recognition program and character recognition method
JP2011022938A
Information processing apparatus, information processing method, and program
JP2022170175A
