Seal recognition method, device, equipment and medium

By performing text detection, recognition and feature matching of seal images in file images, the problem of poor seal text recognition accuracy and coverage in the prior art is solved, and higher recognition accuracy and coverage are achieved.

CN114092937BActive Publication Date: 2025-04-11CHINA CONSTRUCTION BANK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111371790.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-18
Publication Date
2025-04-11
Estimated Expiration
2041-11-18

AI Technical Summary

Technical Problem

It is difficult for the prior art to accurately identify the text content of the seal in the file image. It is affected by factors such as variable seal styles, different fonts, different color depths, and overlapping text interference, resulting in poor recognition accuracy and coverage.

Method used

By obtaining the seal image to be identified, text detection and recognition are performed, feature vectors are extracted, and feature matching and similarity comparison with the feature vectors of existing seals, the seal text with matching or similarity reaches a predetermined threshold is output as the recognition result.

Benefits of technology

The accuracy and coverage of seal text recognition are improved, and text detection and recognition technology and feature matching methods are combined. The recognition results are corrected using seals with successful feature matching, which solves the problem of extracting seal text content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114092937B_ABST
    Figure CN114092937B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer vision technology, and in particular to a seal recognition method, device, equipment and medium. The method comprises: obtaining a seal image to be recognized; performing text recognition on the seal image to be recognized to obtain recognized text, and performing feature vector extraction on the seal image to obtain a first feature vector; performing feature matching on the feature vector of an existing seal with the first feature vector to obtain seal text of one or more existing seals whose matching degree exceeds a first predetermined threshold; performing similarity comparison on the seal text of one or more existing seals with the recognized text, and outputting the seal text with the highest similarity and exceeding a second predetermined threshold as a recognition result, and when the similarities do not exceed the second predetermined threshold, outputting the seal text of the existing seal with the highest matching degree as the recognition result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a seal recognition method, device, equipment and medium. Background Art

[0002] With the development of society and economy, the transaction volume of letter of credit business in the field of international settlement has increased rapidly, and the number of document images involved has also shown a rapid growth phenomenon. In order to speed up business processing and reduce the workload of business personnel, computer technology can be used for auxiliary processing.

[0003] For business scenarios such as letters of credit that require high consistency, efficient and accurate extraction of image information is the primary task in the document processing process. Document images often contain printed text, watermarks, signatures, seals and other contents. For printed text, there are currently some relatively mature detection and recognition algorithms; for watermarks, signatures, seals and other contents, target detection algorithms can be used to detect targets and obtain the position coordinates of each target; and for the text content in the seal, it is generally necessary to recognize it from a single character, which can also be regarded as a special scenario for text detection and recognition. However, due to factors such as the changing styles of seals, different fonts, different shades of colors, and overlapping interference of text, the direct use of commonly used OCR technology cannot obtain accurate recognition results, making the data conversion of seal text full of challenges. Summary of the invention

[0004] The purpose of this application is to provide a seal recognition method, device, equipment and medium to solve the problem of poor recognition accuracy and coverage of seal text content in document images, and achieve better results in accuracy and coverage.

[0005] The embodiment of the present application discloses a seal recognition method for an electronic device, comprising:

[0006] Acquire a seal image to be identified;

[0007] Performing text recognition on the seal image to be recognized to obtain recognized text, and performing feature vector extraction on the seal image to obtain a first feature vector;

[0008] Perform feature matching on the feature vector of the existing seal and the first feature vector to obtain seal characters of one or more existing seals whose matching degree exceeds a first predetermined threshold;

[0009] Compare the similarity between the seal text of one or more existing seals and the recognized text.

[0010] The seal text with the highest similarity and exceeding the second predetermined threshold is output as the recognition result. When the similarities do not exceed the second predetermined threshold, the seal text with the highest matching degree of the existing seal is output as the recognition result.

[0011] Optionally, obtaining a seal image to be identified includes:

[0012] Get the file image;

[0013] Performing rotation correction and / or tilt correction on the document image;

[0014] The seal image to be recognized is detected in the corrected document image.

[0015] Optionally, performing text recognition on the seal image to be recognized to obtain recognized text includes:

[0016] Perform text detection on the stamp image to be recognized, where the curved text is detected by the DRRG algorithm, and the straight text is detected by the DBNET algorithm;

[0017] The detected text is recognized through the CRNN algorithm.

[0018] Optionally, the seal is associated with attribution information including a customer number or a public institution code.

