Image character information identification method and device, storage medium and electronic device
By performing image enhancement processing and feature extraction on the ticket image, combined with the CTC algorithm, the problem of inaccurate recognition of low-resolution or fuzzy text images in the prior art is solved, and the recognition accuracy and processing capabilities of low-quality images are improved.
Patent Information
- Application Number
- CN202510141812.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-08
- Publication Date
- 2025-05-09
AI Technical Summary
In the prior art, when the ticket image recognition system processes complex low-resolution or blurred text images with noise, incorrect recognition results may occur, and the recognition results are greatly affected by image quality. Especially when the acquisition environment is too dark and the light is uneven, the recognition accuracy rate is seriously reduced.
By acquiring the image to be identified, image enhancement processing is performed to increase illuminance, image features are extracted and probability distribution is obtained, and finally the CTC algorithm is used for identification. The method includes steps such as denoising processing, bilateral gamma transformation, morphological processing, edge detection and Hough transformation to improve image quality and the recognition accuracy of processing low-quality images.
By performing image enhancement processing before character recognition, the illuminance and quality of the image are improved, the recognition ability of low-quality images is enhanced, the recognition accuracy is improved, and automated and intelligent image character information recognition is realized.
Smart Images

Figure CN119964175A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular, to a method for recognizing image character information, a device for recognizing image character information, a computer-readable storage medium, and an electronic device. Background Art
[0002] In the prior art, text recognition in images, such as bill images, mainly uses optical character recognition technology, which uses computer vision technology to detect and recognize characters and then convert them into editable formats. Although great progress has been made and it can be applied to various scenarios, the following problems still exist when processing bill images:
[0003] (1) The existing bill image recognition system may produce incorrect recognition results when processing complex low-resolution or blurred text images with noise. In particular, the recognition accuracy may be lower for bill images with handwritten or non-standardized text.
[0004] (2) The recognition result is greatly affected by the image quality. The current bill image recognition system has high requirements for image quality. If the acquisition environment is too dark, the light is uneven, or there are other image distortions, the recognition accuracy will drop significantly. Summary of the invention
[0005] The main purpose of the present application is to provide a method for recognizing image character information, an apparatus for recognizing image character information, a computer-readable storage medium and an electronic device, so as to at least solve the problem of inaccurate recognition of character information in pictures in the prior art.
[0006] According to one aspect of the present application, a method for recognizing image character information is provided, comprising: obtaining an image to be recognized, the image to be recognized including at least one character information; performing image enhancement processing on at least the image to be recognized to increase the illumination of the image to be recognized, and obtaining a preprocessed image; extracting image features of the preprocessed image to obtain a plurality of target image features, and obtaining a probability distribution of the plurality of target image features to obtain a target probability distribution, wherein the target image feature is an image feature corresponding to the character information; and processing the target probability distribution using a CTC algorithm to obtain a recognition result of the image to be recognized.
[0007] Optionally, at least the image to be identified is subjected to image enhancement processing to increase the illumination of the image to be identified to obtain a preprocessed image, including: using a non-local mean denoising algorithm to perform denoising processing on the image to be identified to obtain a first processed image; performing bilateral gamma transform processing on the first processed image to obtain a second processed image; performing morphological processing on the second processed image to obtain a third processed image, wherein the morphological processing includes corrosion processing and dilation processing; using a Canny edge algorithm to process the third processed image to obtain contour information of the third processed image; and performing Hough transform processing on the third processed image according to the contour information to obtain the preprocessed image.
[0008] Optionally, a non-local mean denoising algorithm is used to perform denoising processing on the image to be identified to obtain a first processed image, including: segmenting the image to be identified to obtain multiple image blocks; respectively calculating the Euclidean distance between the average pixel value of the current image block and the average pixel value of other image blocks to obtain multiple Euclidean distances, wherein the current image block is any one of the image blocks, and the other image blocks are any one of the multiple image blocks except the current image block; determining that the other image block corresponding to the maximum value of the multiple Euclidean distances is a similar image block corresponding to the current image block; performing weighted averaging processing on the weights of the pixel values of the other image blocks to obtain updated pixel values, wherein the weights of the pixel values of the other image blocks are proportional to the Euclidean distances; and respectively updating the pixel values of the multiple image blocks using the updated pixel values to obtain the first processed image.
[0009] Optionally, the first processed image includes a plurality of first pixel points, the second processed image includes a plurality of second pixel points, and the first processed image is subjected to bilateral gamma transform processing to obtain the second processed image, including: obtaining position information S0(x0, y0) of the first pixel point; according to the formula S1(x1, y1)=α(1-(1-S0(x0, y0)) γ )+(1-α)(1-(1-S0(x,y) 1 / γ ) γ ) performs bilateral gamma transform processing on the first pixel to obtain the corresponding position information S1(x1, y1) of the second pixel, wherein γ is the gamma index, x0 and x1 are set in a one-to-one correspondence, y0 and y1 are set in a one-to-one correspondence, the gamma index ranges from 2 to 2.5, and α is the average value of the normalized pixels of the first processed image.
[0010] Optionally, extracting image features of the preprocessed image to obtain multiple target image features includes: acquiring a historical image, wherein the historical image is an image acquired before a current moment, and the historical image includes at least one of the character information; inputting the preprocessed image into a multi-scale convolutional neural network model to obtain the target image features, wherein the multi-scale convolutional neural network model is trained using the historical image and the image features of the historical image.
[0011] Optionally, obtaining the probability distribution of multiple target image features to obtain the target probability distribution includes: inputting the multiple target image features into a bidirectional long short-term memory network model in sequence to obtain the target probability distribution, wherein the bidirectional long short-term memory network model includes a reverse layer and a forward layer connected in sequence, and the reverse layer and the forward layer respectively include multiple long short-term memory network units connected in sequence.
[0012] Optionally, the target probability distribution is processed using a CTC algorithm to obtain a recognition result of the image to be recognized, including: calculating the cumulative conditional probability of the target probability distribution to convert the target probability distribution into multiple character sequences to obtain the recognition result, wherein the character information includes the character sequence.
[0013] According to another aspect of the present application, a device for recognizing image character information is provided, comprising: an acquisition unit, used to acquire an image to be recognized, wherein the image to be recognized includes at least one character information; a processing unit, used to perform image enhancement processing on at least the image to be recognized to increase the illumination of the image to be recognized, and obtain a preprocessed image; an extraction unit, used to extract image features of the preprocessed image, obtain multiple target image features, and obtain probability distributions of the multiple target image features, and obtain target probability distributions, wherein the target image features are image features corresponding to the character information; and a recognition unit, used to process the target probability distribution using a CTC algorithm, and obtain a recognition result of the image to be recognized.
[0014] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described.
[0015] According to another aspect of the present application, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute any one of the methods described through the computer program.
[0016] The technical solution of the present application provides a method for recognizing image character information. First, an image to be recognized is obtained, and the image to be recognized includes at least one character information; then, at least the image to be recognized is subjected to image enhancement processing to increase the illumination of the image to be recognized, and a preprocessed image is obtained; then, the image features of the preprocessed image are extracted to obtain multiple target image features, and the probability distribution of the multiple target image features is obtained to obtain a target probability distribution, wherein the target image feature is the image feature corresponding to the character information; finally, the target probability distribution is processed by the CTC algorithm to obtain the recognition result of the image to be recognized. By performing image enhancement processing before character recognition to enhance the illumination of the image, the problem of uneven illumination of the environment during image acquisition is taken into account. Compared with the recognition method that only uses deep learning in the prior art, the recognition accuracy in processing low-quality images is higher. Secondly, after extracting the image features, by calculating the probability distribution of the target image features, semantic problems can be further avoided in the process of processing the image features. Finally, the CTC algorithm is used to process the text in the output bill image. Therefore, the above scheme can realize automatic and intelligent recognition and processing of character information in images, and improve recognition accuracy. The present invention solves the technical problem of inaccurate recognition of character information in pictures in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 A hardware structure block diagram of a mobile terminal for executing a method for recognizing image character information provided in an embodiment of the present application is shown;
[0019] Figure 2 A schematic diagram showing a flow chart of a method for recognizing image character information provided according to an embodiment of the present application;
[0020] Figure 3 A schematic diagram of a multi-scale convolutional neural network model provided according to an embodiment of the present application is shown;
[0021] Figure 4 A specific flow chart of a method for recognizing image character information provided according to an embodiment of the present application is shown;
[0022] Figure 5 A structural block diagram of a device for recognizing image character information provided according to an embodiment of the present application is shown.
[0023] The above drawings include the following reference numerals:
[0024] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION
[0025] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] As introduced in the background technology, the prior art does not accurately recognize character information in images. To solve the above problem, the embodiments of the present application provide a method for recognizing image character information, a device for recognizing image character information, a computer-readable storage medium and an electronic device.
[0029] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0030] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for recognizing image character information according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0031] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for recognizing image character information in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific example of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0032] In this embodiment, a method for recognizing image character information running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0033] Figure 2 is a flow chart of a method for recognizing image character information according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0034] Step S201: Obtain the image to be recognized, where the image to be recognized includes at least one character information;
[0035] Specifically, the above-mentioned character information refers to the character content such as letters, numbers, symbols, etc. contained in the image, as well as the relevant attributes and features of these characters. The character content includes the text itself and the language type. For example, the text content shown in a picture directly conveys the text information that the picture wants to express. The characters in the picture may belong to different languages, such as Chinese, English, Japanese, Arabic, etc. Characters in different languages have unique shapes and structures. Character attributes include font, font size, color, and style. Character features include stroke features, structural features, and texture features. Stroke features are composed of different strokes, such as horizontal, vertical, left-falling, right-falling, etc. Features such as the number, direction, and length of strokes are important bases for character recognition. For example, "一" has only one horizontal stroke, and "人" is composed of a left-falling and a right-falling stroke. Structural features are the overall structures of characters, such as left-right structure, up-down structure, semi-enclosed structure, etc. Characters with different structures have different spatial layouts. Texture features are the texture details of characters, such as the thickness change of strokes and the smoothness of edges. Texture features can reflect the writing style and quality of characters, which is particularly important for handwritten character recognition.
[0036] Step S202: Perform at least image enhancement processing on the above-mentioned image to be recognized to increase the illuminance of the above-mentioned image to be recognized and obtain a preprocessed image;
[0037] Specifically, image enhancement processing is a technology for processing images, aiming to improve the visual effect of images and make them more suitable for observation or subsequent computer processing. The main goal of image enhancement is to highlight the useful information in the image while suppressing the unimportant information, thereby improving the quality and usability of the image.
[0038] Step S203: Extract the image features of the above-mentioned preprocessed image to obtain multiple target image features, and obtain the probability distribution of the multiple above-mentioned target image features to obtain the target probability distribution, where the above-mentioned target image features are the image features corresponding to the above-mentioned character information;
[0039] Specifically, the feature extraction of an image is a process of extracting useful information from the image, and these information can describe the inherent attributes, structures, or contents of the image. The purpose of feature extraction is to convert the image from the original pixel representation into a set of more representative and discriminative feature vectors, so as to provide support for subsequent image analysis, classification, recognition, or other processing tasks.
[0040] Step S204: Process the above-mentioned target probability distribution using the CTC algorithm to obtain the recognition result of the above-mentioned image to be recognized.
[0041] Specifically, the full name of the CTC algorithm is Connectionist Temporal Classification. It is a deep learning algorithm for sequence labeling. It is mainly used to solve the problem that the input sequence and the output sequence are of different lengths and cannot be aligned. It can be applied to speech recognition, text recognition and other fields. The core idea of the CTC algorithm is to expand the label set, introduce a special "blank" label, and define a mapping function to map the predicted sequence to the real sequence. All predicted sequences that can be converted to real sequences through the mapping function are regarded as correct prediction results. In this way, the predicted sequence can be obtained without the need for data alignment processing.
[0042] Through this embodiment, a method for recognizing image character information is provided. First, an image to be recognized is obtained, and the image to be recognized includes at least one character information; then, at least the image to be recognized is subjected to image enhancement processing to increase the illumination of the image to be recognized, and a preprocessed image is obtained; then, the image features of the preprocessed image are extracted to obtain multiple target image features, and the probability distribution of the multiple target image features is obtained to obtain a target probability distribution, wherein the target image features are image features corresponding to the character information; finally, the target probability distribution is processed by the CTC algorithm to obtain the recognition result of the image to be recognized. By performing image enhancement processing before character recognition to enhance the illumination of the image, the problem of uneven illumination of the environment during image acquisition is taken into account. Compared with the recognition method that only uses deep learning in the prior art, the recognition accuracy in processing low-quality images is higher. Secondly, after extracting the image features, by calculating the probability distribution of the target image features, semantic problems can be further avoided in the process of processing the image features. Finally, the CTC algorithm is used to process the text in the output bill image. Therefore, the above scheme can realize automatic and intelligent recognition and processing of character information in images, and improve recognition accuracy. The present invention solves the technical problem of inaccurate recognition of character information in pictures in the prior art.
[0043] In the specific implementation process, the above step S202 can be implemented by the following steps: step S2021, using the non-local mean denoising algorithm to perform denoising on the above image to be identified to obtain a first processed image; step S2022, performing bilateral gamma transform on the above first processed image to obtain a second processed image; step S2023, performing morphological processing on the above second processed image to obtain a third processed image, wherein the above morphological processing includes corrosion processing and expansion processing; step S2024, using the Canny edge algorithm to process the above third processed image to obtain the contour information of the above third processed image; step S2025, according to the above contour information, performing Hough transform on the above third processed image to obtain the above pre-processed image. The denoising process in this method can further reduce the noise impact on the image during the acquisition and transmission process, and the image enhancement method of bilateral gamma correction can further improve the image quality, thereby improving the accuracy of text recognition. In addition, through image edge detection and Hough transform, the problem of text rotation and displacement in the bill image during the acquisition process can be further solved.
[0044] In practical applications, images may be interfered by various noises during the acquisition, transmission and storage process. For example, sensor noise, ambient light changes, transmission channel noise, etc. will cause image quality to deteriorate. The non-local mean denoising algorithm can be used to denoise the above-mentioned image to be identified. Due to the influence of the image acquisition equipment and environment, the image will inevitably have local dark or bright problems. The bilateral gamma transform can be used to improve the quality of the image. In addition, text rotation and displacement are prone to occur during image acquisition and transmission, and the subsequent text feature extraction and recognition effect is inseparable from the tilt angle of the text. Edge detection and Hough transform can solve the problem of text rotation and displacement during image acquisition.
[0045] In order to further improve the accuracy of the denoising algorithm, the above-mentioned step S2021 of the present application can be implemented by the following steps: step S20211, segmenting the above-mentioned image to be identified to obtain multiple image blocks; step S20212, respectively calculating the Euclidean distance between the average pixel value of the current image block and the average pixel value of other image blocks to obtain multiple Euclidean distances, wherein the above-mentioned current image block is any one of the above-mentioned image blocks, and the above-mentioned other image blocks are any one of the above-mentioned image blocks except the above-mentioned current image block; step S20213, determining that the above-mentioned other image block corresponding to the maximum value of the multiple above-mentioned Euclidean distances is a similar image block corresponding to the above-mentioned current image block; step S20214, performing weighted averaging processing on the weights of the pixel values of the above-mentioned other image blocks to obtain updated pixel values, wherein the weights of the pixel values of the above-mentioned other image blocks are proportional to the above-mentioned Euclidean distances; step S20215, using the above-mentioned updated pixel values to respectively update the pixel values of the above-mentioned multiple image blocks to obtain the above-mentioned first processed image.
[0046] Specifically, the Non-Local Means (NLM) denoising algorithm is a denoising algorithm based on image block similarity. The core idea of the algorithm is to use the non-local similarity of pixels in the image to remove noise while retaining the detailed features of the image as much as possible. In the non-local means algorithm, each pixel in the image can be restored by weighted averaging with pixels in other similar areas of the image. Specifically, the algorithm is implemented by the following steps: With the target pixel as the center, a larger search window and a smaller neighborhood window are set. The neighborhood window is slid within the search window, and the similarity between the target neighborhood and each neighborhood window is calculated. The similarity is usually measured by Euclidean distance or Gaussian weighted Euclidean distance. Weights are assigned to the pixels at the center of each neighborhood according to the similarity, and these pixels are weighted averaged to obtain the denoised value of the target pixel.
[0047] The first processed image includes a plurality of first pixels, and the second processed image includes a plurality of second pixels. The step S2022 may also be implemented in other ways, for example: step S20221, obtaining the position information S0(x0, y0) of the first pixel; step S20222, according to the formula S1(x1, y1)=α(1-(1-S0(x0, y0)) γ )+(1-α)(1-(1-S0(x,y) 1 / γ ) γ) Perform bilateral gamma transformation on the first pixel to obtain the corresponding position information S1(x1, y1) of the second pixel, where γ is the gamma index, x0 and x1 are set in one-to-one correspondence, y0 and y1 are set in one-to-one correspondence, the gamma index ranges from 2 to 2.5, and α is the average value of the normalized pixels of the first processed image. The uniformity of image illumination can be further improved by increasing the low pixel value part of the target font and suppressing the high pixel value part of the light source.
[0048] In some embodiments, the above step S203 can be specifically implemented by the following steps: step S2031, obtaining a historical image, the above historical image is an image obtained before the current moment, and the above historical image includes at least one of the above character information; step S2032, inputting the above pre-processed image into a multi-scale convolutional neural network model to obtain the above target image features, wherein the above multi-scale convolutional neural network model is trained using the above historical image and the image features of the above historical image. The method can further quickly obtain the above target image features.
[0049] Specifically, the multi-scale convolutional neural network model is as follows Figure 3 As shown in the figure, based on ResNet, three different sizes of convolution kernels, 3×3, 5×5 and 7×7, are used to perform feature extraction operations on the input image at the same time, and the features extracted at each size are trained in parallel before being fused and spliced. After two convolutions on the processed image, the initial feature data is added to the output features of the second convolution layer, so that the key features lost in the previous convolution layer can be re-extracted in the next convolution. The features extracted by the three different scales of convolution kernels are added and then output.
[0050] The above step S203 can also be implemented by other steps: Step S2033, inputting the plurality of the above target image features into the bidirectional long short-term memory network model in sequence to obtain the above target probability distribution, wherein the above bidirectional long short-term memory network model includes a reverse layer and a forward layer connected in sequence, and the above reverse layer and the above forward layer respectively include a plurality of long short-term memory network units connected in sequence. This method can further quickly obtain the above target probability distribution.
[0051] Specifically, the Bidirectional Long Short-Term Memory (BLSTM) is a special recurrent neural network that can process sequence data and maintain long-term memory. Unlike traditional RNN models, BLSTM takes into account both past and future information, allowing the model to better capture contextual relationships in sequence data. Based on LSTM, BLSTM makes a reverse copy of the input sequence, allowing the network to process sequence data from both forward and backward directions at the same time. In this way, the hidden state of each time step contains both forward and backward information, thereby improving the model's overall understanding of the sequence. Specifically, BLSTM contains two independent LSTM layers, one for forward propagation (from input to output) and the other for backward propagation (from output to input).
[0052] The above step S204 can be implemented by other steps: Step S2041, calculating the cumulative conditional probability of the above target probability distribution to convert the above target probability distribution into multiple character sequences to obtain the above recognition result, wherein the above character information includes the above character sequence. This method converts the previously acquired features into a string sequence by accumulating conditional probabilities, which can further ensure that the recognized text sequence is consistent with the length and order of the original text sequence.
[0053] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the image character information recognition method of the present application will be described in detail below in conjunction with specific embodiments.
[0054] This embodiment relates to a specific method for recognizing image character information. For example, the image to be recognized is a bill image. Figure 4 As shown, the following steps are included:
[0055] Step S1: In the image acquisition stage, a scanner or camera is used to acquire the image of the bill to be processed;
[0056] Step S2: De-noising the image using an image denoising method to reduce the impact of noise on the image during acquisition and transmission;
[0057] Step S3: Processing the image output by S2 using an image enhancement method based on bilateral gamma correction to improve image quality, thereby improving the accuracy of text recognition;
[0058] Step S4: performing image tilt correction on the image generated in step S3, including image edge detection and Hough transform, to solve the problem of text rotation and displacement that occurs during the acquisition process of the bill image;
[0059] Step S5: Input the enhanced image in step S4 into the CNN network to extract image features; in order to better obtain image feature information;
[0060] Step S6: The feature information obtained in step S5 is sequence labeled through BLSTM, relying on the BLSTM network's strong ability to obtain sequence text context information, and the feature information obtained in step S5 is sequence labeled to avoid semantic problems;
[0061] Step S7: Using the CTC algorithm, the sequence obtained in step S6 is converted into a final output string sequence by accumulating conditional probabilities.
[0062] The embodiment of the present application also provides a kind of recognition device of image character information. It should be noted that the recognition device of image character information of the embodiment of the present application can be used to execute the recognition method for image character information provided by the embodiment of the present application. The device is used to implement the above-mentioned embodiment and preferred implementation mode, and the description has been made without further details. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented with software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.
[0063] The following is an introduction to the image character information recognition device provided in an embodiment of the present application.
[0064] Figure 5 Schematic diagram of a device for recognizing image character information according to an embodiment of the present application. Figure 5 As shown, the device comprises:
[0065] The acquisition unit 10 is used to acquire an image to be recognized, wherein the image to be recognized includes at least one character information;
[0066] Specifically, the above-mentioned character information refers to the character content such as letters, numbers, symbols, etc. contained in the image, as well as the related attributes and characteristics of these characters. The character content includes the text itself and the language type. For example, the text content shown in a picture directly conveys the text information that the picture wants to express. The characters in the picture may belong to different languages, such as Chinese, English, Japanese, Arabic, etc. Characters in different languages have unique shapes and structures. Character attributes include font, font size, color, and style. Character features include stroke features, structural features, and texture features. Stroke features are composed of different strokes, such as horizontal, vertical, left-falling, and right-falling strokes. Features such as the number, direction, and length of strokes are important bases for character recognition. For example, "一" has only one horizontal stroke, and "人" is composed of a left-falling and a right-falling stroke. Structural features are the overall structures of characters, such as left-right structure, up-down structure, semi-enclosed structure, etc. Characters with different structures have different spatial layouts. Texture features are the texture details of characters, such as the thickness change of strokes and the smoothness of edges. Texture features can reflect the writing style and quality of characters and are particularly important for handwritten character recognition.
[0067] The processing unit 20 is configured to perform at least image enhancement processing on the above-mentioned image to be recognized to increase the illuminance of the above-mentioned image to be recognized and obtain a preprocessed image.
[0068] Specifically, image enhancement processing is a technology for processing images, aiming to improve the visual effect of images and make them more suitable for observation or subsequent computer processing. The main goal of image enhancement is to highlight the useful information in the image while suppressing the unimportant information, thereby improving the quality and usability of the image.
[0069] The extraction unit 30 is configured to extract the image features of the above-mentioned preprocessed image to obtain a plurality of target image features, and obtain a target probability distribution by acquiring the probability distribution of the plurality of above-mentioned target image features, where the above-mentioned target image features are the image features corresponding to the above-mentioned character information.
[0070] Specifically, feature extraction of an image is a process of extracting useful information from the image, and this information can describe the internal attributes, structures, or contents of the image. The purpose of feature extraction is to convert the image from the original pixel representation into a set of more representative and discriminative feature vectors, thereby providing support for subsequent image analysis, classification, recognition, or other processing tasks.
[0071] The recognition unit 40 is configured to process the above-mentioned target probability distribution using the CTC algorithm to obtain the recognition result of the above-mentioned image to be recognized.
[0072] Specifically, the full name of the CTC algorithm is Connectionist Temporal Classification. It is a deep learning algorithm for sequence labeling. It is mainly used to solve the problem that the input sequence and the output sequence are of different lengths and cannot be aligned. It can be applied to speech recognition, text recognition and other fields. The core idea of the CTC algorithm is to expand the label set, introduce a special "blank" label, and define a mapping function to map the predicted sequence to the real sequence. All predicted sequences that can be converted to real sequences through the mapping function are regarded as correct prediction results. In this way, the predicted sequence can be obtained without the need for data alignment processing.
[0073] Through this embodiment, a device for recognizing image character information is provided, wherein the acquisition unit acquires an image to be recognized, wherein the image to be recognized includes at least one character information; the processing unit at least performs image enhancement processing on the image to be recognized to increase the illumination of the image to be recognized, and obtains a preprocessed image; the extraction unit extracts the image features of the preprocessed image to obtain multiple target image features, and obtains the probability distribution of the multiple target image features to obtain a target probability distribution, wherein the target image features are image features corresponding to the character information; the recognition unit processes the target probability distribution using the CTC algorithm to obtain a recognition result of the image to be recognized. By performing image enhancement processing before character recognition to enhance the illumination of the image, the problem of uneven illumination of the environment during image acquisition is taken into account, and compared with the recognition method that only uses deep learning in the prior art, the recognition accuracy in processing low-quality images is higher. Secondly, after extracting the image features, by calculating the probability distribution of the target image features, semantic problems can be further avoided in the process of processing the image features. Finally, the CTC algorithm is used to process the text in the output bill image. Therefore, the above scheme can realize automatic and intelligent recognition and processing of character information in images, and improve recognition accuracy. The present invention solves the technical problem of inaccurate recognition of character information in pictures in the prior art.
[0074] In the specific implementation process, the processing unit includes a first processing module, a second processing module, a third processing module, a fourth processing module and a fifth processing module, wherein the first processing module is used to perform denoising on the image to be identified by using a non-local mean denoising algorithm to obtain a first processed image; the second processing module is used to perform bilateral gamma transform processing on the first processed image to obtain a second processed image; the third processing module is used to perform morphological processing on the second processed image to obtain a third processed image, wherein the morphological processing includes corrosion processing and expansion processing; the fourth processing module is used to process the third processed image by using a Canny edge algorithm to obtain the contour information of the third processed image; the fifth processing module is used to perform Hough transform processing on the third processed image according to the contour information to obtain the pre-processed image. The denoising processing in the device can further reduce the noise influence on the image during the acquisition and transmission process, and the image enhancement method of bilateral gamma correction can further improve the image quality, thereby improving the accuracy of text recognition. In addition, through image edge detection and Hough transform, the text rotation and displacement problems that occur in the bill image during the acquisition process can be further solved.
[0075] In practical applications, images may be interfered by various noises during the acquisition, transmission and storage process. For example, sensor noise, ambient light changes, transmission channel noise, etc. will cause image quality to deteriorate. The non-local mean denoising algorithm can be used to denoise the above-mentioned image to be identified. Due to the influence of the image acquisition equipment and environment, the image will inevitably have local dark or bright problems. The bilateral gamma transform can be used to improve the quality of the image. In addition, text rotation and displacement are prone to occur during image acquisition and transmission, and the subsequent text feature extraction and recognition effect is inseparable from the tilt angle of the text. Edge detection and Hough transform can solve the problem of text rotation and displacement during image acquisition.
[0076] In order to further improve the accuracy of the denoising algorithm, the first processing module of the present application includes a first processing submodule, a calculation submodule, a determination submodule, a second processing submodule and an update submodule, wherein the first processing submodule is used to segment the above-mentioned image to be identified to obtain multiple image blocks; the calculation submodule is used to respectively calculate the Euclidean distance between the average pixel value of the current image block and the average pixel value of other image blocks to obtain multiple Euclidean distances, wherein the above-mentioned current image block is any one of the above-mentioned image blocks, and the above-mentioned other image blocks are any one of the above-mentioned image blocks except the above-mentioned current image block; the determination submodule is used to determine that the above-mentioned other image block corresponding to the maximum value of the multiple above-mentioned Euclidean distances is a similar image block corresponding to the above-mentioned current image block; the second processing submodule is used to perform weighted average processing on the weights of the pixel values of the above-mentioned other image blocks to obtain updated pixel values, wherein the weights of the pixel values of the above-mentioned other image blocks are proportional to the above-mentioned Euclidean distances; the update submodule is used to use the above-mentioned updated pixel values to respectively update the pixel values of the multiple above-mentioned image blocks to obtain the above-mentioned first processed image.
[0077] Specifically, the Non-Local Means (NLM) denoising algorithm is a denoising algorithm based on image block similarity. The core idea of the algorithm is to use the non-local similarity of pixels in the image to remove noise while retaining the detailed features of the image as much as possible. In the non-local means algorithm, each pixel in the image can be restored by weighted averaging with pixels in other similar areas of the image. Specifically, the algorithm is implemented by the following steps: With the target pixel as the center, a larger search window and a smaller neighborhood window are set. The neighborhood window is slid within the search window, and the similarity between the target neighborhood and each neighborhood window is calculated. The similarity is usually measured by Euclidean distance or Gaussian weighted Euclidean distance. Weights are assigned to the pixels at the center of each neighborhood according to the similarity, and these pixels are weighted averaged to obtain the denoised value of the target pixel.
[0078] The first processed image includes a plurality of first pixel points, the second processed image includes a plurality of second pixel points, the second processing module includes an acquisition submodule and a third processing submodule, wherein the acquisition submodule is used to acquire the position information S0(x0, y0) of the first pixel point; the third processing submodule is used to obtain the position information S0(x0, y0) of the first pixel point according to the formula S1(x1, y1)=α(1-(1-S0(x0, y0)) γ )+(1-α)(1-(1-S0(x,y) 1 / γ ) γ) Perform bilateral gamma transformation on the first pixel to obtain the corresponding position information S1(x1, y1) of the second pixel, where γ is the gamma index, x0 and x1 are set in one-to-one correspondence, y0 and y1 are set in one-to-one correspondence, the gamma index ranges from 2 to 2.5, and α is the average value of the normalized pixels of the first processed image. The uniformity of image illumination can be further improved by increasing the low pixel value part of the target font and suppressing the high pixel value part of the light source.
[0079] In some embodiments, the extraction unit includes an acquisition module and a first input module, wherein the acquisition module is used to acquire a historical image, the historical image is an image acquired before the current moment, and the historical image includes at least one of the above character information; the first input module is used to input the pre-processed image into a multi-scale convolutional neural network model to obtain the target image feature, wherein the multi-scale convolutional neural network model is trained using the historical image and the image features of the historical image. The device can further quickly acquire the target image feature.
[0080] Specifically, the multi-scale convolutional neural network model is as follows Figure 3 As shown in the figure, based on ResNet, three different sizes of convolution kernels, 3×3, 5×5 and 7×7, are used to perform feature extraction operations on the input image at the same time, and the features extracted at each size are trained in parallel before being fused and spliced. After two convolutions on the processed image, the initial feature data is added to the output features of the second convolution layer, so that the key features lost in the previous convolution layer can be re-extracted in the next convolution. The features extracted by the three different scales of convolution kernels are added and then output.
[0081] The extraction unit includes a second input module for sequentially inputting the plurality of target image features into a bidirectional long short-term memory network model to obtain the target probability distribution, wherein the bidirectional long short-term memory network model includes a reverse layer and a forward layer connected in sequence, and the reverse layer and the forward layer respectively include a plurality of long short-term memory network units connected in sequence. The device can further quickly obtain the target probability distribution.
[0082] Specifically, the Bidirectional Long Short-Term Memory (BLSTM) is a special recurrent neural network that can process sequence data and maintain long-term memory. Unlike traditional RNN models, BLSTM takes into account both past and future information, allowing the model to better capture contextual relationships in sequence data. Based on LSTM, BLSTM makes a reverse copy of the input sequence, allowing the network to process sequence data from both forward and backward directions at the same time. In this way, the hidden state of each time step contains both forward and backward information, thereby improving the model's overall understanding of the sequence. Specifically, BLSTM contains two independent LSTM layers, one for forward propagation (from input to output) and the other for backward propagation (from output to input).
[0083] The recognition unit includes a calculation module for calculating the cumulative conditional probability of the target probability distribution to convert the target probability distribution into multiple character sequences to obtain the recognition result, wherein the character information includes the character sequence. The method converts the previously acquired features into a string sequence by accumulating conditional probabilities, which can further ensure that the recognized text sequence is consistent with the length and order of the original text sequence.
[0084] The image character information recognition device includes a processor and a memory. The acquisition unit, processing unit, extraction unit, and recognition unit are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The modules are all located in the same processor; or, the modules are located in different processors in any combination.
[0085] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and image character information can be recognized by adjusting kernel parameters.
[0086] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0087] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the image character information recognition method.
[0088] Specifically, the method for recognizing image character information includes:
[0089] Step S201: Obtain the image to be recognized, where the image to be recognized includes at least one character information;
[0090] Specifically, the above-mentioned character information refers to the character content such as letters, numbers, symbols, etc. included in the image, as well as the relevant attributes and features of these characters. The character content includes the text itself and the language type. For example, the text content shown in a picture directly conveys the text information that the picture wants to express. The characters in the picture may belong to different languages, such as Chinese, English, Japanese, Arabic, etc. Characters of different languages have unique shapes and structures. Character attributes include font, font size, color, and style. Character features include stroke features, structural features, and texture features. Stroke features are composed of different strokes, such as horizontal, vertical, left-falling, right-falling, etc. The number, direction, length, etc. of the strokes are important bases for character recognition. For example, "一" has only one horizontal stroke, and "人" is composed of a left-falling and a right-falling stroke. Structural features are the overall structures of characters, such as left-right structure, up-down structure, semi-enclosed structure, etc. Characters with different structures have different spatial layouts. Texture features are the texture details of characters, such as the thickness change of strokes and the smoothness of edges. Texture features can reflect the writing style and quality of characters, which is particularly important for handwritten character recognition.
[0091] Step S202: Perform at least image enhancement processing on the above-mentioned image to be recognized to increase the illuminance of the above-mentioned image to be recognized and obtain a preprocessed image;
[0092] Specifically, image enhancement processing is a technology for processing images, aiming to improve the visual effect of images and make them more suitable for observation or subsequent computer processing. The main goal of image enhancement is to highlight the useful information in the image while suppressing the unimportant information, thereby improving the quality and usability of the image.
[0093] Step S203: Extract the image features of the above-mentioned preprocessed image to obtain multiple target image features, and obtain the probability distribution of the multiple above-mentioned target image features to obtain the target probability distribution, where the above-mentioned target image features are the image features corresponding to the above-mentioned character information;
[0094] Specifically, the feature extraction of an image is a process of extracting useful information from the image, and these information can describe the inherent attributes, structures, or contents of the image. The purpose of feature extraction is to convert the image from the original pixel representation into a set of more representative and discriminative feature vectors, so as to provide support for subsequent image analysis, classification, recognition, or other processing tasks.
[0095] Step S204: Use the CTC algorithm to process the above-mentioned target probability distribution to obtain the recognition result of the above-mentioned image to be recognized.
[0096] Specifically, the CTC algorithm, whose full name is Connectionist Temporal Classification, is a deep learning algorithm for sequence labeling. It is mainly used to solve the problem that the lengths of the input sequence and the output sequence are different and cannot be aligned, and can be applied to fields such as speech recognition and text recognition. The core idea of the CTC algorithm is to expand the label set, introduce a special "blank" label, and define a mapping function to map the predicted sequence to the true sequence. All predicted sequences that can be converted into the true sequence through the mapping function are regarded as correct prediction results. In this way, the predicted sequence can be obtained without data alignment processing.
[0097] An embodiment of the present invention provides a processor for running a program, wherein when the program runs, it executes the above-mentioned method for recognizing image character information.
[0098] Specifically, the method for recognizing image character information includes:
[0099] Step S201: Obtain the image to be recognized, where the image to be recognized includes at least one character information.
[0100] Specifically, the above-mentioned character information refers to the character content such as letters, numbers, symbols, etc. included in the image, as well as the related attributes and features of these characters. The character content includes the text itself and the language type. For example, the text content shown in a picture directly conveys the text information that the picture wants to express. The characters in the picture may belong to different languages, such as Chinese, English, Japanese, Arabic, etc., and the characters of different languages have unique shapes and structures. The character attributes include font, font size, color, and style. The character features include stroke features, structural features, and texture features. The stroke features are composed of different strokes, such as horizontal, vertical, left-falling, right-falling, etc. The number, direction, length, etc. of the strokes are important bases for character recognition. For example, "一" has only one horizontal stroke, and "人" is composed of a left-falling stroke and a right-falling stroke. The structural feature is the overall structure of the character, such as left-right structure, up-down structure, semi-surrounded structure, etc. The characters of different structures have different spatial layouts. The texture feature is the texture detail of the character, such as the thickness change of the stroke and the smoothness of the edge. The texture feature can reflect the writing style and quality of the character, and is particularly important for handwritten character recognition.
[0101] Step S202: At least perform image enhancement processing on the above-mentioned image to be recognized to increase the illuminance of the above-mentioned image to be recognized and obtain a preprocessed image.
[0102] Specifically, image enhancement is a technique for processing images to improve the visual effect of the image and make it more suitable for observation or subsequent computer processing. The main goal of image enhancement is to highlight the useful information in the image while suppressing unimportant information, thereby improving the quality and usability of the image.
[0103] Step S203, extracting the image features of the preprocessed image to obtain a plurality of target image features, and obtaining a probability distribution of the plurality of target image features to obtain a target probability distribution, wherein the target image features are image features corresponding to the character information;
[0104] Specifically, image feature extraction is the process of extracting useful information from an image, which can describe the intrinsic properties, structure or content of the image. The purpose of feature extraction is to convert the image from its original pixel representation into a set of more representative and discriminative feature vectors, thereby providing support for subsequent image analysis, classification, recognition or other processing tasks.
[0105] Step S204: Using the CTC algorithm to process the target probability distribution, to obtain a recognition result of the image to be recognized.
[0106] Specifically, the full name of the CTC algorithm is Connectionist Temporal Classification. It is a deep learning algorithm for sequence labeling. It is mainly used to solve the problem that the input sequence and the output sequence are of different lengths and cannot be aligned. It can be applied to speech recognition, text recognition and other fields. The core idea of the CTC algorithm is to expand the label set, introduce a special "blank" label, and define a mapping function to map the predicted sequence to the real sequence. All predicted sequences that can be converted to real sequences through the mapping function are regarded as correct prediction results. In this way, the predicted sequence can be obtained without the need for data alignment processing.
[0107] An embodiment of the present invention provides a device, the device including a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:
[0108] Step S201, obtaining an image to be recognized, wherein the image to be recognized includes at least one character information;
[0109] Step S202, performing image enhancement processing on at least the image to be identified to increase the illumination of the image to be identified to obtain a preprocessed image;
[0110] Step S203, extracting the image features of the preprocessed image to obtain a plurality of target image features, and obtaining a probability distribution of the plurality of target image features to obtain a target probability distribution, wherein the target image features are image features corresponding to the character information;
[0111] Step S204: Using the CTC algorithm to process the target probability distribution, to obtain a recognition result of the image to be recognized.
[0112] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0113] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:
[0114] Step S201, obtaining an image to be recognized, wherein the image to be recognized includes at least one character information;
[0115] Step S202, performing image enhancement processing on at least the image to be identified to increase the illumination of the image to be identified to obtain a preprocessed image;
[0116] Step S203, extracting the image features of the preprocessed image to obtain a plurality of target image features, and obtaining a probability distribution of the plurality of target image features to obtain a target probability distribution, wherein the target image features are image features corresponding to the character information;
[0117] Step S204: Using the CTC algorithm to process the target probability distribution, to obtain a recognition result of the image to be recognized.
[0118] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0119] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0120] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0121] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0123] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0124] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0125] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0126] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0127] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0128] 1) The method for recognizing image character information of the present application, first, obtain an image to be recognized, the image to be recognized includes at least one character information; then at least perform image enhancement processing on the image to be recognized to increase the illumination of the image to be recognized, and obtain a preprocessed image; then, extract the image features of the preprocessed image to obtain multiple target image features, and obtain the probability distribution of the multiple target image features to obtain the target probability distribution, wherein the target image features are the image features corresponding to the character information; finally, use the CTC algorithm to process the target probability distribution to obtain the recognition result of the image to be recognized. By performing image enhancement processing before character recognition to enhance the illumination of the image, the problem of uneven illumination of the environment during image acquisition is taken into account. Compared with the recognition method that only uses deep learning in the prior art, the recognition accuracy in processing low-quality images is higher. Secondly, after extracting the image features, by calculating the probability distribution of the target image features, semantic problems can be further avoided in the process of processing the image features. Finally, the CTC algorithm is used to process the text in the output bill image. Therefore, the above scheme can realize automatic and intelligent recognition and processing of character information in images, and improve recognition accuracy. The present invention solves the technical problem of inaccurate recognition of character information in pictures in the prior art.
[0129] 2) The image character information recognition device of the present application, the acquisition unit acquires the image to be recognized, and the image to be recognized includes at least one character information; the processing unit at least performs image enhancement processing on the image to be recognized to increase the illumination of the image to be recognized to obtain a preprocessed image; the extraction unit extracts the image features of the preprocessed image to obtain multiple target image features, and obtains the probability distribution of the multiple target image features to obtain the target probability distribution, wherein the target image features are the image features corresponding to the character information; the recognition unit uses the CTC algorithm to process the target probability distribution to obtain the recognition result of the image to be recognized. By performing image enhancement processing before character recognition to enhance the illumination of the image, the problem of uneven illumination of the environment during image acquisition is taken into account. Compared with the recognition method that only uses deep learning in the prior art, the recognition accuracy in processing low-quality images is higher. Secondly, after extracting the image features, by calculating the probability distribution of the target image features, semantic problems can be further avoided in the process of processing the image features. Finally, the CTC algorithm is used to process the text in the output bill image. Therefore, the above scheme can realize automatic and intelligent recognition and processing of character information in the image, and improve recognition accuracy. The present invention solves the technical problem of inaccurate recognition of character information in pictures in the prior art.
[0130] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for recognizing image character information, characterized in that: include: Acquire an image to be recognized, wherein the image to be recognized includes at least one character information; At least performing image enhancement processing on the image to be identified to increase the illumination of the image to be identified to obtain a preprocessed image; Extracting image features of the preprocessed image to obtain a plurality of target image features, and acquiring probability distributions of the plurality of target image features to obtain a target probability distribution, wherein the target image features are image features corresponding to the character information; The target probability distribution is processed using a CTC algorithm to obtain a recognition result of the image to be recognized.
2. The method according to claim 1, characterized in that: At least performing image enhancement processing on the image to be identified to increase the illumination of the image to be identified to obtain a preprocessed image, including: Using a non-local mean denoising algorithm to perform denoising processing on the image to be identified to obtain a first processed image; Performing bilateral gamma transformation on the first processed image to obtain a second processed image; Performing morphological processing on the second processed image to obtain a third processed image, wherein the morphological processing includes corrosion processing and dilation processing; Using the Canny edge algorithm to process the third processed image to obtain contour information of the third processed image; According to the contour information, the third processed image is subjected to Hough transform processing to obtain the pre-processed image.
3. The method according to claim 2, characterized in that The image to be identified is subjected to denoising processing by using a non-local mean denoising algorithm to obtain a first processed image, including: Segmenting the image to be identified to obtain a plurality of image blocks; respectively calculating the Euclidean distances between the average pixel value of the current image block and the average pixel values of other image blocks to obtain a plurality of the Euclidean distances, wherein the current image block is any one of the image blocks, and the other image blocks are any one of the image blocks except the current image block; Determine that the other image block corresponding to the maximum value among the plurality of Euclidean distances is a similar image block corresponding to the current image block; Performing weighted averaging processing on the weights of the pixel values of the other image blocks to obtain updated pixel values, wherein the weights of the pixel values of the other image blocks are proportional to the Euclidean distance; The pixel values of the plurality of image blocks are updated respectively using the updated pixel values to obtain the first processed image.
4. The method according to claim 2, characterized in that The first processed image includes a plurality of first pixel points, the second processed image includes a plurality of second pixel points, and the first processed image is subjected to bilateral gamma transformation to obtain a second processed image, including: Obtaining position information S0 (x0, y0) of the first pixel; According to the formula S1(x1, y1) = α(1-(1-S0(x0, y0)) γ )+(1-α)(1-(1-S0(x,y) 1 / γ ) γ ) performs bilateral gamma transform processing on the first pixel to obtain the corresponding position information S1(x1, y1) of the second pixel, wherein γ is the gamma index, x0 and x1 are set in a one-to-one correspondence, y0 and y1 are set in a one-to-one correspondence, the gamma index ranges from 2 to 2.5, and α is the average value of the normalized pixels of the first processed image.
5. The method according to claim 1, characterized in that: Extracting image features of the preprocessed image to obtain multiple target image features, including: Acquire a historical image, where the historical image is an image acquired before the current moment, and the historical image includes at least one of the character information; The preprocessed image is input into a multi-scale convolutional neural network model to obtain the target image features, wherein the multi-scale convolutional neural network model is trained using the historical image and the image features of the historical image.
6. The method according to claim 1, characterized in that Obtaining probability distributions of a plurality of target image features to obtain a target probability distribution includes: Inputting the plurality of target image features into the bidirectional long short-term memory network model in sequence to obtain the target probability distribution, wherein the bidirectional long short-term memory network model comprises a reverse layer and a forward layer connected in sequence, and the reverse layer and the forward layer respectively comprise a plurality of long short-term memory network units connected in sequence.
7. The method according to claim 1, characterized in that The target probability distribution is processed using a CTC algorithm to obtain a recognition result of the image to be recognized, including: The cumulative conditional probability of the target probability distribution is calculated to convert the target probability distribution into a plurality of character sequences to obtain the recognition result, wherein the character information includes the character sequence.
8. A device for recognizing image character information, characterized in that: include: An acquisition unit, used for acquiring an image to be recognized, wherein the image to be recognized includes at least one character information; A processing unit, configured to at least perform image enhancement processing on the image to be identified so as to increase the illumination of the image to be identified and obtain a preprocessed image; An extraction unit, used to extract image features of the preprocessed image to obtain a plurality of target image features, and obtain a probability distribution of the plurality of target image features to obtain a target probability distribution, wherein the target image feature is an image feature corresponding to the character information; The recognition unit is used to process the target probability distribution using a CTC algorithm to obtain a recognition result of the image to be recognized.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.