Seal generation method, apparatus, terminal equipment and storage medium
By constructing a seal database and a similarity feature comparison center, and combining text recognition and image processing algorithms, high-accuracy seal images are generated, solving the problem of high text recognition error rate during seal generation and improving the efficiency and accuracy of seal generation.
Patent Information
- Application Number
- CN202310952207.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-31
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-07-31
AI Technical Summary
In existing technologies, the accuracy of character recognition in seal images is generally low, resulting in a high error rate during seal generation.
By establishing a seal database and a word encoding center, constructing a keyword association center and a graphic similarity feature comparison center, using text recognition algorithms to obtain the text content of the seal area, performing cropping, noise reduction and correction, and combining similarity sequence calculations to generate the final seal image.
It improves the accuracy and efficiency of seal generation and solves the problem of high error rate in seal image text recognition.
Smart Images

Figure CN116994251B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition, and more particularly to a method, apparatus, terminal device, and storage medium for generating a seal. Background Technology
[0002] Company seals generally include official seal, financial seal, contract seal, legal representative seal, and invoice seal. The financial seal and contract seal are oval, while the others are round.
[0003] Seal recognition and comparison are widely used in government and enterprise business document (contract / agreement / authorization letter / company certificate) auditing scenarios. It requires the use of manual or AI capabilities to identify the text content of the seal in the document and compare it with the client's company name for auditing.
[0004] However, the aforementioned technologies suffer from a generally low accuracy rate in recognizing characters in seal images.
[0005] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0006] The main objective of this invention is to provide a method, apparatus, terminal device, and storage medium for generating a seal, aiming to solve the technical problem of high error rate in recognizing text in images when generating a seal.
[0007] To achieve the above objectives, the present invention provides a seal generation method, the seal generation method comprising:
[0008] The preset seal image is identified to obtain the seal area and the coordinate position of the seal area;
[0009] Based on the seal area and its coordinate position, an initial seal image is generated through a preset seal text content logical processing center.
[0010] Based on the initial seal image, the final seal image is obtained through similarity sequence calculation.
[0011] Optionally, before the step of generating an initial seal image based on the seal area and its coordinate position using a preset seal text content logical processing center, the method further includes:
[0012] Based on the pre-set regional database, business registration database, and company type thesaurus, establish a seal database and thesaurus coding center;
[0013] Based on the seal database and the word encoding center, a keyword association center and a graphic similarity feature comparison center are constructed.
[0014] The logical processing center for the text content of the seal is obtained through the keyword association center and the graphic similarity feature comparison center.
[0015] Optionally, the step of generating an initial seal image based on the seal area and its coordinate position using a preset seal text content logical processing center includes:
[0016] Based on the coordinates of the seal area, the text content of the seal area is obtained through a text recognition algorithm;
[0017] The text content of the seal area is identified using the seal database and the dictionary encoding center to obtain the identification result;
[0018] Based on the recognition results, the initial seal text content is obtained;
[0019] The initial seal text content is cropped, denoised, and corrected to generate an initial seal image.
[0020] Optionally, the step of obtaining the initial seal text content based on the recognition result includes:
[0021] If the recognition results are consistent, the text content of the seal area is output as the initial seal text content;
[0022] If the recognition result is inconsistent, the text content of the seal area is input into the seal text content logic processing center for processing to obtain the initial seal text content.
[0023] Optionally, if the recognition result is inconsistent, the step of inputting the text content of the seal area into the seal text content logical processing center for processing to obtain the initial seal text content includes:
[0024] The text content in the seal area is preprocessed to obtain the preprocessed text content.
[0025] Based on the number of characters in the text content, the preprocessed text content is divided into segments to obtain the first segmentation result;
[0026] Based on the first segmentation result, a matching result is obtained by matching through the keyword association center;
[0027] The preprocessed text content is segmented based on the matching results to obtain a second segmentation result.
[0028] Based on the results of the second segment, the initial seal text content is obtained.
[0029] Optionally, the step of obtaining the final seal image based on the initial seal image through similarity sequence calculation includes:
[0030] Based on the initial seal image, the similarity of the second segmentation result is calculated using the keyword association center to obtain the similarity result;
[0031] The similarity results are sorted to obtain the sorting results;
[0032] Based on the sorting results, the processed text content is segmented and compared to obtain the comparison results.
[0033] Based on the comparison results, the final seal text content is obtained;
[0034] Based on the final seal text content, generate the final seal image.
[0035] Optionally, after the step of obtaining the final seal image based on the initial seal image through similarity sequence calculation, the method further includes:
[0036] The initial seal image and the final seal image are used to calculate the similarity value;
[0037] Based on the similarity values, a comparison analysis is performed using a preset threshold.
[0038] If the similarity value is above the threshold, the analysis result indicates that the seal content is correct.
[0039] This invention also proposes a seal generation device, the seal generation device comprising:
[0040] The recognition module is used to recognize a preset seal image and obtain the seal area and the coordinate position of the seal area;
[0041] The generation module is used to generate an initial seal image based on the seal area and the coordinate position of the seal area through a preset seal text content logical processing center.
[0042] The acquisition module is used to obtain the final seal image based on the initial seal image through similarity sequence calculation.
[0043] This invention also proposes a terminal device, which includes a memory, a processor, and a stamp generation program stored in the memory and executable on the processor. When the stamp generation program is executed by the processor, it implements the steps of the stamp generation method described above.
[0044] This invention also proposes a computer-readable storage medium storing a seal generation program, which, when executed by a processor, implements the steps of the seal generation method described above.
[0045] This invention proposes a method, apparatus, terminal device, and storage medium for generating a seal. The method involves recognizing a preset seal image to obtain the seal area and its coordinates; generating an initial seal image based on the seal area and its coordinates using a preset seal text content logical processing center; and obtaining a final seal image based on the initial seal image through similarity sequence calculation. This achieves high-accuracy seal generation and further verification of the generated seal, solving the problem of high text recognition error rates in images during seal generation and improving both the efficiency and accuracy of seal generation. Attached Figure Description
[0046] Figure 1 This is a schematic diagram of the functional modules of the terminal device to which the seal generation device of this invention belongs;
[0047] Figure 2 This is a flowchart illustrating an exemplary embodiment of the seal generation method of the present invention;
[0048] Figure 3 This is a schematic diagram illustrating a specific application scenario of the seal generation method of the present invention;
[0049] Figure 4 This is an overall schematic diagram of the seal generation method of the present invention.
[0050] Figure 5 This is a flowchart illustrating another exemplary embodiment of the seal generation method of the present invention;
[0051] Figure 6 This is a flowchart illustrating another exemplary embodiment of the seal generation method of the present invention;
[0052] Figure 7 This is a schematic diagram of the process for obtaining the initial text content of a seal in the seal generation method of the present invention;
[0053] Figure 8 This is a schematic diagram of the process of the seal generation method of the present invention, which involves processing through a logical processing center for seal text content.
[0054] Figure 9 This is a schematic flowchart illustrating another exemplary embodiment of the seal generation method of the present invention;
[0055] Figure 10 This is a schematic diagram illustrating the generation of the final seal image in the seal generation method of the present invention;
[0056] Figure 11 This is a flowchart illustrating another exemplary embodiment of the seal generation method of the present invention.
[0057] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0058] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0059] The main solution of this invention is as follows: A seal database and a word encoding center are established based on a preset regional database, a business registration database, and a company type word library; a keyword association center and a graphic similarity feature comparison center are constructed based on the seal database and the word encoding center; a seal text content logical processing center is obtained through the keyword association center and the graphic similarity feature comparison center. The text content of the seal area is obtained using a text recognition algorithm based on the coordinate position of the seal area; the text content of the seal area is recognized using the seal database and the word encoding center to obtain a recognition result; initial seal text content is obtained based on the recognition result; the initial seal text content is cropped, denoised, and corrected to generate an initial seal image. If the recognition result is consistent, the text content of the seal area is output as the initial seal text content; if the recognition result is inconsistent, the text content of the seal area is input into the seal text content logical processing center for processing to obtain the initial seal text content. The text content of the seal area is preprocessed to obtain preprocessed text content; the preprocessed text content is divided according to the number of characters to obtain a first segment result; the first segment result is matched using the keyword association center to obtain a matching result; the preprocessed text content is further divided according to the matching result to obtain a second segment result; the initial seal text content is obtained based on the second segment result. The initial seal image is used to calculate the similarity of the second segment result using the keyword association center to obtain a similarity result; the similarity results are sorted to obtain a sorting result; the processed text content is compared segment by segment based on the sorting result to obtain a comparison result; the final seal text content is obtained based on the comparison result; the final seal image is generated based on the final seal text content. The initial seal image and the final seal image are used to calculate the similarity to obtain a similarity value; the similarity value is compared and analyzed using a preset threshold; if the similarity value is above the threshold, the analysis result indicates that the seal content is correct. This solves the problem of high image and text recognition error rate during seal generation, achieves high accuracy in seal generation and further verification of the generated seal, and improves the efficiency and accuracy of seal generation.
[0060] Based on the present invention, starting from the problem of high error rate in seal text recognition and generation in the real world, a seal generation method is designed in combination with the seal text content logic processing center. The effectiveness of the seal generation method of the present invention is verified in actual seal generation. Finally, the accuracy and efficiency of seal generation by the method of the present invention are significantly improved.
[0061] Technical terms involved in the embodiments of this invention:
[0062] NLP (Natural Language Processing) is a branch of artificial intelligence that studies how to enable computers to understand, process, and generate natural language. Natural language is the primary means of human daily communication, including forms such as text, speech, and gestures. The goal of NLP is to enable computers to understand and use natural language as effectively as humans. NLP involves multiple tasks and technologies, including text classification, part-of-speech tagging, named entity recognition, syntactic analysis, machine translation, question answering systems, and sentiment analysis. It combines knowledge and techniques from multiple fields such as computer science, linguistics, statistics, and machine learning. Commonly used methods in NLP include rule-based methods, statistical methods, and deep learning methods. Rule-based methods rely on manually defined rules and grammatical knowledge to process language, but their effectiveness is often limited in complex language scenarios. Statistical methods utilize large amounts of language data for learning and modeling, solving some language processing problems by calculating probabilities. Deep learning methods, on the other hand, use neural network models to learn language representations and semantic relationships, improving language processing performance through large-scale data and multi-layered network structures.
[0063] Hidden Markov Model (HMM) is a statistical model commonly used for modeling and predicting sequence data. It is widely applied in fields such as speech recognition, natural language processing, and bioinformatics. HMMs rely on two fundamental assumptions: state transitions satisfy the Markov property, meaning the current state depends only on the previous state; and observations depend only on the current state. An HMM consists of three main parts: a set of states, a set of observations, and model parameters. The state set represents a set of discrete states the system can be in; the observation set represents a set of discrete or continuous observations in each state; and the model parameters include the initial state probability vector, the state transition matrix, and the observation probability matrix. The basic idea of an HMM is to describe the generation process of sequence data by defining state transition probabilities, observation probabilities, and initial state probabilities. Given an observation sequence, an HMM can compute the most probable hidden state sequence using a forward-backward algorithm or a Viterbi algorithm, or estimate the model parameters using the Expectation-Maximization (EM) algorithm. HMMs can be used for various tasks, such as sequence labeling, language modeling, and sequence generation. By learning the state transitions and observation probabilities from the training data, HMM models can be used to predict the hidden states of unknown observation sequences or generate new sequences that conform to a given pattern.
[0064] SSIM, or Structural Similarity Index, is an algorithm for measuring image quality. Unlike traditional metrics such as Mean Squared Error (MSE) and Peak Signal-to-Noise Ratio (PSNR), it better reflects the human eye's perception of image structure and content. The SSIM algorithm calculates similarity by comparing the brightness, contrast, and structural information of two images. Specifically, it divides the image into multiple blocks, calculates brightness, contrast, and structure for each block, and then calculates a weighted average of these results to obtain the final SSIM similarity index. The SSIM similarity index ranges from 0 to 1, where 1 indicates that the two images are identical, and a higher SSIM similarity index indicates that the two images are perceptually more similar. The SSIM algorithm has wide applications in image quality assessment, image compression, and image enhancement. Compared to traditional pixel-level metrics, it better captures the human eye's sensitivity to image structure and content, thus achieving better results in practical applications. However, the SSIM algorithm also has some limitations, such as sensitivity to different types of image distortion and relatively high computational complexity.
[0065] YOLOv5 is a deep learning-based object detection algorithm. It's the latest version of the YOLO (You Only Look Once) series of algorithms. Compared to previous versions, YOLOv5 offers improvements in both accuracy and speed. Training the YOLOv5 model requires large-scale labeled data and corresponding labels, and the network parameters are optimized through backpropagation. In practical applications, a pre-trained model can be used as a starting point, and then fine-tuned or transferred to other models as needed. YOLOv5 is a deep learning-based object detection algorithm that is fast, accurate, simple, and flexible. It can quickly detect multiple objects in an image and provide corresponding category and bounding box information.
[0066] CRNN (Convolutional Recurrent Neural Network) is a deep learning algorithm for scene text recognition. It combines the advantages of Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs), effectively handling text sequences of variable length. CRNN has wide applications in scene text recognition tasks. It can handle text sequences of varying lengths and is suitable for scenes with diverse text positions, sizes, fonts, and backgrounds. The training process of the CRNN algorithm requires a large-scale labeled text image dataset, and the network parameters are optimized through backpropagation.
[0067] OpenCV (Open Source Computer Vision Library) is an open-source computer vision library designed to provide a wide range of image and video processing capabilities. It consists of a series of functions and algorithms that can be used to process images, videos, 3D point clouds, and perform real-time image processing tasks. OpenCV is a cross-platform library that supports multiple programming languages, such as C++, Python, and Java. It is widely used in computer vision, image processing, robotics, virtual reality, autonomous driving, and other fields. OpenCV provides a variety of image cropping algorithms, allowing users to choose the appropriate algorithm for different needs and scenarios.
[0068] Therefore, this invention addresses the problem of high error rates in seal text recognition and generation in the real world. By combining a seal text content logic processing center, a seal generation method is designed. The effectiveness of the seal generation method is verified in actual seal generation. Finally, the accuracy and efficiency of seal generation using the method of this invention are significantly improved.
[0069] Specifically, refer to Figure 1 , Figure 1 This is a schematic diagram of the functional modules of the terminal device to which the seal generation device of the present invention belongs. The seal generation device can be an independent device capable of generating seals, separate from the terminal device, and can be implemented on the terminal device in hardware or software form. The terminal device can be a smart mobile device with data processing capabilities, such as a mobile phone or tablet computer, or a fixed terminal device or server with data processing capabilities.
[0070] In this embodiment, the terminal device to which the stamp generating device belongs includes at least an output module 110, a processor 120, a memory 130, and a communication module 140.
[0071] The memory 130 stores the operating system and the seal generation program. The seal generation device can generate an initial seal image through a preset seal text content logical processing center; based on the initial seal image, a final seal image is obtained through similarity sequence calculation; the final seal image is compared and analyzed based on the initial seal image to obtain the analysis results. The seal generation result and other information generated by this seal generation device are stored in the memory 130; the output module 110 can be a display screen, etc. The communication module 140 can include a WIFI module, a mobile communication module, and a Bluetooth module, etc., and communicates with external devices or servers through the communication module 140.
[0072] When the stamp generation program in memory 130 is executed by the processor, it performs the following steps:
[0073] The preset seal image is identified to obtain the seal area and the coordinate position of the seal area;
[0074] Based on the seal area and its coordinate position, an initial seal image is generated through a preset seal text content logical processing center.
[0075] Based on the initial seal image, the final seal image is obtained through similarity sequence calculation.
[0076] Furthermore, when the stamp generation program in memory 130 is executed by the processor, it also performs the following steps:
[0077] Based on the pre-set regional database, business registration database, and company type thesaurus, establish a seal database and thesaurus coding center;
[0078] Based on the seal database and the word encoding center, a keyword association center and a graphic similarity feature comparison center are constructed.
[0079] The logical processing center for the text content of the seal is obtained through the keyword association center and the graphic similarity feature comparison center.
[0080] Furthermore, when the stamp generation program in memory 130 is executed by the processor, it also performs the following steps:
[0081] Based on the coordinates of the seal area, the text content of the seal area is obtained through a text recognition algorithm;
[0082] The text content of the seal area is identified using the seal database and the dictionary encoding center to obtain the identification result;
[0083] Based on the recognition results, the initial seal text content is obtained;
[0084] The initial seal text content is cropped, denoised, and corrected to generate an initial seal image.
[0085] Furthermore, when the stamp generation program in memory 130 is executed by the processor, it also performs the following steps:
[0086] If the recognition results are consistent, the text content of the seal area is output as the initial seal text content;
[0087] If the recognition result is inconsistent, the text content of the seal area is input into the seal text content logic processing center for processing to obtain the initial seal text content.
[0088] Furthermore, when the stamp generation program in memory 130 is executed by the processor, it also performs the following steps:
[0089] The text content in the seal area is preprocessed to obtain the preprocessed text content.
[0090] Based on the number of characters in the text content, the preprocessed text content is divided into segments to obtain the first segmentation result;
[0091] Based on the first segmentation result, a matching result is obtained by matching through the keyword association center;
[0092] The preprocessed text content is segmented based on the matching results to obtain a second segmentation result.
[0093] Based on the results of the second segment, the initial seal text content is obtained.
[0094] Furthermore, when the stamp generation program in memory 130 is executed by the processor, it also performs the following steps:
[0095] Based on the initial seal image, the similarity of the second segmentation result is calculated using the keyword association center to obtain the similarity result;
[0096] The similarity results are sorted to obtain the sorting results;
[0097] Based on the sorting results, the processed text content is segmented and compared to obtain the comparison results.
[0098] Based on the comparison results, the final seal text content is obtained;
[0099] Based on the final seal text content, generate the final seal image.
[0100] Furthermore, when the stamp generation program in memory 130 is executed by the processor, it also performs the following steps:
[0101] The initial seal image and the final seal image are used to calculate the similarity value;
[0102] Based on the similarity values, a comparison analysis is performed using a preset threshold.
[0103] If the similarity value is above the threshold, the analysis result indicates that the seal content is correct.
[0104] This invention, through the above-described scheme, specifically involves recognizing a preset seal image to obtain the seal area and its coordinates; generating an initial seal image based on the seal area and its coordinates using a preset seal text content logical processing center; and obtaining a final seal image based on the initial seal image through similarity sequence calculation. This achieves high-accuracy seal generation and further verification of the generated seal, solving the problem of high text recognition error rates in images during seal generation, and improving the efficiency and accuracy of seal generation.
[0105] Based on, but not limited to, the terminal device architecture described above, embodiments of the method of the present invention are proposed.
[0106] Reference Figure 2 , Figure 2 This is a flowchart illustrating an exemplary embodiment of the seal generation method of the present invention. The seal generation method includes:
[0107] Step S01: Recognize the preset seal image to obtain the seal area and the coordinate position of the seal area;
[0108] The subject executing the method in this embodiment can be a seal generation device, a seal generation terminal device, or a server. This embodiment takes a seal generation device as an example, which can be integrated into a terminal device with data processing functions.
[0109] To identify the seal area in a seal image, the following steps are taken:
[0110] First, the seal generation method described in this embodiment has specific application scenarios such as... Figure 3 As shown, this includes, but is not limited to, scenario a: contract and invoice seal recognition, which detects whether there are seals in contract documents and common invoices to quickly determine the legality of contracts and invoices; scenario b: electronic archiving of seals, which uses images of seals on paper contract documents and common invoices to electronically retain them, greatly improving content management efficiency; and scenario c: business acceptance form audit, which combines document classification capabilities to automatically identify the contracts and agreements accepted by the business system, determine whether there are seals, and extract the seal text information into the audit system, etc.
[0111] Finally, an object detection algorithm is used to identify the image containing the seal, and the seal area and its corresponding coordinates are obtained, which are represented as (x1, y1) and (x2, y2) in this embodiment.
[0112] Step S05: Based on the seal area and the coordinate position of the seal area, an initial seal image is generated through a preset seal text content logical processing center.
[0113] To obtain the initial seal image, the following steps are required:
[0114] First, the obtained seal area and its coordinates are processed through the seal text content logic processing center. The seal text content logic processing center is pre-built and has functions such as keyword association and graphic similarity comparison.
[0115] Finally, after processing the seal area and its coordinate position through the seal text content logic processing center, an initial seal image is obtained. The initial seal image mainly contains the text content and graphic of the seal, and this initial seal image can be used to generate the final seal image and compare them.
[0116] Step S06: Based on the initial seal image, the final seal image is obtained through similarity sequence calculation.
[0117] After obtaining the initial seal image, the following steps are taken to obtain the final seal image:
[0118] First, the initial seal image is used to identify the text content of the seal. In this embodiment, in order to obtain the final seal image, the problem to be solved is the accuracy of the text content of the seal. After identification, the text content of the seal can be obtained.
[0119] Then, the text content of the initial seal is segmented. In this embodiment, the segmentation is divided into three segments, but in other embodiments, it can also be two or four segments, etc.
[0120] Then, based on the segmentation results, the similarity sequence is calculated to obtain the text content with the highest similarity in each segment;
[0121] Finally, the text content with the highest similarity among each segment is used as the text content for the final seal, and the final seal image is generated.
[0122] Specifically, such as Figure 4 As shown, Figure 4 This is a schematic diagram of the overall seal generation method of the present invention.
[0123] First, a database and a dictionary encoding center were established, which resulted in more accurate results for the generation of the initial seal image;
[0124] Then, based on the database and the word encoding center, a keyword association center and a graphic similarity feature comparison center are generated. The keyword association center is mainly used for the association of text content between the initial seal image and the final seal image, while the graphic similarity feature comparison center is mainly used to compare the two to obtain the verification result.
[0125] Then, the keyword association center and the graphic similarity feature comparison center are used to generate the logical processing center for the seal text content;
[0126] Then, the seal document or seal image is identified to obtain the seal area and the text content within the seal area;
[0127] Then, the text content within the stamp area is cropped and a new image N is generated, which is the initial stamp image;
[0128] Then, the text content of the initial seal image is segmented into three segments: front, middle and back. The content similarity of these segments is calculated, and the text content with the highest weight is selected to form the final seal text content. This is then used to generate a new image M, which is the final seal image.
[0129] Finally, the SSIM similarity algorithm is used to compare the similarity between the initial seal image and the final seal image. If the similarity is greater than a preset value, the association result of the final seal image is considered correct. The preset value can be adjusted according to the actual business.
[0130] This embodiment, through the above-described scheme, specifically identifies a preset seal image to obtain the seal area and its coordinate position; based on the seal area and its coordinate position, an initial seal image is generated using a preset seal text content logical processing center; and based on the initial seal image, a final seal image is obtained through similarity sequence calculation. This achieves high-accuracy seal generation, solves the problem of high text recognition error rate in images during seal generation, and improves the efficiency and accuracy of seal generation.
[0131] Reference Figure 5 , Figure 5 This is a flowchart illustrating another exemplary embodiment of the seal generation method of the present invention.
[0132] Based on the above Figure 2 In the embodiment shown, before step S05, which involves generating an initial seal image based on the seal area and its coordinate position using a preset seal text content logic processing center, the seal generation method further includes:
[0133] Step S02: Establish a seal database and a thesaurus coding center based on the preset regional database, business registration database, and company type thesaurus.
[0134] Step S03: Based on the seal database and the word encoding center, construct a keyword association center and a graphic similarity feature comparison center;
[0135] Step S04: Obtain the logical processing center for the seal text content through the keyword association center and the graphic similarity feature comparison center.
[0136] Specifically, in order to build a logical processing center for the text content of the seal, the following steps are taken:
[0137] First, the main parts of the seal text content logical processing center include a keyword association center and a graphic similarity feature comparison center. The main construction of these is achieved through a database and a word encoding center.
[0138] Then, a seal database is constructed using regional databases, business registration databases, and company type thesaurus. The regional database is constructed by downloading publicly available datasets from the National Administrative Division Information Query Platform website and modifying the administrative division names by adding "A" before the province, city, county, district, and town codes. This administrative region database is collectively referred to as AC. The business registration database is constructed by downloading publicly available datasets from the National Industrial and Commercial Enterprise Registration Query System website and modifying the enterprise business information according to administrative divisions, using the regional database's AC code + hyphen + sequentially numbered 6-digit unique numeric code. This business registration database is collectively referred to as BC. The company type thesaurus is constructed because most enterprise business registration suffixes are: Limited Liability Company, Joint-Stock Company, Branch Company, Company, Group, etc. Therefore, the company type thesaurus uses "G" + a unique four-digit numeric code. This company type thesaurus is collectively referred to as GC.
[0139] Then, a keyword association center is constructed using a seal database. Specifically, this involves using a regional database, a business registration database, and a company type thesaurus, and employing an NLP Hidden Markov Model (HMM) for Chinese keyword segmentation. The HMM is a generative model that describes the dependency relationship between two related sequences, referred to as the state sequence and the observation sequence. A keyword association center mapping table is then constructed, with the mapping relationship MAP as shown below: MAP(A,B,G)={(AC1,BC1,GC1),...,(AC...G ... n ,BC n GC n )}, MAP(A,B,G) can be represented as a complete business registration name, where A is the region name of the word segmentation, B is the middle part of the business registration, and G is the latter part of the company type;
[0140] Finally, for the content of the seal text obtained by word segmentation and paragraph association, a post-verification method needs to be added to determine whether the actual content is accurate. In this embodiment, it is the graphic similarity feature comparison center. Among them, the SSIM similarity algorithm is used in this embodiment. The SSIM similarity algorithm can compare features such as brightness, contrast, and structure of two images, and can obtain more accurate results by separately processing local areas. The SSIM structural similarity algorithm is as follows: SSIM(x,y) = [l(x,y)] α . [c(x,y)] β . [s(x,y)] γ Among them, l(x,y) is the part for comparing the illumination of the image, [c(x,y)] is the part for comparing the illumination of the image, [s(x,y)] is the part for comparing the illumination of the image. The image needs to be normalized (adjust the pixel threshold to [0,1]) before calculation can be performed to obtain numerical values for comparison. The judgment criterion of SSIM is that SSIM is a number between 0 and 1. The larger the SSIM, the smaller the difference between the two images.
[0141] Furthermore, the specific method for constructing the keyword association center is as follows:
[0142] First, design a marked boundary range for word segmentation. Denote the starting position of the complete industrial and commercial filing name as B, the middle position as M, the ending position as E, and a single character forming a word as S. The marked boundary range is called the state value set in the terminology. For example, for "Boluo County Hongyuan Huahui Electronics Co., Ltd.", it can be marked as: Boluo County / BME Hongyuan / SS Huahui Electronics / BMME Co., Ltd. / BEBE. By this method, for the generation of the corpus, this part of the corpus is called the observation sequence. In actual applications, the keyword association center mapping of MAP(A,B,G) needs to be dynamically generated by the model, and this part is called the hidden sequence;
[0143] Then, calculate the probability distribution of the initial state of MAP(A,B,G). According to the state of the first character of each sentence in the corpus of the industrial and commercial filing name, count the frequency of this state and calculate the probability of this state. For example, for "Boluo County / BME Hongyuan / SS Huahui Electronics / BMME Co., Ltd. / BEBE", splice these characters together by line breaks, split them according to " / " punctuation, record the state of the first character of each sentence, and count the probability of occurrence, expressed as "MAP start (A,B,G) = {AC: 0.3, BC: 0.4, GC: 0.3};
[0144] Then, the MAP(A,B,G) state transition probability matrix is calculated. Based on the state sequence before and after each word, the relationships between states are statistically analyzed. It is assumed that the current state is only related to the previous state and not to any preceding states. The specific set is represented as follows:
[0145]
[0146] Then, the emission probability matrix MAP(A,B,G) is calculated. The emission probability matrix represents the probability of a given observation occurring in a given state. In a given state, the sum of the probabilities of all observations in that state is 1. Specifically, it represents the probability of all words occurring in a given state as follows:
[0147]
[0148] Finally, the Viterbi algorithm is used to divide the final AC. n BC n GC n The sequence mapping relationship yields MAP(A,B,G).
[0149] This embodiment, through the above-described scheme, specifically establishes a seal database and a terminology encoding center based on a preset regional database, business registration database, and company type terminology; based on the seal database and terminology encoding center, it constructs a keyword association center and an image similarity feature comparison center; and through the keyword association center and the image similarity feature comparison center, it obtains the seal text content logical processing center. This achieves the acquisition of the seal text content logical processing center, solves the problem of high text recognition error rate in images during seal generation, and improves the efficiency and accuracy of seal generation.
[0150] Reference Figure 6 , Figure 6 This is a flowchart illustrating another exemplary embodiment of the seal generation method of the present invention.
[0151] Based on the above Figure 2 In the embodiment shown, step S04, which involves generating an initial seal image based on the seal area and its coordinates using a preset seal text content logical processing center, includes:
[0152] Step S051: Based on the coordinate position of the seal area, obtain the text content of the seal area using a text recognition algorithm;
[0153] Step S052: The text content of the seal area is identified through the seal database and the word encoding center to obtain the identification result;
[0154] Step S053: Based on the recognition result, obtain the initial seal text content;
[0155] Step S054: The initial seal text content is cropped, denoised, and corrected to generate an initial seal image.
[0156] Specifically, the following steps are taken to obtain the initial seal image:
[0157] First, a text recognition algorithm is used to obtain the text content of the seal area by acquiring the coordinates of the seal area. At the same time, the number of characters and the length of the seal text content are also obtained. The purpose of obtaining these is to facilitate the cropping algorithm to calculate and crop the seal image later.
[0158] Then, the seal text content is identified through the seal database and the word coding center to obtain the identification result. The identification result is used to determine whether the current text content needs to be processed before it can be used as the initial seal text content for output.
[0159] Then, based on the recognition results, the initial text content of the seal is obtained;
[0160] Finally, the obtained initial seal text content is cropped using the OpenCV cropping algorithm. Noise reduction is performed on the outer and inner circles of the circular and elliptical seals. The image shape is unfolded into a matrix, and the text within the seal is corrected to generate the initial seal image, with an image size of 60*120. The size of the initial seal image should be adjusted according to the actual business requirements.
[0161] This embodiment, through the above-described scheme, specifically obtains the text content of the seal area using a text recognition algorithm based on the coordinate position of the seal area; identifies the text content of the seal area using the seal database and a dictionary encoding center to obtain the recognition result; obtains the initial seal text content based on the recognition result; and performs cropping, noise reduction, and correction on the initial seal text content to generate an initial seal image. This achieves the generation of an initial seal image, solves the problem of inaccurate seal recognition results during seal generation, and improves the efficiency of seal generation.
[0162] Reference Figure 7 , Figure 7 This is a schematic diagram illustrating the process of obtaining the initial seal text content in the seal generation method of the present invention.
[0163] Based on the above Figure 6 In the embodiment shown, step S053, which involves obtaining the initial seal text content based on the recognition result, includes:
[0164] Step S0531: If the recognition result is consistent, then output the text content of the seal area;
[0165] Step S0532: If the recognition result is inconsistent, the text content of the seal area is input into the seal text content logic processing center for processing to obtain the initial seal text content.
[0166] Specifically, to obtain the initial text content of the seal, the following steps are performed:
[0167] First, based on the recognition results obtained from the seal database and the word coding center, it can be determined whether the current seal text content is consistent with the content in the business database. The business database exists in the seal database and is constructed in advance.
[0168] Then, when the recognition result shows that the text content is consistent with the content in the business database, it is considered that the current text content meets the output standard, and the current text content is output as the initial seal text.
[0169] Finally, when the recognition result shows that the text content is inconsistent with the content in the business database, the current text content is input into the pre-built seal text content logical processing center for segmentation. After processing, the processed text content is output as the initial seal text.
[0170] This embodiment, through the above-described scheme, specifically outputs the text content of the seal area if the recognition results are consistent; if the recognition results are inconsistent, the text content of the seal area is input into the seal text content logic processing center for processing to obtain the initial seal text content. Thus, the initial seal text is processed, solving the problem of errors after seal recognition and improving the accuracy of seal generation.
[0171] Reference Figure 8 , Figure 8 This is a schematic diagram illustrating the process of the seal generation method of the present invention, which involves processing through a logical processing center for the text content of the seal.
[0172] Based on the above Figure 7 In the embodiment shown, step S0532, if the recognition result is inconsistent, involves inputting the text content of the seal area into the seal text content logic processing center for processing to obtain the initial seal text content.
[0173] Step S05321: Preprocess the text content of the seal area to obtain the preprocessed text content;
[0174] Step S05322: Divide the preprocessed text content into segments based on the number of characters in the text content to obtain the first segmentation result;
[0175] Step S05323: Based on the first segmentation result, match the keyword association center to obtain the matching result;
[0176] Step S05324: The preprocessed text content is segmented according to the matching result to obtain the second segmentation result;
[0177] Step S05325: Obtain the initial seal text content based on the second segmentation result.
[0178] Specifically, in order to process the acquired text content, the following steps are taken:
[0179] First, the text content within the stamp area is preprocessed. The preprocessing process includes, but is not limited to, removing special symbol formats from the stamp text content, such as -, ~, , @, #, _, etc.
[0180] Then, based on the number of characters in the text content, the preprocessed text content is divided into segments to obtain the first segmentation result. In this embodiment, the text content is divided into a first segment, a middle segment, and a last segment, with the number of segments being ≤3. The text content is divided into 3 segments according to the standard method. The number of other segments is the same as the 3-segment division method.
[0181] Then, based on the obtained segmentation results, the preceding content in the first segment is matched using regular expression matching to check whether the divided content contains province, city, county, district, or town. If it does, the containing content is re-segmented to form a new preceding content L. font Length is AreaFont len If not found, the keyword association center's thesaurus is used for NLP understanding and matching to find the preceding content with a weight closest to 1. The following content in the first segment is then matched to see if it contains the company type thesaurus. If it does, the contained content is re-segmented to form new following content R. font , length is CompanyFont len If it does not exist, then do not segment it. Based on the segmentation results of the preceding and following segments, segment the middle section to form a new middle section C. font Length is BusFont len In this embodiment, the segmentation logic formula used is: BusFont len =SealFont total -(AreaFont len +Companylen ).
[0182] Finally, the result after the second segment is output as the initial seal text content.
[0183] This embodiment, through the above-described scheme, specifically involves preprocessing the text content of the seal area to obtain preprocessed text content; dividing the preprocessed text content into segments based on the number of characters to obtain a first segmentation result; matching the first segmentation result using the keyword association center to obtain a matching result; further segmenting the preprocessed text content based on the matching result to obtain a second segmentation result; and finally, obtaining the initial seal text content based on the second segmentation result. This achieves segmentation and matching of the initial seal text, solving the problem of low accuracy in seal text content recognition and improving the efficiency of seal generation.
[0184] Reference Figure 9 , Figure 9 This is a flowchart illustrating another exemplary embodiment of the seal generation method of the present invention.
[0185] Based on the above Figure 2 In the aforementioned embodiment, step S06, which involves obtaining the final seal image based on the initial seal image through similarity sequence calculation, includes:
[0186] Step S061: Based on the initial seal image, perform similarity calculation on the second segmentation result through the keyword association center to obtain the similarity result;
[0187] Step S062: Sort the similarity results to obtain the sorting results;
[0188] Step S063: Based on the sorting result, perform segmented content comparison on the processed text content to obtain the comparison result;
[0189] Step S064: Based on the comparison results, obtain the final seal text content;
[0190] Step S065: Generate the final seal image based on the final seal text content.
[0191] Specifically, the following steps are taken to obtain the final seal image:
[0192] First, based on the initial seal image, regular expression matching is used to compare the segmented content of the front, middle, and rear sections with the MAP(A,B,G) keyword search, and the results are sorted according to the similarity. The sorting scheme is shown below, with the front section L... font The sequence is L poc Lpoc =((L) m1 AC 1001 ),(L m2 AC 1801 ),...,(L mn AC i )), L m1 This represents the similarity of the preceding content in the current segment. The text similarity is calculated using a phonetic-graphic code algorithm, which mainly separates the text into phonetic and graphic codes for calculation. The formula for calculating the phonetic-graphic code is:
[0193]
[0194] In this system, P represents the similarity of the phonetic code, and S represents the similarity of the shape code; each accounts for 50% of the total word similarity. Additionally, AC... i This can be represented as the preceding content of the corresponding keyword association center, which is implemented here using an encoding method, based on L poc L of the sequence m1 Similarity values are sorted in descending order; similarly, C in the following... poc and R poc Implement using the same method, middle section C font The sequence is C poc C poc =((C m1 ,BC 2011 ),(C m2 ,BC 3411 ),...,(C mn ,BC i )), the latter part R font The sequence is R poc R poc =((R) m1 GC 1040 ),(R m1 GC 1050 ),...,(R mn GC i ));
[0195] Then, take L respectively poc C poc R poc The most similar sequences are listed first, such as L. poc L m1 For the corresponding similarity coefficient, through L m1 AC can be found 1001 AC 1001 The mapped content is the actual front-end content. Similarly, C poc C m1 and R poc R m1The algorithm strategies are the same, and the only difference is C poc of C m1 The corresponding BC 2011 For the content, the actual code needs to be retrieved. The area code content before the dash is retrieved and then compared with the actual content of AC 1001 If they are exactly the same, it means the similarity is completely correct. If the content of BC 2011 and AC 1001 is inconsistent, then the weight coefficient needs to be calculated for the content segmented in the front and middle sections and the number of words replaced in the similarity sequence;
[0196] Finally, according to the comparison result, the final seal text content is obtained and the final seal image is generated.
[0197] Furthermore, an example of calculating the weight coefficient for the content segmented in the front and middle sections and the number of words replaced in the similarity sequence is as follows:
[0198] First, assume that the content of C f1 is: "Luoluo County Hongyuan Huahui Electronics Co., Ltd.", where the length of the number of characters, SealFont total = 13;
[0199] Then, calculate the weight ratio of the correct content in the front section. For example, the content of L font is "Luoluo County". After similarity association comparison, the system finds that the character "Luoluo" should be "Bo". The actual length of L font , AreaFont len = 3, then the weight ratio of the correct content of L font is L weight = 0.15 = 2 / 13. Among them, the calculation formula of L w is:
[0200] Then, calculate the weight ratio of the correct content in the middle section. For example, the content of C font is "Hongyuan Huahui Electronics". After similarity association comparison, the system finds that the character "yuan" should be "yuan". The actual length of C font is BusFont len = 6, then the weight ratio of the correct content of C font is C weight = 0.39 = 5 / 13. Among them, the calculation formula of C w is:
[0201] Then, calculate the weight ratio of the correct content in the back section. For example, the content of R font is "Limited Sub-Company". After similarity association comparison, the system finds that the character "Sub" should be "Company". R fontThe actual length is CompanyFont len =4, then R font The correct content has a weighting of R. weight =0.23=3 / 13, where, R w The calculation formula is:
[0202] Then, combining the formula for calculating the weight of the number of characters in the front, middle, and back sections, the accuracy percentage of the seal text can be calculated, where the accuracy percentage is SealCorrect. total Its calculation formula is SealCorrect total =L weight +C weight +R weight ;
[0203] Then, according to SealCorrect total The calculation formula shows that the accuracy rate of the seal text is 0.77. Assuming the optimal word segmentation threshold is Score, where Score = 0.7, since the threshold of 0.77 is greater than Score, it can be determined that the similarity association of the content before, during and after the middle section has passed the verification.
[0204] Finally, the identified seal text reads "Boluo County Hongyuan Huahui Electronics Co., Ltd." A new image M is generated with a size of 60*120. The image size should be adjusted according to actual business needs.
[0205] More specifically, such as Figure 10 As shown, Figure 10 This is a schematic diagram illustrating the generation of the final seal image in the seal generation method of the present invention.
[0206] First, the real business data, i.e., the image containing the seal, is used to identify the seal area and obtain the seal text.
[0207] Then, the seal text is input into the seal text content logic processing center for processing, resulting in the initial seal text and the segmented front, middle and back sections.
[0208] Then, the content of the first, middle and last sections are compared using the keyword association center to obtain the final seal text content;
[0209] Finally, the actual seal content, i.e. the final seal content, is obtained by comparing the image feature similarity with the center.
[0210] This embodiment, through the above-described scheme, specifically involves calculating the similarity of the second segmentation results based on the initial seal image using the keyword association center, obtaining a similarity result; sorting the similarity results to obtain a sorting result; comparing the processed text content segment by segment based on the sorting result to obtain a comparison result; obtaining the final seal text content based on the comparison result; and generating the final seal image based on the final seal text content. This achieves the generation of the final seal image, solves the problem of low seal generation accuracy, and improves the efficiency of seal generation.
[0211] Reference Figure 11 , Figure 11 A flowchart illustrating another exemplary embodiment of the seal generation method of the present invention.
[0212] Based on the above Figure 2 In the embodiment shown, after step S06, which involves obtaining the final seal image based on the initial seal image through similarity sequence calculation, the method further includes:
[0213] Step S07: Calculate the similarity between the initial seal image and the final seal image to obtain a similarity value;
[0214] Step S08: Based on the similarity values, perform a comparison analysis using a preset threshold;
[0215] Step S09: If the similarity value is above the threshold, the analysis result is that the content of the seal is correct.
[0216] Specifically, to further verify the generated seal, the following steps are taken:
[0217] First, based on the initial and final seal images, the SSIM similarity algorithm is used to compare the brightness, contrast, structure and other features of the two images to obtain the feature similarity value. The features being compared can be added, modified or deleted according to the actual situation.
[0218] Then, the feature similarity values are accumulated and passed through a preset threshold T. s Comparative analysis was performed, among which, T s It can be customized according to the actual usage scenario;
[0219] Finally, if the similarity value is in T s If the above is true, then the current seal content can be considered correct.
[0220] This embodiment, through the above-described scheme, specifically calculates the similarity between the initial seal image and the final seal image to obtain a similarity value; based on the similarity value, a comparison analysis is performed using a preset threshold; if the similarity value is above the threshold, the analysis result indicates that the seal content is correct. Thus, the final seal image is verified, solving the problem of low accuracy due to the lack of corresponding verification measures after seal generation, and improving the accuracy of seal generation.
[0221] Furthermore, embodiments of the present invention also propose a seal generation device, the seal generation device comprising:
[0222] The recognition module is used to recognize a preset seal image and obtain the seal area and the coordinate position of the seal area;
[0223] The generation module is used to generate an initial seal image based on the seal area and the coordinate position of the seal area through a preset seal text content logical processing center.
[0224] The acquisition module is used to obtain the final seal image based on the initial seal image through similarity sequence calculation.
[0225] Furthermore, this embodiment of the invention also proposes a terminal device, which includes a memory, a processor, and a seal generation program stored in the memory and executable on the processor. When the seal generation program is executed by the processor, it implements the steps of the seal generation method described above.
[0226] Since this seal generation program employs all the technical solutions of all the foregoing embodiments when executed by the processor, it has at least all the beneficial effects brought about by all the technical solutions of all the foregoing embodiments, which will not be elaborated here.
[0227] Furthermore, embodiments of the present invention also propose a computer-readable storage medium storing a seal generation program, wherein the seal generation program, when executed by a processor, implements the steps of the seal generation method as described above.
[0228] Since this seal generation program employs all the technical solutions of all the foregoing embodiments when executed by the processor, it has at least all the beneficial effects brought about by all the technical solutions of all the foregoing embodiments, which will not be elaborated here.
[0229] Compared to existing technologies, the seal generation method, apparatus, terminal device, and storage medium proposed in this invention recognize a preset seal image to obtain the seal area and its coordinate position. Based on the seal area and its coordinate position, an initial seal image is generated through a preset seal text content logic processing center. Finally, based on the initial seal image, a final seal image is obtained through similarity sequence calculation. This solves the problem of high text recognition error rate in image generation, achieving high-accuracy seal generation and further verification of the generated seal. Based on this invention, starting from the problem of high text recognition error rate in real-world seal recognition and generation, a seal generation method is designed in conjunction with a seal text content logic processing center. The effectiveness of the seal generation method of this invention has been verified in actual seal generation, and the accuracy and efficiency of seal generation using this method are significantly improved.
[0230] Compared with existing technologies, the solutions of the embodiments of the present invention have the following advantages:
[0231] 1. Compared with existing OCR methods for seal recognition, this method is simpler and more feasible in terms of technical implementation because it uses word segmentation and association to identify the seal content, and then regenerates a new image using the original seal content and the segmented and associated content. The SSIM similarity algorithm is then used to compare the similarity between the two images. This not only makes up for the low accuracy problem of existing seal text recognition technology, such as the difficulty in recognizing blurry characters, incomplete shapes, tilted characters, and characters that are obscured by signatures, which leads to high error rates, but also improves the overall accuracy of seal text recognition.
[0232] 2. Compared with existing technologies that require manual opening of images one by one to view the text content of the seal, this method completes the corresponding instruction operation on the machine entirely through code, without the need for manual review and inspection. Due to human limitations, manual review and inspection can easily lead to errors. Therefore, the method of this patent greatly improves the efficiency of seal recognition and comparison and reduces the error rate of review and inspection.
[0233] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0234] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0235] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the methods of each embodiment of the present invention.
[0236] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for generating a seal, characterized in that, The seal generation method includes the following steps: The preset seal image is identified to obtain the seal area and the coordinate position of the seal area; The steps for generating an initial seal image based on the seal area and its coordinates, using a preset seal text content logical processing center, include: Based on the coordinates of the seal area, the text content of the seal area is obtained through a text recognition algorithm; The text content of the seal area is identified using a seal database and a dictionary encoding center to obtain the identification result; Based on the recognition result, the initial seal text content is obtained, including: if the recognition result is inconsistent, the text content of the seal area is input into the seal text content logic processing center for processing to obtain the initial seal text content; The initial seal text content is cropped, denoised, and corrected to generate an initial seal image; The logical processing center for the seal text content is obtained from a keyword association center and a graphic similarity feature comparison center. The graphic similarity feature comparison center is constructed based on a method of adding post-verification to the seal text content associated with word segmentation and segmentation. The construction method of the keyword association center includes: Design the annotation boundary range for word segmentation; Based on the annotation boundary range of the word segmentation, the probability distribution of the initial state of MAP, the state transition probability matrix of MAP, and the emission probability matrix of MAP are calculated. The MAP represents the mapping relationship in the keyword association center mapping table. The keyword association center is constructed based on the probability distribution of the initial state of the MAP, the state transition probability matrix of the MAP, and the emission probability matrix of the MAP. Based on the initial seal image, the final seal image is obtained through similarity sequence calculation.
2. The seal generation method according to claim 1, characterized in that, Before the step of generating an initial seal image based on the seal area and its coordinate position through a preset seal text content logic processing center, the method further includes: Based on the preset regional database, business registration database, and company type thesaurus, the seal database and the thesaurus coding center are established; Based on the seal database and the word encoding center, a keyword association center and a graphic similarity feature comparison center are constructed. The logical processing center for the text content of the seal is obtained through the keyword association center and the graphic similarity feature comparison center.
3. The seal generation method according to claim 1, characterized in that, The step of obtaining the initial seal text content based on the recognition result further includes: If the recognition results are consistent, the text content of the seal area is output as the initial seal text content.
4. The seal generation method according to claim 3, characterized in that, If the recognition result is inconsistent, the step of inputting the text content of the seal area into the seal text content logic processing center for processing to obtain the initial seal text content includes: The text content in the seal area is preprocessed to obtain the preprocessed text content. Based on the number of characters in the text content, the preprocessed text content is divided into segments to obtain the first segmentation result; Based on the first segmentation result, a matching result is obtained by matching through the keyword association center; The preprocessed text content is segmented based on the matching results to obtain a second segmentation result. Based on the results of the second segment, the initial seal text content is obtained.
5. The seal generation method according to claim 4, characterized in that, The step of obtaining the final seal image based on the initial seal image through similarity sequence calculation includes: Based on the initial seal image, the similarity of the second segmentation result is calculated using the keyword association center to obtain the similarity result; The similarity results are sorted to obtain the sorting results; Based on the sorting results, the processed text content is segmented and compared to obtain the comparison results. Based on the comparison results, the final seal text content is obtained; Based on the final seal text content, generate the final seal image.
6. The seal generation method according to claim 1, characterized in that, The step of obtaining the final seal image based on the initial seal image through similarity sequence calculation further includes: The initial seal image and the final seal image are used to calculate the similarity value; Based on the similarity values, a comparison analysis is performed using a preset threshold. If the similarity value is above the threshold, the analysis result indicates that the seal content is correct.
7. A seal generating device, characterized in that, The seal generating device includes: The recognition module is used to recognize a preset seal image and obtain the seal area and the coordinate position of the seal area; The generation module is used to generate an initial seal image based on the seal area and the coordinate position of the seal area through a preset seal text content logical processing center. The generation module is further configured to obtain the text content of the seal area based on the coordinate position of the seal area using a text recognition algorithm; to recognize the text content of the seal area using a seal database and a word encoding center to obtain a recognition result; and to obtain initial seal text content based on the recognition result, including: if the recognition result is inconsistent, inputting the text content of the seal area into the seal text content logic processing center for processing to obtain initial seal text content; and to crop, reduce noise, and correct the initial seal text content to generate an initial seal image; the seal text content logic processing center is obtained by a keyword association center and a graphic similarity feature comparison center, and the graphic similarity feature comparison center is constructed based on adding post-verification to the seal text content associated with word segmentation and segmentation; The generation module is also used to design the annotation boundary range of word segmentation; calculate the probability distribution of the initial state of MAP, the state transition probability matrix of MAP, and the emission probability matrix of MAP based on the annotation boundary range of word segmentation, wherein MAP represents the mapping relationship in the keyword association center mapping table; and construct the keyword association center based on the probability distribution of the initial state of MAP, the state transition probability matrix of MAP, and the emission probability matrix of MAP. The acquisition module is used to obtain the final seal image based on the initial seal image through similarity sequence calculation.
8. A terminal device, characterized in that, The terminal device includes a memory, a processor, and a seal generation program stored in the memory and executable on the processor. When the seal generation program is executed by the processor, it implements the steps of the seal generation method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a seal generation program, which, when executed by a processor, implements the steps of the seal generation method as described in any one of claims 1-6.
Citation Information
Patent Citations
Stamp recognition method, device and equipment based on artificial intelligence and storage medium
CN112037077A
Seal image generation method and device, equipment and storage medium
CN115841531A