[0019] Optionally, performing feature matching on the feature vector of the existing seal and the first feature vector to obtain seal text of one or more existing seals whose matching degree exceeds a first predetermined threshold comprises:

[0020] The customer number associated with the document image is obtained, and a feature vector of an existing seal associated with the customer number is feature matched with the first feature vector to obtain seal text of one or more existing seals whose matching degree exceeds a first predetermined threshold.

[0021] Optionally, it also includes:

[0022] In the case that there is no existing seal associated with the customer number, a feature matching is performed between the feature vector of the existing seal associated with the public institution code and the first feature vector.

[0023] Optionally, it also includes:

[0024] When the matching degree does not reach the first predetermined threshold, the recognized text is output as the recognition result.

[0025] The embodiment of the present application discloses a seal recognition device, comprising:

[0026] A seal image acquisition module, used to acquire the seal image to be identified;

[0027] A processing module, used for performing text recognition on the seal image to be recognized to obtain recognized text, and performing feature vector extraction on the seal image to obtain a first feature vector;

[0028] A feature matching module, used for performing feature matching between a feature vector of an existing seal and the first feature vector, to obtain seal characters of one or more existing seals whose matching degree exceeds a first predetermined threshold;

[0029] The similarity comparison module is used to compare the similarity between the seal text of one or more existing seals and the recognized text.

[0030] The output module is used to output the seal text with the highest similarity and exceeding the second predetermined threshold as the recognition result; when the similarities do not exceed the second predetermined threshold, the seal text with the highest matching degree of the existing seal is output as the recognition result.

[0031] The embodiment of the present application discloses a seal recognition device, which includes a memory storing computer executable instructions and a processor. When the instructions are executed by the processor, the device implements any of the above-mentioned seal recognition methods.

[0032] The embodiment of the present application discloses a computer storage medium, on which instructions are stored. When the instructions are executed on a computer, the computer is enabled to execute any of the above-mentioned seal recognition methods.

[0033] Compared with the prior art, the main differences and effects of the embodiments of the present application are:

[0034] In the present application, the feature vector of the existing seal is feature matched with the first feature vector to obtain the seal text of one or more existing seals whose matching degree exceeds the first predetermined threshold; the seal text of one or more existing seals is compared with the recognition text for similarity, and the seal text with the highest similarity and exceeding the second predetermined threshold is output as the recognition result. When the similarity does not exceed the second predetermined threshold, the seal text of the existing seal with the highest matching degree is output as the recognition result; when the matching degree does not reach the first predetermined threshold, the recognition text is output as the recognition result. The text detection and recognition technology is combined with the feature matching method, and the seal text recognition result is corrected by using the seal with successful feature matching, while the seal with unsuccessful feature matching directly outputs the seal text recognition result, which solves the problem of seal text content extraction in the data conversion process and achieves better results in accuracy and coverage.

[0035] In this application, the seal image is subjected to text detection, wherein the curved text is detected by the DRRG algorithm, and the straight text is detected by the DBNET algorithm; the detected text is subjected to text recognition by the CRNN algorithm. Different algorithms are used to detect arc-shaped, circular text or horizontal text appearing in various types of seals such as circular, elliptical, and square contained in the file image. This improves the recognition precision and accuracy while also ensuring the recognition speed.

[0036] In this application, the customer number associated with the document image is obtained, and the feature vector of the existing seal associated with the customer number is feature matched with the first feature vector to obtain the seal text of one or more existing seals whose matching degree exceeds the first predetermined threshold; if there is no existing seal associated with the customer number, the feature vector of the existing seal associated with the public institution code is feature matched with the first feature vector. A complete seal image base is established for customers and public institutions, and the customer number is obtained as prior knowledge to reduce the time consumption of matching search and improve matching accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A flow chart of a seal recognition method according to an embodiment of the present application is shown.

[0038] Figure 2 A schematic diagram showing a document image and a seal base library according to an embodiment of the present application.

[0039] Figure 3 A schematic diagram showing a seal recognition device according to an embodiment of the present application.

[0040] Figure 4 A block diagram of a seal recognition device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0041] The present application will be further described below in conjunction with specific embodiments and accompanying drawings. It will be appreciated that the specific embodiments described herein are only intended to explain the present application and are not intended to limit the present application. In addition, for ease of description, only some but not all structures or processes related to the present application are shown in the accompanying drawings. It should be noted that in this specification, similar reference numerals and letters represent similar items in the following accompanying drawings.

