A seal content recognition method, system, device and computer storage medium

CN122821568APending Publication Date: 2026-09-25XINTU (JIAXING) DIGITAL TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202610792589.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-03
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0003]本申请的目的是针对印章识别方法在背景干扰与复杂的印章形态下,难以兼顾内容识别准确性和识别效率的问题;提出了一种印章内容识别方法、系统、设备及计算机存储介质,通过提取反映印章内容缺失程度的完整性表征和多模态特征,将多维度匹配与动态阈值结合,提升了印章内容识别精度和效率

Benefits of technology

1、通过引入反映印章内容缺失程度的完整性表征,使系统能够定量感知印章的缺损状况,为后续匹配提供了场景感知能力,克服了能检测元素却无法评估内容完整性程度从而导致识别内容缺失的局限;将完整性表征作为反馈控制信号自适应调整后续多维特征匹配的判定阈值,使得内容缺失的退化样本能够获得更宽松的容错匹配空间,在印章完整或轻微缺损时保持较高门限以确保精度、抑制背景干扰引起的误匹配,从而在各类退化条件下自适应地平衡了召回率与精确率;同时,利用多模态特征进行多维特征匹配,充分利用了印章的结构化信息,有效缓解了颜色退化、印油扩散等带来的字符粘连与背景干扰问题,增强了在复杂印章形态下的抗干扰能力,实现了更精准的印章内容识别;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122821568A_ABST
    Figure CN122821568A_ABST
Patent Text Reader

Abstract

The application discloses a seal content recognition method, system, device and computer storage medium, relates to the technical field of seal content recognition, and comprises the following steps: obtaining the integrity representation of a to-be-recognized seal image based on image degradation detection and seal ink diffusion compensation, wherein the integrity representation reflects the content loss degree of the seal; extracting multi-modal features after geometric correction of the image compensated by the seal ink diffusion; adjusting the determination threshold of the multi-dimensional feature matching mechanism based on the integrity representation to obtain a target threshold; performing multi-dimensional feature matching on a candidate seal image based on the multi-modal features, and outputting a seal content recognition result according to the target threshold. The application adaptively adjusts the matching determination threshold based on the integrity representation reflecting the content loss degree of the seal, provides a fault-tolerant matching space for degraded samples, avoids misrecognition or rejection, and performs hierarchical cascading screening by using multi-modal features, so that the recognition efficiency and accuracy are considered, and efficient and accurate recognition is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of seal content recognition technology, specifically a seal content recognition method, system, device, and computer storage medium. Background Technology

[0002] Conventional methods for recognizing seal content employ a three-step approach: detection, correction, and recognition, supplemented by strategies such as color segmentation, polar coordinate transformation, Bézier curves, and post-processing with edit distance. While traditional OCR (Optical Character Recognition) technology performs excellently in regular text recognition, it faces various challenges due to the unique characteristics of seals (such as irregular shapes and background interference). Seal images commonly exhibit issues like curved layout, color degradation, background overlap, and mixed categories. In real-world production environments, existing technologies still reveal the following shortcomings: First, when faced with degradation phenomena such as "broken lines" or "hollowed-out" seal content caused by insufficient ink or uneven pressure, related recognition algorithms often fail to accurately assess the completeness of the content during the content detection and text correction stages, resulting in missing content. For example, although patent CN119179798A can detect three types of elements—seals, text, and special markings—it cannot assess the completeness of the seal content. Secondly, traditional polar coordinate transformation assumes the seal is a perfect circle, making it difficult to handle pixel stretching caused by perspective distortion and uneven pressure. Furthermore, single-curve fitting is prone to boundary drift, leading to geometric correction distortion. Finally, traditional HSV color segmentation easily fails when the ink fades or the background overlaps, and ink diffusion can cause characters to stick together, increasing the difficulty of recognition. This not only fails to ensure recognition accuracy but also struggles to maintain recognition efficiency. Therefore, there is an urgent need for a new generation of seal recognition framework that is geometrically interpretable, possesses strong anti-interference capabilities, and is suitable for high-concurrency recognition scenarios. Summary of the Invention

[0003] The purpose of this application is to address the problem that seal recognition methods struggle to balance accuracy and efficiency in the face of background interference and complex seal shapes. A seal content recognition method, system, device, and computer storage medium are proposed. By extracting integrity representations and multimodal features that reflect the degree of missing seal content, and combining multidimensional matching with dynamic thresholds, the accuracy and efficiency of seal content recognition are improved.

[0004] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows: In a first aspect, embodiments of this application provide a method for recognizing seal content, the method comprising: The integrity characterization of the seal image to be identified is obtained based on image degradation detection and ink diffusion compensation, and the integrity characterization reflects the degree of missing seal content. After geometric correction of the ink diffusion compensated image, multimodal features are extracted. The judgment threshold of the multidimensional feature matching mechanism is adjusted based on the integrity characterization to obtain the target threshold. Multidimensional feature matching is performed on the candidate seal image based on the multimodal features, and the seal content recognition result is output according to the target threshold.

