WO2020010547A1 - 字符识别方法、装置、存储介质及电子设备 - Google Patents

字符识别方法、装置、存储介质及电子设备 Download PDF

Info

Publication number
WO2020010547A1
WO2020010547A1 PCT/CN2018/095295 CN2018095295W WO2020010547A1 WO 2020010547 A1 WO2020010547 A1 WO 2020010547A1 CN 2018095295 W CN2018095295 W CN 2018095295W WO 2020010547 A1 WO2020010547 A1 WO 2020010547A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
correction processing
text
recognized
text line
Prior art date
Application number
PCT/CN2018/095295
Other languages
English (en)
French (fr)
Inventor
梁昊
南一冰
廉士国
Original Assignee
深圳前海达闼云端智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳前海达闼云端智能科技有限公司 filed Critical 深圳前海达闼云端智能科技有限公司
Priority to CN201880001125.2A priority Critical patent/CN108885699B/zh
Priority to PCT/CN2018/095295 priority patent/WO2020010547A1/zh
Publication of WO2020010547A1 publication Critical patent/WO2020010547A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/63Scene text, e.g. street names
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Definitions

  • the present disclosure relates to the field of image processing, and in particular, to a character recognition method, device, storage medium, and electronic device.
  • text images can be divided into document images and scene images.
  • document images Usually includes a large number of characters, a regular distribution of characters, and a single image background.
  • a scene image usually includes a small number of characters, rich character types, random character distribution, and a complex image background.
  • the document image and the scene image have the above-mentioned different image characteristics, and the current character recognition algorithm is aimed at a specific text image, the document image and the scene image need to be separately recognized by different character recognition algorithms, resulting in character recognition.
  • the algorithm is not very versatile.
  • the present disclosure provides a character recognition method, device, storage medium, and electronic device.
  • a character recognition method comprising:
  • the to-be-recognized characters in at least one of the text line images are identified through a preset character recognition model.
  • a character recognition device comprising:
  • a determining module configured to determine an image category corresponding to a target image including characters to be recognized; wherein different image categories correspond to different correction processing methods;
  • a correction module configured to perform correction processing on the target image by using a correction processing manner corresponding to the image category
  • An extraction module configured to extract at least one text line image from the target image after the correction process
  • a recognition module configured to recognize the character to be recognized in at least one of the text line images by using a preset character recognition model.
  • a computer-readable storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of the method described in the first aspect above.
  • an electronic device including:
  • a processor configured to execute the computer program in the memory to implement the steps of the method according to the first aspect.
  • an image category corresponding to a target image including a character to be recognized may be determined; then, the target image is corrected by a correction processing manner corresponding to the image category; and then, from the corrected processing At least one text line image is extracted from the target image; finally, the to-be-recognized characters in at least one of the text line images are identified by a preset character recognition model. Since different image categories correspond to different correction processing methods, in this way, the images of different image categories can be corrected according to the corresponding correction processing methods, and the images after the correction processing can be subjected to character recognition.
  • the present disclosure can satisfy Character recognition is performed on the scene image, thereby avoiding the problem of poor generality of the character recognition algorithm in the prior art.
  • Fig. 1 is a schematic flowchart of a character recognition method according to an exemplary embodiment
  • Fig. 2 is a block diagram of a first character recognition device according to an exemplary embodiment
  • Fig. 3 is a block diagram of a second character recognition device according to an exemplary embodiment
  • Fig. 4 is a block diagram of a third character recognition device according to an exemplary embodiment
  • Fig. 5 is a block diagram of a fourth character recognition device according to an exemplary embodiment
  • Fig. 6 is a block diagram of a fifth character recognition device according to an exemplary embodiment
  • Fig. 7 is a block diagram of a sixth character recognition device according to an exemplary embodiment
  • Fig. 8 is a block diagram of an electronic device according to an exemplary embodiment.
  • a character recognition algorithm mainly includes two steps of character detection and character recognition.
  • character detection can be divided into two methods: single character detection and text line extraction.
  • single character detection is to directly detect a single character in the target image.
  • Text line extraction is mainly to extract character areas distributed in lines.
  • the character recognition method is also different: when single character detection is used, the extracted single characters can be directly identified separately, and all single characters can be arranged and combined according to the character position information of the single characters to generate The final recognition result; when using text line extraction, the characters in each text line need to be segmented first, and then the segmented characters are recognized, and the characters of each text line are identified based on the position information of each text line The results are permuted and combined to generate the final recognition result.
  • Text images can be divided into document images and scene images.
  • document images usually include a large number of characters, a regular distribution of characters, and a single image background.
  • scene images usually include fewer characters and character types. Rich, random distribution of characters, complex image background.
  • the current character recognition algorithm cannot perform character recognition on both the document image and the scene image at the same time. Instead, different character recognition algorithms are required to perform character recognition separately, resulting in characters. The generality of the recognition algorithm is poor.
  • the present disclosure proposes a character recognition method, device, storage medium, and electronic device.
  • an image type of a target image may be determined, and then a correction processing method corresponding to the target image is determined according to the image type.
  • Correction processing is performed on the target image according to the correction processing method corresponding to the target image.
  • at least one text line image can be extracted from the corrected target image.
  • the at least one text line image in the text image is identified according to the character recognition model. Recognize characters. Since different image categories correspond to different correction processing methods, in this way, the images of different image categories can be corrected according to the corresponding correction processing methods, and the images after the correction processing can be character-recognized.
  • the present disclosure can meet the requirements for text images and Character recognition is performed on the scene image, thereby avoiding the problem of poor generality of the character recognition algorithm in the prior art.
  • Fig. 1 is a schematic flowchart of a character recognition method according to an exemplary embodiment. As shown in FIG. 1, the method includes:
  • the image category may include a document image and a scene image, where the document image usually includes a large number of characters, the character distribution is regular, and the image background is single; unlike the document image, the scene image usually includes a small number of characters
  • the character types are rich, the characters are randomly distributed, and the image background is complicated.
  • an image sample of a determined image category may be obtained, and an image category corresponding to the target image may be determined according to the image sample.
  • the image sample may include a document image sample and a scene image sample, and The difference between the number of document image samples and the number of scene image samples is less than or equal to a preset threshold.
  • a deep learning method can be used to train a preset classifier by using document image samples and scene image samples to obtain the target classification.
  • the target classifier can output an image category corresponding to the target image when the target image is input into the target classifier.
  • the correction processing manner includes orientation correction processing and / or distortion correction processing.
  • the target image is corrected by the correction processing manner corresponding to the image category. It can include the following steps:
  • the first tilt angle can be obtained by a projection analysis method or a Hough transform method, and of course, the document image can also be subjected to threshold segmentation to obtain a binary document image, and according to the binary document image, The pixel point information of the character to be recognized is used to obtain the first tilt angle.
  • a projection analysis method or a Hough transform method the document image can also be subjected to threshold segmentation to obtain a binary document image, and according to the binary document image, The pixel point information of the character to be recognized is used to obtain the first tilt angle.
  • steps S13 and S14 are performed;
  • step S14 is performed.
  • the direction correction process may be to continuously rotate the target image until the first tilt angle between the character to be recognized in the text image and the horizontal axis is smaller than the preset angle.
  • step S15 is performed;
  • the distortion correction process can be corrected by using a blank position between the text lines, so that the text lines are restored to a horizontal distribution or a vertical distribution.
  • a blank position between the text lines so that the text lines are restored to a horizontal distribution or a vertical distribution.
  • steps S11 to S15 can correct the first tilt angle and distortion of the characters to be recognized in the text image, thereby improving the accuracy of character recognition in subsequent steps.
  • the corresponding correction processing method is the direction correction processing. Specifically, correcting the target image by using the correction processing method corresponding to the image category includes the following steps:
  • S21 Perform text area detection on the scene image to obtain at least one text area.
  • the text area detection may include any one of edge detection, area detection, texture detection, or learning detection. Of course, it may also be two, three, or four of the four detection methods described above. In combination, the above examples are merely illustrative, and this disclosure does not limit them.
  • the second tilt angle can be obtained by a projection analysis method or a Hough transform method.
  • the scene image can also be subjected to threshold segmentation to obtain a binary scene image, and the pixels of the characters to be recognized in the binary scene image can be obtained.
  • the point information is used to obtain the second tilt angle.
  • step S23 is performed.
  • the direction correction process may be to continuously rotate the text area until the second tilt angle between the character to be recognized and the horizontal axis in the text area is smaller than the preset angle.
  • steps S21 to S23 can correct the second tilt angle of the character to be recognized in the scene image, thereby improving the accuracy of character recognition in subsequent steps.
  • At least one text line image may be extracted based on a deep learning method, and specifically, may include the following steps:
  • the spatial feature may be a correlation between pixels in the target image.
  • the spatial feature is input to a recurrent neural network layer in a text line detection model to obtain a sequence feature of the target image.
  • the recurrent neural network layer may be an LSTM (Long-Short-Term Memory Network; Long Short Term Memory Network), BLSTM (Bi-directional long-term and short-term memory network; Bi-directional Long Short Term Memory Network) or GRU (Gated Recurrent Unit (LSTM variant), etc.
  • LSTM Long-Short-Term Memory Network
  • BLSTM Bi-directional long-term and short-term memory network
  • GRU Gated Recurrent Unit
  • a sliding window of a preset size and ratio may be used to slide in the target image to intercept the candidate text box.
  • the classification process may be completed by a classification layer in the text line detection model.
  • the classification layer may be a softmax layer, and the input and output dimensions of the softmax layer are consistent.
  • the dimensions are inconsistent, a fully connected layer needs to be added before the softmax layer, so that the input and output dimensions of the softmax layer are consistent.
  • NMS non-maximum suppression; non maximum suppression
  • character recognition steps are processed in units of characters, and then character classifiers are used for character prediction.
  • character segmentation is difficult, which may destroy the character structure.
  • the accuracy of character segmentation directly affects the final character.
  • Recognition results In order to avoid the problem of low recognition accuracy caused by character segmentation, the present disclosure can treat the text line image as a whole, instead of cutting the characters to be recognized in the text line image, and directly identify all the to-be-recognized characters in the text line image. Characters so that you can take full advantage of character contexts for recognition.
  • the method further includes: obtaining position information of at least one text line image, where after the text line image is determined in step S103, the text line image corresponding to the text line image may be determined Position information.
  • the preset character recognition model and the position information are used to identify the character to be recognized in at least one text line image.
  • the preset character recognition model includes a deep learning layer, a recurrent network layer, and an encoding layer.
  • the character recognition process may include the following steps:
  • the deep learning layer may be a CNN (Convolutional Neural Network; Convolutional Neural Networks).
  • CNN Convolutional Neural Network
  • Each slice corresponds to a character feature. Because there may be overlap between adjacent slices, the character feature Contains a certain context.
  • the recurrent neural network layer may be LSTM, BLSTM, or GRU, etc.
  • the character features can be further learned through the neural network layer to obtain the feature vector corresponding to the slice.
  • the above example is only an example, and this disclosure does not make this. limited.
  • the coding layer may be a CTC (Time Series Classification Algorithm; Connectionist Temporal Classification) layer.
  • the encoding result can be obtained according to the CTC layer. Since the text line image can include multiple characters to be recognized, the encoding result can include multiple encodings.
  • each of the encoding results Match the corresponding relationship between the encoding and the preset encoding to obtain the characters corresponding to each encoding, and arrange the characters corresponding to each encoding according to the encoding order of the multiple encodings to obtain the text information of the text line image. It is assumed that the encoding correspondence relationship is the correspondence relationship between encoding samples and character samples. The above examples are merely examples, and this disclosure does not limit this.
  • a sequence between at least one text line image in the text line image may be obtained according to the position information, so that the text information of the at least one text line image is sorted in order to obtain a target recognition result.
  • the present disclosure is described by using the horizontal arrangement of the characters to be recognized in the target image as an example.
  • the characters to be recognized are vertically arranged, at least one text column image in the target image may be extracted and passed.
  • the preset character recognition model recognizes the character to be recognized in at least one of the text column images.
  • an image type of a target image can be determined, then a correction processing method corresponding to the target image is determined according to the image type, and then, a correction processing is performed on the target image according to the correction processing method corresponding to the target image, and secondly, At least one text line image may be extracted from the target image after the correction process, and finally, characters to be recognized in the at least one text line image are identified according to a character recognition model. Since different image categories correspond to different correction processing methods, in this way, the images of different image categories can be corrected according to the corresponding correction processing methods, and the images after the correction processing can be character-recognized.
  • the present disclosure can meet the requirements for text images and Character recognition is performed on the scene image, thereby avoiding the problem of poor generality of the character recognition algorithm in the prior art.
  • Fig. 2 is a block diagram of a character recognition device 20 according to an exemplary embodiment. As shown in Fig. 2, it includes:
  • a determining module 201 configured to determine an image category corresponding to a target image including characters to be recognized; wherein different image categories correspond to different correction processing methods;
  • a correction module 202 configured to perform correction processing on the target image by using a correction processing method corresponding to the image category;
  • An extraction module 203 configured to extract at least one text line image from the target image after the correction process
  • the recognition module 204 is configured to recognize the to-be-recognized character in at least one text line image through a preset character recognition model.
  • the image category includes a document image and a scene image.
  • Fig. 3 is a block diagram illustrating a determination module 201 according to an exemplary embodiment. As shown in Fig. 3, the determination module 201 includes:
  • the first determining sub-module 2012 is configured to determine an image category corresponding to the target image according to the image sample.
  • Fig. 4 is a block diagram of a correction module 202 according to an exemplary embodiment.
  • the correction processing method includes a direction correction process and / or a distortion correction process;
  • the processing mode includes the direction correction process and the distortion correction process, the correction module 202 includes:
  • a second acquisition submodule 2021 configured to acquire a first tilt angle between the character to be recognized in the text image and a horizontal axis
  • a first correction submodule 2022 configured to perform a direction correction process on the text image when the first tilt angle is greater than or equal to a preset angle
  • a second determining submodule 2023 configured to determine whether the character to be recognized in the text image is distorted
  • the second correction sub-module 2024 is configured to perform distortion correction processing on the text image when the character to be recognized in the text image is distorted.
  • Fig. 5 is a block diagram of a correction module 202 according to an exemplary embodiment. As shown in Fig. 5, when the image type is a scene image, the correction processing method includes a direction correction process; the correction module 202 includes:
  • a detection submodule 2025 configured to detect a text area of the scene image to obtain at least one text area
  • a third acquisition submodule 2026 configured to sequentially acquire a second tilt angle between the character to be recognized and the horizontal axis in at least one of the text areas;
  • a third correction sub-module 2027 is configured to perform a direction correction process on at least one text area when the second tilt angle in at least one text area is greater than or equal to a preset angle.
  • Fig. 6 is a block diagram of a character recognition device 20 according to an exemplary embodiment. As shown in Fig. 6, the method further includes:
  • An obtaining module 305 configured to obtain position information of at least one text line image before recognizing the character to be recognized in at least one text line image through a preset character recognition model;
  • the recognition module 304 is configured to recognize the character to be recognized in at least one text line image through the preset character recognition model and the position information.
  • Fig. 7 is a block diagram of a recognition module 304 according to an exemplary embodiment.
  • the preset character recognition model includes a deep learning layer, a recurrent network layer, and an encoding layer.
  • the recognition module 304 includes:
  • An extraction sub-module 3041 configured to perform character feature extraction on at least one text line image according to the deep learning layer
  • a fourth acquisition submodule 3042 configured to input the extracted character features to the recurrent network layer to obtain at least one feature vector corresponding to the text line image;
  • a fifth acquisition submodule 3043 configured to input the feature vector to the encoding layer to obtain at least one encoding result of the text line image, and obtain at least one text line image text information according to the encoding result;
  • the sixth obtaining sub-module 3044 is configured to arrange the text information of at least one text line image in an orderly manner according to the position information to obtain a target recognition result of the target image.
  • an image type of a target image can be determined, then a correction processing method corresponding to the target image is determined according to the image type, and then a correction processing is performed on the target image according to the correction processing method corresponding to the target image.
  • At least one text line image may be extracted from the target image after the correction process, and finally, characters to be recognized in the at least one text line image are identified according to a character recognition model. Since different image categories correspond to different correction processing methods, in this way, the images of different image categories can be corrected according to the corresponding correction processing methods, and the images after the correction processing can be character-recognized.
  • the present disclosure can meet the requirements for text images and Character recognition is performed on the scene image, thereby avoiding the problem of poor generality of the character recognition algorithm in the prior art.
  • Fig. 8 is a block diagram of an electronic device 800 according to an exemplary embodiment.
  • the electronic device 800 may include a processor 801 and a memory 802.
  • the electronic device 800 may further include one or more of a multimedia component 803, an input / output (I / O) interface 804, and a communication component 805.
  • the processor 801 is configured to control the overall operation of the electronic device 800 to complete all or part of the steps in the foregoing character recognition method.
  • the memory 802 is configured to store various types of data to support the operation on the electronic device 800. These data may include, for example, instructions for any application program or method for operating on the electronic device 800, and application-related data. Examples include contact data, messages sent and received, pictures, audio, video, and more.
  • the memory 802 may be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as a static random access memory (Static Random Access Memory (SRAM for short), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory (EEPROM for short), Erasable Programmable Read-Only Memory (EEPROM) Programmable Read-Only Memory (referred to as EPROM), Programmable Read-Only Memory (Programmable Read-Only Memory (referred to as PROM), read-only memory (Read-Only Memory (ROM for short), magnetic memory, flash memory, magnetic disk or optical disk.
  • the multimedia component 803 may include a screen and an audio component.
  • the screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals.
  • the audio component may include a microphone for receiving external audio signals.
  • the received audio signal may be further stored in the memory 802 or transmitted through the communication component 805.
  • the audio component also includes at least one speaker for outputting an audio signal.
  • the I / O interface 804 provides an interface between the processor 801 and other interface modules.
  • the other interface modules may be a keyboard, a mouse, a button, and the like. These buttons can be virtual buttons or physical buttons.
  • the communication component 805 is used for wired or wireless communication between the electronic device 800 and other devices.
  • Wireless communication such as Wi-Fi, Bluetooth, Near Field Communication (Near Field Communication (NFC for short), 2G, 3G, or 4G, or a combination of one or more of them, so the corresponding communication component 805 may include: a Wi-Fi module, a Bluetooth module, and an NFC module.
  • the electronic device 800 may be implemented by one or more application-specific integrated circuits (Application Specific Integrated Circuits) Specific Integrated Circuit (ASIC for short), Digital Signal Processor (Digital Signal Processor (DSP for short), Digital Signal Processing Equipment (Digital Signal Processing Device (DSPD), Programmable Logic Device (Programmable Logic Device (PLD for short), Field Programmable Gate Array (Field Programmable Gate Array (FPGA for short), controller, microcontroller, microprocessor or other electronic components to perform the above-mentioned character recognition method.
  • ASIC Application Specific Integrated Circuits
  • ASIC Application Specific Integrated Circuits
  • DSP Digital Signal Processor
  • DSPD Digital Signal Processing Equipment
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • controller microcontroller, microprocessor or other electronic components to perform the above-mentioned character recognition method.
  • a computer-readable storage medium including program instructions is provided, and the program instructions implement the steps of the foregoing character recognition method when executed by a processor.
  • the computer-readable storage medium may be the foregoing memory 802 including program instructions, and the foregoing program instructions may be executed by the processor 801 of the electronic device 800 to complete the foregoing character recognition method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Multimedia (AREA)
  • Character Input (AREA)

Abstract

本公开涉及一种字符识别方法、装置、存储介质及电子设备,所述方法包括:首先,可以确定包括待识别字符的目标图像对应的图像类别;接着,通过所述图像类别对应的校正处理方式对所述目标图像进行校正处理;然后,从校正处理后的目标图像中提取至少一个文本行图像;最后,通过预设字符识别模型识别至少一个所述文本行图像中的所述待识别字符。由于不同的图像类别对应不同的校正处理方式,这样,可以将不同图像类别的图像按照对应的校正处理方式进行校正处理,并对校正处理后的图像进行字符识别,本公开能够满足对文本图像和场景图像进行字符识别,从而避免了现有技术中字符识别算法的通用性较差的问题。

Description

字符识别方法、装置、存储介质及电子设备 技术领域
本公开涉及图像处理领域,具体地,涉及一种字符识别方法、装置、存储介质及电子设备。
背景技术
随着计算机技术和多媒体的快速发展,越来越多的信息以图像形式传播,并且图像中的信息可以是描述性的文本,目前,文本图像可以划分为文档图像和场景图像,其中,文档图像通常包括的字符数量较多,字符分布规律,图像背景单一;与文档图像不同,场景图像通常包括的字符数量较少,字符类型丰富,字符分布随意,图像背景复杂。
考虑到文档图像和场景图像具备上述不同的图像特征,并且目前的字符识别算法是针对特定的文本图像,使得文档图像和场景图像需要通过不同的字符识别算法分别进行字符识别,从而造成了字符识别算法的通用性较差。
发明内容
为了解决上述问题,本公开提供一种字符识别方法、装置、存储介质及电子设备。
根据本公开的第一方面,提供一种字符识别方法,所述方法包括:
确定包括待识别字符的目标图像对应的图像类别;其中,不同的图像类别对应不同的校正处理方式;
通过所述图像类别对应的校正处理方式对所述目标图像进行校正处理;
从校正处理后的目标图像中提取至少一个文本行图像;
通过预设字符识别模型识别至少一个所述文本行图像中的所述待识别字符。
根据本公开的第二方面,提供一种字符识别装置,所述装置包括:
确定模块,用于确定包括待识别字符的目标图像对应的图像类别;其中,不同的图像类别对应不同的校正处理方式;
校正模块,用于通过所述图像类别对应的校正处理方式对所述目标图像进行校正处理;
提取模块,用于从校正处理后的目标图像中提取至少一个文本行图像;
识别模块,用于通过预设字符识别模型识别至少一个所述文本行图像中的所述待识别字符。
根据本公开的第三方面,提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述第一方面所述方法的步骤。
根据本公开的第四方面,提供一种电子设备,包括:
存储器,其上存储有计算机程序;
处理器,用于执行所述存储器中的所述计算机程序,以实现上述第一方面所述方法的步骤。
在上述技术方案中,首先,可以确定包括待识别字符的目标图像对应的图像类别;接着,通过所述图像类别对应的校正处理方式对所述目标图像进行校正处理;然后,从校正处理后的目标图像中提取至少一个文本行图像;最后,通过预设字符识别模型识别至少一个所述文本行图像中的所述待识别字符。由于不同的图像类别对应不同的校正处理方式,这样,可以将不同图像类别的图像按照对应的校正处理方式进行校正处理,并对校正处理后的图像进行字符识别,本公开能够满足对文本图像和场景图像进行字符识别,从而避免了现有技术中字符识别算法的通用性较差的问题。
本公开的其他特征和优点将在随后的具体实施方式部分予以详细说明。
附图说明
附图是用来提供对本公开的进一步理解,并且构成说明书的一部分,与下面的具体实施方式一起用于解释本公开,但并不构成对本公开的限制。在附图中:
图1是根据一示例性实施例示出的一种字符识别方法的流程示意图;
图2是根据一示例性实施例示出的第一种字符识别装置的框图;
图3是根据一示例性实施例示出的第二种字符识别装置的框图;
图4是根据一示例性实施例示出的第三种字符识别装置的框图;
图5是根据一示例性实施例示出的第四种字符识别装置的框图;
图6是根据一示例性实施例示出的第五种字符识别装置的框图;
图7是根据一示例性实施例示出的第六种字符识别装置的框图;
图8是根据一示例性实施例示出的一种电子设备的框图。
具体实施方式
以下结合附图对本公开的具体实施方式进行详细说明。应当理解的是,此处所描述的具体实施方式仅用于说明和解释本公开,并不用于限制本公开。
首先,对本公开的应用场景进行说明,本公开可以应用于字符识别的场景,在该场景下,字符识别算法主要包括字符检测和字符识别两个步骤。目前,字符检测可分为单个字符检测和文本行提取两种方式,其中,单个字符检测即为直接对目标图像中的单个字符进行检测,文本行提取主要是提取出成行分布的字符区域。针对上述两种方式,单个字符检测极易发生漏检的情况,即目标图像中的一个或多个字符未被检测到,从而影响字符识别的准确率;文本行提取是将成行分布的字符当作整体,不易发生漏检,但检测出文本行后需要对文本行中的各个字符进行分割,从而对分割的准确率有较高的要求。对于上述不同的字符检测方式,字符识别方式也不同:在采用单个字符检测时,可以直接对提取的单个字符分别进行识别,并根据单个字符的字符位置信息对全部单个字符进行排列组合,从而生成最终识别结果;在采用文本行提取时,需要先对每个文本行中的字符进行分割,再对分割后的字符进行识别,并根据每个文本行的位置信息对每个文本行的字符识别结果进行排列组合,以生成最终识别结果。
由于目前文本图像可以划分为文档图像和场景图像,其中,文档图像通常包括的字符数量较多,字符分布规律,图像背景单一;与文档图像不同,场景图像通常包括的字符数量较少,字符类型丰富,字符分布随意,图像背景复杂。对于文档图像和场景图像,由于具备上述不同的图像特征,使得当前的字符识别算法无法同时对文档图像和场景图像进行字符识别,而需要通过不同的字符识别算法分别进行字符识别,从而造成了字符识别算法的通用性较差。
为了解决上述问题,本公开提出了一种字符识别方法、装置、存储介质及电子设备,首先,可以确定目标图像的图像类别,接着,根据图像类别确定该目标图像对应的校正处理方式,然后,根据该目标图像对应的校正处理方式对该目标图像进行校正处理,其次,可以从校正处理后的目标图像中提取至少一个文本行图像,最后,根据字符识别模型识别至少一个文本行图像中的待识别字符。由于不同的图像类别对应不同的校正处理方式,这样,可以将不同图像类别的图像按照对应的校正处理方式进行校正处理,并对校正处理后的图像进行字符识别,本公开能够满足对文本图像和场景图像进行字符识别,从而避免了现有技术中字符识别算法的通用性较差的问题。
下面结合具体的实施例对本公开进行详细说明。
图1是根据一示例性实施例示出的一种字符识别方法的流程示意图。如图1所示,所述方法包括:
S101、确定包括待识别字符的目标图像对应的图像类别。
在本步骤中,该图像类别可以包括文档图像和场景图像,其中,文档图像通常包括的字符数量较多,字符分布规律,图像背景单一;与文档图像不同,场景图像通常包括的字符数量较少,字符类型丰富,字符分布随意,图像背景复杂,考虑到文档图像和场景图像之间具备上述不同的图像特征,因此,不同图像类别对应不同的校正处理方式,上述图像类别只是举例说明,本公开对此不作限定。
在一种可能的实现方式中,可以获取已确定图像类别的图像样本,并根据该图像样本确定该目标图像对应的图像类别,进一步地,该图像样本可以包括文档图像样本和场景图像样本,并且该文档图像样本的数量和该场景图像样本的数量之间的差值小于或者等于预设阈值,这样,可以基于深度学习的方法,通过文档图像样本和场景图像样本训练预设分类器得到目标分类器,从而在该目标图像输入至该目标分类器中时,该目标分类器可以输出该目标图像对应的图像类别。
S102、通过该图像类别对应的校正处理方式对该目标图像进行校正处理。
在该图像类别为文档图像时,由于文档图像中待识别字符通常处于密集分布,这样,若文档图像中的待识别字符存在倾斜和/或畸变时,则可能会影响到字符识别的准确率,为了避免该问题,本公开可以对该文档图像进行校正处理,该校正处理方式包括方向校正处理和/或畸变校正处理,此时,通过该图像类别对应的校正处理方式对该目标图像进行校正处理可以包括以下步骤:
S11、获取该文档图像中的该待识别字符与水平轴之间的第一倾斜角度。
在一种可能的实现方式中,可以通过投影分析法或Hough变换法等得到该第一倾斜角度,当然,还可以对该文档图像进行阈值分割得到二值文档图像,并根据二值文档图像中的待识别字符的像素点信息获取该第一倾斜角度,具体过程可以参考现有技术,不再赘述。
S12、确定该第一倾斜角度是否大于或者等于预设角度。
在该第一倾斜角度大于或者等于该预设角度时,执行步骤S13和S14;
在该第一倾斜角度小于该预设角度时,执行步骤S14。
S13、对该文档图像进行方向校正处理。
其中,方向校正处理可以是不断旋转该目标图像,直至该文本图像中的待识别字符与水平轴之间的第一倾斜角度小于该预设角度。
S14、确定该文档图像中的该待识别字符是否存在畸变。
在采用扫描仪或者相机采集文本图像时,若文本本身倾斜和弯曲,或者拍摄视角倾斜等,则会导致文本图像存在畸变,这样,使得本来水平或者垂直的文本行变得弯曲,从而造成文本图像中的文本行之间存在干扰,影响待识别字符的最终识别结果。
在该文档图像中的待识别字符存在畸变时,执行步骤S15;
在该文档图像中的待识别字符不存在畸变时,确定完成校正处理。
S15、对该文档图像进行畸变校正处理。
其中,畸变校正处理可以通过利用文本行之间的空白位置进行校正,使得文本行恢复成水平分布或者垂直分布,具体过程可以参考现有技术,不再赘述。
需要说明的是,对于上述方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本公开并不受所描述的动作顺序的限制,因为依据本公开,某些步骤可以采用其他顺序或者同时进行,例如,步骤S14和S15可以在步骤S11之前执行,此时,可以先畸变校正处理,再进行方向校正处理;其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本公开所必须的。
综上,基于文本图像的图像特征,步骤S11至S15可以将文本图像中待识别字符的第一倾斜角度和畸变进行校正,从而提高了后续步骤中的字符识别的准确率。
在该图像类别为场景图像时,由于场景图像中待识别字符通常处于稀疏分布,并且往往存在随意分布的少量文本行,这样,场景图像中的文本行之间影响较小,从而无需进行畸变校正处理,因此,对于场景图像,对应的校正处理方式为方向校正处理,具体地,通过该图像类别对应的校正处理方式对该目标图像进行校正处理包括以下步骤:
S21、对该场景图像进行文字区域检测得到至少一个文字区域。
其中,文字区域检测可以包括基于边缘检测、基于区域检测、基于纹理检测或者基于学习检测中的任一种,当然,还可以是上述四种检测方法中的两种、三种、或者四种的结合,上述示例只是举例说明,本公开对此不作限定。
S22、依次获取至少一个该文字区域中的该待识别字符与水平轴之间的第二倾斜角度。
同样地,可以通过投影分析法或Hough变换法等得到该第二倾斜角度,当然,还可以对该场景图像进行阈值分割得到二值场景图像,并根据二值场景图像中的待识别字符的像素点信息获取该第二倾斜角度,具体过程可以参考现有技术,不再赘述。
在该第二倾斜角度大于或者等于该预设角度时,执行步骤S23;
在该第二倾斜角度小于该预设角度时,确定完成校正处理。
S23、对至少一个该文字区域进行方向校正处理。
其中,方向校正处理可以是不断旋转该文字区域,直至该文本区域中的待识别字符与水平轴之间的第二倾斜角度小于该预设角度。
综上,基于场景图像的图像特征,步骤S21至S23可以将场景图像中待识别字符的第二倾斜角度进行校正,从而提高了后续步骤中的字符识别的准确率。
S103、从校正处理后的目标图像中提取至少一个文本行图像。
在本步骤中,可以基于深度学习的方法提取至少一个文本行图像,具体地,可以包括以下步骤:
S31、通过文本行检测模型中的多层卷积层提取目标图像的空间特征。
其中,该空间特征可以是该目标图像中像素之间的相关关系。
S32、将该空间特征输入至文本行检测模型中的循环神经网络层得到该目标图像的序列特征。
在本步骤中,该循环神经网络层可以是LSTM(长短时记忆网络;Long Short Term Memory Network)、BLSTM(双向长短时记忆网络;Bi-directional Long Short Term Memory Network)或者GRU(Gated Recurrent Unit,LSTM变体)等,上述示例只是举例说明,本公开对此不作限定。
S33、按照预设规则获取该目标图像中的候选文本框,并基于该序列特征对该候选文本框进行分类。
在一种可能的实现方式中,可以采用预设大小和比例的滑动窗在该目标图像中滑动,以截取该候选文本框,具体过程参考现有技术,本公开不再赘述。
其中,该分类过程可以通过该文本行检测模型中的分类层完成,示例地,该分类层可以是softmax层,并且该softmax层的输入与输出的维度一致,在该softmax层的输入与输出的维度不一致时,需要在softmax层前增加全连接层,从而达到softmax层的输入与输出的维度一致。
S34、使用文本行检测模型中的回归卷积层获取候选文本框的文本框位置信息。
S35、使用NMS(非最大值抑制;non maximum suppression)方法,根据该文本框位置信息和分类结果对候选文本框进行筛选得到文本行图像。
S104、通过预设字符识别模型识别至少一个该文本行图像中的该待识别字符。
通常字符识别步骤以字符为单位处理,然后采用字符分类器进行字符预测,但是,在文本行图像复杂时,字符分割比较困难,可能会破坏字符结构,由于字符分割的精度直接影响到字符的最终识别结果,为了避免字符分割造成的识别准确率低的问题,本公开可以将文本行图像作为一个整体,不对该文本行图像中的待识别字符进行切割,直接识别文本行图像中的全部待识别字符,从而可以充分利用字符上下文关系进行识别。
需要说明的是,在本步骤前,还包括:获取至少一个该文本行图像的位置信息,其中,由于在步骤S103中确定文本行图像后,可以根据文本框位置信息确定该文本行图像对应的位置信息,此时,通过该预设字符识别模型和该位置信息识别至少一个该文本行图像中的该待识别字符,该预设字符识别模型包括深度学习层、循环网络层以及编码层,具体地,字符识别过程可以包括以下步骤:
S41、根据该深度学习层对至少一个该文本行图像进行字符特征提取。
其中,该深度学习层可以是CNN(卷积神经网络;Convolutional Neural Networks),这样,可以通过CNN将至少一个该文本行图像沿着水平方向形成多个切片,每个切片对应了一个字符特征,由于该相邻切片之间可能存在重叠,从而使得该字符特征包含一定的上下文关系。
S42、将提取的字符特征输入至该循环网络层得到至少一个该文本行图像对应的特征向量。
其中,该循环神经网络层可以是LSTM、BLSTM或者GRU等,这样,通过该神经网络层可以进一步地学习该字符特征,从而得到切片对应的特征向量,上述示例只是举例说明,本公开对此不作限定。
S43、将该特征向量输入到该编码层得到至少一个该文本行图像的编码结果,并根据该编码结果得到至少一个该文本行图像的文本信息。
在本步骤中,该编码层可以是CTC(时序分类算法;Connectionist Temporal Classification)层,这样,可以根据CTC层得到编码结果,由于该文本行图像中可以包括多个待识别字符,因此,该编码结果中可以包括多个编码,这样,将该编码结果中的每个编码与预设编码对应关系进行匹配得到每个编码对应的字符,根据该多个编码的编码顺序将每个编码对应的字符进行有序排列得到该文本行图像的文本信息,其中,该预设编码对应关系为编码样本与字符样本之间的对应关系,上述示例只是举例说明,本公开对此不作限定。
S44、根据该位置信息对至少一个该文本行图像的文本信息进行有序排列得到该目标图像的目标识别结果。
在本步骤中,可以根据该位置信息得到该文本行图像中的至少一个文本行图像之间的先后顺序,从而将至少一个文本行图像的文本信息按照先后顺序进行排序得到目标识别结果。
需要说明的是,本公开是以目标图像中的待识别字符为水平排列为例进行说明的,在该待识别字符是垂直排列时,可以提取该目标图像中的至少一个文本列图像,并通过预设字符识别模型识别至少一个该文本列图像中的该待识别字符,具体过程可以参考上述文本行图像的叙述,不再赘述。
采用上述方法,首先,可以确定目标图像的图像类别,接着,根据图像类别确定该目标图像对应的校正处理方式,然后,根据该目标图像对应的校正处理方式对该目标图像进行校正处理,其次,可以从校正处理后的目标图像中提取至少一个文本行图像,最后,根据字符识别模型识别至少一个文本行图像中的待识别字符。由于不同的图像类别对应不同的校正处理方式,这样,可以将不同图像类别的图像按照对应的校正处理方式进行校正处理,并对校正处理后的图像进行字符识别,本公开能够满足对文本图像和场景图像进行字符识别,从而避免了现有技术中字符识别算法的通用性较差的问题。
图2是根据一示例性实施例示出的字符识别装置20的框图,如图2所示,包括:
确定模块201,用于确定包括待识别字符的目标图像对应的图像类别;其中,不同的图像类别对应不同的校正处理方式;
校正模块202,用于通过该图像类别对应的校正处理方式对该目标图像进行校正处理;
提取模块203,用于从校正处理后的目标图像中提取至少一个文本行图像;
识别模块204,用于通过预设字符识别模型识别至少一个该文本行图像中的该待识别字符。
可选地,该图像类别包括文档图像和场景图像。
图3是根据一示例性实施例示出的确定模块201的框图,如图3所示,该确定模块201包括:
第一获取子模块2011,用于获取已确定图像类别的图像样本;
第一确定子模块2012,用于根据该图像样本确定该目标图像对应的图像类别。
图4是根据一示例性实施例示出的校正模块202的框图,如图4所示,在该图像类别为文档图像时,该校正处理方式包括方向校正处理和/或畸变校正处理;在该校正处理方式包括该方向校正处理和该畸变校正处理时,该校正模块202包括:
第二获取子模块2021,用于获取该文本图像中的该待识别字符与水平轴之间的第一倾斜角度;
第一校正子模块2022,用于在该第一倾斜角度大于或者等于预设角度时,对该文本图像进行方向校正处理;
第二确定子模块2023,用于确定该文本图像中的该待识别字符是否存在畸变;
第二校正子模块2024,用于在该文本图像中的该待识别字符存在畸变时,对该文本图像进行畸变校正处理。
图5是根据一示例性实施例示出的校正模块202的框图,如图5所示,在该图像类别为场景图像时,该校正处理方式包括方向校正处理;该校正模块202包括:
检测子模块2025,用于对该场景图像进行文字区域检测得到至少一个文字区域;
第三获取子模块2026,用于依次获取至少一个该文字区域中的该待识别字符与水平轴之间的第二倾斜角度;
第三校正子模块2027,用于在至少一个该文字区域中的该第二倾斜角度大于或者等于预设角度时,对至少一个该文字区域进行方向校正处理。
图6是根据一示例性实施例示出的字符识别装置20的框图,如图6所示,还包括:
获取模块305,用于在通过预设字符识别模型识别至少一个该文本行图像中的该待识别字符前,获取至少一个该文本行图像的位置信息;
该识别模块304,用于通过该预设字符识别模型和该位置信息识别至少一个该文本行图像中的该待识别字符。
图7是根据一示例性实施例示出的识别模块304的框图,如图7所示,该预设字符识别模型包括深度学习层、循环网络层以及编码层,该识别模块304包括:
提取子模块3041,用于根据该深度学习层对至少一个该文本行图像进行字符特征提取;
第四获取子模块3042,用于将提取的字符特征输入至该循环网络层得到至少一个该文本行图像对应的特征向量;
第五获取子模块3043,用于将该特征向量输入到该编码层得到至少一个该文本行图像的编码结果,并根据该编码结果得到至少一个该文本行图像的文本信息;
第六获取子模块3044,用于根据该位置信息对至少一个该文本行图像的文本信息进行有序排列得到该目标图像的目标识别结果。
采用上述装置,首先,可以确定目标图像的图像类别,接着,根据图像类别确定该目标图像对应的校正处理方式,然后,根据该目标图像对应的校正处理方式对该目标图像进行校正处理,其次,可以从校正处理后的目标图像中提取至少一个文本行图像,最后,根据字符识别模型识别至少一个文本行图像中的待识别字符。由于不同的图像类别对应不同的校正处理方式,这样,可以将不同图像类别的图像按照对应的校正处理方式进行校正处理,并对校正处理后的图像进行字符识别,本公开能够满足对文本图像和场景图像进行字符识别,从而避免了现有技术中字符识别算法的通用性较差的问题。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
图8是根据一示例性实施例示出的一种电子设备800的框图。如图8所示,该电子设备800可以包括:处理器801,存储器802。该电子设备800还可以包括多媒体组件803,输入/输出(I/O)接口804,以及通信组件805中的一者或多者。
其中,处理器801用于控制该电子设备800的整体操作,以完成上述的字符识别方法中的全部或部分步骤。存储器802用于存储各种类型的数据以支持在该电子设备800的操作,这些数据例如可以包括用于在该电子设备800上操作的任何应用程序或方法的指令,以及应用程序相关的数据,例如联系人数据、收发的消息、图片、音频、视频等等。该存储器802可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,例如静态随机存取存储器(Static Random Access Memory,简称SRAM),电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,简称EEPROM),可擦除可编程只读存储器(Erasable Programmable Read-Only Memory,简称EPROM),可编程只读存储器(Programmable Read-Only Memory,简称PROM),只读存储器(Read-Only Memory,简称ROM),磁存储器,快闪存储器,磁盘或光盘。多媒体组件803可以包括屏幕和音频组件。其中屏幕例如可以是触摸屏,音频组件用于输出和/或输入音频信号。例如,音频组件可以包括一个麦克风,麦克风用于接收外部音频信号。所接收的音频信号可以被进一步存储在存储器802或通过通信组件805发送。音频组件还包括至少一个扬声器,用于输出音频信号。I/O接口804为处理器801和其他接口模块之间提供接口,上述其他接口模块可以是键盘,鼠标,按钮等。这些按钮可以是虚拟按钮或者实体按钮。通信组件805用于该电子设备800与其他设备之间进行有线或无线通信。无线通信,例如Wi-Fi,蓝牙,近场通信(Near Field Communication,简称NFC),2G、3G或4G,或它们中的一种或几种的组合,因此相应的该通信组件805可以包括:Wi-Fi模块,蓝牙模块,NFC模块。
在一示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(Application Specific Integrated Circuit,简称ASIC)、数字信号处理器(Digital Signal Processor,简称DSP)、数字信号处理设备(Digital Signal Processing Device,简称DSPD)、可编程逻辑器件(Programmable Logic Device,简称PLD)、现场可编程门阵列(Field Programmable Gate Array,简称FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述的字符识别方法。
在另一示例性实施例中,还提供了一种包括程序指令的计算机可读存储介质,该程序指令被处理器执行时实现上述的字符识别方法的步骤。例如,该计算机可读存储介质可以为上述包括程序指令的存储器802,上述程序指令可由电子设备800的处理器801执行以完成上述的字符识别方法。
以上结合附图详细描述了本公开的优选实施方式,但是,本公开并不限于上述实施方式中的具体细节,在本公开的技术构思范围内,可以对本公开的技术方案进行多种简单变型,这些简单变型均属于本公开的保护范围。
另外需要说明的是,在上述具体实施方式中所描述的各个具体技术特征,在不矛盾的情况下,可以通过任何合适的方式进行组合。为了避免不必要的重复,本公开对各种可能的组合方式不再另行说明。
此外,本公开的各种不同的实施方式之间也可以进行任意组合,只要其不违背本公开的思想,其同样应当视为本公开所公开的内容。

Claims (16)

  1. 一种字符识别方法,其特征在于,所述方法包括:
    确定包括待识别字符的目标图像对应的图像类别;其中,不同的图像类别对应不同的校正处理方式;
    通过所述图像类别对应的校正处理方式对所述目标图像进行校正处理;
    从校正处理后的目标图像中提取至少一个文本行图像;
    通过预设字符识别模型识别至少一个所述文本行图像中的所述待识别字符。
  2. 根据权利要求1所述的方法,其特征在于,所述图像类别包括文档图像和场景图像。
  3. 根据权利要求1或2所述的方法,其特征在于,所述确定包括待识别字符的目标图像对应的图像类别包括:
    获取已确定图像类别的图像样本;
    根据所述图像样本确定所述目标图像对应的图像类别。
  4. 根据权利要求2所述的方法,其特征在于,在所述图像类别为文档图像时,所述校正处理方式包括方向校正处理和/或畸变校正处理;在所述校正处理方式包括所述方向校正处理和所述畸变校正处理时,所述通过所述图像类别对应的校正处理方式对所述目标图像进行校正处理包括:
    获取所述文档图像中的所述待识别字符与水平轴之间的第一倾斜角度;
    在所述第一倾斜角度大于或者等于预设角度时,对所述文档图像进行方向校正处理;
    确定所述文档图像中的所述待识别字符是否存在畸变;
    在所述文档图像中的所述待识别字符存在畸变时,对所述文档图像进行畸变校正处理。
  5. 根据权利要求2所述的方法,其特征在于,在所述图像类别为场景图像时,所述校正处理方式包括方向校正处理;所述通过所述图像类别对应的校正处理方式对所述目标图像进行校正处理包括:
    对所述场景图像进行文字区域检测得到至少一个文字区域;
    依次获取至少一个所述文字区域中的所述待识别字符与水平轴之间的第二倾斜角度;
    在至少一个所述文字区域中的所述第二倾斜角度大于或者等于预设角度时,对至少一个所述文字区域进行方向校正处理。
  6. 根据权利要求1或2所述的方法,其特征在于,在所述通过预设字符识别模型识别至少一个所述文本行图像中的所述待识别字符前,还包括:
    获取至少一个所述文本行图像的位置信息;
    所述通过预设字符识别模型识别至少一个所述文本行中的所述待识别字符包括:
    通过所述预设字符识别模型和所述位置信息识别至少一个所述文本行图像中的所述待识别字符。
  7. 根据权利要求6所述的方法,其特征在于,所述预设字符识别模型包括深度学习层、循环网络层以及编码层,所述通过所述预设字符识别模型和所述位置信息识别至少一个所述文本行图像中的所述待识别字符包括:
    根据所述深度学习层对至少一个所述文本行图像进行字符特征提取;
    将提取的字符特征输入至所述循环网络层得到至少一个所述文本行图像对应的特征向量;
    将所述特征向量输入到所述编码层得到至少一个所述文本行图像的编码结果,并根据所述编码结果得到至少一个所述文本行图像的文本信息;
    根据所述位置信息对至少一个所述文本行图像的文本信息进行有序排列得到所述目标图像的目标识别结果。
  8. 一种字符识别装置,其特征在于,所述装置包括:
    确定模块,用于确定包括待识别字符的目标图像对应的图像类别;其中,不同的图像类别对应不同的校正处理方式;
    校正模块,用于通过所述图像类别对应的校正处理方式对所述目标图像进行校正处理;
    提取模块,用于从校正处理后的目标图像中提取至少一个文本行图像;
    识别模块,用于通过预设字符识别模型识别至少一个所述文本行图像中的所述待识别字符。
  9. 根据权利要求8所述的装置,其特征在于,所述图像类别包括文档图像和场景图像。
  10. 根据权利要求8或9所述的装置,其特征在于,所述确定模块包括:
    第一获取子模块,用于获取已确定图像类别的图像样本;
    第一确定子模块,用于根据所述图像样本确定所述目标图像对应的图像类别。
  11. 根据权利要求9所述的装置,其特征在于,在所述图像类别为文档图像时,所述校正处理方式包括方向校正处理和/或畸变校正处理;在所述校正处理方式包括所述方向校正处理和所述畸变校正处理时,所述校正模块包括:
    第二获取子模块,用于获取所述文档图像中的所述待识别字符与水平轴之间的第一倾斜角度;
    第一校正子模块,用于在所述第一倾斜角度大于或者等于预设角度时,对所述文档图像进行方向校正处理;
    第二确定子模块,用于确定所述文档图像中的所述待识别字符是否存在畸变;
    第二校正子模块,用于在所述文档图像中的所述待识别字符存在畸变时,对所述文档图像进行畸变校正处理。
  12. 根据权利要求9所述的装置,其特征在于,在所述图像类别为场景图像时,所述校正处理方式包括方向校正处理;所述校正模块包括:
    检测子模块,用于对所述场景图像进行文字区域检测得到至少一个文字区域;
    第三获取子模块,用于依次获取至少一个所述文字区域中的所述待识别字符与水平轴之间的第二倾斜角度;
    第三校正子模块,用于在至少一个所述文字区域中的所述第二倾斜角度大于或者等于预设角度时,对至少一个所述文字区域进行方向校正处理。
  13. 根据权利要求8或9所述的装置,其特征在于,还包括:
    获取模块,用于在通过预设字符识别模型识别至少一个所述文本行图像中的所述待识别字符前,获取至少一个所述文本行图像的位置信息;
    所述识别模块,用于通过所述预设字符识别模型和所述位置信息识别至少一个所述文本行图像中的所述待识别字符。
  14. 根据权利要求13所述的装置,其特征在于,所述预设字符识别模型包括深度学习层、循环网络层以及编码层,所述识别模块包括:
    提取子模块,用于根据所述深度学习层对至少一个所述文本行图像进行字符特征提取;
    第四获取子模块,用于将提取的字符特征输入至所述循环网络层得到至少一个所述文本行图像对应的特征向量;
    第五获取子模块,用于将所述特征向量输入到所述编码层得到至少一个所述文本行图像的编码结果,并根据所述编码结果得到至少一个所述文本行图像的文本信息;
    第六获取子模块,用于根据所述位置信息对至少一个所述文本行图像的文本信息进行有序排列得到所述目标图像的目标识别结果。
  15. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现权利要求1-7中任一项所述方法的步骤。
  16. 一种电子设备,其特征在于,包括:
    存储器,其上存储有计算机程序;
    处理器,用于执行所述存储器中的所述计算机程序,以实现权利要求1-7中任一项所述方法的步骤。
PCT/CN2018/095295 2018-07-11 2018-07-11 字符识别方法、装置、存储介质及电子设备 WO2020010547A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880001125.2A CN108885699B (zh) 2018-07-11 2018-07-11 字符识别方法、装置、存储介质及电子设备
PCT/CN2018/095295 WO2020010547A1 (zh) 2018-07-11 2018-07-11 字符识别方法、装置、存储介质及电子设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/095295 WO2020010547A1 (zh) 2018-07-11 2018-07-11 字符识别方法、装置、存储介质及电子设备

Publications (1)

Publication Number Publication Date
WO2020010547A1 true WO2020010547A1 (zh) 2020-01-16

Family

ID=64325024

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/095295 WO2020010547A1 (zh) 2018-07-11 2018-07-11 字符识别方法、装置、存储介质及电子设备

Country Status (2)

Country Link
CN (1) CN108885699B (zh)
WO (1) WO2020010547A1 (zh)

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111611933A (zh) * 2020-05-22 2020-09-01 中国科学院自动化研究所 文档图像的信息提取方法及系统
CN111695566A (zh) * 2020-06-18 2020-09-22 郑州大学 一种对固定格式文档的识别处理方法及处理系统
CN111767859A (zh) * 2020-06-30 2020-10-13 北京百度网讯科技有限公司 图像校正的方法、装置、电子设备及计算机可读存储介质
CN111814538A (zh) * 2020-05-25 2020-10-23 北京达佳互联信息技术有限公司 目标对象的类别识别方法、装置、电子设备及存储介质
CN111832558A (zh) * 2020-06-15 2020-10-27 北京三快在线科技有限公司 文字图像矫正方法、装置、存储介质及电子设备
CN111914840A (zh) * 2020-07-31 2020-11-10 中国建设银行股份有限公司 一种文本识别方法、模型训练方法、装置及设备
CN112001331A (zh) * 2020-08-26 2020-11-27 上海高德威智能交通系统有限公司 图像识别方法、装置、设备及存储介质
CN112149663A (zh) * 2020-08-28 2020-12-29 北京来也网络科技有限公司 结合rpa和ai的图像文字的提取方法、装置及电子设备
CN112364834A (zh) * 2020-12-07 2021-02-12 上海叠念信息科技有限公司 一种基于深度学习和图像处理的表格识别的还原方法
CN112560862A (zh) * 2020-12-17 2021-03-26 北京百度网讯科技有限公司 文本识别方法、装置及电子设备
CN112699871A (zh) * 2020-12-23 2021-04-23 平安银行股份有限公司 字段内容识别方法、系统、设备及计算机可读存储介质
CN112733623A (zh) * 2020-12-26 2021-04-30 科大讯飞华南人工智能研究院(广州)有限公司 文本要素提取方法、相关设备及可读存储介质
CN112784932A (zh) * 2021-03-01 2021-05-11 北京百炼智能科技有限公司 一种字体识别方法、装置和存储介质
CN113076961A (zh) * 2021-05-12 2021-07-06 北京奇艺世纪科技有限公司 一种图像特征库更新方法、图像检测方法和装置
CN113191345A (zh) * 2021-04-28 2021-07-30 北京有竹居网络技术有限公司 一种文本行方向确定方法及其相关设备
CN113298079A (zh) * 2021-06-28 2021-08-24 北京奇艺世纪科技有限公司 一种图像处理方法、装置、电子设备及存储介质
CN113392756A (zh) * 2021-06-11 2021-09-14 北京猿力未来科技有限公司 图本识别方法及装置
CN113408270A (zh) * 2021-06-10 2021-09-17 广州三七极创网络科技有限公司 变体文本的识别方法、装置及电子设备
CN113610073A (zh) * 2021-06-29 2021-11-05 北京搜狗科技发展有限公司 图片中公式的识别方法、装置及存储介质
CN113642556A (zh) * 2021-08-04 2021-11-12 五八有限公司 一种图像处理方法、装置、电子设备及存储介质
CN113657364A (zh) * 2021-08-13 2021-11-16 北京百度网讯科技有限公司 用于识别文字标志的方法、装置、设备以及存储介质
CN114429632A (zh) * 2020-10-15 2022-05-03 腾讯科技(深圳)有限公司 识别点读内容的方法、装置、电子设备及计算机存储介质
CN114495106A (zh) * 2022-04-18 2022-05-13 电子科技大学 一种应用于dfb激光器芯片的深度学习mocr方法
CN115640401A (zh) * 2022-12-07 2023-01-24 恒生电子股份有限公司 文本内容提取方法及装置

Families Citing this family (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111695377B (zh) * 2019-03-13 2023-09-29 杭州海康威视数字技术股份有限公司 一种文本检测方法、装置和计算机设备
CN111723627A (zh) * 2019-03-22 2020-09-29 北京搜狗科技发展有限公司 一种图像处理方法、装置和电子设备
CN111832371A (zh) * 2019-04-23 2020-10-27 珠海金山办公软件有限公司 文本图片矫正方法、装置、电子设备及机器可读存储介质
CN110490190B (zh) * 2019-07-04 2021-10-26 贝壳技术有限公司 一种结构化图像文字识别方法及系统
CN110674811B (zh) * 2019-09-04 2022-04-29 广东浪潮大数据研究有限公司 图像识别的方法及装置
CN110807454B (zh) * 2019-09-19 2024-05-14 平安科技(深圳)有限公司 基于图像分割的文字定位方法、装置、设备及存储介质
CN112949638B (zh) * 2019-11-26 2024-04-05 金毛豆科技发展(北京)有限公司 一种证件图像上传方法和装置
CN111126273B (zh) * 2019-12-24 2024-04-23 珠海奔图电子有限公司 图像处理方法、装置、电子设备以及存储介质
CN113128306A (zh) * 2020-01-10 2021-07-16 北京字节跳动网络技术有限公司 垂直文本行识别方法、装置、设备及计算机可读存储介质
CN111242083B (zh) * 2020-01-21 2024-01-26 腾讯云计算(北京)有限责任公司 基于人工智能的文本处理方法、装置、设备、介质
CN111444908B (zh) * 2020-03-25 2024-02-02 腾讯科技(深圳)有限公司 图像识别方法、装置、终端和存储介质
CN111444834A (zh) * 2020-03-26 2020-07-24 同盾控股有限公司 图像文本行检测方法、装置、设备及存储介质
CN111353493B (zh) * 2020-03-31 2023-04-28 中国工商银行股份有限公司 文本图像方向校正方法及装置
CN113554558A (zh) * 2020-04-26 2021-10-26 北京金山数字娱乐科技有限公司 一种图像处理的方法和装置
CN111563502B (zh) * 2020-05-09 2023-12-15 腾讯科技(深圳)有限公司 图像的文本识别方法、装置、电子设备及计算机存储介质
CN111639566A (zh) * 2020-05-19 2020-09-08 浙江大华技术股份有限公司 一种提取表单信息的方法及装置
CN111753850A (zh) * 2020-06-29 2020-10-09 珠海奔图电子有限公司 文档处理方法、装置、计算机设备及计算机可读存储介质
CN111985465A (zh) * 2020-08-17 2020-11-24 中移(杭州)信息技术有限公司 文本识别方法、装置、设备及存储介质
CN112132003A (zh) * 2020-09-18 2020-12-25 北京搜狗科技发展有限公司 一种数据处理方法、装置和录音设备
CN113033377A (zh) * 2021-03-16 2021-06-25 北京有竹居网络技术有限公司 字符位置修正方法、装置、电子设备和存储介质
CN114387432A (zh) * 2022-01-13 2022-04-22 平安普惠企业管理有限公司 字符方向检测方法、装置、电子设备及存储介质
CN114155546B (zh) * 2022-02-07 2022-05-20 北京世纪好未来教育科技有限公司 一种图像矫正方法、装置、电子设备和存储介质
CN117877051A (zh) * 2022-10-12 2024-04-12 华为终端有限公司 一种文档检测矫正方法及终端
CN115983938A (zh) * 2022-12-13 2023-04-18 北京京东拓先科技有限公司 在线购药管理的方法和装置
CN117237957A (zh) * 2023-11-16 2023-12-15 新视焰医疗科技(杭州)有限公司 用于检测文件方向并对倾斜或畸形文件矫正的方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104636743A (zh) * 2013-11-06 2015-05-20 北京三星通信技术研究有限公司 文字图像校正的方法和装置
CN105631448A (zh) * 2015-12-28 2016-06-01 小米科技有限责任公司 图像校正方法及装置
CN107610091A (zh) * 2017-07-31 2018-01-19 阿里巴巴集团控股有限公司 车险图像处理方法、装置、服务器及系统
CN107862303A (zh) * 2017-11-30 2018-03-30 平安科技(深圳)有限公司 表格类图像的信息识别方法、电子装置及可读存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104636743A (zh) * 2013-11-06 2015-05-20 北京三星通信技术研究有限公司 文字图像校正的方法和装置
CN105631448A (zh) * 2015-12-28 2016-06-01 小米科技有限责任公司 图像校正方法及装置
CN107610091A (zh) * 2017-07-31 2018-01-19 阿里巴巴集团控股有限公司 车险图像处理方法、装置、服务器及系统
CN107862303A (zh) * 2017-11-30 2018-03-30 平安科技(深圳)有限公司 表格类图像的信息识别方法、电子装置及可读存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
REN, CHAO ET AL.: "A New Method on the Segmentation and Recognition of Chinese Characters for Automatic Chinese Seal Imprint Retrieval", 2011 INTERNATIONAL CONFERENCE ON DOCUMENT ANALYSIS AND RECOGNITION, 3 November 2011 (2011-11-03), pages 972 - 976, XP055680666 *

Cited By (35)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111611933A (zh) * 2020-05-22 2020-09-01 中国科学院自动化研究所 文档图像的信息提取方法及系统
CN111611933B (zh) * 2020-05-22 2023-07-14 中国科学院自动化研究所 文档图像的信息提取方法及系统
CN111814538B (zh) * 2020-05-25 2024-03-05 北京达佳互联信息技术有限公司 目标对象的类别识别方法、装置、电子设备及存储介质
CN111814538A (zh) * 2020-05-25 2020-10-23 北京达佳互联信息技术有限公司 目标对象的类别识别方法、装置、电子设备及存储介质
CN111832558A (zh) * 2020-06-15 2020-10-27 北京三快在线科技有限公司 文字图像矫正方法、装置、存储介质及电子设备
CN111695566A (zh) * 2020-06-18 2020-09-22 郑州大学 一种对固定格式文档的识别处理方法及处理系统
CN111695566B (zh) * 2020-06-18 2023-03-14 郑州大学 一种对固定格式文档的识别处理方法及处理系统
CN111767859A (zh) * 2020-06-30 2020-10-13 北京百度网讯科技有限公司 图像校正的方法、装置、电子设备及计算机可读存储介质
CN111914840A (zh) * 2020-07-31 2020-11-10 中国建设银行股份有限公司 一种文本识别方法、模型训练方法、装置及设备
CN112001331A (zh) * 2020-08-26 2020-11-27 上海高德威智能交通系统有限公司 图像识别方法、装置、设备及存储介质
CN112149663A (zh) * 2020-08-28 2020-12-29 北京来也网络科技有限公司 结合rpa和ai的图像文字的提取方法、装置及电子设备
CN114429632A (zh) * 2020-10-15 2022-05-03 腾讯科技(深圳)有限公司 识别点读内容的方法、装置、电子设备及计算机存储介质
CN114429632B (zh) * 2020-10-15 2023-12-12 腾讯科技(深圳)有限公司 识别点读内容的方法、装置、电子设备及计算机存储介质
CN112364834A (zh) * 2020-12-07 2021-02-12 上海叠念信息科技有限公司 一种基于深度学习和图像处理的表格识别的还原方法
CN112560862A (zh) * 2020-12-17 2021-03-26 北京百度网讯科技有限公司 文本识别方法、装置及电子设备
CN112560862B (zh) * 2020-12-17 2024-02-13 北京百度网讯科技有限公司 文本识别方法、装置及电子设备
CN112699871A (zh) * 2020-12-23 2021-04-23 平安银行股份有限公司 字段内容识别方法、系统、设备及计算机可读存储介质
CN112699871B (zh) * 2020-12-23 2023-11-14 平安银行股份有限公司 字段内容识别方法、系统、设备及计算机可读存储介质
CN112733623A (zh) * 2020-12-26 2021-04-30 科大讯飞华南人工智能研究院(广州)有限公司 文本要素提取方法、相关设备及可读存储介质
CN112784932B (zh) * 2021-03-01 2024-06-07 北京百炼智能科技有限公司 一种字体识别方法、装置和存储介质
CN112784932A (zh) * 2021-03-01 2021-05-11 北京百炼智能科技有限公司 一种字体识别方法、装置和存储介质
CN113191345A (zh) * 2021-04-28 2021-07-30 北京有竹居网络技术有限公司 一种文本行方向确定方法及其相关设备
CN113076961A (zh) * 2021-05-12 2021-07-06 北京奇艺世纪科技有限公司 一种图像特征库更新方法、图像检测方法和装置
CN113076961B (zh) * 2021-05-12 2023-09-05 北京奇艺世纪科技有限公司 一种图像特征库更新方法、图像检测方法和装置
CN113408270A (zh) * 2021-06-10 2021-09-17 广州三七极创网络科技有限公司 变体文本的识别方法、装置及电子设备
CN113392756A (zh) * 2021-06-11 2021-09-14 北京猿力未来科技有限公司 图本识别方法及装置
CN113298079B (zh) * 2021-06-28 2023-10-27 北京奇艺世纪科技有限公司 一种图像处理方法、装置、电子设备及存储介质
CN113298079A (zh) * 2021-06-28 2021-08-24 北京奇艺世纪科技有限公司 一种图像处理方法、装置、电子设备及存储介质
CN113610073A (zh) * 2021-06-29 2021-11-05 北京搜狗科技发展有限公司 图片中公式的识别方法、装置及存储介质
CN113642556A (zh) * 2021-08-04 2021-11-12 五八有限公司 一种图像处理方法、装置、电子设备及存储介质
CN113657364B (zh) * 2021-08-13 2023-07-25 北京百度网讯科技有限公司 用于识别文字标志的方法、装置、设备以及存储介质
CN113657364A (zh) * 2021-08-13 2021-11-16 北京百度网讯科技有限公司 用于识别文字标志的方法、装置、设备以及存储介质
CN114495106A (zh) * 2022-04-18 2022-05-13 电子科技大学 一种应用于dfb激光器芯片的深度学习mocr方法
CN115640401B (zh) * 2022-12-07 2023-04-07 恒生电子股份有限公司 文本内容提取方法及装置
CN115640401A (zh) * 2022-12-07 2023-01-24 恒生电子股份有限公司 文本内容提取方法及装置

Also Published As

Publication number Publication date
CN108885699A (zh) 2018-11-23
CN108885699B (zh) 2020-06-26

Similar Documents

Publication Publication Date Title
WO2020010547A1 (zh) 字符识别方法、装置、存储介质及电子设备
CN108009543B (zh) 一种车牌识别方法及装置
US9697416B2 (en) Object detection using cascaded convolutional neural networks
US9760788B2 (en) Mobile document detection and orientation based on reference object characteristics
CN107220640B (zh) 字符识别方法、装置、计算机设备和计算机可读存储介质
JP5775225B2 (ja) マルチレイヤ連結成分をヒストグラムと共に用いるテキスト検出
JP2008217347A (ja) ナンバープレート認識装置、その制御方法、コンピュータプログラム
US9619753B2 (en) Data analysis system and method
US20140022406A1 (en) Automatic correction of skew in natural images and video
EP2974261A2 (en) Systems and methods for classifying objects in digital images captured using mobile devices
US20140286527A1 (en) Systems and methods for accelerated face detection
CN103198311B (zh) 基于拍摄的图像来识别字符的方法及装置
US10764563B2 (en) 3D enhanced image correction
KR102559021B1 (ko) 불량 이미지 생성 장치 및 방법
US20180247152A1 (en) Method and apparatus for distance measurement
CN111985465A (zh) 文本识别方法、装置、设备及存储介质
CN111738272A (zh) 一种目标特征提取方法、装置及电子设备
US10275888B2 (en) Algorithmic method for detection of documents in images
US20230069608A1 (en) Object Tracking Apparatus and Method
CN108182391B (zh) 一种基于教育视频自动提取不重复的幻灯片方法
KR102101481B1 (ko) 인공지능 기반의 휴대용 보안영상 학습장치 및 방법
CN113177885A (zh) 校正图像的方法、装置、存储介质及电子设备
CN112598043A (zh) 一种基于弱监督学习的协同显著性检测方法
JP2009098867A (ja) 文字列認識方法、コンピュータプログラム、記憶媒体
KR102323602B1 (ko) 보안영상 출력 장치 및 방법

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18925987

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS (EPO FORM 1205A DATED 01.06.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18925987

Country of ref document: EP

Kind code of ref document: A1