[0042] It should be understood that although the terms "first", "second", etc. may be used herein to describe various features, these features should not be limited by these terms. These terms are used only to distinguish and should not be understood as indicating or implying relative importance. For example, a first feature may be referred to as a second feature, and similarly a second feature may be referred to as a first feature without departing from the scope of the exemplary embodiments.

[0043] In the description of this application, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in this embodiment can be understood according to specific circumstances.

[0044] Illustrative embodiments of the present application include, but are not limited to, seal recognition methods, devices, apparatuses, and media.

[0045] The various aspects of the illustrative embodiments will be described using terms commonly used by those skilled in the art to convey the essence of their work to other persons skilled in the art. However, it is apparent to those skilled in the art that some alternative embodiments may be implemented using the features described in part. For purposes of explanation, specific numbers and configurations are set forth to provide a more thorough understanding of the illustrative embodiments. However, it is apparent to those skilled in the art that alternative embodiments may be implemented without the specific details. In some other cases, some well-known features are omitted or simplified herein to avoid obscuring the illustrative embodiments of the present application.

[0046] In addition, various operations will be described as multiple separate operations in a manner that is most helpful for understanding the illustrative embodiments; however, the order of description should not be interpreted as implying that these operations must rely on the order of description, and many of the operations can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can also be rearranged. When the described operations are completed, the process can be terminated, but can also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0047] References in the specification to "one embodiment," "an embodiment," "an illustrative embodiment," etc., indicate that the described embodiment may include a particular feature, structure, or property, but each embodiment may or may not necessarily include the particular feature, structure, or property. Moreover, these phrases are not necessarily referring to the same embodiment. In addition, when particular features are described in conjunction with a specific embodiment, the knowledge of those skilled in the art can affect the combination of these features with other embodiments, whether or not these embodiments are explicitly described.

[0048] Unless the context dictates otherwise, the terms "comprising," "having," and "including" are synonymous. The phrase "A and / or B" means "(A), (B), or (A and B)."

[0049] As used herein, the term "module" may refer to, be part of, or include: memory (shared, dedicated, or group) for running one or more software or firmware programs, application-specific integrated circuits (ASICs), electronic circuits and / or processors (shared, dedicated, or group), combinational logic circuits, and / or other suitable components that provide the described functionality.

[0050] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order is not necessary. Instead, in some embodiments, these features may be described in a manner and / or order different from that shown in the illustrative drawings. In addition, the structural or method features included in a specific figure do not mean that all embodiments need to include such features. In some embodiments, these features may not be included or may be combined with other features.

[0051] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0052] OCR (Optical Character Recognition): refers to the process in which an electronic device (such as a scanner or digital camera) examines the characters printed on paper, determines their shapes by detecting dark and light patterns, and then uses character recognition methods to translate the shapes into computer text; that is, for printed characters, the text in the paper document is converted into a black and white dot matrix image file by optical means, and the text in the image is converted into a text format by recognition software for further editing and processing by word processing software. As a very important research direction in the field of machine vision, OCR technology involves a variety of application fields. The existing more mature OCR technology can be used to accurately and efficiently convert various image content into computer-processable data. However, for the relevant images in the field of export letters of credit, the documents involved are of various types, and their styles and contents are different. In particular, when it is necessary to obtain the information of the issuer of the document from the seal, the recognition difficulty is very high. The commonly used OCR technology cannot be directly applied to the content recognition of the seal, and it is necessary to conduct targeted research or application on the problem of extracting seal information.

[0053] Due to the fact that the styles of seals in document images (for example, images of export letters of credit) vary, the fonts vary, the colors vary, and the text overlaps, the effects of text detection and recognition algorithms based on neural networks vary. Common seal styles include square, circular, and oval. Circular and oval seals often contain both horizontal and curved texts, and it is difficult for a single text detection and recognition algorithm to achieve good detection and recognition results. If the seal is printed in a non-blank area, that is, when it overlaps with text, signatures, etc., or when the seal is incomplete, it will greatly interfere with the text detection and recognition results in the seal.

[0054] The ancient book seal text recognition technology based on graph model matching targets seal characters, which, although complex in writing, are almost free of bending and deformation. In addition, graph models are established for limited characters, which limits their scope of use. When characters that do not exist in the graph model library appear, it is difficult to obtain correct recognition results.