[0005] In this solution, by extracting integrity representations that reflect the degree of missing content in the seal and fusing them with multimodal features, the determination threshold for multidimensional feature matching is dynamically adjusted using integrity representations. This allows the recognition decision to adapt to the seal's damage status, avoiding the problem of false rejection of severely damaged seals or false matching of complete seals using fixed thresholds. Based on this, multimodal features are combined for matching and recognition, which enhances robustness to background interference and complex shapes, thus balancing the accuracy and efficiency of content recognition in real production environments.

[0006] Optionally, the step of obtaining the integrity characterization of the seal image to be identified based on image degradation detection and ink diffusion compensation, wherein the integrity characterization reflects the degree of missing seal content, includes: performing color degradation detection on the seal image to be identified to determine the image degradation type; selecting a corresponding color enhancement strategy based on the image degradation type to perform color enhancement and seal region separation on the seal image to be identified, thereby obtaining an initial seal image; performing ink diffusion compensation on the initial seal image based on morphological erosion operations to obtain a compensated seal image; and performing multi-element collaborative detection on the compensated seal image to obtain a quantitative score reflecting the degree of missing seal content.

[0007] Optionally, the step of performing multi-element collaborative detection on the compensated seal image to obtain a quantitative score reflecting the degree of missing seal content includes: evaluating the seal outline integrity, text continuity, and key area integrity of the compensated seal image; and obtaining the quantitative score reflecting the degree of missing seal content by weighted fusion of the seal outline integrity score, text continuity score, and key area integrity score.

[0008] Optionally, the step of extracting multimodal features after geometric correction of the ink diffusion compensation image includes: filtering the rotation rectangle of the compensation stamp image, cropping and rotating the compensation stamp image according to the rotation rectangle; identifying the stamp shape, and performing geometric correction on the cropped and rotated stamp image according to the stamp shape; repairing content loss in the geometrically corrected stamp image based on the quantitative score; if the quantitative score is less than a preset threshold, using stamp symmetry and prior knowledge completion strategies to complete the missing areas of the stamp image to obtain a repaired stamp image; extracting visual and textual semantic features from the repaired stamp image using a deep learning network, and fusing the visual features and textual semantic features into a unified modal feature vector based on an attention mechanism to obtain the multimodal features.

[0009] Optionally, the step of identifying the seal shape and performing geometric correction on the cropped and rotated seal image based on the seal shape includes: identifying the shape of the seal image to be identified, including circles, ellipses, squares, or rhombuses; and using a flexible correction strategy to perform geometric correction on the cropped and rotated seal image based on the identified shape, wherein a polar coordinate transformation based on curve fitting is used for circles or ellipses, and a perspective transformation is used for squares or rhombuses.

[0010] Optionally, adjusting the judgment threshold of the multidimensional feature matching mechanism based on the integrity representation to obtain the target threshold includes: determining the threshold adjustment coefficient based on the quantization score; and calculating the target threshold by comprehensively considering the quantization score, the threshold adjustment coefficient, and the basic threshold.

[0011] Optionally, the step of performing multi-dimensional feature matching on candidate seal images based on the multimodal features and outputting seal content recognition results according to the target threshold includes: searching a standard seal feature library based on the visual features to determine first candidate seal features; performing a dimensional feature comparison on the first candidate seal features based on the multimodal features and determining second candidate seal features based on feature similarity; extracting the text semantic features of the second candidate seal features and performing consistency verification with the text semantic features of the seal to be recognized to determine third candidate seal features and their corresponding consistency scores; comparing the consistency scores with the target threshold, and if the consistency scores are greater than or equal to the target threshold, then using the third candidate seal features as the seal content recognition result of the seal image to be recognized.

[0012] Secondly, embodiments of this application provide a seal content recognition system, including: The feature acquisition module is used to obtain the integrity representation of the seal image to be identified based on image degradation detection and ink diffusion compensation, wherein the integrity representation reflects the degree of missing seal content; after geometric correction of the ink diffusion compensated image, multimodal features are extracted; the threshold acquisition module is used to adjust the judgment threshold of the multidimensional feature matching mechanism based on the integrity representation to obtain the target threshold; the seal recognition module is used to perform multidimensional feature matching on the candidate seal image based on the multimodal features, and output the seal content recognition result according to the target threshold.

[0013] Thirdly, embodiments of this application provide a computer device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store computer programs; and the processor is used to implement the steps of the method described in the first aspect above when executing the program stored in the memory.

[0014] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described in the first aspect above.

