Method and system for generating text output from image
By comparing the text data in the image with the domain vocabulary database and the language dictionary database, and splitting and correcting the words that were not successfully matched, the problem of inaccurate text extraction in low-quality images in the prior art is solved, and the problem of inaccurate text extraction in low-quality images is realized. Higher text extraction accuracy and data reliability.
Patent Information
- Application Number
- CN202380046909.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-06-14
- Filing Date
- 2023-06-12
- Publication Date
- 2025-02-07
AI Technical Summary
Existing OCR technology is difficult to accurately extract text information in low-quality images, and the extracted text may be incorrect.
By receiving images, machine-readable text data is extracted and compared with domain vocabulary databases and language dictionary databases, the words that were successfully matched and those that were not successfully matched were determined. Split and correct the unsuccessfully matched words to generate improved text output.
Improves the accuracy of text extraction, reduces the time to process wrong text, and improves data reliability through automated text correction.
Smart Images

Figure CN119404232A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to electronic image processing and recognition of textual content thereof, and more particularly, to systems and methods for generating textual output from electronic images with improved accuracy. Background Art
[0002] In personal space or business environment, many users need to digitize paper documents, wherein users digitize paper documents such as financial statements, government documents, legal documents, medical records, logistics invoices, freight documents, tax forms, etc. Typically, users need to convert the text of these documents into machine-readable data for record keeping purposes and to make the data searchable. Optical character recognition (OCR) is a well-known technology for converting paper documents (including printed and / or handwritten text) into digital form (such as machine-encoded text) electronically or mechanically. Typically, commercially available scanners are used to scan a given paper document to generate a raster image. In general, a raster image is compiled using a rectangular matrix or grid of square pixels. The raster image is further passed through commercially available software, such as an OCR engine. The OCR engine processes the raster image to identify elements (e.g., characters, words, numbers, special characters, etc.) to generate text data as output.
[0003] It has been observed that OCR engines generally have some limitations, for example, even on a clear and high-quality electronic image of a document, the OCR engine may make errors during text extraction for some words. Many electronic images of documents in daily operation may not be clear or of poor quality, may be distorted during scanning, and / or degraded during binarization after scanning. In such documents, some tags required to extract text information are not recognizable; therefore, the text information may not be correctly extracted. Although improving image quality can result in better text extraction than the original image, OCR technology may still not provide significant improvements in text extraction, and the extracted text may have errors. Summary of the invention
[0004] In addition to providing other technical advantages, there is a need for technology to overcome one or more of the above-mentioned limitations, such as inaccurate extraction of text information from relatively low quality images and correction of the extracted text information. Various embodiments of the present disclosure provide systems and methods for generating text output from images with improved accuracy. Various embodiments of the present disclosure describe a computing device or tool that enables text processing of text extracted from images and reduces the time to dispose of erroneous text while improving the accuracy of text extraction. The disclosed technology implements automated text correction with the help of domain and language specific knowledge databases.
[0005] To achieve the above and other objectives of the present disclosure, in one aspect, a computer-implemented method is disclosed. The computer-implemented method executed by a processor includes receiving an image including text data. The method also includes extracting machine-readable text data from the image. The machine-readable text data includes one or more words. In addition, the method includes comparing each of the one or more words with a data set including at least one of a domain vocabulary database and a language dictionary database to determine a first word set and a second word set. The first word set is words that successfully match the words available in the data set, and the second word set is words that do not successfully match the words available in the data set. In addition, the method includes splitting at least one word in the second word set into two or more words to determine a third word set that matches the words available in the data set. The method also includes generating a text output associated with the image based at least on the first word set and the third word set.
[0006] The advantage of some embodiments is that images can be received from various sources, and this source includes for example commercially available scanners, commercially available cameras, memory or the Internet connected via a network. In addition, machine-readable text data is extracted from the image based on any character recognition engine. In addition, the advantage of some embodiments is that one or more words included in the machine-readable text data are compared with the entire data set including a domain vocabulary database (for example, a specific word related to a specific industry field) and a language dictionary database. Such comparison ensures that even if there is no such word in the language dictionary database, those words that exist in the domain vocabulary database are also compared and successfully matched. Another advantage of some embodiments is to correct those words that may have been connected by mistake by splitting the second word set and matching the split words in the data set. For example, performing a splitting step for a certain second word set (for example, connected words) ensures that these words are corrected by the processor before generating text output (that is, final output).
[0007] In one aspect, the step of comparing each of the one or more words includes calculating a highest similarity score for each word in the second word set with a word available in the data set. Upon determining that the highest similarity score is at least equal to a threshold similarity score, the method includes detecting from the data set the word corresponding to the highest similarity score as a corrected word of the corresponding word in the second word set. Additionally, the method includes classifying the corrected word into the first word set.
[0008] An advantage of some embodiments is that the second word set that does not match the data set is subjected to an additional processing step so that such words can be corrected. A maximum domain similarity score is calculated for each word in the second word set, and if the maximum domain similarity score is greater than a threshold similarity score, the corresponding second word set is corrected or replaced with a correct word from the data set. After correction, all corrected words are reclassified as the first word set. Calculating the maximum similarity score ensures that the second word set is corrected with increased accuracy.
[0009] In one aspect, the method includes splitting at least one word in the second word set into two or more words based at least in part on a predefined text parsing rule. In addition, the method includes comparing the two or more words to a data set to determine whether the two or more words have a successful match in the data set. The method also includes classifying the two or more words into a third word set in response to determining that the two or more words have a successful match in the data set.
[0010] An advantage of some embodiments is that even those second word sets (i.e., connected words) that are not corrected after calculating the highest similarity scores can be corrected via additional processing. Based on the teachings of at least some embodiments of the present disclosure, these words are also corrected by performing a splitting step based on predefined text parsing rules. Each connected word is split into two or more words, and if the two or more words are meaningful words that have a match in the data set, the two or more words are classified into a third word set.
[0011] In one aspect, the text output is generated based on the first set of words, the second set of words that remain unmatched, and the third set of words. An advantage of such an embodiment is that the text output is comprehensive and covers all words of the input image after the correction process.
[0012] In one aspect, the language dictionary database is configured to store words according to syntactic and semantic rules of at least one language, and the domain vocabulary database is configured to store keywords corresponding to at least one domain. An advantage of some embodiments is that the language database includes a set of words for at least one language, and the domain vocabulary database also includes a set of words for at least one domain, and these sets are used for comparison purposes to ensure that words present in the machine-readable text data are corrected with increased accuracy.
[0013] In one aspect, before extracting machine-readable text data from an image, the image is processed based on at least one image preprocessing operation to enhance the quality of the image. At least one image preprocessing operation includes at least one of the following: (a) an adaptive thresholding method, (b) an image enhancement method, and (c) a de-tilting method. An advantage of some embodiments is that even if the image quality is low, the image must undergo various image preprocessing operations to enhance its quality. In an example, the adaptive thresholding method includes eliminating gray areas in the image. The image enhancement method includes updating one or more image parameters of the image. The one or more image parameters include at least one of the following: (a) brightness, (b) contrast, (c) clarity, and (d) aspect ratio. In yet another aspect, the de-tilting method includes changing the tilt angle of the image.
[0014] An advantage of some embodiments is that in order to improve the image quality, various pre-processing operations are performed on the image before performing text extraction. The various pre-processing operations may be related to the orientation of the image, the brightness or contrast of the image, the clarity or aspect ratio of the image, the tilt angle of the image, etc.
[0015] In another aspect, a computing device is disclosed. The computing device includes: a memory including executable instructions; and a processor. The processor is communicatively coupled to the memory. The processor is configured to execute instructions to cause the computing device to at least partially receive an image including text data. The computing device is also caused to extract machine-readable text data from the image. The machine-readable text data includes one or more words. In addition, the computing device is caused to compare each of the one or more words with a data set including at least one of a domain vocabulary database and a language dictionary database to determine a first word set and a second word set. The first word set is a word that successfully matches the words available in the data set, and the second word set is a word that does not successfully match the words available in the data set. In addition, the computing device is caused to split at least one word in the second word set into two or more words to determine a third word set that matches the words available in the data set. The computing device is also caused to generate a text output associated with the image based at least on the first word set and the third word set.
[0016] In yet another aspect, a non-transitory computer-readable storage medium is disclosed. The non-transitory computer-readable storage medium includes computer-executable instructions. The computer-executable instructions, when executed by at least a processor of a computing device, cause the computing device to perform a method. The method includes receiving an image including text data. The method also includes extracting machine-readable text data from the image. The machine-readable text data includes one or more words. In addition, the method includes comparing each of the one or more words with a data set including at least one of a domain vocabulary database and a language dictionary database to determine a first word set and a second word set. The first word set is a word that successfully matches the words available in the data set, and the second word set is a word that does not successfully match the words available in the data set. In addition, the method includes splitting at least one word in the second word set into two or more words to determine a third word set that matches the words available in the data set. The method also includes generating a text output associated with the image based at least on the first word set and the third word set. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The following detailed description of the illustrative embodiments is better understood when read in conjunction with the accompanying drawings. For the purpose of illustrating the present disclosure, exemplary configurations of the present disclosure are shown in the accompanying drawings. However, the present disclosure is not limited to the specific devices or tools and means disclosed herein. In addition, it should be understood by those skilled in the art that the drawings are not drawn to scale. Whenever possible, similar elements have been indicated by the same numbers:
[0018] Figure 1A is a diagram of an environment relevant to at least some embodiments of the present disclosure;
[0019] Figure 1B is an illustration of another environment relevant to at least some embodiments of the present disclosure;
[0020] Figure 2 is a simplified block diagram of a computing device according to an embodiment of the present disclosure;
[0021] Figure 3 is a schematic representation of a process flow for performing intelligent text output generation according to an embodiment of the present disclosure;
[0022] FIG. 4A to FIG. 4G collectively represent example representations for performing image pre-processing, character recognition, and text processing on an image according to embodiments of the present disclosure;
[0023] Figure 5 is a process flow diagram of a computer-implemented method for accurately generating text output from an image according to an embodiment of the present disclosure;
[0024] Figure 6A data flow graph representation showing a method for extracting words from an image and determining a first set of words and a second set of words based on the extracted words according to an embodiment of the present disclosure;
[0025] Fig. 7A is a simplified data flow graph representation for performing additional text processing on a second set of words according to an embodiment of the present disclosure;
[0026] Figure 7B is a simplified data flow graph representation of a text output for splitting a second set of words (i.e., residual words) to determine corrected words and generate an image according to an embodiment of the present disclosure;
[0027] Figure 8 represents a simplified data flow graph representation for accurately generating text output from an image according to another embodiment of the present disclosure; and
[0028] Fig. 9 is a simplified block diagram of an electronic device capable of implementing various embodiments of the present disclosure.
[0029] Unless specifically noted, the drawings referred to in this specification should not be understood as being drawn to scale and such drawings are merely schematic in nature. DETAILED DESCRIPTION
[0030] In the following description, for the purpose of explanation, many specific details are set forth in order to provide a thorough understanding of the present disclosure. However, it will be appreciated by those skilled in the art that the present disclosure can be practiced without these specific details. The description of known components and processing techniques is omitted to avoid unnecessarily obscuring the embodiments herein. The examples used herein are merely to promote an understanding of the manner in which the embodiments herein can be practiced, and further enable those skilled in the art to practice the embodiments herein. Therefore, the examples should not be considered to limit the scope of the embodiments herein.
[0031] References in this specification to "one embodiment" or "an embodiment" mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present technology. The phrase "in an embodiment" appearing in various places in the specification is not necessarily all referring to the same embodiment, nor is it a separate or alternative embodiment that is mutually exclusive of other embodiments. In addition, various features are described that may be exhibited by some embodiments but not others. Similarly, various requirements are described that may be requirements of some embodiments but not others.
[0032] In addition, although the following description contains many specific details for illustrative purposes, it will be understood by those skilled in the art that many variations and / or modifications of the details are within the scope of the present disclosure. Similarly, although many features of the present disclosure are related to each other or described in conjunction with each other, it will be understood by those skilled in the art that many of these features can be provided independently of other features. Therefore, this description of the present disclosure is set forth without loss of generality and without imposing any limitations on the present disclosure.
[0033] The term "image" used throughout this description refers to an image containing some textual data or information, and it may take the form of a scanned document, or a captured image of a file or scene containing textual information. Images also include video frames containing some subtitle text or screen text.
[0034] The term "text data" used throughout this description refers to the actual or exact text present in an image, and "text data" may include text, characters, numbers, alphanumeric characters, or symbols. The term "machine-readable text data" used throughout this description refers to text extracted from an image based on the execution of a character recognition engine. Some examples of character recognition engines include optical character recognition (OCR) engines, intelligent character recognition (ICR) engines, and the like.
[0035] Various embodiments of the present disclosure provide a variety of advantages and technical effects. For example, the present disclosure enables text to be extracted from low-quality images (e.g., images of scanned documents) with improved accuracy. The present disclosure also performs corrections on the extracted text with changes (e.g., typos, errors, misspellings, truncated and / or connected text, etc.) by comparing the extracted words with words available in one or more domain vocabulary databases and / or language dictionary databases. Therefore, using the disclosed method, image text extraction can be achieved faster with improved accuracy. In addition, the present disclosure provides a technology in which the extracted text can be stored, retrieved and processed, which improves storage space requirements, accuracy of text extraction, and text processing speed for misspelled words. For example, according to an embodiment, when an input image contains text that is unique to a specific technology or business field, during text processing, the disclosed method can first compare the extracted words with words available in the domain vocabulary database, and then, if the extracted words do not exist in the domain vocabulary database, compare them with words available in the language dictionary database. Since a domain vocabulary database has a smaller number of words than a language dictionary database, such an implementation may reduce the number of search queries in a significant manner, thereby optimizing computer processing requirements.
[0036] According to the present disclosure, a computing device for performing text extraction from an image with increased accuracy is disclosed. In some embodiments, the computing device can act as a user device or an electronic device. In some embodiments, the computing device can act as a server system.
[0037] Reference below Figure 1A to Figure 1B to Fig. 9 Various example embodiments of the present disclosure are described.
[0038] Figure 1A An exemplary illustration of an environment 100 related to at least some embodiments of the present disclosure is shown. Although the environment 100 is presented in one arrangement, other embodiments may include portions of the environment 100 (or other portions) arranged in other ways, e.g., depending on performing text extraction from low-quality images. The environment 100 generally includes a server system 102, a computing device 104 associated with a user 106, an image data source 108, and a data set 118 including a domain vocabulary database 110 and a language dictionary database 112, each of which is coupled to and in communication with (and / or accessible to) a network 114. The network 114 may include, but is not limited to, a light-fidelity (Li-Fi) network, a local area network (LAN), a wide area network (WAN), a metropolitan area network (MAN), a satellite network, the Internet, a fiber optic network, a coaxial cable network, an infrared (IR) network, a radio frequency (RF) network, a virtual network, and / or a network capable of supporting Figure 1A another suitable public and / or private network for communications between the entities shown in, or any combination thereof.
[0039] Various entities in environment 100 may connect to network 114 according to various wired and wireless communication protocols, such as Transmission Control Protocol and Internet Protocol (TCP / IP), User Datagram Protocol (UDP), 2nd Generation (2G), 3rd Generation (3G), 4th Generation (4G), 5th Generation (5G) communication protocols, Long Term Evolution (LTE) communication protocols, any future communication protocols, or any combination thereof. In some instances, network 114 may include a security protocol (e.g., Hypertext Transfer Protocol (HTTP)) and / or any other protocol or set of protocols. In an example, network 114 may include, but is not limited to, a local area network (LAN), a wide area network (WAN) (e.g., the Internet), a mobile network, a virtual network, and / or a network capable of supporting Figure 1A another suitable public and / or private network for communication between two or more of the entities shown in, or any combination thereof.
[0040] A user 106 (e.g., an employee of Company 'A') may use a computing device 104 to capture an image via a camera module of the computing device 104. In one example, the user 106 may use the computing device 104 to scan a document. The image associated with the scanned document may include at least some portion containing text data. The text data may be standard text (e.g., typed characters) or handwritten text. In some scenarios, the image may be of lower quality, requiring image preprocessing operations before extracting the text. In another example, the image may have been captured, for example, using a conventional digital camera or video recording device.
[0041] Examples of computing device 104 may include, but are not limited to, smart phones, tablet computers, scanners, other handheld computers, wearable devices, laptop computers, desktop computers, servers, portable media players, gaming devices, personal digital assistants (PDAs), and the like.
[0042] In one example, user 106 can access text output generation application (also referred to as 'text extraction application') 116 via computing device 104 through network 114. Text extraction application 116 can be hosted at a remote server (such as server system 102). A local version of text extraction application 116 at user computing device and data associated with text extraction application 116 can be retrieved through network 114. In an example, text extraction application 116 can be or include a web browser, which user 106 can launch to navigate to a website for performing intelligent text extraction. In another example, text extraction application 116 can be a desktop application or a mobile application. In yet another example, text extraction application 116 can include a background process that performs various operations without direct interaction from user 106. Text extraction application 116 can include a "plug-in" or "extension" of another application, such as a web browser plug-in or extension. Text extraction application 116 can implement detection of text in image documents. When receiving an image, text extraction application 116 is configured to apply image processing and text processing methods to obtain text data associated with the image. In one embodiment, before text detection, an image preprocessing operation is applied to enhance the quality of low-quality images. The text extraction application 116 can analyze the image to determine whether the image needs to be preprocessed. Alternatively, each image is automatically preprocessed by the text extraction application 116.
[0043] In one form, the text extraction application 116 detects one or more candidate regions of the image that contain text or are likely to contain text. The text in the candidate regions is then identified by a character recognition method. In other words, the text extraction application 116 extracts machine-readable text data from the image.
[0044] It should be noted that the accuracy of the character recognition method may not be 100%, and therefore the text extracted from the image may be different from the actual text present in the image. The extraction can be performed at least in part based on a character recognition engine. The character recognition engine includes, but is not limited to, an optical character recognition (OCR) engine or an intelligent character recognition (ICR) engine. In one example, the text extraction application 116 can utilize a commercially available character recognition engine (such as Pytesseract, OpenOCR, etc.) to extract machine-readable text data from an image.
[0045] In addition, the text extraction application 116 applies text processing operations to the extracted machine-readable text data to improve the accuracy or readability of the machine-readable text data. In addition, the text extraction application 116 generates a text output associated with the image based on the application of the text processing operations to the extracted machine-readable text data. Figure 2 Detailed explanation of applying text processing operations on the extracted machine-readable text data.
[0046] In one embodiment, server system 102 is a computing server configured to perform the process further described herein. Server system 102 is a back-end server of text extraction application 116. Server system 102 facilitates extracting text with greater accuracy from low-quality images by utilizing domain vocabulary database 110 and language dictionary database 112. Specifically, server system 102 is configured to receive images of text data that may contain blurry or obscured text from computing device 104 or image data source 108 associated with user 106. For images with low quality, the quality of such images is first enhanced. In an embodiment, server system 102 is configured to apply adaptive thresholding method (adaptive thresholding method) to eliminate gray areas from images. Additionally or alternatively, server system 102 is configured to enhance one or more image parameters, including, for example, brightness, contrast, clarity, aspect ratio, etc. Server system 102 is also additionally or alternatively configured to change the tilt angle (e.g., horizontal angle or vertical angle) of the image.
[0047] Once the image quality is improved, the server system 102 is configured to perform text extraction to extract machine-readable text data from the image. The server system 102 is also configured to tokenize the machine-readable text data (i.e., the text extracted after character recognition is performed), and one or more words are identified as corresponding entities, such as nouns, organizations, places, etc. In addition, a word data set 118 including a standard language dictionary (i.e., a library of standard words for a given language stored in a language dictionary database 112) and a domain vocabulary (e.g., a library of words containing industry-specific words stored in a domain vocabulary database 110) is searched to identify whether each of the one or more words present in the extracted text (i.e., the machine-readable text data) is available in the data set 118. The data set 118 includes the words available in the domain vocabulary database 110 and the language dictionary database 112.
[0048] The words that match the data set 118 are retained and considered as correct words (the first word set), and the remaining words (i.e., words not found in the data set 118) are considered as misspelled words (the second word set). The server system 102 is also configured to compare each word in the second word set (i.e., misspelled words) with the words available in the domain vocabulary database 110. If the highest domain similarity score associated with the individual misspelled word is not greater than the first threshold similarity score, the individual misspelled word is compared with the words available in the language dictionary database 112, and the highest language similarity score of the individual misspelled word is calculated. If the highest language similarity score is not greater than the second threshold similarity score, the individual misspelled word is marked as a residual word, otherwise, the individual misspelled word is updated based at least in part on the associated highest domain similarity score and / or the highest language similarity score. In this way, the server system 102 is configured to determine corrected words for some misspelled words, and these corrected words are included in the first word set. It should be noted that the second set of words now includes only residual words for which corrected words are not available based on comparison of similarity scores.
[0049] In addition, the server system 102 is configured to split the second word set (i.e., residual words) into two or more words according to certain text parsing rules explained later in this specification. If the two or more words are meaningful dictionary words, then consider splitting, otherwise, do not change the residual words at all.
[0050] In one embodiment, the server system 102 may access one or more databases, such as a domain vocabulary database 110 and a language dictionary database 112. The domain vocabulary database 110 and the language dictionary database 112 may be embodied within the server system 102, or may be separate components. The domain vocabulary database 110 is configured to store words corresponding to a specific domain. For example, the specific domain may be related to logistics and freight, finance, education, medical care, advertising technology, etc. The language dictionary database 112 is configured to store words according to syntactic rules and semantic rules of at least one language.
[0051] In one embodiment, the domain vocabulary database 110 is configured to store keywords. In addition, keywords also include words that are specific to a particular field or industry. For example, in one implementation, if the domain vocabulary database 110 is configured to store keywords related to the medical field, the domain vocabulary database 110 may include keywords such as health, healthcare, daycare, treatment, nursing, outpatient department (OPD), intensive care unit (ICU), etc. In another example, in another implementation, if the domain vocabulary database 110 is configured to store keywords related to the financial field, the domain vocabulary database 110 may include keywords such as investment, loan, insurance, mortgage, mutual fund (MF), systematic investment plan (SIP), equity linked savings plan (ELSS), wealth management, etc.
[0052] Figure 1A The number and arrangement of systems, devices, and / or networks shown are provided as examples. Figure 1A There may be additional systems, devices, and / or networks; fewer systems, devices, and / or networks; different systems, devices, and / or networks, or differently arranged systems, devices, and / or networks than those shown. Figure 1A Two or more of the systems or devices shown may be implemented in a single system or device, or Figure 1A The single system or device shown may be implemented as multiple distributed systems or devices. Additionally or alternatively, a system set (e.g., one or more systems) or a device set (e.g., one or more devices) of environment 100 may perform one or more functions described as being performed by another system set or another device set of environment 100.
[0053] It should be noted that the functionality of the server system may also be partially or fully implemented in a cloud architecture, a standalone computing device. In such an implementation, text extraction and correction from an image may be performed by a computing device that may not necessarily be connected to an external server, such as Figure 1B shown.
[0054] Figure 1BAn exemplary illustration of another environment 120 related to at least some embodiments of the present disclosure is shown. Although the environment 120 is presented in one arrangement, other embodiments may include portions of the environment 120 (or other portions) arranged in other ways, e.g., depending on performing text extraction from low-quality images. The environment 120 generally includes a computing device 122 associated with a user 124, a peripheral device 126, a domain vocabulary database 110, and a language dictionary database 112.
[0055] The user 124 is authorized to access the computing device 122 to launch the text extraction application 116. The text extraction application 116 is installed inside the computing device 122. In one example, the computing device 122 is a desktop computer located inside a facility. Examples of facilities may include warehouses, institutions, organizations, buildings, etc. The user 124 is also present inside the facility to operate the computing device 122 to access the text extraction application 116. In an example, the text extraction application 116 is pre-installed in the computing device 122. In another example, the text extraction application 116 is installed in the computing device 122 via a storage medium (e.g., a hard disk drive (HDD), a solid state drive (SSD), a flash drive, a pen drive, a compact disk (CD), a Blu-ray disc, etc.).
[0056] A peripheral device 126 is connected to the computing device 122. Examples of peripheral devices 126 include, but are not limited to, cameras and scanners. In an embodiment, the user 124 may utilize the peripheral device 126 (e.g., a camera) to initially capture an image, which is then uploaded to the text extraction application 116 in an offline manner (i.e., without using the Internet). In another embodiment, the user 124 may utilize the peripheral device 126 (e.g., a scanner) to initially scan an image, which is then accessed via the text extraction application 116 in an offline manner (i.e., without using the Internet).
[0057] The domain vocabulary database 110 and the language dictionary database 112 are connected to or electronically stored in the computing device 122. The text extraction application 116 can access the domain vocabulary database 110 and the language dictionary database 112 in an offline manner (ie, without using the Internet).
[0058] The user 124 can access the text extraction application 116 offline without using the Internet. The text extraction application 116 can be accessed from a remote server (e.g., Figure 1A The server system 102) is downloaded to the computing device 122. The computing device 122 can be connected to Figure 1AThe text extraction application 116 can be downloaded from the network 114 of the user 124 at any time. In an example, the text extraction application 116 can be or include a web browser, which the user 124 can launch to navigate to a website for performing intelligent text extraction. In another example, the text extraction application 116 can be a desktop application or a mobile application. In yet another example, the text extraction application 116 can include a background process that performs various operations without direct interaction from the user 124. The text extraction application 116 may include a "plug-in" or "extension" of another application, such as a web browser plug-in or extension.
[0059] The text extraction application 116 can implement the detection of text in the image document. When receiving the image, the text extraction application 116 is configured to apply image processing and text processing methods to obtain text data associated with the image. In one embodiment, before text detection, image preprocessing operations are applied to enhance the quality of low-quality images. The text extraction application 116 can analyze the image to determine whether a preprocessing operation is needed. Alternatively, each image is automatically preprocessed by the text extraction application 116.
[0060] The text extraction application 116 also applies text processing operations to the extracted machine-readable text data to improve the accuracy or readability of the machine-readable text data. In addition, the text extraction application 116 generates a text output associated with the image based on the application of the text processing operations to the extracted machine-readable text data. Figure 2 A detailed explanation of applying the text processing operation to the extracted machine-readable text data is given and therefore will not be repeated here for the sake of brevity.
[0061] In one embodiment, computing device 122 is a computer system configured to perform the process further described herein. Computing device 122 facilitates extracting text with greater accuracy from low-quality images by utilizing domain vocabulary database 110 and language dictionary database 112. Specifically, computing device 122 is configured to receive an image containing blurred or obscured text data with the help of peripheral device 126. Then, computing device 122 is configured to apply image preprocessing operations to the image to enhance the quality of the image. Computing device 122 is also configured to extract machine-readable text data from the image based on character recognition technology (e.g., OCR, ICR, etc.). In addition, computing device 122 is configured to apply text processing operations to machine-readable text data to generate text output associated with the image.
[0062] Figure 1B The number and arrangement of systems, devices, and / or networks shown are provided as examples. Figure 1BThere may be additional systems, devices, and / or networks; fewer systems, devices, and / or networks; different systems, devices, and / or networks, or differently arranged systems, devices, and / or networks than those shown. Figure 1B Two or more of the systems or devices shown may be implemented in a single system or device, or Figure 1B The single system or device shown may be implemented as multiple distributed systems or devices. Additionally or alternatively, a system set (e.g., one or more systems) or a device set (e.g., one or more devices) of environment 120 may perform one or more functions described as being performed by another system set or another device set of environment 120.
[0063] Figure 2 2 is a simplified block diagram of a computing device 200 according to an embodiment of the present disclosure. An example of computing device 200 may be server system 102 or computing device 122. In some embodiments, computing device 200 may be embodied as a device in a cloud-based and / or SaaS (Software as a Service) architecture.
[0064] The computing device 200 includes at least one processor 202 for executing instructions, a memory 204 , an input / output module 206 , a communication module 208 , and a storage module 210 , which communicate with each other via a centralized circuit system 214 .
[0065] The processor 202 includes suitable logic, circuit systems and / or interfaces to perform operations for performing intelligent text extraction from images including text data. Examples of the processor 202 include, but are not limited to, an application specific integrated circuit (ASIC) processor, a reduced instruction set computing (RISC) processor, a graphics processing unit (GPU), a complex instruction set computing (CISC) processor, a field programmable gate array (FPGA), etc. The processor 202 includes an image pre-processing engine 216, a character recognition engine 218, and a text processing engine 220. It should be noted that the components described herein can be configured in a variety of ways, including electronic circuit systems, digital arithmetic and logic blocks, and memory systems combined with software, firmware, and embedded technologies.
[0066] The memory 204 includes suitable logic, circuit systems and / or interfaces to store a set of computer-readable instructions 212 for performing operations. The memory 204 may be embodied as one or more volatile memory devices, one or more non-volatile memory devices and / or a combination of one or more volatile memory devices and non-volatile memory devices. For example, the memory 204 may be embodied as a semiconductor memory (such as a mask ROM, a PROM (programmable ROM), an EPROM (erasable PROM), a flash memory, a RAM (random access memory), etc.), a magnetic storage device (such as a hard disk drive, a floppy disk, a magnetic tape, etc.), an optical magnetic storage device (e.g., a magneto-optical disk), a CD-ROM (read-only disk memory), a CD-R (compact disk recordable), a CD-R / W (compact disk rewritable), a DVD (digital versatile disk), and a BD ( CD).
[0067] In at least some embodiments, memory 204 stores instructions 212 that may be used by engines of processor 202 , such as image pre-processing engine 216 , character recognition engine 218 , and text processing engine 220 .
[0068] As explained above, the memory 204 also stores code / instructions used by the communication module 208. In at least some embodiments, the communication module 208 can use the instructions 212 stored in the memory 204 to receive images including text data from one or more data sources (e.g., the image data source 108). The image can include printed text or handwritten text.
[0069] It should be noted that the computing device 200 shown in the figure and described below is merely illustrative of a device that may benefit from embodiments of the present disclosure and, therefore, should not be considered to limit the scope of the present disclosure. Figure 2 It should be noted that the components described herein can be configured in a variety of ways, including electronic circuit systems, digital arithmetic and logic blocks, and memory systems combined with software, firmware, and embedded technology.
[0070] The image preprocessing engine 216 includes suitable logic and / or interfaces for performing at least one image preprocessing operation on the image. In some embodiments, the text data may include printed text or handwritten text. The image may include some partially obscured (e.g., unclear or blurred) text. The image preprocessing engine 216 receives the image from the image data source 108. The image data source 108 includes at least one of a local data directory, a third party external data directory, or an input source. The input source may also include a camera, a printer, a scanner, etc.
[0071] In an example, user 106 may use a commercially available scanner to scan a document (e.g., a paper document), and further upload an image of the document into text extraction application 116. In another example, user 106 may upload an image including text data from a local directory of a computing device (e.g., computing device 104) in which text extraction application 116 is installed into text extraction application 116. In yet another example, user 106 may upload an image including text data into text extraction application 116 from a third-party external directory connected to the text extraction application via a network (e.g., network 114).
[0072] The image preprocessing engine 216 is configured to perform at least one image preprocessing operation on the image to enhance the quality of the image before extracting machine-readable text data from the image. The image preprocessing operation is performed to generate a digitally manipulated version of the image with enhanced quality. In a non-limiting example, preprocessing is performed on the image when the image includes low contrast areas. For example, an image document may include a shaded text portion, thereby reducing the contrast between the text portion in the image and surrounding features. Additionally, in another implementation, preprocessing is performed to correct image quality issues, such as compression artifacts.
[0073] In some embodiments, the image preprocessing operation includes at least one of: (a) an adaptive thresholding method, (b) an image enhancement method, and (c) a de-skew method.
[0074] Image preprocessing engine 216 is configured to apply adaptive thresholding method to eliminate gray areas in image. Usually, "adaptive thresholding" method is used to separate desired foreground image object from background based on the difference of pixel intensity in each region. More specifically, threshold is calculated for each pixel in image. If pixel value is lower than threshold, then this value is set to background value, otherwise, this value is set to foreground value. In one embodiment, image preprocessing engine 216 is configured to apply adaptive thresholding method to increase brightness or white area in image. For example, adaptive thresholding method divides image into multiple windows. Adaptive thresholding method further iterates window on each window in multiple windows, and determines threshold value with calculating average value. In addition, adaptive thresholding method repairs brightness of image based on threshold value. For example, adaptive thresholding method makes those windows darker than other windows in multiple windows in multiple windows brighten. In this way, adaptive thresholding method eliminates gray areas in image by brightening image and making characters in image clearer.
[0075] In addition, the image preprocessing engine 216 is configured to apply an image enhancement method to update one or more image parameters of the image. The one or more image parameters include at least one of the following: (a) brightness, (b) contrast, (c) clarity, and (d) aspect ratio. In one embodiment, the image preprocessing engine 216 is configured to apply an image enhancement method to enhance the quality of the image by updating or changing one or more image parameters (including, for example, brightness of the image, contrast of the image, clarity of the image, aspect ratio of the image, etc.).
[0076] In general, brightness refers to the overall lightness or darkness of an image. In some embodiments, the image preprocessing engine 216 is configured to increase or reduce the brightness of an image based on the quality of the image. In simple terms, contrast can be defined as the difference between the maximum pixel intensity and the minimum pixel intensity in an image. In some embodiments, the image preprocessing engine 216 is configured to increase or reduce the contrast of an image based on the quality of the image. In general, clarity refers to the clarity of the details in an image. In some implementations, the image preprocessing engine 216 is configured to increase or reduce the clarity of an image based on the quality of the image. In general, the aspect ratio of an image refers to the proportional relationship between the width and height of an image. In addition, the aspect ratio is expressed as two numbers separated by a colon. Examples of aspect ratios can include 16:9, 1:1, 5:3, etc. In one embodiment, the image preprocessing engine 216 is configured to change the aspect ratio of an image as needed.
[0077] The image preprocessing engine 216 is also configured to apply a de-skewing method to change the tilt angle of the image. In general, de-skewing is a technique or process for straightening an image that has been scanned or written askew. The tilt angle may include a horizontal angle or a vertical angle of the image. For example, when capturing an image of a document, the camera may be positioned at an angle so that the captured image appears to be tilted too far in one direction, or the image appears to be misaligned. De-skewing is a technique for correcting (i.e., changing) the angle or orientation of an image. The image preprocessing engine 216 is configured to apply the preprocessing operations mentioned above based on the quality of the image.
[0078] Therefore, the image may also be processed to correct various image distortions. For example, the image may be processed to correct for perspective distortion. Text positioned on a plane that is not perpendicular to the camera is affected by perspective distortion, which may make text recognition more difficult. During image preprocessing, conventional perspective distortion correction techniques may be applied to the image.
[0079] Once the image pre-processing operations have been applied to the image to enhance quality, the image pre-processing engine 216 is configured to pass the image to the character recognition engine 218 .
[0080] The character recognition engine 218 includes suitable logic and / or interfaces for extracting machine-readable text data from the image. In an embodiment, the machine-readable text data can be extracted based on the character recognition engine. According to one example, the machine-readable text data can be extracted based on an optical character recognition (OCR) engine. According to another example, the machine-readable text data can be extracted based on an intelligent character recognition (ICR) engine.
[0081] The image can be a scanned document, a photograph of a document, text on a sign or billboard, or text superimposed on an image (e.g., subtitles in a video, etc.). Generally speaking, Intelligent Character Recognition (ICR) is an advanced optical character recognition specifically designed for handwriting recognition. In addition, ICR allows the computer to learn fonts and different handwriting styles during processing to improve accuracy.
[0082] In some embodiments, machine-readable text data is tokenized and each of one or more words is identified as an entity. Entities may include nouns, organizations, places, etc. In general, "tokenization" is the process of splitting a string or text into smaller units (called tokens). In one example, the text "Deliver the shipment today" may be tokenized into tokens such as "Deliver", "the", "shipment", and "today".
[0083] The machine-readable text data includes one or more words. "Text data" herein refers to data that is actually present in the image (i.e., handwritten or printed text). In addition, "machine-readable text data" herein refers to one or more words extracted from the image by the character recognition engine 218. For example, an image may include "Polland" as text data. However, the character recognition engine 218 may extract the machine-readable text data as "911" based on the low accuracy of the underlying OCR engine. o ll an d".
[0084] In some scenarios, one or more words may also include numerical data (e.g., integer values, decimal values, etc.) or special characters (e.g., @, !, #, $, %, etc.). In addition, each of the one or more words may belong to the same language (e.g., English, etc.). In some other scenarios, one or more words may belong to different languages.
[0085] The character recognition engine 218 is configured to transmit the machine-readable text data to the text processing engine 220. The text processing engine 220 is communicatively coupled to the domain vocabulary database 110 and the language dictionary database 112. In one example, the domain vocabulary database 110 is configured to store keywords related to freight and logistics. In one example, the language dictionary database 112 is configured to store words belonging to languages such as English, Spanish, French, German, etc. In another example, the language dictionary database 112 can be configured to store words belonging to multiple languages. According to one embodiment, if the language dictionary database 112 is configured to store words belonging to multiple languages, a selection option can be provided so that various languages can be selected from multiple languages, and only words belonging to the selected language will be considered for matching / comparison purposes.
[0086] It should be noted that the domain vocabulary database 110 is configured to store keywords that are specific to a particular domain. For example, the domain may include logistics, healthcare, finance, advertising technology (ad-tech), educational technology (ed-tech), etc. Therefore, the domain vocabulary database 110 is not limited to only including keywords related to freight and logistics. In addition, the domain vocabulary database 110 is configured to store keywords belonging to one or more domains (e.g., domains related to text data included in an image) as needed. According to one embodiment, if the domain vocabulary database 110 is configured to store words belonging to multiple domains, a selection option may be provided so that various domains can be selected from the multiple domains, and only words belonging to the selected domains will be considered for matching / comparison purposes.
[0087] The text processing engine 220 includes suitable logic and / or interfaces for receiving machine-readable text data from the character recognition engine 218. The text processing engine 220 is configured to compare each of the one or more words with words in the data set 118 including at least one of the domain vocabulary database 110 and the language dictionary database 112 to determine a first word set and a second word set from the one or more words. More specifically, the text processing engine 220 is configured to run a query to compare each individual word included in the one or more words with the available words in the domain vocabulary database 110 and the language dictionary database 112 (i.e., the words already stored in the domain vocabulary database and the language dictionary database). For each individual word that successfully matches the data set 118, the corresponding word is stored as the first word set, and the remaining words that do not successfully match the data set 118 are stored as the second word set. In other words, the first word set is the words that successfully match the words available in the data set 118, and the second word set is the words that do not successfully match the words available in the data set 118. Therefore, there is no need to perform any additional processing on the first word set because these words have been identified as correct words.
[0088] In one embodiment, the text processing engine 220 is configured to determine the language of the machine-readable text data (i.e., one or more words). The one or more words may belong to a single language or multiple languages. Once the corresponding language of the one or more words is determined, for example using a machine learning-based technique, the text processing engine 220 is configured to compare each of the one or more words with only the words of the determined language from the language dictionary database 112. The text processing engine 220 saves a lot of computing time and resources in this way.
[0089] For example, one or more words may belong to English and Spanish. In this scenario, the text processing engine 220 identifies the language of one or more words in the machine-readable text data as "English" and "Spanish". Therefore, the text processing engine 220 is configured to compare each of the one or more words in a specific language (e.g., Spanish) with a language dictionary database 112 that includes only Spanish words. Similarly, the text processing engine 220 is configured to compare each of the one or more words in the English language with a language dictionary database 112 that includes only English words, and so on.
[0090] In this example, in another embodiment, the text processing engine 220 selects only two language dictionaries (i.e., English and Spanish) for comparison purposes from the multiple language dictionaries present in the language dictionary database 112. In addition, after selecting the two languages, one or more words are compared with the words present in the two language dictionaries.
[0091] Similarly, the domain vocabulary database 110 may include words from multiple domains. When the text processing engine 220 identifies one or more domains from the machine-readable text data using, for example, machine learning-based techniques, the identified one or more domains are selected in the domain vocabulary database 110 for comparison purposes. In this way, the text processing engine 220 saves a lot of computing time and resources.
[0092] During the comparison process, the text processing engine 220 is configured to run a query to search for one or more words of the machine-readable text data in the data set 118. The text processing engine 220 runs the query to determine matching words and misspelled words from the one or more words. "Matched words" herein refer to those words that exist in at least one of the domain vocabulary database 110 and the language dictionary database 112. In addition, "misspelled words" herein refer to those words that do not match the words available in the domain vocabulary database 110 and the language dictionary database 112. Therefore, the matching words are stored as a first word set (i.e., because the matching words are identified as correct words because they are already available in the domain vocabulary database 110 or the language dictionary database 112), and the misspelled words are stored as a second word set. The second word set (i.e., the misspelled words) is further subjected to additional processing steps.
[0093] The text processing engine 220 is also configured to perform correction on the misspelled words (i.e., the second word set) to determine the 'corrected words'. However, there may be some misspelled words that are not corrected, and they are called 'residual words'. In order to perform the correction, in an embodiment, the text processing engine 220 is configured to calculate the highest similarity score of each word in the second word set (i.e., each misspelled word) and the words available in the data set 118 (i.e., the domain vocabulary database 110 and the language dictionary database 112). If the highest similarity score is at least equal to (i.e., greater than or equal to) the threshold similarity score, the text processing engine 220 is configured to detect the words corresponding to the highest similarity score from the data set 118 as the corrected words of the corresponding words in the second word set. The corrected words are further classified as the first word set. However, if the highest similarity score is less than the threshold similarity score, the text processing engine 220 considers that such misspelled words in the second word set do not have any matches in the data set 118, and such misspelled words are marked as residual words. Thus, matched words (ie, words present in data set 118) and corrected words (ie, words having at least a threshold similarity to words of data set 118) are stored as a first word set, and the second word set now includes only residual words.
[0094] For example, the highest similarity score can be calculated based on methods such as Levenshtein distance, SequenceMatcher, cosine similarity, etc. In general, "Levenshtein distance" is a string metric used to measure the difference between two sequences. More precisely, Levenshtein distance is a number that represents the difference between two strings. In general, the higher the number, the greater the difference between the two strings. In one example, if the Levenshtein distance between two strings (e.g., string A and string B) is three, this means that at least three edits are required to convert the misspelled string A into the correct string B. In this example, string A is a misspelled string extracted from machine-readable text data, and string B is a correct string stored in data set 118. In general, editing can be performed by at least one of three methods, for example, inserting characters, deleting characters, or replacing characters.
[0095] In general, a "SequenceMatcher" is a class available in a python (i.e., programming language) module called "difflib". A SequenceMatcher is used to compare pairs of input sequences to determine or find the longest contiguous matching subsequence (LCS) that does not contain "junk" elements. In other words, a SequenceMatcher does not produce a minimum edit sequence like the Levenshtein distance, but tends to produce matches that "look right" to a human. The term "junk" in this article refers to elements that the algorithm is programmed not to match (e.g., elements such as spaces, elements within HTML tags, etc.).
[0096] In general, "cosine similarity" is a measure of the similarity between two sequences of numbers. In addition, these sequences are considered as vectors in an inner product space, and cosine similarity is defined as the cosine of the angle between them (i.e., the dot product of the vectors divided by the product of their lengths). For example, in text processing, each word is assigned a different coordinate, and a document is represented by a vector of the number of times each word appears in the document. Cosine similarity further gives a measure of how similar two documents are in terms of their topics, regardless of the length of these documents.
[0097] In one implementation, the threshold similarity score (i.e., Levenshtein distance) is set to 2. However, the user 106 can modify the threshold similarity score as desired. In another implementation, the threshold similarity score (i.e., cosine similarity) is set to 95. However, the user 106 can modify the threshold similarity score as desired.
[0098] In another embodiment, the text processing engine 220 is configured to determine the corrected words and residual words by initially calculating the highest domain similarity score of each word in the second word set with the words available in the domain vocabulary database 110. The text processing engine 220 is also configured to determine whether the highest domain similarity score is at least equal to (i.e., greater than or equal to) a first threshold similarity score. Upon determining that the highest domain similarity score is at least equal to the first threshold similarity score, the text processing engine 220 is configured to detect the word from the data set 118 corresponding to the highest domain similarity score as the 'corrected word' of the corresponding word in the second word set. More specifically, based on the calculation of the highest domain similarity score, the corresponding word in the second word set is replaced with the detected word.
[0099] Upon determining that the highest domain similarity score is less than the first threshold similarity score, the text processing engine 220 is further configured to calculate the highest language similarity score of the remaining words in the second word set with the words available in the language dictionary database 112. The text processing engine 220 is further configured to determine whether the highest language similarity score is at least equal to (i.e., greater than or equal to) the second threshold similarity score. Upon determining that the highest language similarity score is at least equal to the second threshold similarity score, the text processing engine 220 is configured to detect the word corresponding to the highest language similarity score as a corrected word of the corresponding word in the second word set. More specifically, based on the calculation of the highest language similarity score, the corresponding word is replaced with the detected word.
[0100] When it is determined that the highest language similarity score is less than the second threshold similarity score, the text processing engine 220 is configured to mark the remaining words in the second word set as residual words. Therefore, after calculating the highest domain similarity score and the highest language similarity score, the matched words and the corrected words are stored as the first word set, and the residual words are stored again as the second word set.
[0101] The highest domain similarity score can be calculated based on methods such as Levenshtein distance, SequenceMatcher, cosine similarity, etc. Similarly, the highest language similarity score can be calculated based on methods such as Levenshtein distance, SequenceMatcher, cosine similarity, natural language processing (NLP)-based techniques, etc. In one example, for Levenshtein distance, the first threshold similarity score and the second threshold similarity score are set to 2. In some examples, for cosine similarity, the first threshold similarity score and the second threshold similarity score are set to 95. However, the user 106 can modify the first threshold similarity score and the second threshold similarity score based on needs.
[0102] In an embodiment, the text processing engine 220 initially calculates the highest domain similarity score and then calculates the highest language similarity score (i.e., the highest domain similarity score is prioritized over the highest language similarity score). The highest domain similarity score is prioritized over the highest language similarity score because one or more words may include words that are unique to a particular domain. In an example scenario, if the highest language similarity score is calculated for these words, these words may be corrected based on the language dictionary database 112, however, they must have been corrected based on the domain vocabulary database 110. Therefore, in this embodiment, the calculation of the highest domain similarity score is prioritized over the highest language similarity score, however, it should be noted that the calculation of the highest domain similarity score and the highest language similarity score can be performed in parallel, or the calculation of the highest domain similarity score and the highest language similarity score can be performed in any order as desired.
[0103] The text processing engine 220 is also configured to process the remaining second word set (i.e., residual words) to determine the corresponding valid words. In an embodiment, the text processing engine 220 is configured to split at least one word in the second word set (i.e., residual words) into two or more words to determine the third word set that matches the words available in the data set 118. More specifically, in an example, the text processing engine 220 is configured to split each word in the second word set (i.e., residual words) into two or more words based at least in part on a predefined text parsing rule. For example, any readily available word splitter can be used to split the residual words into two or more words. In general, such word splitters split the words connected into two or more words.
[0104] Words may be connected together due to an error (in the case of handwritten text) or a system error (in the case of printed text). According to an embodiment, the text processing engine 220 is configured to parse each residual word character by character, and then connect the characters in an iterative manner to determine whether the connection of the characters forming the word matches the words available in the data set 118. Thereafter, the text processing engine 220 is configured to compare the two or more words with the data set 118 to determine whether the two or more words are successfully matched in the data set 118. In response to determining that the two or more words have a successful match in the data set 118, the text processing engine 220 is configured to classify the two or more words into a third word set.
[0105] In some embodiments, the predefined text parsing rules define a set of rules that the text processing engine 220 follows to split at least one word in the second word set. In one example, the predefined text parsing rules enable the text processing engine 220 to determine whether to split the residual word into two or more words.
[0106] For example, let us consider that the residual word (i.e., the word in the second word set) is "MIAMIFLORIDA". According to one example, the text processing engine 220 can be configured to split the residual word into 'M', 'I', 'A', 'M', etc. character by character. The text processing engine 220 further starts processing with the first character (i.e., 'M') and connects the next character to check whether the connection of the first character and the second character (i.e., 'MI') is stored in at least one of the domain vocabulary database 110 and the language dictionary database 112. Since 'MI' is not stored in the domain vocabulary database 110 and the language dictionary database 112, the text processing engine 220 is configured to connect the next character (i.e., 'A' and 'MI') to check whether 'MIA' is stored in any one of the domain vocabulary database 110 and the language dictionary database 112. According to another example, the predefined text parsing rule can be based on any N-Gram model. Generally speaking, N-Grams are continuous sequences of words or word units or symbols in a document.
[0107] Similarly, the text processing engine 220 is configured to split the residual word into two, three or more words according to the connected words (i.e., residual words). For example, if two words are connected together as residual words, the text processing engine 220 is configured to split the residual word into two words. In another example, if four words are connected together as residual words, the text processing engine 220 is configured to split the residual word into four words, and so on. In the example mentioned above, the text processing engine 220 splits the residual word (i.e., "MIAMIFLORIDA") into two words (i.e., "MIAMI" and "FLORIDA") because both words have successful matches in the data set 118. Therefore, the two words (i.e., "MIAMI" and "FLORIDA") are classified into the third word set.
[0108] It should be noted that when two or more words do not match in the data set 118, the text processing engine 220 is configured to retain the corresponding residual words (i.e., words that do not match / do not change even after the word splitting step) as the second word set. That is, now the 'second word set' only includes residual words that cannot be split and corrected and remain unmatched or unchanged. It should be noted that such a second word set remains intact in the text output together with the first word set and the third word set. More specifically, the text processing engine 220 is configured to generate a text output associated with the image based on at least the first word set, the second word set (i.e., residual words that do not match even after performing the word splitting step) and the third word set. In one embodiment, the text processing engine 220 is configured to align the first word set, the second word set and the third word set in the text output of the image with the same layout according to the layout of the original image. The text output can be further displayed on the display screen of the computing device 200. More specifically, the text output includes a first set of words, a second set of words (ie, unchanged residual words), and a third set of words according to the format, layout, and orientation of the original input image.
[0109] The computing device 200 also includes an input / output module 206 (hereinafter referred to as 'I / O module 206') and at least one communication module, such as communication module 208. In an embodiment, the I / O module 206 may include a mechanism configured to receive input from a user of the computing device 200 (e.g., user 106) and provide output thereto. To this end, the I / O module 206 may include at least one input interface and / or at least one output interface. Examples of input interfaces may include, but are not limited to, a keyboard, a mouse, a joystick, a keypad, a touch screen, soft keys, a microphone, etc. Examples of output interfaces may include, but are not limited to, a display, such as a light emitting diode display, a thin film transistor (TFT) display, a liquid crystal display, an active matrix organic light emitting diode (AMOLED) display, a microphone, a speaker, a ringer, a vibrator, etc.
[0110] In an example, the processor 202 may include an I / O circuit system that is configured to control at least some functions of one or more elements of the I / O module 206, such as, for example, a speaker, a microphone, a display, etc. The processor 202 and / or the I / O circuit system may be configured to control one or more functions of one or more elements of the I / O module 206 via computer program instructions (e.g., software and / or firmware stored on a memory (e.g., memory 204) or the like accessible to the processor 202).
[0111] The communication module 208 may include communication circuitry, such as, for example, a transceiver circuitry including an antenna and other communication media interfaces to connect to a wired and / or wireless communication network. In at least some embodiments, the communication circuitry may enable receiving images from an image data source 108 including, for example, a memory 204.
[0112] In at least one embodiment, the communication module 208 is configured to receive images including text data in real time. In an embodiment, the image can be scanned using a scanner connected to the computing device 200. In another embodiment, the image can be captured by a camera connected to the computing device 200. In yet another embodiment, the image can be uploaded from the storage 204 with the help of the communication module 208.
[0113] The communication module 208 is configured to forward the image to the processor 202. The modules of the processor 202 in conjunction with the instructions 212 stored in the memory 204 may be configured to perform operations on the image to intelligently extract text output from the image, i.e., perform operations such as image pre-processing, character recognition, and text pre-processing to intelligently extract information from the image.
[0114] The computing device 200 also includes a storage module 210, which can be embodied as any computer-operated hardware suitable for storing and / or retrieving data. In some embodiments, the storage module 210 is configured to store information related to various images (e.g., images can include handwritten or printed data), machine-readable text data corresponding to various images, extracted text output corresponding to various images, etc. The storage module 210 can also store information related to character recognition model types (e.g., Pytesseract, OpenOCR, etc.), etc.
[0115] The storage module 210 may include a plurality of storage units, such as hard disks and / or solid state drives in a redundant array of inexpensive disks (RAID) configuration. In some embodiments, the storage module 210 may include a storage area network (SAN) and / or a network attached storage (NAS) system. In one embodiment, the storage module 210 may correspond to a distributed storage system in which separate databases are configured to store custom information, such as information related to machine-readable text data, text output, character recognition models, etc. Although the storage module 210 is depicted as being integrated within the computing device 200, in at least some embodiments, the storage module 210 is located external to the computing device 200 and may be accessed by the computing device 200 using a storage interface ( Figure 2The storage interface is any component capable of providing the processor 202 with access to the storage module 210. The storage interface may include, for example, an Advanced Technology Attachment (ATA) adapter, a Serial ATA (SATA) adapter, a Small Computer System Interface (SCSI) adapter, a RAID controller, a SAN adapter, a network adapter, and / or any component that provides the processor 202 with access to the storage module 210.
[0116] In one embodiment, various components of computing device 200, such as processor 202, memory 204, I / O module 206, communication module 208, and storage module 210, are configured to communicate with each other via or through centralized circuit system 214. Centralized circuit system 214 may be various devices configured to provide or enable communication between components of computing device 200, etc. In certain embodiments, centralized circuit system 214 may be a central printed circuit board (PCB), such as a motherboard, mainboard, system board, or logic board. Centralized circuit system 214 may also or alternatively include other printed circuit assemblies (PCAs) or communication channel media.
[0117] Figure 3 is a schematic representation 300 of a process flow for performing intelligent text output generation according to an embodiment of the present disclosure.
[0118] As explained above, an image 305 is received from an image data source 108 (see 302). The image data source 108 may include a local directory of the computing device 104 of FIG. 1, a third-party external directory accessed on the computing device 104 of FIG. 1 via the Internet (e.g., the network 114 of FIG. 1), etc. The image data source 108 may also include peripheral devices 126, including, for example, cameras, scanners, etc. In such a scenario, the communication module (e.g., Figure 2 The communication module 208 ) is configured to receive the image 305 from the image data source 108 .
[0119] In an example, the image data source 108 may include a scanner for scanning a paper document, and the image 305 then refers to the scanned image of the paper document. In another example, the image data source 108 may include a camera for capturing an image of a paper document, and the image 305 then refers to the captured image of the paper document. In yet another example, the image data source 108 may refer to a non-volatile memory storing the image 305. The image 305 includes text data. In some embodiments, the image 305 may include complete text data (e.g., in the case of an invoice document), or the image 305 may include partial text data (e.g., in the case of subtitles displayed in a video frame).
[0120] In addition, the image preprocessing engine 216 is configured to receive an image 305 (see 304) including text data. In some embodiments, a portion of the image 305 may include at least partially obscured (i.e., unclear or blurred) text. In addition, the image preprocessing engine 216 is configured to perform at least one image preprocessing operation on the image 305 to enhance its quality. More specifically, the image preprocessing engine 216 is configured to perform at least one image preprocessing operation on the image to increase the readability of the text data of the image 305.
[0121] In an embodiment, the image pre-processing engine 216 may perform only one image pre-processing operation on the image 305. In another embodiment, the image pre-processing engine 216 may perform any two image pre-processing operations on the image 305. In yet another embodiment, the image pre-processing engine 216 may perform three image pre-processing operations on the image 305. In some embodiments, the image pre-processing engine 216 analyzes the quality of the image 305 to determine the number of image pre-processing operations required to enhance the quality of the image 305.
[0122] The image pre-processing engine 216 is also configured to pass the image 305 to the character recognition engine 218 (see 306). The character recognition engine 218 is configured to extract machine-readable text data from the image 305. The character recognition engine 218 is configured to apply an optical character recognition (OCR) engine (including, for example, P y tesseract,O p enOCR, etc.) to extract machine-readable text data from the image 305. The machine-readable text data includes one or more words. The machine-readable text data may also include digital data, special characters, symbols, etc.
[0123] In addition, the character recognition engine 218 is configured to pass the machine-readable text data to the text processing engine 220 (see 308). The text processing engine 220 is configured to perform text processing operations on the machine-readable text data to intelligently extract information from the machine-readable text data. More specifically, the text processing engine 220 is configured to perform intelligent text extraction from the machine-readable text data. The text processing engine 220 can utilize the domain vocabulary database 110 and the language dictionary database 112 to intelligently perform text extraction (see 310). The text processing engine 220 further displays the text output after applying the text processing operations to the machine-readable text data (see 312). This article refers to Figure 2 A detailed explanation of extracting information (ie, text output) from machine-readable text data is explained, and therefore, for the sake of brevity, it is not repeated here. The extracted information (ie, text output) can also be used for one or more downstream tasks (eg, sentiment analysis, etc.).
[0124] In one example, the performance of the text extraction application 116 is evaluated for various images with different image quality levels. The performance indicators of the text extraction application 116 are shown in Table 1 below:
[0125]
[0126] Table 1: Performance metrics of text extraction applications for various images
[0127] Here, bN refers to blurring of the image taking into account a kernel of size NxN. Additionally, bNg refers to including grayscale to the bN image. For example, b7 refers to blurring of the image taking into account a kernel of size 7x7. Additionally, b7g refers to including grayscale to the b7 image. As shown in Table 1, when the text extraction application 116 applies image preprocessing operations to the image before extracting machine-readable text data and applies text processing operations to the machine-readable text data, the performance of the text extraction application 116 is higher (e.g., an average of 45.2).
[0128] FIG. 4A to FIG. 4G Detailed Description of the Invention Collectively, example representations for performing image pre-processing, character recognition, and text processing on an image according to embodiments of the present disclosure are shown.
[0129] Figure 4A An exemplary representation 400 of an image 402 of a sample invoice according to an embodiment of the present disclosure is shown. As explained above, the processor 202 is configured to receive the image 402 of the sample invoice. The sample invoice may be associated with an organization "A" (e.g., a freight company). In an example, the sample invoice is scanned by a scanner, and the scanned image (i.e., image 402) is uploaded to the text extraction application 116. In another example, a camera may be used to capture an image of the sample invoice, and the captured image (i.e., image 402) is then uploaded to the text extraction application 116. The user 106 may access a user interface (UI) of the text extraction application 116 to upload the image 402 into the text extraction application 116.
[0130] In one example, image 402 may include some handwritten text (see 404). Image 402 may also include obscured text (i.e., unclear or blurred text) (see 406). Therefore, processor 202 is configured to apply at least one image preprocessing operation to image 402 to enhance the quality of image 402. For example, processor 202 is configured to apply an adaptive thresholding method to eliminate gray areas in image 402. Additionally or alternatively, processor 202 is configured to apply an image enhancement method to update one or more image parameters of image 402. Processor 202 may also additionally or alternatively apply a de-tilting method to change the tilt angle of the image. It should be noted that processor 202 is configured to apply at least one of the image preprocessing operations to image 402 or not apply a graphics preprocessing operation based on the quality of image 402.
[0131] Figure 4B An exemplary representation 410 of an image 415 obtained after performing an image pre-processing operation according to an embodiment of the present disclosure is shown. Image 415 is similar to image 402, however, image 415 exemplarily represents an image obtained after applying at least one image pre-processing operation to image 402. Image 415 has increased the quality and readability of text data originally present in image 402.
[0132] like Figure 4B As shown, image 415 includes a first part (see 412), which depicts the "bill to" address in the sample invoice. The "bill to" address in this article refers to the company name and the address of the shared invoice. In addition, image 415 includes a second part (see 414), which depicts the "ship to" address in the sample invoice. The "ship to" address in this article refers to the company name and the address of the shared actual freight (e.g., goods, products, services, etc.). Image 415 also includes a third part (see 416), which depicts a list of items (e.g., goods, products, services, etc.) provided and the cost per unit (i.e., the cost of a single unit of a specific item) and the final cost based on the quantity of each item. In addition, image 415 includes a fourth part (see 418), which depicts the total amount payable to the shipper of the goods after deducting any discounts (if applicable) and adding appropriate taxes based on the country. The fourth part depicts the total "Balance due" (in appropriate currency) that should be paid to the shipper of the goods.
[0133] As explained above, the processor 202 is configured to extract machine-readable text data from the image 415. In a non-limiting example, the processor 202 is configured to extract machine-readable text from the image 415 based on an OCR engine known in the art. In another embodiment, the processor 202 is configured to extract machine-readable text data from the image 415 based on an ICR engine known in the art.
[0134] It should be noted that the accuracy of the underlying OCR engine or underlying ICR engine for extracting machine-readable text data may not be 100%. Therefore, " machine-readable text data " herein refers to the data extracted from image 415 based on the underlying OCR engine or ICR engine. In the example, the handwritten text "company" displayed in the first part is not correctly interpreted by the underlying OCR engine or ICR engine. As a result, the handwritten text "company" included in the first part is interpreted as "compeny". Similarly, the text "Product A" of shielding has been extracted as 'Product A' by the character recognition engine. These errors occur because the accuracy of the underlying character recognition engine (i.e., OCR engine, ICR engine, etc.) is relatively low. As explained above, machine-readable text data includes one or more words extracted after the character recognition engine is applied.
[0135] Figure 4C A table 420 depicting one or more words extracted from an image 415 is shown according to an embodiment of the present disclosure. The table 420 includes one or more words (i.e., machine-readable text data) extracted from the image 415. In an embodiment, the one or more words are extracted from the image 415 based on execution of a character recognition engine known in the art. In another embodiment, the one or more words are extracted from the image 415 based on execution of an OCR engine known in the art. In another embodiment, the one or more words are extracted from the image 415 based on execution of an ICR engine known in the art.
[0136] The processor 202 is further configured to compare each of the one or more words with the data set 118 (i.e., the domain vocabulary database 110 and the language dictionary database 112) to determine a first set of words and a second set of words from the one or more words. In this example, the domain vocabulary database 110 can store customized domain words (e.g., names of frequent customers of organization "A" and logistics-related terms), and can be updated based on at least the invoice history of organization "A" and manual intervention.
[0137] As explained above, the first set of words corresponds to words that successfully matched words stored in the data set 118. Additionally, the second set of words represents words that did not successfully match the data set 118.
[0138] Figure 4D A table 430 depicting a first set of words from one or more words extracted from image 415 is shown according to an embodiment of the present disclosure. Table 430 depicts a list of words that were successfully matched in data set 118, and therefore these words are referred to as the first set of words. For example, the first set of words includes "Bill", "To", etc. A complete list of the first set of words extracted from image 415 is shown in table 430.
[0139] As explained above, the second word set includes misspelled words (i.e., words that were not successfully matched with the data set 118). Misspelled words include words that were incorrectly extracted due to poor accuracy of the underlying character recognition engine. Figure 1B , due to the poor accuracy of the underlying character recognition engine used for text extraction, the handwritten text "company" included in the first part is extracted as "compeny". Similarly, the masked text "Product A" has been extracted as 'Prodjct A' by the character recognition engine. The misspelled words may also be incorrectly printed or typed (in the case of printed text) or incorrectly written (in the case of handwritten text). The processor 202 is then configured to correct the misspelled words based on the highest similarity score to determine the corrected words of some of the misspelled words, and the misspelled words for which the corrected words are not obtained are referred to as "residual words". In one embodiment, the highest similarity score is calculated based on a comparison of each misspelled word with the words stored in the data set 118.
[0140] In some embodiments, the processor 202 is initially configured to correct at least some of the words in the second set of words (i.e., the misspelled words) based on the highest domain similarity score. Based on this operation, some of the words in the second set of words may be corrected (referred to as 'corrected words') and some words may not be corrected (referred to as 'residual words'). The highest domain similarity score is calculated based on a comparison of each misspelled word with words stored in the domain vocabulary database 110. If the misspelled word is not corrected based on the highest domain similarity score, the processor 202 is further configured to correct the misspelled word based on the highest language similarity score to determine the corrected words and the residual words. In addition, the highest language similarity score is calculated based on a comparison of each misspelled word with words stored in the language dictionary database 112. Reference has been made to Figure 2 A detailed explanation of correcting a misspelled word to determine a corrected word and a residual word is explained and therefore will not be repeated here for the sake of brevity.
[0141] Figure 4EA table 440 depicting misspelled words and corresponding corrected words is shown according to an embodiment of the present disclosure.
[0142] Table 440 includes misspelled words (i.e., "John Doe," "Compeny," "Product," "Discont," "Taxrate," and "Balancedue") (see 442). Misspelled words correspond to those words that have not been successfully matched with words stored in data set 118. As previously explained, processor 202 is configured to correct misspelled words based on calculation of the highest similarity score with words present in data set 118 (either domain database or language database). In another embodiment, processor 202 is configured to correct misspelled words based on calculation of the highest domain similarity score and comparison of that score with a first threshold score, and, if necessary, also based on calculation of the highest language similarity score and comparison of that score with a second threshold score.
[0143] In the example shown, the processor 202 is configured to correct the misspelled word "John Doe". The processor 202 is configured to calculate the highest similarity score. However, the highest similarity score is less than the threshold similarity score, and therefore the misspelled word "John Doe" is referred to as a residual word. In some embodiments, the processor 202 is configured to calculate the highest domain similarity score and the highest language similarity score. Since the highest domain similarity score is less than the first threshold similarity score, and the highest language similarity score is less than the second threshold similarity score, therefore, the misspelled word "John Doe" is referred to as a residual word.
[0144] In addition, Figure 4E In the example shown in , the processor 202 is configured to correct the misspelled word "Compeny". The processor 202 is configured to calculate the highest similarity score based on the words available in the data set 118. In one example, the misspelled word "Compeny" is found to have the highest similarity with the word "Company" available in the language dictionary database 112. Therefore, the processor 202 is configured to replace the misspelled word "Compeny" with the word "Company" based on at least the highest domain similarity score or the highest language similarity score. In another example, a single character 'e' is replaced with 'a' based on the Levenshtein distance, and the misspelled word "Compeny" is replaced with the word "Company". The word "Company" is further classified as the first word set. Similarly, the word "Product" is also corrected to "Product".
[0145] In this way, misspelled words (see 442) are corrected to their corresponding corrected words (see 444). The corrected words left blank in table 440 are residual words. "Residual words" herein refer to those words that cannot be corrected based on the highest similarity score or the highest domain similarity score and the highest language similarity score. It should be noted that all corrected words are classified as the first word set, and only these residual words are now the current second word set.
[0146] Figure 4F A table 450 depicting residual words and corresponding corrected words is shown according to an embodiment of the present disclosure.
[0147] As explained above, processor 202 is also configured to correct current second word set, i.e. residual words. These second word sets (residual words) are words that are still not matched after calculating the highest similarity score or the highest domain similarity score and the highest language similarity score. As explained above, processor 202 is also configured to split the second word set (i.e., residual words) into two or more words at least in part based on predefined text parsing rules. In one embodiment, predefined text parsing rules define whether residual words will be split into two, three or more words.
[0148] For example, a word from the second word set (or residual word) is considered as "John Doe". The residual word "John Doe" is not successfully matched in the data set 118. In addition, based on the calculation of the highest similarity score, the highest domain similarity score, and the highest language similarity score, the residual word "John Doe" cannot be replaced with the correct word. Therefore, the residual word "John Doe" is further split based on the text parsing rules.
[0149] The processor 202 is configured to split the residual word character by character, and then connect the characters in an iterative manner to check whether the connection of the characters forms a word that matches a word already stored in the data set 118. For example, the processor is configured to split the residual word "John Doe" character by character into 'J', 'o', 'h', 'n', 'D', 'o' and 'e'. The processor is also configured to connect the characters in an iterative manner and further check whether the connection of the characters successfully matches any word already stored in the data set 118.
[0150] For example, the processor 202 connects the first character (i.e., 'J') with the subsequent character (i.e., 'o') to check whether the connection of the first character and the second character (i.e., 'Jo') matches a word already stored in the data set 118. In this example, since 'Jo' is not stored in the data set 118, the processor 202 is also configured to connect the next character (i.e., 'h') with the already connected string (i.e., 'Jo') to form 'Joh'. In addition, the processor 202 is configured to determine whether 'Joh' matches a word already stored in the data set 118. Since 'Joh' is again unsuccessfully matched with the words already stored in the data set 118, the processor is again configured to connect the next character (i.e., 'n') with the already connected string (i.e., 'Joh') to form 'John'. Since 'John' is a name that can be successfully matched in the language dictionary database 112 or the domain vocabulary database 110, the processor 202 is configured to treat the word 'John' as a word and further check the remaining characters in an iterative manner. It should be noted that the processor 202 may determine one, two, or more words from the remaining characters, and therefore, there may be any number of words that may be determined from the remaining words.
[0151] In our example of the word 'JohnDoe', the processor 202 is configured to determine another word (i.e., 'Doe') as a word that matches the language dictionary data set 118. Therefore, the words 'John' and 'Doe' are now classified as a third word set. In this way, the processor 202 is configured to determine a third word set (i.e., correct words) for at least one word in the second word set (i.e., residual words). More specifically, a "residual word" in this article refers to a connected word in which two or more words have been connected due to some error. In addition, the processor 202 is configured to split the connected words into two or more correct words. Table 450 includes a list of residual words (see 452) and a third word set (see 454). If any word in the second word set (i.e., residual word) is not corrected even after the splitting step, then that particular word can remain intact in the text output associated with the image 415. It should be noted that after the split operation, some words in the second word set (i.e., residual words) are corrected into the 'third word set', and some words that have not been corrected are only retained as the final 'second word set'. Therefore, in this way, the 'second word set' ultimately includes only the remaining words that have not changed after the split operation.
[0152] Figure 4G An exemplary representation 460 of a text output 462 of an image 415 after performing a text processing operation on the image 415 is shown according to an embodiment of the present disclosure. In an embodiment, the text output 462 may be displayed on Figure 2The text output 462 includes the first set of words, the third set of words, and the second set of words (i.e., the "unchanged words" that cannot be corrected even after the splitting operation), if any. The "unchanged words" herein refer to the final second set of words, i.e., those words that have not been corrected after calculating the highest similarity score, the highest domain similarity score, the highest language similarity score, and the split residual words. Such words are displayed unchanged in the final text output 462 associated with the image 415. Reference FIG. 4A to FIG. 4B In the example image shown in , there are no unchanged words, and therefore, the text output 462 includes only the first set of words and the third set of words.
[0153] Figure 5 is a process flow diagram of a computer-implemented method 500 for accurately generating text output from an image according to an embodiment of the present disclosure. The method 500 depicted in the flow diagram may be performed by a computing device 200. The operations of the flow diagram of the method 500 and combinations of the operations in the flow diagram of the method 500 may be implemented by different devices such as hardware, firmware, a processor (e.g., the processor 202), a circuit system, and / or associated with the execution of software including one or more computer program instructions. It should be noted that the operations of the method 500 may be described and / or practiced using systems other than the computing device 200. The method 500 begins with operation 502.
[0154] At operation 502 , the method 500 includes receiving, by the processor 202 , an image including text data.
[0155] At operation 504, method 500 includes extracting, by processor 202, machine-readable text data from the image. The machine-readable text data includes one or more words.
[0156] At operation 506, the method 500 includes comparing, by the processor 202, each of the one or more words to the data set 118 including at least one of the domain vocabulary database 110 and the language dictionary database 112 to determine a first set of words and a second set of words. The first set of words are words that successfully matched with the words available in the data set 118, and the second set of words are words that did not successfully match with the words available in the data set 118.
[0157] At operation 508 , the method 500 includes splitting, by the processor 202 , at least one word in the second set of words into two or more words to determine a third set of words that matches the words available in the data set 118 .
[0158] At operation 510 , the method 500 includes generating, by the processor 202 , a text output associated with the image based on at least the first set of words and the third set of words.
[0159] Figure 6 A data flow diagram representation 600 is shown for extracting words from an image and determining a first set of words and a second set of words from the extracted words according to an embodiment of the present disclosure. It should be understood that each operation explained in the representation 600 is performed by the text extraction application 116. The sequence of operations of the representation 600 may not necessarily be performed in the same order as they are presented. In addition, one or more operations may be grouped together and performed in a single step, or an operation may have several sub-steps that may be performed in parallel or in a sequential manner. It should be noted that for the purpose of explaining Figure 6 The process steps can be referred to Figure 1A to Figure 1B and Figure 2 system components.
[0160] At 602, the text extraction application 116 receives an image including text data. In one example, the text extraction application 116 is installed in a mobile phone having a camera. In addition, a user of the mobile phone can launch the text extraction application 116 in the mobile phone to scan a document using the camera of the mobile phone, or the user can capture an image of the document using the camera of the mobile phone. In another example, the image may already be stored in a local directory of the phone (e.g., external memory).
[0161] At 604, the text extraction application 116 performs at least one image preprocessing operation on the image to enhance the quality of the image. Additionally, the image preprocessing operation is performed on the image to enhance the quality or increase the readability of the text data of the image. The image preprocessing operation is performed before performing text extraction from the image.
[0162] The image preprocessing operation can be any combination of operations 604a to 604c. At 604a, the text extraction application 116 applies an adaptive thresholding method to eliminate gray areas in the image or increase the brightness of the image. At 604b, the text extraction application 116 applies an image enhancement method to update one or more image parameters of the image. The one or more image parameters may include but are not limited to at least one of the following: (a) brightness, (b) contrast, (c) clarity, and (d) aspect ratio. The text extraction application 116 can automatically update any one or all of the one or more image parameters based on the quality of the image. At 604c, the text extraction application 116 applies a de-skewing method to change the tilt angle of the image. For example, the document may not be scanned correctly, which causes the angle of the scanned image to stretch too much in one direction or the orientation of the scanned image becomes incorrect. In such cases, the text extraction application 116 is configured to apply a de-skewing method to change the tilt angle and orientation of the image.
[0163] At 606, the text extraction application 116 extracts machine-readable text data from the image based on the character recognition engine. The machine-readable text data may include one or more words. The machine-readable text data may also include numeric data, special characters, symbols, etc. Based on the number of extracted words (i.e., one or more words) represented as 'N', the text extraction application 116 iteratively runs multiple steps for each word in the one or more words.
[0164] At 608, the text extraction application 116 may compare the i-th word among the extracted words with words stored in or available in the data set 118 associated with the domain vocabulary database 110 and the language dictionary database 112. Herein, 'i' is a positive integer, and the i-th is less than or equal to the number of one or more words (denoted as 'N'). First, the word associated with the i-th index value equal to the lowest value is selected (e.g., the first word).
[0165] At 610 , the text extraction application 116 identifies whether the i-th word exactly matches at least one of the words available in the data set 118 .
[0166] When the text extraction application 116 identifies that the i-th word completely matches at least one of the words available in the data set 118, the text extraction application stores the i-th word in a first storage portion (associated with a first set of words) of the memory 204 at 612. In other words, the text extraction application 116 marks or assigns the i-th word in the first set of words. Specifically, the first set of words are the words that successfully match the words available in the data set 118.
[0167] When the text extraction application 116 identifies that the i-th word does not completely match at least one of the words available in the data set 118, the text extraction application stores the i-th word in a second storage portion (associated with a second set of words) of the memory 204 at 614. In other words, the text extraction application 116 marks or assigns the i-th word in the second set of words. Specifically, the second set of words are words that are not successfully matched with the words available in the data set 118.
[0168] At 616, the text extraction application 116 increments the i-th value (i→i+1) and checks the i-th value against the number of words extracted. If the i-th value is less than or equal to 'N', the process returns to step 608, otherwise the process ends. In other words, the text extraction application 116 selects the next word from the one or more words to compare the next word with the words available in the data set 118.
[0169] After identifying the second set of words from the one or more words, the text extraction application 116 can perform additional text processing on the second set of words to improve the quality of the text extraction process.
[0170] Fig. 7A (Combined Figure 6 ) is a simplified data flow diagram representation 700 for performing additional text processing on a second word set according to an embodiment of the present disclosure. It should be understood that each operation explained in representation 700 is performed by the text extraction application 116. The sequence of operations of representation 700 may not necessarily be performed in the same order as they are presented. In addition, one or more operations may be grouped and performed in a single step, or an operation may have several sub-steps that may be performed in parallel or in a sequential manner. It should be noted that for the purpose of explaining Fig. 7A The process steps can be referred to Figure 1A to Figure 1B and Figure 2 system components.
[0171] At 702 , the text extraction application 116 accesses a second set of words from a second storage portion of the memory 204 .
[0172] At 704, the text extraction application 116 retrieves the jth word (ie, the misspelled word) from the second set of words. First, the word associated with the jth index value equal to the lowest value (eg, 1) is selected.
[0173] At 706, the text extraction application 116 calculates the highest similarity score of the jth word with the words available in the dataset 118 (including the domain vocabulary database 110 and the language dictionary database 112). More specifically, the text extraction application 116 identifies the highest similarity score of the jth word by calculating the similarity scores of the jth word with the words available in the dataset 118.
[0174] At 708 , the text extraction application 116 checks whether the highest similarity score is at least equal to (ie, greater than or equal to) a threshold similarity score.
[0175] When the highest similarity score is not greater than or equal to the threshold similarity score, at 710, the text extraction application 116 stores the jth word as a residual word and performs a reference Figure 7B Describes the operation.
[0176] When the highest similarity score is greater than or equal to the threshold similarity score, at 712 , the text extraction application 116 detects the word corresponding to the highest similarity score (ie, the corrected word of the j th word found in the data set 118 ) as the corrected word of the j th word.
[0177] In addition, at 714, the text extraction application 116 stores the detected words as a first word set. j Replace the word with the detected word.
[0178] At 716, the text extraction application 116 j The jth value is incremented (j→j+1) and the jth value is checked against the number of the second word set (denoted as 'M'). If the jth value is less than or equal to 'M', the process returns to step 704, otherwise the process ends. In other words, the text extraction application 116 selects the next word from the second word set to calculate the highest similarity score of the next word with the words available in the data set 118.
[0179] Figure 7B (Combined Fig. 7A ) is a simplified data flow diagram representation 720 for splitting groups of a second set of words (i.e., residual words) to determine corrected words and generate text output for an image according to an embodiment of the present disclosure. It should be understood that each operation explained in representation 720 is performed by the text extraction application 116. The sequence of operations of representation 720 may not necessarily be performed in the same order as they are presented. In addition, one or more operations may be grouped and performed in the form of a single step, or an operation may have several sub-steps that may be performed in parallel or in a sequential manner. It should be noted that for the purpose of explaining Figure 7B The process steps can be referred to Figure 1A to Figure 1B and Figure 2 system components.
[0180] At 722, the text extraction application 116 takes the kth residual word and splits the kth residual word into two or more words based at least in part on a predefined text parsing rule. It should be noted that the text extraction application 116 can split the kth residual word into any number of words based on the predefined text parsing rule. In an example, operation 722 can be initialized by selecting the first word (K=1) of a total of 'L' residual words, where 'L' is a positive integer.
[0181] At 724 , the text extraction application 116 compares the two or more words to the words available in the data set 118 to determine whether the two or more words are successfully matched in the data set 118 .
[0182] At 726, the text extraction application 116 categorizes the two or more words into a third set of words based on the comparison. More specifically, when the two or more words have a successful match with the words available in the data set 118, the two or more words are included in the third set of words. When the two or more words do not successfully match with the words available in the data set 118, the kth residual word remains unchanged in the text output.
[0183] At 728 , the text extraction application 116 increments the kth value (k→k+1) and checks the kth value against the number of residual words (denoted as 'L'). If the kth value is less than or equal to 'L', the process returns to step 722 , otherwise the process moves to step 730 .
[0184] At step 730, the text extraction application 116 generates a text output associated with the image based on the first set of words, the third set of words, and the unchanged words. Specifically, the text extraction application 116 inserts the third set of words into the text output associated with the image to replace the corresponding residual words. "Text output" herein refers to the final output generated after performing text processing operations on the extracted machine-readable text data.
[0185] Figure 8 A simplified data flow diagram representation 800 for accurately generating text output from an image according to another embodiment of the present disclosure is shown. It should be understood that each operation explained in representation 800 is performed by the text extraction application 116. The sequence of operations of representation 800 may not necessarily be performed in the same order as they are presented. In addition, one or more operations may be grouped and performed in a single step, or an operation may have several sub-steps that may be performed in parallel or in a sequential manner. It should be noted that for the purpose of explaining Figure 8 The process steps can be referred to Figure 1A to Figure 1B and Figure 2 system components.
[0186] As mentioned above, the text extraction application 116 extracts one or more words from the image based on a character recognition engine. In order to improve the efficiency of the text extraction process, the text extraction application 116 performs additional text processing on the extracted words.
[0187] At 802, the text extraction application 116 searches the extracted words in the data set 118 associated with the domain vocabulary database 110 and the language dictionary database 112 to determine matching words (i.e., the first set of words) and misspelled words (i.e., the second set of words) from the extracted words. In one example, the text extraction application 116 performs an exact string match to determine matching words and misspelled words.
[0188] To perform corrections on misspelled words, the text extraction application 116 performs threshold matching with words available in the data set 118 associated with the domain vocabulary database 110 and the language dictionary database 112 .
[0189] At 804, the text extraction application 116 selects an nth word from the misspelled words. Herein, 'n' is a positive integer, and 'n' is less than or equal to the number of misspelled words (denoted as 'P'). In an example, operation 804 can be initialized by selecting the word associated with the nth index value equal to the lowest value (e.g., 1).
[0190] At 806, the text extraction application 116 calculates the highest domain similarity score of the nth word with the words available in the domain vocabulary database 110. More specifically, the text extraction application 116 is configured to compare the nth word with the words available in the domain vocabulary database 110 and calculate the highest domain similarity score based on the comparison.
[0191] At 808 , the text extraction application 116 checks whether the highest domain similarity score of the nth word is at least equal to (ie, greater than or equal to) a first threshold similarity score.
[0192] When the highest domain similarity score is greater than or equal to the first threshold similarity score, at 810 , the text extraction application 116 detects the domain word corresponding to the highest domain similarity score (i.e., the matching word found in the domain vocabulary database 110 ) as the “corrected word” for the nth misspelled word.
[0193] When the highest domain similarity score is not greater than or equal to the first threshold similarity score, at 812, the text extraction application 116 calculates a highest language similarity score of the nth misspelled word with the words available in the language dictionary database 112. More specifically, the text extraction application 116 compares the nth misspelled word with the words available in the language dictionary database 112 and calculates the highest language similarity score based on the comparison.
[0194] At 814 , the text extraction application 116 checks whether the highest linguistic similarity score of the nth word is at least equal to (ie, greater than or equal to) a second threshold similarity score.
[0195] When the highest language similarity score is greater than or equal to the second threshold similarity score, at 816 , the text extraction application 116 detects the language word corresponding to the highest language similarity score (ie, the matching word found in the language dictionary database 112 ) as the corrected word for the nth misspelled word.
[0196] When the highest linguistic similarity score is not greater than or equal to the second threshold similarity score, at 818 , the text extraction application 116 marks the nth word as a residual word and splits the residual word into two or more words based at least in part on a predefined text parsing rule.
[0197] At 820 , the text extraction application 116 compares the two or more words to words available in the data set 118 associated with the domain vocabulary database 110 and the language dictionary database 112 to determine whether the two or more words are successfully matched in the data set 118 .
[0198] At 822, the text extraction application 116 categorizes the two or more words into corrected words based on the comparison. More specifically, when the two or more words have a successful match with the words available in the data set 118, the two or more words are included in the corrected words and inserted into the text output in place of the nth word. When the two or more words do not successfully match with the words available in the data set 118, the nth word remains unchanged in the text output.
[0199] At 824, the text extraction application 116 increments the nth value (n→n+1) and checks the nth value against the number of misspelled words (denoted as 'P'). If the nth value is less than or equal to 'P', the process returns to step 804, otherwise the process moves to step 826.
[0200] At step 826, the text extraction application 116 generates text output associated with the image based on the matched words, the corrected words, and the unchanged words. Specifically, the text extraction application 116 inserts the corrected words into the text output associated with the image to replace the corresponding misspelled words.
[0201] Fig. 9 1 is a simplified block diagram of an electronic device 900 capable of implementing various embodiments of the present disclosure. For example, the electronic device 900 may correspond to the computing device 104 of the user 106 of FIG. 1 . The electronic device 900 is depicted as including one or more applications 906. For example, the one or more applications 906 may include the text extraction application 116 of FIG. 1 . The text extraction application 116 may be an instance of an application hosted and managed by the computing device 200. One of the one or more applications 906 on the electronic device 900 is capable of communicating with a server system to perform intelligent text extraction in real time, as explained above.
[0202] It should be noted that the computing device 900 shown in the figure and described below is merely illustrative of one type of device and should therefore not be considered to limit the scope of the embodiments. Thus, it should be understood that at least some of the components described below in conjunction with the electronic device 900 may be optional and may therefore be included in embodiments in conjunction with the electronic device 900. Fig. 9Thus, the electronic device 900 can be any of a mobile electronic device such as a cellular phone, a tablet computer, a laptop computer, a mobile computer, a personal digital assistant (PDA), a mobile television, a mobile digital assistant, or any combination of the above devices, as well as other types of communication or multimedia devices, among other examples.
[0203] The electronic device 900 shown includes a controller or processor 902 (e.g., a signal processor, a microprocessor, an ASIC, or other control and processing logic circuit system) for performing such tasks as signal encoding, data processing, image processing, input / output processing, power control, and / or other functions. An operating system 904 controls the allocation and use of components of the electronic device 900 and supports one or more operations of an application (see application 906), such as a text extraction application 116 that implements one or more innovative features described herein. In addition, the application 906 may include common mobile computing applications (e.g., email applications, calendars, contact managers, web browsers, messaging applications) or any other computing applications.
[0204] The electronic device 900 shown includes one or more memory components, such as non-removable memory 908 and / or removable memory 910. In an embodiment, non-removable memory 908 and / or removable memory 910 can be collectively referred to as a database. Non-removable memory 908 can include RAM, ROM, flash memory, hard disk or other known memory storage technologies. Removable memory 910 can include flash memory, smart card or user identity module (SIM). One or more memory components can be used to store data and / or code for running operating system 904 and application 906. Electronic device 900 can also include user identity module (UIM) 912. UIM 912 can be a memory device with a built-in processor. UIM 912 can include, for example, user identity module (SIM), universal integrated circuit card (UICC), universal user identity module (USIM), removable user identity module (R-UIM) or any other smart card. UIM 912 usually stores information elements related to mobile users. UIM912 in the form of a SIM card is well known in the Global System for Mobile Communications (GSM) communication system, the Code Division Multiple Access (CDMA) system or due to the third generation (3G) wireless communication protocols (such as Universal Mobile Telecommunications System (UMTS), CDMA9000, Wideband CDMA (WCDMA) and Time Division Synchronous CDMA (TD-SCDMA)) or due to the fourth generation (4G) wireless communication protocols (such as LTE (Long Term Evolution)).
[0205] The electronic device 900 may support one or more input devices 920 and / or one or more output devices 930. Examples of input devices 920 may include, but are not limited to, a touch screen / display screen 922 (e.g., capable of capturing finger tap input, finger gesture input, multi-finger tap input, multi-finger gesture input, or keystroke input from a virtual keyboard or keypad), a microphone 924 (e.g., capable of capturing voice input), a camera module 926 (e.g., capable of capturing still images and / or video images), and a physical keyboard 928. Examples of output devices 930 may include, but are not limited to, a speaker 932 and a display 934. Other possible output devices may include piezoelectric or other tactile output devices. Some devices may provide more than one input / output function. For example, the touch screen 922 and the display 934 may be combined into a single input / output device.
[0206] Wireless modem 940 may be coupled to one or more antennas ( Fig. 9 902 and external devices, as is well known in the art. The wireless modem 940 is shown in a general form and may include, for example, a cellular modem 942 for long-range communication with a mobile communication network, a Wi-Fi compatible modem 944 and / or a Bluetooth compatible modem 946 for short-range communication with an external Bluetooth-equipped device or a local wireless data network or router. The wireless modem 940 is typically configured to communicate with one or more cellular networks, such as a GSM network for data and voice communication within a single cellular network, between cellular networks, or between the electronic device 900 and a public switched telephone network (PSTN).
[0207] The electronic device 900 may also include one or more input / output ports 950, a power source 952, one or more sensors 954 (e.g., an accelerometer, gyroscope, compass, or infrared proximity sensor for detecting the orientation or motion of the electronic device 900, and a biometric sensor for scanning the biometric identity of an authorized user), a transceiver 956 (for wireless transmission of analog or digital signals), and / or a physical connector 960, which may be a USB port, an IEEE 1294 (FireWire) port, and / or an RS-232 port. The components shown are not required or complete, as any of the components shown may be deleted and other components may be added.
[0208] refer to Figure 5 , Figure 6 , Figures 7A to 7B and Figure 8One or more operations of the disclosed method or computing device 200 may be implemented using software that includes computer executable instructions stored on one or more computer-readable media (e.g., non-transitory computer-readable media, such as one or more optical disks, volatile memory components (e.g., DRAM or SRAM), or non-volatile memory or storage components (e.g., hard disk drives or solid-state non-volatile memory components, such as flash memory components)) and executed on a computer (e.g., any suitable computer, such as a laptop, netbook, netbook, tablet computing device, smart phone or other mobile computing device). For example, such software may be executed on a single local computer or in a network environment (e.g., via the Internet, a wide area network, a local area network, a web-based remote server, a client-server network (such as a cloud computing network) or other such network) using one or more network computers. In addition, any of the intermediate or final data created and used during the implementation of the disclosed method or system may also be stored on one or more computer-readable media (e.g., non-transitory computer-readable media) and is considered to be within the scope of the disclosed technology. In addition, any of the software-based embodiments may be uploaded, downloaded or remotely accessed by suitable communication means. Such suitable communications means include, for example, the Internet, the World Wide Web, an intranet, software applications, cable (including fiber optic cable), magnetic communications, electromagnetic communications (including RF, microwave and infrared communications), electronic communications or other such communications means.
[0209] Although the present invention has been described with reference to specific exemplary embodiments, it should be noted that various modifications and changes may be made to these embodiments without departing from the broad spirit and scope of the present invention. For example, the various operations, blocks, etc. described herein may be implemented and operated using any combination of hardware circuitry (e.g., complementary metal oxide semiconductor (CMOS) based logic circuitry), firmware, software, and / or hardware, firmware and / or software (e.g., embodied in a machine-readable medium). For example, the apparatus and method may be implemented using transistors, logic gates, and circuits (e.g., application specific integrated circuit (ASIC) circuitry and / or digital signal processor (DSP) circuitry).
[0210] Specifically, the computing device 200 and its various components may be implemented using software and / or using transistors, logic gates, and circuits (e.g., integrated circuit circuit systems, such as ASIC circuit systems). Various embodiments of the present invention may include one or more computer programs stored or otherwise embodied on a non-transitory computer-readable storage medium, wherein the computer program is configured to cause a processor or computer to perform one or more operations. A non-transitory computer-readable storage medium storing, embodying, or encoding a computer program or similar language may be embodied as a tangible data storage device storing one or more software programs, which are configured to cause a processor or computer to perform one or more operations. Such operations may be, for example, any of the steps or operations described herein. In some embodiments, the computer program may be stored and provided to a computer using any type of non-transitory computer-readable medium. Non-transitory computer-readable media include any type of tangible storage media. Examples of non-transitory computer-readable media include magnetic storage media (such as floppy disks, magnetic tapes, hard drives, etc.), optical magnetic storage media (e.g., magneto-optical disks), CD-ROMs (Compact Disc Read Only Memory), CD-Rs (Compact Disc Recordable), CD-R / W (Compact Disc Rewritable), DVDs (Digital Versatile Discs), BDs ( The computer program may be provided to the computer using any type of transient computer-readable medium. Examples of transient computer-readable media include electrical signals, optical signals, and electromagnetic waves. Transient computer-readable media may provide the program to the computer via a wired communication line (e.g., electrical wires and optical fibers) or a wireless communication line.
[0211] As discussed above, various embodiments of the present disclosure may be practiced with steps and / or operations in different orders and / or with hardware elements in configurations different from those disclosed. Therefore, although the present disclosure has been described based on these exemplary embodiments, it should be noted that certain modifications, variations, and alternative configurations may be apparent and are fully within the spirit and scope of the present disclosure.
[0212] Although various exemplary embodiments of the present disclosure are described herein in language specific to structural features and / or method actions, the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Instead, the specific features and actions described above are disclosed as exemplary forms of implementing the claims.
[0213] Embodiments of computer-implemented methods, computing devices, and computer-readable storage media according to the present disclosure are set forth as follows:
[0214] Clause 1. A computer-implemented method comprising:
[0215] receiving, by a processor, an image including text data;
[0216] extracting, by the processor, machine-readable text data from the image, the machine-readable text data comprising one or more words;
[0217] comparing, by the processor, each of the one or more words to a data set including at least one of a domain vocabulary database and a language dictionary database to determine a first set of words and a second set of words, the first set of words being words that successfully matched with words available in the data set, and the second set of words being words that did not successfully match with the words available in the data set;
[0218] splitting, by the processor, at least one word in the second set of words into two or more words to determine a third set of words that matches the words available in the data set; and
[0219] A text output associated with the image is generated, by the processor, based on at least the first set of words and the third set of words.
[0220] Clause 2. The computer-implemented method of Clause 1, wherein the step of comparing each of the one or more words comprises:
[0221] calculating a highest similarity score for each word in the second set of words with the words available in the data set;
[0222] Upon determining that the highest similarity score is at least equal to a threshold similarity score, detecting from the data set a word corresponding to the highest similarity score as a corrected word of a corresponding word in the second set of words; and
[0223] The corrected words are classified into the first set of words.
[0224] Clause 3. A computer-implemented method as described in any of the preceding clauses, further comprising:
[0225] splitting the at least one word in the second set of words into the two or more words based at least in part on a predefined text parsing rule;
[0226] comparing the two or more words to the data set to determine whether the two or more words are successfully matched in the data set; and
[0227] In response to determining that the two or more words have a successful match in the data set, the two or more words are classified into the third set of words.
[0228] Clause 4. The computer-implemented method of Clause 1, wherein the language dictionary database is configured to store words according to syntactic rules and semantic rules of at least one language.
[0229] Clause 5. A computer-implemented method as described in any of the preceding claims, further comprising generating, by the processor, the text output associated with the image based at least on the first set of words, the second set of words that remain unmatched after splitting, and the third set of words.
[0230] Clause 6. A computer-implemented method as described in Clause 1, wherein before extracting the machine-readable text data from the image, the image is processed based on at least one image pre-processing operation to enhance the quality of the image.
[0231] Clause 7. A computer-implemented method as described in Clause 5, wherein the at least one image preprocessing operation includes at least one of the following: (a) an adaptive thresholding method, (b) an image enhancement method, and (c) a de-skew method.
[0232] Clause 8. The computer-implemented method of Clause 7, wherein the adaptive thresholding method comprises eliminating gray areas in the image.
[0233] Clause 9. A computer-implemented method as described in Clause 7, wherein the image enhancement method includes updating one or more image parameters of the image, the one or more image parameters including at least one of: (a) brightness, (b) contrast, (c) sharpness, and (d) aspect ratio.
[0234] Clause 10. The computer-implemented method of Clause 7, wherein the de-skew method comprises changing a skew angle of the image.
[0235] Clause 11. A computing device comprising:
[0236] a memory including executable instructions; and
[0237] a processor communicatively coupled to the memory, the processor configured to execute the instructions to cause the computing device, at least in part:
[0238] receiving an image including text data;
[0239] extracting machine-readable text data from the image, the machine-readable text data comprising one or more words;
[0240] comparing each of the one or more words to a data set including at least one of a domain vocabulary database and a language dictionary database to determine a first set of words and a second set of words, the first set of words being words that successfully matched with words available in the data set, and the second set of words being words that did not successfully match with the words available in the data set;
[0241] splitting at least one word in the second set of words into two or more words to determine a third set of words that matches the words available in the data set; and
[0242] A text output associated with the image is generated based on at least the first set of words and the third set of words.
[0243] Clause 12. The computing device of clause 11, wherein in order to compare each of the one or more words, the computing device is further caused, at least in part:
[0244] calculating a highest similarity score for each word in the second set of words with the words available in the data set;
[0245] Upon determining that the highest similarity score is at least equal to a threshold similarity score, detecting from the data set a word corresponding to the highest similarity score as a corrected word of a corresponding word in the second set of words; and
[0246] The corrected words are classified into the first set of words.
[0247] Clause 13. The computing device of any of clauses 11 to 12, wherein the computing device is further caused, at least in part:
[0248] splitting the at least one word in the second set of words into the two or more words based at least in part on a predefined text parsing rule;
[0249] comparing the two or more words to the data set to determine whether the two or more words are successfully matched in the data set; and
[0250] In response to determining that the two or more words have a successful match in the data set, the two or more words are classified into the third set of words.
[0251] Clause 14. The computing device of Clause 11, wherein the language dictionary database is configured to store words according to syntactic rules and semantic rules of at least one language.
[0252] Clause 15. The computing device of Clause 11, wherein prior to extracting the machine-readable text data from the image, the image is processed based on at least one image pre-processing operation to enhance a quality of the image.
[0253] Clause 16. The computing device of Clause 15, wherein the at least one image preprocessing operation comprises at least one of: (a) an adaptive thresholding method, (b) an image enhancement method, and (c) a de-skew method.
[0254] Clause 17. A non-transitory computer-readable storage medium comprising computer-executable instructions that, when executed by at least a processor of a computing device, cause the computing device to perform a method comprising:
[0255] receiving an image including text data;
[0256] extracting machine-readable text data from the image, the machine-readable text data comprising one or more words;
[0257] comparing each of the one or more words to a data set including at least one of a domain vocabulary database and a language dictionary database to determine a first set of words and a second set of words, the first set of words being words that successfully matched with words available in the data set, and the second set of words being words that did not successfully match with the words available in the data set;
[0258] splitting at least one word in the second set of words into two or more words to determine a third set of words that matches the words available in the data set; and
[0259] A text output associated with the image is generated based on at least the first set of words and the third set of words.
[0260] Clause 18. The non-transitory computer-readable storage medium of Clause 17, wherein the step of comparing each of the one or more words comprises:
[0261] calculating a highest similarity score for each word in the second set of words with the words available in the data set;
[0262] Upon determining that the highest similarity score is at least equal to a threshold similarity score, detecting a word corresponding to the highest similarity score as a corrected word of a corresponding word in the second set of words; and
[0263] The corrected words are classified into the first set of words.
[0264] Clause 19. The non-transitory computer-readable storage medium of any of the preceding clauses, further comprising:
[0265] splitting the at least one word in the second set of words into the two or more words based at least in part on a predefined text parsing rule;
[0266] comparing the two or more words to the data set to determine whether the two or more words are successfully matched in the data set; and
[0267] In response to determining that the two or more words have a successful match in the data set, the two or more words are classified into the third set of words.
[0268] Clause 20. The non-transitory computer-readable storage medium of Clause 17, wherein prior to extracting the machine-readable text data from the image, the image is processed based on at least one image pre-processing operation to enhance a quality of the image.
[0269] Clause 21. The non-transitory computer-readable storage medium of Clause 20, wherein the at least one image pre-processing operation comprises at least one of: (a) an adaptive thresholding method, (b) an image enhancement method, and (c) a de-skew method.
Claims
1. A computer-implemented method comprising: receiving, by a processor, an image including text data; extracting, by the processor, machine-readable text data from the image, the machine-readable text data comprising one or more words; comparing, by the processor, each of the one or more words to a data set including at least one of a domain vocabulary database and a language dictionary database to determine a first set of words and a second set of words, the first set of words being words that successfully matched with words available in the data set, and the second set of words being words that did not successfully match with the words available in the data set; splitting, by the processor, at least one word in the second set of words into two or more words to determine a third set of words that matches the words available in the data set; as well as A text output associated with the image is generated, by the processor, based on at least the first set of words and the third set of words.
2. The computer-implemented method of claim 1 , wherein the step of comparing each of the one or more words comprises: calculating a highest similarity score for each word in the second set of words with the words available in the data set; Upon determining that the highest similarity score is at least equal to a threshold similarity score, detecting from the data set a word corresponding to the highest similarity score as a corrected word of a corresponding word in the second set of words; as well as The corrected words are classified into the first word set.
3. The computer-implemented method of any preceding claim, further comprising: splitting the at least one word in the second set of words into the two or more words based at least in part on a predefined text parsing rule; comparing the two or more words to the data set to determine whether the two or more words are successfully matched in the data set; as well as In response to determining that the two or more words have a successful match in the data set, the two or more words are classified into the third set of words.
4. The computer-implemented method of any one of the preceding claims, wherein the language dictionary database is configured to store words according to syntactic rules and semantic rules of at least one language.
5. The computer-implemented method of any one of the preceding claims, wherein the domain vocabulary database is configured to store keywords corresponding to at least one domain.
6. A computer-implemented method as described in any of the preceding claims, further comprising generating, by the processor, the text output associated with the image based on at least the first set of words, the second set of words that remain unmatched after splitting, and the third set of words.
7. A computer-implemented method as claimed in any one of the preceding claims, wherein before extracting the machine-readable text data from the image, the image is processed based on at least one image pre-processing operation to enhance the quality of the image.
8. The computer-implemented method of claim 7, wherein the at least one image pre-processing operation comprises at least one of: (a) an adaptive thresholding method, (b) an image enhancement method, and (c) a de-skew method.
9. The computer-implemented method of claim 8, wherein the adaptive thresholding method includes eliminating gray areas in the image.
10. The computer-implemented method of claim 8, wherein the image enhancement method comprises updating one or more image parameters of the image, the one or more image parameters comprising at least one of: (a) brightness, (b) contrast, (c) sharpness, and (d) aspect ratio.
11. The computer-implemented method of claim 8, wherein the de-skewing method comprises changing a tilt angle of the image.
12. A computing device comprising: a memory including executable instructions; as well as a processor communicatively coupled to the memory, the processor configured to execute the instructions to cause the computing device to, at least in part: receiving an image including text data; extracting machine-readable text data from the image, the machine-readable text data comprising one or more words; comparing each of the one or more words to a data set including at least one of a domain vocabulary database and a language dictionary database to determine a first set of words and a second set of words, the first set of words being words that successfully matched with words available in the data set, and the second set of words being words that did not successfully match with the words available in the data set; splitting at least one word in the second set of words into two or more words to determine a third set of words that match the words available in the data set; as well as A text output associated with the image is generated based on at least the first set of words and the third set of words.
13. The computing device of claim 12, wherein to compare each of the one or more words, the computing device is further caused, at least in part: calculating a highest similarity score for each word in the second set of words with the words available in the data set; Upon determining that the highest similarity score is at least equal to a threshold similarity score, detecting from the data set a word corresponding to the highest similarity score as a corrected word of a corresponding word in the second set of words; as well as The corrected words are classified into the first word set.
14. The computing device of any one of claims 12 to 13, wherein the computing device is further caused, at least in part: splitting the at least one word in the second set of words into the two or more words based at least in part on a predefined text parsing rule; comparing the two or more words to the data set to determine whether the two or more words are successfully matched in the data set; as well as In response to determining that the two or more words have a successful match in the data set, the two or more words are classified into the third set of words.
15. The computing device of claim 12, wherein the language dictionary database is configured to store words according to syntactic rules and semantic rules of at least one language.
16. The computing device of claim 12, wherein prior to extracting the machine-readable text data from the image, the image is processed based on at least one image pre-processing operation to enhance the quality of the image.
17. The computing device of claim 16, wherein the at least one image pre-processing operation comprises at least one of: (a) an adaptive thresholding method, (b) an image enhancement method, and (c) a de-skew method.
18. A non-transitory computer-readable storage medium comprising computer-executable instructions that, when executed by at least a processor of a computing device, cause the computing device to perform a method comprising: receiving an image including text data; extracting machine-readable text data from the image, the machine-readable text data comprising one or more words; comparing each of the one or more words to a data set including at least one of a domain vocabulary database and a language dictionary database to determine a first set of words and a second set of words, the first set of words being words that successfully matched with words available in the data set, and the second set of words being words that did not successfully match with the words available in the data set; splitting at least one word in the second set of words into two or more words to determine a third set of words that match the words available in the data set; as well as A text output associated with the image is generated based on at least the first set of words and the third set of words.
19. The non-transitory computer-readable storage medium of claim 18, wherein the step of comparing each of the one or more words comprises: calculating a highest similarity score for each word in the second set of words with the words available in the data set; Upon determining that the highest similarity score is at least equal to a threshold similarity score, detecting a word corresponding to the highest similarity score as a corrected word of a corresponding word in the second set of words; as well as The corrected words are classified into the first word set.
20. The non-transitory computer-readable storage medium of any one of claims 18 to 19, further comprising: splitting the at least one word in the second set of words into the two or more words based at least in part on a predefined text parsing rule; comparing the two or more words to the data set to determine whether the two or more words are successfully matched in the data set; as well as In response to determining that the two or more words have a successful match in the data set, the two or more words are classified into the third set of words.
21. The non-transitory computer-readable storage medium of claim 18, wherein before extracting the machine-readable text data from the image, the image is processed based on at least one image pre-processing operation to enhance the quality of the image.
22. The non-transitory computer-readable storage medium of claim 21, wherein the at least one image pre-processing operation comprises at least one of: (a) an adaptive thresholding method, (b) an image enhancement method, and (c) a de-skew method.