[0055] In order to solve the above technical problems, an embodiment of the present application provides a seal recognition method for an electronic device.

[0056] Figure 1 A flow chart of a seal recognition method according to an embodiment of the present application is shown. Figure 2 A schematic diagram of a document image and a seal base according to an embodiment of the present application is shown. Figure 1 and Figure 2 This method is explained exemplarily.

[0057] like Figure 1 and Figure 2 As shown, the seal recognition method 100 includes:

[0058] Step 102, rotation correction and tilt correction are performed on the document image. For example, the document image that needs to be recognized by seal (for example, the image of the export letter of credit issued by the customer to the bank, the letter of credit is a written document issued by the bank to the exporter (seller) at the request of the importer (buyer) to guarantee the payment of the goods) may be rotated or tilted, and then the document image is rotated and tilted to obtain a positive document image.

[0059] Step 104 , detecting the seal image in the corrected document image. For example, performing seal detection on the corrected positive document image 201 , detecting the seal image 202 in the document image 201 .

[0060] Those skilled in the art will appreciate that, according to the recognition method of the embodiment of the present application, when the seal image can be directly obtained, steps 102 and 104 are not necessary.

[0061] Step 106, perform text detection on the seal image 202. Text detection is a prerequisite for text recognition: first locate the text area in the image through a text detection algorithm to find the bounding box of a single character or text line. For example, the seal text area 2021 in the seal image 202 is detected through a text detection algorithm.

[0062] Step 108, perform text recognition on the detected text. The text recognition algorithm compares the text detection result with the characters in the character library one by one, and outputs the best matching result. For example, the seal text area 2021 is recognized by the text recognition algorithm, and the recognized text 203 is recognized.

[0063] According to one embodiment of the present application, commonly used text detection methods include EAST / CTPN / SegLink / PixelLink / TextBoxes / TextSnake / MSR.

[0064] In text recognition, CRNN or Seq2Seq are generally used to identify horizontal text lines, while STN+RNN / cascade R-CNN+LSTM algorithms are used for recognition of curved and irregular text.

[0065] The mechanism of end-to-end text detection and recognition combines text detection and text recognition, and can directly obtain the position information and character information of the text through a single network training and learning. The end-to-end model FOTS proposes RROI (ROIRotate) to allow detection and recognition to share the convolutional feature layer, which can generate directional text areas from the convolutional feature map, support tilted text line detection and recognition, and achieve real-time detection and recognition speed. The end-to-end model MaskTextSpotter based on Mask R-CNN can detect various non-horizontal texts and achieve good detection results in natural scenes, but the model can only recognize numbers and English letters. The semi-supervised learning method STN-OCR uses the spatial transformer network (STN) to perform affine transformation on the original input image in the detection part, so that the detected multiple text blocks can be rotated, scaled, tilted and other graphic correction actions are performed separately, so as to obtain better recognition accuracy in the subsequent text recognition stage.

[0066] Those skilled in the art will appreciate that the text detection and recognition in the seal image may also adopt other commonly used technologies in the art, which will not be elaborated here.

[0067] Step 110 , extracting a feature vector from the seal image 202 to obtain a first feature vector. For example, extracting a feature vector from the seal image 202 to obtain a first feature vector 204 of the seal image 202 .

[0068] According to an embodiment of the present application, the feature vector extraction of the seal image may adopt various conventional image processing techniques well known to those skilled in the art, which will not be described in detail here.

[0069] Step 112, feature matching is performed between the feature vector of the existing seal and the first feature vector. Feature matching refers to an image matching method that takes the feature extracted from the image as a conjugate entity, and takes the proposed feature attribute or description parameter (actually the feature of the feature, which can also be considered as the feature of the image) as the matching entity, and calculates the similarity measure between the matching entities to achieve conjugate entity registration. The feature matching method has a relatively small application scope in the field of seal text recognition, and generally can achieve good results for limited seal scenes. The ancient book seal text recognition technology based on graph model matching proposes to construct a graph model based on the stroke structure features of the seal text, which mainly includes four important steps: binarization, skeleton extraction, skeleton pruning and variable approximation, and the seal text graph model after the optimal skeleton approximation is used as the structural feature of the seal text image. In the matching process, node similarity matrix calculation, connection similarity matrix calculation, and global similarity matrix calculation are performed, and the reference seal text sample with the highest global consistency matching score is selected as the recognition result. For example, the feature vectors of several seals are stored in the seal feature vector base library 205, Figure 2 2 shows a part of the feature vectors 206-213, wherein the feature vectors 206 and 207 correspond to the seal identified by the label information 214 (the label information may include the seal text of the corresponding seal), the feature vectors 208 and 209 correspond to the seal identified by the label information 215, the feature vectors 210 and 211 correspond to the seal identified by the label information 216, and the feature vectors 212 and 213 correspond to the seal identified by the label information 217. All (or part) of the feature vectors including the feature vectors 206-213 in the seal feature vector base 205 are feature matched with the first feature vector 204.