[0015] The beneficial effects of this application are: 1. By introducing an integrity representation that reflects the degree of missing content in the seal, the system can quantitatively perceive the seal's damage status, providing scene awareness for subsequent matching. This overcomes the limitation of being able to detect elements but not assess the degree of content integrity, thus leading to the identification of missing content. The integrity representation is used as a feedback control signal to adaptively adjust the judgment threshold of subsequent multi-dimensional feature matching, allowing degraded samples with missing content to obtain a more lenient fault-tolerant matching space. A high threshold is maintained when the seal is complete or slightly damaged to ensure accuracy and suppress false matching caused by background interference. Thus, recall and precision are adaptively balanced under various degradation conditions. At the same time, multi-modal features are used for multi-dimensional feature matching, making full use of the structured information of the seal. This effectively alleviates the problems of character adhesion and background interference caused by color degradation and ink diffusion, enhances the anti-interference ability under complex seal shapes, and achieves more accurate seal content recognition. 2. By combining a multi-dimensional feature matching mechanism with a dynamic threshold, the recognition process does not require repeated complex geometric corrections and binarization optimizations of the image. It can directly use pre-extracted features for rapid comparison and verification, which significantly improves the processing efficiency in high-concurrency scenarios. Ultimately, it achieves both accuracy and efficiency in seal content recognition in real production environments. Attached Figure Description

[0016] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings. The drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings.

[0017] Figure 1 A flowchart of a seal content recognition method provided in this application embodiment.

[0018] Figure 2 This is a schematic diagram of a seal content recognition system module provided in an embodiment of this application.

[0019] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description of this application is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely one preferred embodiment of this application and are only used to explain this application. They do not limit the scope of protection of this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] Example 1: As Figure 1 As shown, a method for recognizing the content of a seal includes steps S1-S4, wherein: S1. Obtain the integrity characterization of the seal image to be identified based on image degradation detection and ink diffusion compensation, wherein the integrity characterization reflects the degree of missing content of the seal.

[0022] In an optional embodiment, step S1 includes: Perform color degradation detection on the image of the seal to be identified to determine the type of image degradation; Based on the image degradation type, select the corresponding color enhancement strategy to perform color enhancement and seal region separation on the seal image to be identified, and obtain the initial seal image; After performing ink diffusion compensation on the initial stamp image based on morphological erosion operation, a compensated stamp image is obtained. Multi-element collaborative detection is performed on the compensated seal image to obtain a quantitative score reflecting the degree of missing seal content.

[0023] Specifically, integrity representation is an indicator used to quantitatively assess the current state of quality degradation of a seal image, its core being to reflect the degree of missing content. In actual business scenarios, due to factors such as insufficient ink volume, uneven stamping pressure, and differences in the hardness of the backing material, seal images often exhibit missing phenomena such as broken lines, hollowed-out areas, or half-characters. This embodiment extracts integrity representation to transform this ambiguous visual deficiency into a calculable quantitative feedback signal. It should be understood that the specific form of integrity representation is not limited to numerical scoring; it can also be discrete level labels, such as severe deficiency, moderate deficiency, slight deficiency, or probability distribution vectors, as long as it can objectively reflect the severity of content loss. Multimodal features refer to the information expression of at least two different modalities extracted from the same seal image. Relying solely on visual features can easily lead to confusion when encountering similar seals with highly similar visual appearances but different text content, while relying solely on text features is also difficult to distinguish when encountering seals with different layouts but the same text. Multimodal features complement each other, with visual features capturing the overall structure and layout patterns, and semantic features capturing the inherent meaning and text entities. The two corroborate each other, thereby significantly improving the discriminativeness and robustness of feature expression.

[0024] In some embodiments, due to factors such as scanner offset, ink aging, or paper light transmission, the color of the stamp image often degrades during acquisition and transfer. Therefore, the color space distribution of the image is analyzed first to identify the specific degradation type. Furthermore, to avoid the negative effects of a single enhancement algorithm under different degradation scenarios, color enhancement needs to be performed on the image according to the degradation type. If the degradation type is fading, the system selects a contrast stretching strategy to amplify the grayscale difference between the stamp strokes and the background, making the originally blurred strokes stand out. If the degradation type is channel crosstalk, the system selects a color balance correction strategy to correct the offset color channels and restore the original red or blue features of the stamp. After completing targeted color enhancement, stamp region separation is further performed to separate the enhanced stamp foreground from background elements such as table lines, printed text, and handwritten text. This is because background interference such as table lines easily adheres to the stamp strokes. If not separated, subsequent detection is prone to mistaking table lines crossing the stamp as part of the strokes, thus seriously interfering with the accuracy of integrity assessment. Therefore, semantic segmentation and other separation methods are used to remove background interference and obtain the initial stamp image.

[0025] Furthermore, morphological erosion is employed for microscopic compensation. The core of morphological erosion lies in shrinking stroke boundaries. This is achieved by sliding structural elements across the image, retaining only the areas completely covered by the structural elements, thus shrinking the widened stroke edges inward. This shrinkage operation effectively strips away the edges of the diffused ink, restoring the original slender shape and continuity of the strokes. It also reveals breaks and gaps previously obscured by the diffused ink, providing a realistic morphological basis for subsequent accurate detection. Finally, the system outputs a compensated stamp image with realistic morphological restoration.