[0070] Step 114, determine whether there is a matching seal whose matching degree reaches a first predetermined threshold. For example, determine whether there is a feature vector whose matching degree with the first feature vector 204 reaches a first predetermined threshold (for example, 0.7) among all (or part of) the feature vectors in the seal feature vector base library 205. Since the feature vector corresponds to the seal, it can be determined whether there is a matching seal whose matching degree with the first feature vector 204 reaches the first predetermined threshold.

[0071] Those skilled in the art will appreciate that the selection of the first predetermined threshold for the matching degree may be determined according to actual conditions.

[0072] Step 116, if the judgment result of step 114 is no, then the recognized text is output and the method ends. For example, if the matching degree of all feature vectors in the seal feature vector base 205 and the first feature vector 204 is lower than the first predetermined threshold, then the recognized text 203 is directly output.

[0073] Step 118, if the judgment result of step 114 is yes, then output the seal text of one or more matching seals whose matching degree reaches the first predetermined threshold. Among them, the output can be limited to the seal text of the matching seal with the highest matching degree not exceeding a predetermined number. For example, the first predetermined threshold is set to 0.7 and the predetermined number is set to 2. The matching degrees of feature vector 207, feature vector 210 and feature vector 213 with the first feature vector 204 are 0.8, 0.95 and 0.75 respectively, while the matching degrees of other feature vectors in the seal feature vector base library 205 with the first feature vector 204 do not reach 0.7. Then output the seal text contained in the label information 216 corresponding to the feature vector 210 and the seal text contained in the label information 217 corresponding to the feature vector 213.

[0074] Step 120 , compare the seal characters of one or more matching seals with the recognized characters. For example, compare the seal characters contained in the label information 216 and the seal characters contained in the label information 217 output in step 118 with the recognized characters 203 recognized in step 108 .

[0075] Step 122, determine whether there is a seal character whose similarity reaches a second predetermined threshold. For example, when the second predetermined threshold is set to 0.9, determine whether the seal character included in the label information 216 and the recognized character 203, and the seal character included in the label information 217 and the recognized character 203 have a similarity of 0.9.

[0076] Likewise, those skilled in the art will appreciate that the selection of the second predetermined threshold for similarity can be determined based on actual conditions.

[0077] Step 124: If the result of the judgment in step 122 is no, then the seal text of the matching seal with the highest matching degree is output. For example, if the similarity between the seal text contained in the label information 216 and the recognized text 203, and the seal text contained in the label information 217 and the recognized text 203 is less than 0.9, then the seal text contained in the label information 216 corresponding to the feature vector 210 with the highest matching degree among the feature vectors output in step 118 is output.

[0078] Step 126: If the judgment result of step 122 is yes, the seal text with the highest similarity reaching the second predetermined threshold is output. For example, if the seal text included in the label information 216 has a similarity of 0.97 with the recognized text 203 and the seal text included in the label information 217 has a similarity of 0.98 with the recognized text 203, the seal text included in the label information 217 is output.

[0079] It can be understood that the first predetermined threshold, the second predetermined threshold and the predetermined number can be set as required.

[0080] In this application, text detection and recognition technology is combined with a feature matching method. The seal text recognition results are corrected using seals with successful feature matching, while the seal text recognition results are directly output for seals with unsuccessful feature matching. This solves the problem of seal text content extraction during data conversion and achieves better results in accuracy and coverage.

[0081] According to some embodiments of the present application, performing text recognition on the seal image to obtain recognized text further includes:

[0082] The seal image is subjected to text detection, wherein the curved text is detected by the DRRG algorithm, and the straight text is detected by the DBNET algorithm; then, the detected text is recognized by the CRNN algorithm.

[0083] In view of the fact that the seal text in the export letter of credit document is horizontal, arc or circular, the DRRG algorithm is used to detect the arc and circular text in the seal, and DBNET is used to detect the horizontal text. DRRG is an end-to-end network consisting of a CNN-based text proposal network and a GCN-based relational reasoning network. The traditional CNN-based relational reasoning network can only integrate spatial information and channel information, while the GCN-based relational reasoning method can integrate the sequence information between texts, which is more suitable for the reasoning relationship between texts than CNN, so that the network can achieve better results when processing texts of arbitrary shapes. In order to achieve more accurate detection results, some text detection methods often use complex network structures and post-processing operations, which consumes a certain amount of time cost. The differentiable binarization module proposed by DBNET can adaptively set the binarization threshold, simplify post-processing, and balance the network performance and speed.

[0084] CRNN can be trained end-to-end, with a small model but fast speed. It is mainly used to recognize text sequences of indefinite length: CNN extracts the features of the input image, then uses a bidirectional RNN to predict the feature sequence, learns the feature vectors in the sequence and outputs the predicted label distribution, and finally converts the predicted label distribution into the final label sequence through CTC loss.

[0085] In this application, different algorithms are used to detect arc-shaped, circular text or horizontal text in various types of seals such as circular, elliptical, and square in the document image, thereby improving the recognition precision and accuracy while also ensuring the recognition speed.

[0086] According to some embodiments of the present application, the seal feature vector base library 205 may be established and operated in the following manner:

[0087] Multiple seal images of the same seal are stored in a subfolder, and the subfolder and the seal image therein are associated with unique seal label information. The subfolder is then placed in a folder named after the seal's ownership information. This is how a seal image base library is established. Feature extraction is then performed on each seal image to extract a seal feature vector, and feature vectors with the same ownership information and their associated label information are stored in the same file named after the ownership information. This is how a seal feature vector base library is established.

[0088] The following combination Figure 2 Further explanation, for example:

[0089] 1) Establishment of seal image database

[0090] In the practice of letter of credit examination, there are cases where a single customer uses multiple seals. The character information contained in different seals is different, but they belong to the same company. For example, a customer with customer number 218 has multiple seals, and the same seal includes multiple seal images. Multiple (for example, 10-20, 2 are shown in the figure) seal images of the same seal can be classified into subfolders of the same seal named with corresponding label information. For example, seal images 220 and 221 are classified into a subfolder named with label information 214, and seal images 222 and 223 are classified into a subfolder named with label information 215. These subfolders are then assigned to the folder named with the same customer number 218.

[0091] Since the types of documents issued by customers also include public documents provided by third-party companies such as insurance policies, bills of lading, and airway bills, and the stamps used are not customer stamps, it is necessary to establish a corresponding image base library and corresponding label information for such public agency seals. Similarly, for example, seal images 224 and 225 are classified into a subfolder named after label information 216, and seal images 226 and 227 are classified into a subfolder named after label information 217. These subfolders are then assigned to a folder named after the same public agency 219 ("public agency 219" can be a public agency code). In this way, a seal image base library 228 is established.

[0092] 2) Feature vector extraction

[0093] According to the seal image base established in the early stage, the feature extraction VGG16 model is used to extract the features of the seal images under each customer number folder and the seal images under the public institution folder, and the feature vectors with the same attribution information and their associated label information are stored in the same file named after the attribution information to establish the seal feature vector base. For example, feature vectors 206-213 are extracted respectively according to seal images 220-227, and then feature vectors 206 and 207 of customers belonging to customer number 218 and their associated label information 214, as well as feature vectors 208 and 209 and their associated label information 215 are included in the .h5 file named after customer number 218. Similarly, feature vectors 210 and 211 and their associated label information 216, as well as feature vectors 212 and 213 and their associated label information 217, belonging to public institution 218, are included in the .h5 file named after public institution 219. In this way, the seal feature vector base 205 is established, which is convenient for matching search and management.

[0094] 3) Seal feature matching

[0095] Since the prior knowledge of the customer number of the customer described by the seal can be obtained from the message interface before the seal is matched, the seal feature vector under the customer number can be compared first during the matching process to obtain a matching result; if the seal is not successfully matched with the customer's seal, it will be compared with the feature vectors of public institutions (customs, inspection and quarantine agencies, China Council for the Promotion of International Trade, shipping companies, insurance institutions, inspection and quarantine agencies, China Council for the Promotion of International Trade) to obtain a matching result. For example, when matching the first feature vector 204 extracted in step 108 with the feature vector in the feature vector base library 205, first obtain the customer number associated with the file image 201, for example, if it is customer number 218, then all feature vectors in the customer number 218.h5 file are feature matched with the first feature vector 204. If the matching degree is lower than the first predetermined threshold, or the file image 201 is not associated with customer number 218, and there is no file named with the customer number in the feature vector base library 205, then the feature vectors in the public agency 219.h5-public agency n.h5 file are feature matched with the first feature vector 204.