[0026] Furthermore, considering that the loss of seal content is often not a single-dimensional issue, but rather a combination of missing elements such as outlines, text, and special markings, collaborative detection can not only locate the position of each element but also output a quantitative score reflecting the state of each element's loss. This quantitative score, as a concrete numerical representation of integrity, objectively reflects the severity of content loss in the current seal image. For example, the quantitative score can be set to a range of 0 to 100, with lower scores indicating more severe content loss. This embodiment effectively eliminates interference from color degradation, background overlap, and ink diffusion through a triple defense combination of color enhancement, background separation, and morphological erosion. This ensures that the final output quantitative score truly reflects the essential degree of content loss in the seal, providing a solid and reliable control signal for subsequent adaptive threshold adjustment.

[0027] In an optional embodiment, the step of performing multi-element collaborative detection on the compensated stamp image to obtain a quantitative score reflecting the degree of missing stamp content includes: The compensated seal image is evaluated for seal outline integrity, text continuity, and key area integrity. The quantitative score reflecting the degree of missing seal content is obtained by weighted fusion of the seal outline integrity score, text continuity score, and key area integrity score.

[0028] Specifically, the seal outline integrity assessment corresponds to the integrity based on the boundary outline. An edge detection algorithm is used to extract the edge outline that compensates for the width of the seal image. The outline closure is determined based on the ratio of the number of outline endpoints to the maximum allowable number of outline breaks, thereby determining the main outline with the largest pixel area, i.e., the outer outline of the seal. The outline closure is calculated based on the main outline with the largest pixel area. The outline continuity is calculated by the ratio of the actual perimeter of the main outline to the ideal perimeter. The outline closure and outline continuity are weighted and fused to obtain the seal outline integrity score.

[0029] Specifically, text continuity assessment corresponds to the quantification of stroke integrity through text skeleton structure analysis. First, text detection boxes are extracted from the compensated stamp image. Tiny detection boxes with areas smaller than a preset pixel threshold are filtered out to eliminate noise. Then, overlapping text boxes are merged to obtain masks for all valid text regions. Based on the masks of valid text regions, a single-pixel-width text skeleton is extracted to obtain a skeleton image. The degree of stroke breakage is calculated based on the number of endpoints and intersections in the skeleton image, expressed as: Stroke breakage degree = 1 - (Actual number of endpoints - Theoretical number of endpoints) / Maximum allowed number of additional endpoints. The maximum allowed number of additional endpoints is preset based on the text region area, such as allowing 2 additional endpoints per 1000 pixels. Text connectivity is calculated based on the number of connected components within each text region, expressed as: Text connectivity = 1 - (Actual number of connected components - Theoretical number of connected components) / Maximum allowed number of additional connected components. The stroke breakage degree and text connectivity are weighted and fused to obtain a text continuity score.

[0030] Specifically, the critical region integrity assessment corresponds to the quantification of the completeness of core information through critical region localization and pixel density analysis. By identifying critical regions in the compensated stamp image, such as the central region (coding area) and lower semicircular region (name area) for circular / elliptical stamps, and the upper region (name area) and central region (coding area) for square / diamond stamps, the critical regions are calculated. The critical region pixel density is calculated based on the ratio of foreground pixels within the critical region to the total number of pixels in the critical region. The critical region missing rate is calculated based on the ratio of the critical region pixel density to the average pixel density of the critical regions of the stamp. Finally, the comprehensive critical region score is calculated as 1 - the critical region missing rate.

[0031] Furthermore, in the weighting of the seal outline integrity score, text continuity score, and key area integrity score, the integrity of the key area directly determines the legal validity of the seal, so it has the highest weight; the integrity of the text strokes affects the recognition accuracy, so it has the second highest weight; and the outline integrity mainly affects the overall validity of the seal, so it has the lowest weight.

[0032] In this embodiment, a quantitative score is obtained by comprehensively evaluating and weighting the three dimensions of seal outline integrity, text continuity, and key area integrity. This score can comprehensively reflect the degree of missing content of the seal from multiple levels and more accurately depict the impact of degradation phenomena such as insufficient ink and uneven pressure than a single indicator. This refined integrity characterization provides a more reliable quantitative basis for the adaptive adjustment of subsequent judgment thresholds and helps to improve the ability to identify and distinguish seals with different degrees of defects. S2. After geometric correction of the image with ink diffusion compensation, extract multimodal features.