[0096] In this application, a complete seal image database is established for customers (for example, letter of credit customers) and public institutions, the feature vector of each seal is extracted and a unique corresponding seal label information is assigned. By using the acquired customer number as prior knowledge, the matching search time is reduced and the matching accuracy is improved.

[0097] Figure 3 A schematic diagram showing a seal recognition device according to an embodiment of the present application.

[0098] like Figure 3 As shown, the device 300 includes

[0099] A memory 302 for storing computer executable instructions, and

[0100] The processor 304 is configured to execute the instruction to implement any possible method of the first embodiment.

[0101] The first embodiment is a method embodiment corresponding to the present embodiment, and the present embodiment can be implemented in conjunction with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in the present embodiment, and are not repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in the present embodiment can also be applied in the first embodiment.

[0102] Specifically, Figure 3 As shown, the device 300 may include one or more (only one is shown in the figure) memories 302 and processors 304 (the processor 304 may include but is not limited to a central processing unit CPU, a graphics processor GPU, a digital signal processor DSP, a microprocessor MCU or a programmable logic device FPGA and other processing devices). The specific connection medium between the above-mentioned memory 302 and the processor 304 is not limited in the embodiment of the present application. Figure 3 In the embodiment, the memory 302 and the processor 304 are connected via a bus 306. The bus 306 is connected to the processor 304 via a bus 306. Figure 3 The connection between other components is shown by bold lines, and is not intended to be limiting. The bus 306 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but it does not mean that there is only one bus or one type of bus. Those skilled in the art will understand that Figure 3 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 3 More or fewer components as shown, or with Figure 3 Different configurations shown.

[0103] The processor 304 executes various functional applications and data processing by running the software programs and modules stored in the memory 302, that is, implements the above-mentioned seal recognition method.

[0104] The memory 302 can be used to store program instructions / modules corresponding to the seal recognition method in some embodiments of the present application executed by the processor 304. The memory 302 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 302 may further include a memory remotely arranged relative to the processor 304, and these remote memories can be connected to the device 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 combinations thereof.

[0105] Figure 4 A block diagram of a seal recognition device according to an embodiment of the present application is shown as follows: Figure 4 As shown, the device 400 includes:

[0106] A seal image acquisition module 402 is used to acquire a seal image to be identified;

[0107] The processing module 404 is used to perform text recognition on the seal image to be recognized to obtain recognized text, and to extract feature vectors from the seal image to obtain a first feature vector;

[0108] A feature matching module 406 is used to perform feature matching between a feature vector of an existing seal and the first feature vector to obtain seal characters of one or more existing seals whose matching degree exceeds a first predetermined threshold;

[0109] The similarity comparison module 408 is used to compare the seal characters of one or more existing seals with the recognition characters.

[0110] The output module 410 is used to output the seal text with the highest similarity and exceeding the second predetermined threshold as the recognition result; when the similarities do not exceed the second predetermined threshold, the seal text with the highest matching degree of the existing seal is output as the recognition result.

[0111] The first embodiment is a method embodiment corresponding to the present embodiment, and the present embodiment can be implemented in conjunction with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in the present embodiment, and are not repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in the present embodiment can also be applied in the first embodiment.

[0112] According to some embodiments of the present application, a computer storage medium is disclosed, on which instructions are stored. When the instructions are executed on a computer, the computer is enabled to execute any possible method of the first embodiment described above.

[0113] The first embodiment is a method embodiment corresponding to the present embodiment, and the present embodiment can be implemented in conjunction with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in the present embodiment, and are not repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in the present embodiment can also be applied in the first embodiment.