[0033] In an optional embodiment, step S2 includes: Filter the rotating rectangle of the compensation stamp image, and crop and rotate the compensation stamp image according to the rotating rectangle; Identify the shape of the seal and perform geometric correction on the cropped and rotated seal image based on the seal shape; Based on the quantitative score, the geometrically corrected seal image is repaired for missing content. If the quantitative score is less than a preset threshold, the missing areas of the seal image are filled in using seal symmetry and prior knowledge completion strategies to obtain the repaired seal image. The visual and textual semantic features of the repaired seal image are extracted using a deep learning network, and the visual and textual semantic features are fused into a unified modality feature vector based on an attention mechanism to obtain the multimodal features.

[0034] Specifically, after cropping, rotation correction, and geometric correction, the physical posture of the seal image has been restored, but substantial content loss still exists. Therefore, a conditional triggering mechanism based on quantization scoring is introduced. Minor defects, such as a quantization score greater than or equal to a preset threshold, often manifest as slight breaks in individual strokes. These breaks can be tolerated by the robustness of the feature network in subsequent feature extraction stages and do not affect global feature matching. Conversely, if minor defects are forcibly repaired, the repair algorithm is prone to introducing false features that were not originally present, such as mistakenly adding blemishes as strokes or adding characters that were not originally present. Once these false features enter the feature library, they will lead to more serious misidentification. Therefore, the repair process is only triggered when the quantization score is less than the preset threshold, i.e., when the content loss reaches a severe level (such as missing half-characters or large areas of hollowing out).

[0035] Specifically, strategies based on seal symmetry and prior knowledge can be employed to complete the missing half of the text. For example, for a circular seal, the system utilizes its centrally symmetrical geometric prior to mirror and flip the remaining half of the text along the central axis, thereby completing the missing half. For coded areas, prior knowledge of seal coding rules, such as the fixed length and arrangement of administrative division codes, is used to logically deduce and complete the incomplete numbers.

[0036] Furthermore, features from both modalities are extracted separately using deep learning networks. Visual features are extracted using a convolutional neural network, while textual semantic features are extracted using a semantic model. Since simply concatenating the two features cannot resolve the modal conflict problem, potentially leading to feature vector tearing in space, this embodiment employs an attention mechanism for fusion. By dynamically calculating attention weights, the mechanism adaptively determines which modal feature should dominate during the fusion process. For example, when the seal's appearance is clear but the text is blurry, the attention mechanism automatically increases the weight of visual features to stabilize the structural anchor point; when the seal's appearance is deformed due to degradation but the core text is still discernible, the attention mechanism automatically increases the weight of semantic features to provide identity verification. Through this dynamic weighting, the attention mechanism effectively eliminates conflicts and redundancy between modalities, fusing them into a unified modal feature vector with stronger representational capabilities.

[0037] In this embodiment, during the extraction of multimodal features, a rotating rectangle is used for cropping and rotation correction to eliminate directional deviations. Then, differential geometric correction is performed based on the identified seal shape, avoiding the shortcomings of traditional polar coordinate transformations that assume perfect circles and cannot adapt to perspective distortion and pixel stretching. When the missing content of the quantitative scoring indication is small, the missing area is filled in using seal symmetry and prior knowledge, repairing breaks and hollows caused by insufficient ink, making the seal image more complete. Finally, features are extracted through a deep learning network, and an attention mechanism is used to fuse visual features and textual semantic features into a unified modal feature vector, enhancing the discriminative ability and anti-interference capability of the features, providing strong support for accurate matching and recognition. Conditional triggering repair avoids false feature contamination, and attention fusion eliminates modal conflicts, providing high-quality and consistent multimodal feature input for subsequent cascaded matching.

[0038] In an optional embodiment, the step of identifying the seal shape and performing geometric correction on the cropped and rotated seal image based on the seal shape includes: Identify the shape of the seal image to be identified, including shapes such as circles, ovals, squares, or rhombuses; Based on the identified shape, a flexible correction strategy is used to perform geometric correction on the cropped and rotated stamp image. Specifically, for circles or ellipses, a polar coordinate transformation based on curve fitting is used, and for squares or rhombuses, a perspective transformation is used.

[0039] Understandably, related technologies for seal geometry correction generally suffer from a systemic flaw: a "hard assumption of perfect circles." This means they assume all seals are perfect circles and directly use linear polar coordinate transformation to stretch the circle into a rectangle. However, in actual business images, due to uneven stamping pressure, paper deformation, or perspective distortion from the shooting angle, most circular seals appear as ellipses in the image, while square seals appear as trapezoids or parallelograms. If traditional linear polar coordinate transformation is forcibly applied to the ellipse, the pixels along the major axis are overstretched, while those along the minor axis are compressed, resulting in severe vertical or horizontal deformation of the corrected text. The elongated or compressed character strokes significantly increase the false recognition rate of subsequent recognition models. To avoid this flaw, this embodiment introduces a combined mechanism of adaptive shape recognition and flexible correction strategies.

[0040] Specifically, the polygon approximation error and ellipse fitting residual of the outline are calculated by extracting the coordinate point set of the outer contour of the seal. If the approximation error of the outline point set is extremely small and the fitting residual conforms to the geometric characteristics of a circle or ellipse, it is identified as a circle or ellipse; if the outline point set exhibits obvious right-angle characteristics and has few sides, it is identified as a square or rhombus.

[0041] Specifically, for circular or elliptical seals, a polar coordinate transformation based on curve fitting is employed. Taking an elliptical financial seal as an example, after extracting the contour point set, the system fits the lengths of the major and minor axes of the ellipse, as well as the rotation angle of the major axis. During the polar coordinate transformation, for any pixel in the image, the radius and angle of that point in the elliptical polar coordinate system are dynamically calculated based on its coordinates relative to the center of the ellipse. This ensures that the width of the transformed rectangle adaptively matches the actual arc length of the ellipse at different angles. Through this dynamic radius calculation based on curve fitting, the pixel stretching and compression defects caused by the fixed radius in traditional linear polar coordinate transformation are avoided. This prevents the text along the major axis of the elliptical seal from being excessively stretched, and the text along the minor axis from being squeezed and overlapped. The aspect ratio of the text is restored to a normal visual proportion, fundamentally eliminating the damage to recognition accuracy caused by residual perspective distortion.

[0042] Specifically, for square or rhomboid seals, since the text is usually arranged along straight lines or at specific angles, there is no issue with curved layout. Therefore, perspective transformation is used for flexible correction. Specifically, by solving the mapping matrix between the coordinates of the vertices of the deformed quadrilaterals in the source image and the coordinates of the vertices of the standard rectangle in the target image, the trapezoidal distortion caused by the shooting angle is restored to a standard planar rectangular structure. This mapping matrix calculation takes into account the perspective scaling relationship in the depth direction, accurately restoring the original parallel horizontal and vertical strokes, thus restoring the gridded text layout within the square seal.

[0043] In this embodiment, by adaptively recognizing the shape of the seal and adopting a corresponding flexible correction strategy, the polar coordinate transformation based on curve fitting can adaptively handle perspective distortion and local pixel stretching, avoiding distortion residue caused by hard linear mapping. At the same time, through the combined preprocessing strategy of color degradation detection and adaptive enhancement, background interference separation, and ink diffusion compensation, the principle is to select targeted enhancement and compensation algorithms for different degradation types, effectively restoring the visual quality of the seal image, providing high-quality input for subsequent feature extraction, and significantly improving the recognition accuracy in color degradation and background overlap scenarios.

[0044] S3. Adjust the judgment threshold of the multi-dimensional feature matching mechanism based on the integrity representation to obtain the target threshold. In an optional embodiment, adjusting the decision threshold of the multidimensional feature matching mechanism based on the integrity representation to obtain the target threshold includes: The threshold adjustment coefficient is determined based on the quantitative score. The target threshold is calculated by combining the quantitative score, the threshold adjustment coefficient, and the basic threshold.

[0045] In some embodiments, the threshold adjustment coefficient is calculated as follows: Threshold adjustment coefficient = Quantitative score / 100; the base threshold is a strict judgment standard set for high-quality stamp images with complete content. The target threshold can be calculated using a linear offset method: Target threshold = Base threshold - (1 - Threshold adjustment coefficient) * Preset threshold offset.

[0046] In this embodiment, a quantitative score reflecting the degree of missing content in the seal is obtained through multi-element collaborative detection, and this score is used as a feedback control signal to adaptively adjust the judgment threshold for subsequent matching. The principle is that degraded samples with missing content naturally have a larger distance in the feature space, making them highly susceptible to rejection if a fixed threshold is used. However, dynamically lowering the judgment threshold based on the completeness quantitative score provides a more lenient tolerance for degraded samples, effectively solving the problem of misidentification or rejection caused by the inability to assess content completeness and fixed thresholds in existing technologies, and significantly improving the recognition error tolerance rate of degraded seals.

[0047] S4. Perform multi-dimensional feature matching on the candidate seal images based on the multi-modal features, and output the seal content recognition result according to the target threshold.

[0048] In an optional embodiment, the step of performing multi-dimensional feature matching on the candidate seal image based on the multimodal features and outputting the seal content recognition result according to the target threshold includes: The visual features are used to search the standard seal feature library to determine the first candidate seal features; the multimodal features are used to perform a dimensional feature comparison of the first candidate seal features, and the second candidate seal features are determined based on the feature similarity. Extract the textual semantic features of the second candidate seal features, perform consistency verification with the textual semantic features of the seal to be identified, and determine the third candidate seal features and their corresponding consistency scores. The consistency score is compared with the target threshold. If the consistency score is greater than or equal to the target threshold, the third candidate seal feature is used as the seal content recognition result of the seal image to be identified.