[0114] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented in the form of instructions or programs carried or stored on one or more transient or non-transient machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors, etc. When the instructions or programs are run by the machine, the machine may perform the aforementioned various methods. For example, the instructions may be distributed via a network or other computer-readable medium. Therefore, the machine-readable medium may include, but is not limited to, any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, such as a floppy disk, an optical disk, a compact disk read-only memory (CD-ROMs), a magneto-optical disk, a read-only memory (ROM), a random access memory (RAM), an erasable programmable read-only memory (EPROM), an electronically erasable programmable read-only memory (EEPROM), a magnetic card or an optical card, or a flash memory or a tangible machine-readable memory for transmitting network information via electrical, optical, acoustic, or other forms of signals (e.g., carrier waves, infrared signals, digital signals, etc.). Accordingly, machine-readable media includes any form of machine-readable media suitable for storing or transmitting electronic instructions or information readable by a machine (eg, a computer).

[0115] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the use of the technical solution of the present application is not limited to the various applications mentioned in the embodiments of the present patent. Various structures and variations can be easily implemented with reference to the technical solution of the present application to achieve the various beneficial effects mentioned herein. Various changes made within the knowledge of ordinary technicians in the field without departing from the purpose of the present application should all fall within the scope of the patent application.

Claims

1. A seal recognition method, used in electronic equipment, characterized in that: include: Acquire a seal image to be identified; Performing text recognition on the seal image to be recognized to obtain recognized text, and performing feature vector extraction on the seal image to obtain a first feature vector; Perform feature matching on a feature vector of an existing seal and the first feature vector, wherein the feature vector of the existing seal corresponds to an existing seal identified by label information, wherein the label information includes the seal text of the corresponding seal, and obtain the seal text of the existing seal included in the label information corresponding to one or more feature vectors whose matching degree exceeds a first predetermined threshold; Compare the seal characters of one or more existing seals with the recognition characters for similarity, The seal text with the highest similarity and exceeding a second predetermined threshold is output as the recognition result. When the similarities do not exceed the second predetermined threshold, the seal text with the highest matching degree is output as the recognition result.

2. The method according to claim 1, characterized in that The step of obtaining the seal image to be identified comprises: Get the file image; Performing rotation correction and / or tilt correction on the document image; The seal image to be recognized is detected in the corrected document image.

3. The method according to claim 2, characterized in that The step of performing text recognition on the seal image to be recognized to obtain recognized text comprises: Performing text detection on the seal image to be identified, wherein the text arranged in a curved manner is detected by the DRRG algorithm, and the text arranged in a straight line is detected by the DBNET algorithm; The detected text is subjected to the text recognition through the CRNN algorithm.

4. The method according to claim 3, characterized in that The existing seal is associated with attribution information, which includes a customer number or a public institution code.

5. The method according to claim 4, characterized in that Performing feature matching between the feature vector of the existing seal and the first feature vector to obtain one or more seal characters of the existing seal whose matching degree exceeds a first predetermined threshold comprises: The customer number associated with the document image is obtained, and a feature vector of an existing seal associated with the customer number is matched with the first feature vector to obtain seal text of one or more existing seals whose matching degree exceeds a first predetermined threshold.

6. The method according to claim 5, characterized in that Also includes: In the case that there is no existing seal associated with the customer number, the feature matching is performed between the feature vector of the existing seal associated with the public institution code and the first feature vector.

7. The method according to claim 6, characterized in that Also includes: When the matching degree does not reach the first predetermined threshold, the recognized text is output as the recognition result.

8. A seal recognition device, characterized in that: include: A seal image acquisition module, used to acquire the seal image to be identified; A processing module, used for performing text recognition on the seal image to be recognized to obtain recognized text, and performing feature vector extraction on the seal image to obtain a first feature vector; A feature matching module is used to perform feature matching between a feature vector of an existing seal and the first feature vector, wherein the feature vector of the existing seal corresponds to an existing seal identified by label information, wherein the label information includes the seal text of the corresponding seal, and obtain the seal text of the existing seal included in the label information corresponding to one or more feature vectors whose matching degree exceeds a first predetermined threshold; A similarity comparison module, used for comparing the seal characters of one or more existing seals with the recognition characters for similarity; The output module is used to output the seal text with the highest similarity and exceeding a second predetermined threshold as the recognition result; when the similarities do not exceed the second predetermined threshold, the seal text with the highest matching degree of the existing seal is output as the recognition result.

9. A seal recognition device, characterized in that: The device comprises a memory storing computer executable instructions and a processor. When the instructions are executed by the processor, the device implements the seal recognition method according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that: Instructions are stored on the computer storage medium. When the instructions are executed on a computer, the computer is enabled to execute the seal recognition method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Invoice seal recognition method and device, computer equipment and storage medium

    CN110751139A

  • Seal recognition method, device and equipment and medium

    CN111353485A