[0049] In this embodiment, the multidimensional feature matching mechanism is a three-level hierarchical cascaded matching. The first level is feature coarse screening, which uses only visual features for retrieval. Visual features are typically lightweight low-dimensional vectors, and their similarity calculation, such as cosine distance or Euclidean distance, is extremely fast. Distances are quickly calculated in the standard seal feature library using visual features, and the features are sorted from smallest to largest distance. The top K candidate features are then selected as the first candidate seal features, thereby significantly compressing the massive full candidate space to a very small Top-K range within milliseconds. It should be understood that the specific value of K can be dynamically set according to the size of the feature library and the business's tolerance for latency.

[0050] The second level is fine-tuning. Since the first level relies solely on visual features, its inherent limitation is its inability to distinguish seals with extremely similar appearances but different textual entities. For example, the administrative approval seal and the administrative licensing seal of the same administrative agency have almost identical visual layouts, with only subtle differences in text content; visual features can easily confuse the two. Therefore, a multimodal feature comparison, encompassing both visual and semantic modalities, is performed on the first candidate seal features. This comparison not only assesses structural similarity in the visual dimension but also semantic consistency, resulting in a more accurate feature similarity score. Based on this score, the system reorders the first candidate seal features and selects the top M features as the second candidate seal features, where M is less than K. This coarse-to-fine funnel-shaped screening avoids the high computational overhead of full-scale testing and compensates for the blind spots of single visual features through multimodal cross-validation, achieving a significant leap in accuracy.

[0051] The third level is semantic verification. Although the second level of screening has introduced multimodal information, in extreme degradation scenarios, the visual structure of the seal may be severely deformed, causing strong interference in the visual branches of the multimodal fusion features, leading to deviations in the fusion similarity calculation. Textual semantic features have a strong ability to resist visual interference. As long as the core text entities of the seal can be partially identified and extracted, its semantic vector can provide a stable identity anchor. Therefore, the third level of matching is semantic verification, implementing fallback logic to prevent misidentification. The textual semantic features of the second candidate seal feature are extracted separately and a pure semantic consistency check is performed with the textual semantic features of the seal to be identified. For example, the cosine similarity of the semantic vectors of the two is calculated or the parsed text string is compared through edit distance. Through this pure semantic consistency check, the hidden danger of visual deformation interference is eliminated, and the only optimal candidate feature, namely the third candidate seal feature, is finally determined, and its corresponding consistency score is output. This consistency score is the final matching metric obtained after integrating multi-level screening logic, objectively reflecting the degree of semantic core consistency between the seal to be identified and the third candidate feature.

[0052] In this embodiment, a three-level progressive cascaded matching strategy is adopted, consisting of coarse screening using visual features, fine screening using multimodal features, and verification using textual semantic features. The principle is that while coarse screening using single-modal features is fast, its accuracy is limited; while direct fine multimodal matching offers high accuracy, it incurs significant computational overhead. By first using lightweight visual features to quickly narrow down the candidate pool in the feature library, and then performing computationally expensive fine multimodal comparison and semantic verification on a small number of candidates, a hierarchical screening from coarse to fine is achieved. This significantly reduces computational latency while maintaining high matching accuracy, effectively balancing recognition efficiency and accuracy.

[0053] Based on the same inventive concept, this application also provides a seal content recognition system corresponding to a seal content recognition method, such as... Figure 2 As shown, it includes: The feature acquisition module is used to obtain the integrity characterization of the seal image to be identified based on image degradation detection and ink diffusion compensation. The integrity characterization reflects the degree of missing content of the seal. After geometric correction of the ink diffusion compensated image, multimodal features are extracted. The threshold acquisition module is used to adjust the judgment threshold of the multi-dimensional feature matching mechanism based on the integrity representation to obtain the target threshold; The seal recognition module is used to perform multi-dimensional feature matching on candidate seal images based on the multimodal features, and output the seal content recognition result according to the target threshold.

[0054] In this embodiment, through the collaborative work of various modules, the integrity representation output by the feature acquisition module is transformed into a dynamic target threshold by the threshold acquisition module, which ultimately guides the judgment criteria of the seal recognition module. This allows degraded samples to obtain a lenient fault-tolerant matching space, while complete samples are subject to strict anti-misidentification protection. This avoids the problems of poor adaptability of fixed thresholds when facing samples with fluctuating quality, and the inability to balance the accuracy and efficiency of seal content recognition.

[0055] This application also provides a computer device, such as... Figure 3 As shown, it includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, used to execute a program stored in memory, implements a method for recognizing the content of a seal.

[0056] The communication bus mentioned in the above computer equipment can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not indicate that there is only one bus or one type of bus.

[0057] The communication interface is used for communication between the aforementioned computer equipment and other devices.

[0058] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0059] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0060] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements a method for recognizing seal content.

[0061] The above-described embodiments are preferred embodiments of this application and are not intended to limit the specific scope of this application. The scope of this application includes but is not limited to the specific embodiments described above. All equivalent changes made in accordance with the shape, structure, and method of this application are within the protection scope of this application.

Claims

1. A method for recognizing the content of a seal, characterized in that: Includes the following steps: The integrity characterization of the seal image to be identified is obtained based on image degradation detection and ink diffusion compensation, and the integrity characterization reflects the degree of missing content of the seal. Multimodal features are extracted from the image after geometric correction of the ink diffusion compensation. The determination threshold of the multidimensional feature matching mechanism is adjusted based on the integrity representation to obtain the target threshold; Based on the multimodal features, multidimensional feature matching is performed on the candidate seal images, and the seal content recognition result is output according to the target threshold.

2. The method for recognizing seal content according to claim 1, characterized in that: The integrity characterization of the seal image to be identified, obtained based on image degradation detection and ink diffusion compensation, reflects the degree of missing content in the seal and includes: Perform color degradation detection on the image of the seal to be identified to determine the type of image degradation; Based on the image degradation type, select the corresponding color enhancement strategy to perform color enhancement and seal region separation on the seal image to be identified, and obtain the initial seal image; After performing ink diffusion compensation on the initial stamp image based on morphological erosion operation, a compensated stamp image is obtained. Multi-element collaborative detection is performed on the compensated stamp image to obtain a quantitative score reflecting the degree of missing stamp content.

3. The method for recognizing seal content according to claim 2, characterized in that: The step of performing multi-element collaborative detection on the compensated seal image to obtain a quantitative score reflecting the degree of missing seal content includes: The compensated seal image is evaluated for seal outline integrity, text continuity, and key area integrity. The quantitative score reflecting the degree of missing seal content is obtained by weighted fusion of the seal outline integrity score, text continuity score, and key area integrity score.

4. The method for recognizing seal content according to claim 1, characterized in that: The extraction of multimodal features after geometric correction of the image for ink diffusion compensation includes: Filter the rotating rectangle of the compensation stamp image, and crop and rotate the compensation stamp image according to the rotating rectangle; Identify the shape of the seal and perform geometric correction on the cropped and rotated seal image based on the seal shape; Based on the quantitative score, the geometrically corrected seal image is repaired for missing content. If the quantitative score is less than a preset threshold, the missing areas of the seal image are filled in using seal symmetry and prior knowledge completion strategies to obtain the repaired seal image. The visual and textual semantic features of the repaired seal image are extracted using a deep learning network, and the visual and textual semantic features are fused into a unified modality feature vector based on an attention mechanism to obtain the multimodal features.

5. The seal content recognition method according to claim 4, characterized in that: The process of identifying the seal shape and performing geometric correction on the cropped and rotated seal image based on the seal shape includes: Identify the shape of the seal image to be identified, including shapes such as circles, ovals, squares, or rhombuses; Based on the identified shape, a flexible correction strategy is used to perform geometric correction on the cropped and rotated stamp image. Specifically, for circles or ellipses, a polar coordinate transformation based on curve fitting is used, and for squares or rhombuses, a perspective transformation is used.

6. The seal content recognition method according to claim 4, characterized in that: Based on the integrity representation, the decision threshold of the multi-dimensional feature matching mechanism is adjusted to obtain the target threshold, including: The threshold adjustment coefficient is determined based on the quantitative score. The target threshold is calculated by combining the quantitative score, the threshold adjustment coefficient, and the basic threshold.

7. The method for recognizing seal content according to claim 6, characterized in that: The step of performing multi-dimensional feature matching on candidate seal images based on the multimodal features and outputting seal content recognition results according to the target threshold includes: Based on the aforementioned visual features, a search is conducted in the standard seal feature database to determine the first candidate seal features; Based on the multimodal features, the first candidate seal features are compared dimension by dimension, and the second candidate seal features are determined according to the feature similarity. Extract the textual semantic features of the second candidate seal features, perform consistency verification with the textual semantic features of the seal to be identified, and determine the third candidate seal features and their corresponding consistency scores. The consistency score is compared with the target threshold. If the consistency score is greater than or equal to the target threshold, the third candidate seal feature is used as the seal content recognition result of the seal image to be identified.

8. A seal content recognition system, characterized in that: A seal content recognition method applicable to any one of claims 1-7, comprising: The feature acquisition module is used to obtain the integrity characterization of the seal image to be identified based on image degradation detection and ink diffusion compensation. The integrity characterization reflects the degree of missing content in the seal. After geometric correction of the ink diffusion compensated image, multimodal features are extracted. The threshold acquisition module is used to adjust the judgment threshold of the multi-dimensional feature matching mechanism based on the integrity representation to obtain the target threshold; The seal recognition module is used to perform multi-dimensional feature matching on candidate seal images based on the multimodal features, and output the seal content recognition result according to the target threshold.

9. A computer device, characterized in that: include: The system includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; the memory is used to store computer programs; and the processor, when executing the program stored in the memory, implements the steps of the seal content recognition method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a seal content recognition method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Seal retrieval method and system, electronic equipment and storage medium

    CN119179798A