Image recognition method and device based on chrominance domain positioning and topological constraints

By adopting an image recognition method based on chromaticity domain localization and topological constraints, the problem of MRZ recognition under complex imaging conditions on low-computing-power terminals was solved, achieving stable and efficient MRZ recognition results and improving the accuracy and robustness of recognition.

CN121305247BActive Publication Date: 2026-03-03CREATOR CHINA TCH CO
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511862940.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-11
Publication Date
2026-03-03
Estimated Expiration
2045-12-11

AI Technical Summary

Technical Problem

On low-computing-power terminals, existing technologies struggle to achieve stable and efficient MRZ recognition under complex imaging conditions, and lack predictable performance boundaries.

Method used

An image recognition method based on chromaticity domain localization and topological constraints is adopted. An initial mask is generated through dual criteria, and connected component topological attribute filtering is combined with artificial color embedding technology to locate MRZ color blocks in the chromaticity space. Tilt estimation and cropping are performed, and character segmentation is performed by combining format constraints and uncertainty propagation scheduling mechanism. Finally, a linear SVM classifier is used for character recognition.

Benefits of technology

Stable and efficient MRZ recognition under complex imaging conditions was achieved on low-computing-power terminals, with predictable performance boundaries, improving the accuracy and robustness of recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121305247B_ABST
    Figure CN121305247B_ABST
Patent Text Reader

Abstract

The application discloses an image recognition method and device based on chroma domain positioning and topological constraint, relates to the technical field of data processing, and comprises the following steps: after an input image is preprocessed, an initial mask is generated in combination with contrast criteria and darkness criteria, pseudo targets are removed through hole-preserving connected domain analysis and Euler number filtering; rendering is performed by using an artificial color embedding technology, chroma domain positioning is performed in an HSV space, and an MRZ region is extracted; an inclination angle is estimated based on edge line direction consistency, and a maximum inscribed rectangle cutting is performed to obtain an MRZ cutting region; character segmentation is performed based on format constraint, an uncertainty conduction scheduling mechanism is adopted to adjust segmentation parameters and a retry strategy, and multiple single-character images are output; HOG features are extracted from the single-character images, a character classification is performed by using an SVM classifier, and preliminary recognition results and classification scores of each character are obtained; a final recognition score is fused based on structure prior scores and classification scores, and complete MRZ text is output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to an image recognition method and device based on chromaticity domain localization and topological constraints. Background Technology

[0002] Automatic recognition of machine-readable zones (MRZs) is a core component of automated processing of passport, ID card, and other document information. Its accuracy and stability directly impact the efficiency and reliability of critical operations such as immigration management and financial account opening. Currently, with the widespread adoption of mobile terminals and embedded devices, the industry urgently needs to achieve robust real-time MRZ recognition in edge environments with low computing power and limited resources.

[0003] Existing technologies can be mainly divided into three categories: First, end-to-end deep neural network models, which have high accuracy under certain conditions, but their computational complexity and memory consumption make it difficult to achieve low latency and low power consumption deployment on the edge. Second, general OCR engines combined with rule-based post-processing. This method is stable when the image quality is good, but under complex imaging conditions such as strong reflection, low contrast, slight blur or tilt, which are common in document collection, the stability of its localization and segmentation stages decreases significantly, and the variance of the recognition results is large. Third, pipeline methods based on traditional image processing, which have the advantages of lightweight operators and strong controllability, but rely heavily on manually designed features and thresholds, have insufficient generalization ability under extreme conditions, and usually lack deterministic guarantees for latency and memory consumption in the worst case.

[0004] Therefore, on low-computing-power terminals, there is a need for an MRZ recognition mechanism that can remain stable and efficient under complex imaging conditions and has predictable performance boundaries.

[0005] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0006] The main objective of this application is to provide an image recognition method and device based on chromaticity domain localization and topological constraints, aiming to solve the technical problem of how to achieve stable, efficient, and predictable performance boundaries of MRZ recognition under low computing power terminals and complex imaging conditions.

[0007] To achieve the above objectives, this application proposes an image recognition method based on chromaticity domain localization and topological constraints, the method comprising:

[0008] Receive the input image;

[0009] An initial mask is generated for the image using dual criteria, and a first mask is obtained by filtering the initial mask based on the topological properties of connected components.

[0010] The first mask is rendered as the target color gamut using artificial color embedding technology, and MRZ color block positioning is performed in the color space to extract the MRZ region.

[0011] Perform edge-line-based tilt estimation and maximum inscribed clipping on the MRZ region to obtain the MRZ clipping region;

[0012] Based on format constraints, the MRZ cropping region is segmented into characters, and an uncertainty propagation scheduling mechanism is used to adjust the segmentation parameters and retry strategy to output multiple single-character images.

[0013] HOG features are extracted from the single-character image, and a linear SVM classifier is used to classify the characters to obtain the preliminary recognition result and classification score for each character.

[0014] The structure prior score is generated by combining the field position of the MRZ cropping region, the predefined character set, and the check bit rules. The structure prior score is then weighted and fused with the classification score to obtain the final recognition score.

[0015] The optimal category for each character is determined by the final recognition score, and the recognized character sequence is assembled into a complete MRZ text according to preset rules and then output.

[0016] In one embodiment, the preprocessing step of the input image includes:

[0017] Decode the input image to obtain an RGB image;

[0018] The RGB image is converted to a grayscale image, and the grayscale image is downsampled to obtain a preprocessed grayscale image.

[0019] In one embodiment, the step of generating an initial mask by applying dual criteria to the image and filtering the initial mask based on the topological properties of connected components to obtain a first mask includes:

[0020] A black hat operation is performed on the grayscale image, and the result of the black hat operation is binarized using the Otsu thresholding method to obtain a contrast criterion mask.

[0021] Gaussian blurring is applied to the grayscale image to obtain a local mean image. A preset constant bias value is subtracted from the local mean image to obtain an adaptive threshold. The grayscale value of each pixel in the grayscale image is compared with the adaptive threshold at the corresponding position to generate a darkness criterion mask.

[0022] Perform a logical AND operation between the contrast criterion mask and the darkness criterion mask to fuse them and generate an initial mask;

[0023] Perform hole-preserving connectivity analysis on the initial mask to identify all connected regions;

[0024] Calculate the area and Euler number of each connected region, and filter the connected regions based on preset area threshold ranges and Euler number threshold ranges to remove pseudo-connected regions. The first mask is constructed based on the retained connected regions.

[0025] In one embodiment, the step of rendering the first mask into the target color gamut using artificial color embedding technology, locating MRZ color blocks in the color space, and extracting the MRZ region includes:

[0026] Affine color rendering is performed on the original image area corresponding to the original RGB image or the preprocessed grayscale image through the first mask to generate an affine color embedded image, wherein the foreground area is rendered as a first predetermined color and the background area is rendered as a second predetermined color.

[0027] The affine color-embedded image is converted from the RGB color space to the HSV color space;

[0028] On the chroma channel of the HSV color space, threshold segmentation is performed based on the hue saturation threshold range corresponding to the second predetermined color to obtain candidate color block regions;

[0029] Geometric feature discrimination is performed on the candidate color block regions to filter out connected regions that conform to the geometric layout characteristics of the MRZ region. The geometric feature discrimination includes at least evaluating the region aspect ratio, region area, and color consistency.

[0030] The target MRZ region is determined from the selected connected regions, and the bounding box of the target MRZ region is output to complete the MRZ region extraction.

[0031] In one embodiment, the step of performing edge-line-based tilt estimation and maximum inscribed clipping on the MRZ region to obtain the MRZ clipping region includes:

[0032] Based on the bounding box of the MRZ region, extract the MRZ sub-image from the original image or the preprocessed image;

[0033] Edge detection is performed on the MRZ sub-image to obtain an edge point set;

[0034] Based on the edge point set, within a preset angle search range, the edge direction consistency score under different candidate tilt angles is calculated;

[0035] The candidate tilt angle with the highest edge direction consistency score is selected as the estimated tilt angle;

[0036] Based on the estimated tilt angle, the MRZ sub-image is rotated and corrected to obtain the rotated MRZ image;

[0037] Calculate the largest inscribed axis-aligned rectangle in the MRZ image after rotation;

[0038] The rotated MRZ image is cropped based on the maximum inscribed axis aligned rectangle to remove the black borders and jagged areas caused by rotation, thus obtaining the MRZ cropped area.

[0039] In one embodiment, the step of segmenting the MRZ clipping region based on format constraints includes:

[0040] A vertical projection analysis is performed on the MRZ cutting area to obtain the grayscale value distribution curve in the horizontal direction of the MRZ cutting area;

[0041] Based on the image width of the MRZ cropping region, a corresponding segmentation threshold is selected from a plurality of preset segmentation thresholds, wherein the segmentation threshold is negatively correlated with the image width;

[0042] Based on the segmentation threshold, the grayscale value distribution curve is used to locate character gaps, and initial character segmentation is performed to obtain an initial character sequence.

[0043] Based on predefined MRZ layout information, the initial character sequence is detected, wherein the detection includes at least character count, character spacing and check digit verification;

[0044] When an abnormal character spacing is detected, a backtracking and re-slicing mechanism is triggered. The backtracking and re-slicing mechanism includes deleting the previous segmentation character, adjusting the segmentation position, and then re-slicing.

[0045] In one embodiment, the step of adjusting the segmentation parameters and retry strategy using an uncertainty propagation scheduling mechanism to output multiple single-character images includes:

[0046] During the segmentation process, one or more quality indicators among mask coverage, boundary entropy, and hole ratio are calculated in real time.

[0047] Based on the comparison between the value of the quality indicator and the preset threshold, the segmentation threshold and retry strategy are adjusted. Specifically, when the quality indicator is lower than the first threshold, the segmentation threshold is increased and backtracking and re-segmentation are allowed; when the quality indicator is higher than the second threshold, an early stop mechanism is executed, where the first threshold is less than the second threshold.

[0048] When the initial character sequence meets the predefined MRZ format requirements and passes the check digit verification, the segmentation process is terminated early, and the final segmented single-character images are output.

[0049] In one embodiment, the steps of extracting HOG features from the single-character image and using a linear SVM classifier to classify the characters to obtain a preliminary recognition result and classification score for each character include:

[0050] The size of each single-character image is normalized to a preset fixed size;

[0051] Calculate HOG features on the normalized single-character image;

[0052] The HOG features are input into a pre-trained multi-class linear support vector machine classifier, which outputs a preliminary classification score for each character belonging to each candidate character category.

[0053] In the preliminary classification score, the candidate character category with the highest score for each character is selected as the preliminary recognition result and classification score for each character.

[0054] In one embodiment, the step of generating a structural prior score by combining the field position of the MRZ cropping region, a predefined character set, and check bit rules, and then weighting and fusing the structural prior score with the classification score to obtain the final recognition score includes:

[0055] Based on the standard layout of the MRZ cropping area, determine the position index of the currently recognized character in the field;

[0056] Based on the position index, obtain the predefined character set of the currently recognized character;

[0057] Determine whether each candidate character category of the currently identified character belongs to the predefined character set. If it belongs to the predefined character set, assign a positive character set prior score; otherwise, assign zero or negative score.

[0058] Based on the character sequence formed by the preliminary recognition results, the check bit of the specified field is calculated according to the preset rules, and all candidate character categories are traversed according to the character position of the check bit.

[0059] If a character belongs to the check bit, and the candidate character category of the character passes the check bit verification, then a positive check bit prior score is assigned to the candidate character category.

[0060] The character set prior score and the check bit prior score are added together to form a single structure prior score.

[0061] For each candidate character category, the classification score and the prior structure score of each character are linearly weighted and fused according to a preset weighting formula to obtain the final recognition score.

[0062] Furthermore, to achieve the above objectives, this application also proposes an image recognition device based on chromaticity domain localization and topological constraints, the image recognition device based on chromaticity domain localization and topological constraints comprising:

[0063] An image receiving module is used to receive input images;

[0064] A mask generation module is used to generate an initial mask for the image using dual criteria, and to filter the initial mask based on the topological properties of connected components to obtain a first mask;

[0065] The chromaticity gamut localization module is used to render the first mask into the target chromaticity gamut using artificial color embedding technology, and to perform MRZ color block localization in the chromaticity space and extract the MRZ region.

[0066] The geometric correction module is used to perform edge-line-based tilt estimation and maximum inscribed clipping on the MRZ region to obtain the MRZ clipping region;

[0067] The segmentation control module is used to segment the MRZ cropping region into characters based on format constraints, and to adjust the segmentation parameters and retry strategy using an uncertainty propagation scheduling mechanism to output multiple single-character images;

[0068] The character recognition module is used to extract HOG features from the single character image and use a linear SVM classifier to classify the characters, obtaining a preliminary recognition result and classification score for each character.

[0069] The prior fusion module is used to generate a structural prior score by combining the field position of the MRZ cropping region, the predefined character set and the check bit rules, and to perform a weighted fusion of the structural prior score and the classification score to obtain the final recognition score.

[0070] The assembly output module is used to determine the optimal category of each character based on the final recognition score, and to assemble the recognized character sequence into a complete MRZ text and output it according to preset rules.

[0071] Furthermore, to achieve the above objectives, this application also proposes an image recognition device based on chromaticity domain localization and topological constraints. The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. The computer program is configured to implement the steps of the image recognition method based on chromaticity domain localization and topological constraints as described above.

[0072] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the image recognition method based on chromaticity domain localization and topological constraints as described above.

[0073] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the image recognition method based on chromaticity domain localization and topological constraints as described above.

[0074] One or more technical solutions proposed in this application have at least the following technical effects:

[0075] The system receives an input image; generates an initial mask using dual criteria, and filters the initial mask based on connected component topology properties to obtain a first mask; renders the first mask into the target color gamut using artificial color embedding technology, and performs MRZ color block localization in the color space to extract MRZ regions; performs edge-line-based tilt estimation and maximum incircle clipping on the MRZ regions to obtain MRZ clipped regions; performs character segmentation on the MRZ clipped regions based on format constraints, and uses an uncertainty propagation scheduling mechanism to adjust segmentation parameters and retry strategies, outputting multiple single-character images; extracts HOG features from the single-character images, and uses a linear SVM classifier to classify the characters, obtaining preliminary recognition results and classification scores for each character; generates a structural prior score by combining the field position of the MRZ clipped regions, a predefined character set, and check bit rules, and weights and fuses the structural prior score with the classification score to obtain a final recognition score; determines the optimal category for each character based on the final recognition score, and assembles the recognized character sequences into complete MRZ text according to preset rules and outputs it. Attached Figure Description

[0076] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0077] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0078] Figure 1 This is a flowchart illustrating an embodiment of the image recognition method based on chromaticity domain localization and topological constraints provided in this application.

[0079] Figure 2 This is a flowchart illustrating Embodiment 2 of the image recognition method based on chromaticity domain localization and topological constraints provided in this application;

[0080] Figure 3 This is a flowchart illustrating Embodiment 3 of the image recognition method based on chromaticity domain localization and topological constraints provided in this application;

[0081] Figure 4 This is a flowchart illustrating Embodiment 4 of the image recognition method based on chromaticity domain localization and topological constraints provided in this application;

[0082] Figure 5 This is a flowchart illustrating Embodiment 5 of the image recognition method based on chromaticity domain localization and topological constraints in this application.

[0083] Figure 6 This is a flowchart illustrating Embodiment Six of the image recognition method based on chromaticity domain localization and topological constraints in this application;

[0084] Figure 7 This is a flowchart illustrating Embodiment Seven of the image recognition method based on chromaticity domain localization and topological constraints in this application;

[0085] Figure 8 This is a schematic diagram of the module structure of an image recognition device based on chromaticity domain localization and topological constraints according to an embodiment of this application;

[0086] Figure 9 This is a schematic diagram of the device structure of the hardware operating environment involved in the image recognition method based on chromaticity domain localization and topological constraints in the embodiments of this application.

[0087] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0088] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0089] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0090] Due to the limitations of existing technologies, it is impossible to achieve stable, efficient, and predictable performance boundaries for MRZ recognition under conditions of low computing power terminals and complex imaging.

[0091] This application provides a solution that receives an input image; generates an initial mask for the image using dual criteria, and filters the initial mask based on the topological properties of connected components to obtain a first mask; renders the first mask into a target color gamut using artificial color embedding technology, and performs MRZ color block localization in the color space to extract MRZ regions; performs edge-line-based tilt estimation and maximum incircle clipping on the MRZ regions to obtain MRZ clipped regions; performs character segmentation on the MRZ clipped regions based on format constraints, and uses an uncertainty propagation scheduling mechanism to adjust the segmentation parameters and retry strategy to output multiple single-character images; extracts HOG features from the single-character images, and uses a linear SVM classifier to classify the characters, obtaining a preliminary recognition result and classification score for each character; generates a structural prior score by combining the field position of the MRZ clipped regions, a predefined character set, and check bit rules, and weights and fuses the structural prior score with the classification score to obtain a final recognition score; determines the optimal category for each character based on the final recognition score, and assembles the recognized character sequences into complete MRZ text according to preset rules and outputs it.

[0092] Based on this, embodiments of this application provide an image recognition method based on chromaticity domain localization and topological constraints, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the image recognition method based on chromaticity domain localization and topological constraints of this application.

[0093] In this embodiment, the image recognition method based on chromaticity domain localization and topological constraints includes steps S10~S80:

[0094] Step S10: Receive the input image;

[0095] It should be noted that, in this embodiment, "image" refers to digital image data containing the machine-readable area of ​​documents such as passports, ID cards, endorsements, or travel permits. A unified image data source is provided, compatible with various input formats, such as JPG or BMP format data in memory, Base64 encoded strings, or image file paths stored on the device, ensuring the method's versatility and ease of integration.

[0096] Step S20: Generate an initial mask for the image using dual criteria, and filter the initial mask based on the topological properties of connected components to obtain a first mask;

[0097] It should be noted that in this embodiment, the dual criteria refer to two independent criteria based on local contrast and absolute pixel darkness, respectively. The initial mask refers to the binary image that may contain text regions, initially filtered through the dual criteria. The connected component topological properties refer to the overall structural features of connected pixel regions in the image that remain unchanged under continuous deformation, mainly including the Euler number of the region (used to characterize the number of holes in the region) and the connectivity of the region itself. The first mask refers to the purer binary image of the text region obtained after filtering by topological properties. The purpose of this step is to overcome interference such as strong reflection and low contrast by fusing different evidence and utilizing the inherent structural characteristics of characters to filter out noise and pseudo-text regions.

[0098] Step S30: The first mask is rendered as the target color gamut using artificial color embedding technology, and MRZ color block positioning is performed in the color space to extract the MRZ region;

[0099] It should be noted that in this embodiment, the texture and contrast problem is transformed into a color separation problem. Artificial color embedding technology refers to actively and differentially mapping the foreground (suspected text) and background regions in the original image to a set of preset high-contrast color pairs based on the information from the first mask. The target color gamut refers to a specific color combination specified for the foreground and background, such as "black text on a red background." The chromaticity space refers to a color model used to represent color information, such as HSV or HSL spaces, which separates the brightness information of a color from its hue and saturation information. MRZ color block localization refers to identifying coherent MRZ candidate regions in the converted chromaticity space based on the hue and saturation features of a preset target background color (such as red) through threshold segmentation and geometric analysis. This step utilizes the stability and saliency of color features to avoid the localization difficulties caused by uneven lighting, reflection, or low contrast in the grayscale domain, thereby stably and accurately extracting the MRZ region.

[0100] In one possible implementation, the specific method of artificial color embedding is as follows: the color corresponding to the pixels marked as foreground in the first mask in the original RGB image is set to black (0,0,0), while the color corresponding to the background pixels is set to red (255,0,0), thereby generating an affine color embedding image.

[0101] Step S40: Perform edge-line-based tilt estimation and maximum inscribed clipping on the MRZ region to obtain the MRZ clipping region;

[0102] It should be noted that in this embodiment, edge-line-based tilt estimation refers to estimating the tilt angle relative to the horizontal direction by analyzing the directional distribution of significant edge lines within the MRZ region. Maximum inscribed cropping refers to finding and cropping the largest rectangular region in the rotated image, whose sides are parallel to the image coordinate axes, and this rectangle is entirely within the valid image content. The MRZ cropped region refers to the upright and complete MRZ image region after tilt correction and removal of invalid edges (such as black borders or jagged edges caused by rotation). This step corrects the slight tilt of the MRZ region and transforms the unavoidable angle estimation error during rotation into controllable, uniform white space around the image, rather than distorted character projection, thereby greatly reducing boundary disturbances and variance during subsequent vertical projection analysis, achieving geometric correction for stability.

[0103] Step S50: Based on format constraints, the MRZ cropping region is segmented into characters, and an uncertainty propagation scheduling mechanism is used to adjust the segmentation parameters and retry strategy to output multiple single-character images;

[0104] It should be noted that in this embodiment, format constraints refer to the structural prior knowledge, such as the fixed number of characters, field length, character type, and checksum rules, as specified in the international standards followed by the machine-readable area. Character segmentation refers to the process of vertically dividing a horizontal MRZ text line image into independent individual character images. The uncertainty propagation scheduling mechanism refers to a dynamic control system that can adaptively adjust the parameters and decision logic of the segmentation algorithm based on the quality evaluation index of the current intermediate processing results. Segmentation parameters may include projection thresholds for judging character gaps, morphological operation parameters for merging or splitting regions, etc. The retry strategy defines how the system backtracks and tries different segmentation paths or parameters when the initial segmentation result does not meet the format constraints. By deeply integrating the preset format into low-level image processing (segmentation), a closed-loop control system of perception-decision-execution is formed, intelligently guiding the segmentation process and stably outputting usable single-character images.

[0105] Specifically, the core of the deterministic transmission scheduling mechanism lies in using quality indicators from preceding steps (such as mask generation) or the current segmentation process (e.g., mask coverage in the MRZ region, information entropy at character boundaries, and the proportion of holes within character regions) to synthesize an uncertainty signal. When this signal indicates high uncertainty, the scheduling mechanism triggers a more conservative strategy, such as increasing the segmentation threshold to tolerate wider gaps, or allowing a limited number of backtracking attempts to re-segment suspicious characters.

[0106] Step S60: Extract HOG features from the single-character image and use a linear SVM classifier to classify the characters, obtaining the preliminary recognition result and classification score for each character;

[0107] It should be noted that in this embodiment, HOG features refer to Histogram of Oriented Gradients, which describes the shape of an object by calculating and statistically analyzing the distribution of gradient directions within a local region of the image. The linear SVM classifier is a support vector machine model based on a linear kernel function, used to perform multi-class classification on the extracted HOG features, determining the category to which a character belongs (e.g., numbers 0-9, letters A, B, and C). The preliminary identification result refers to the most probable character category predicted by the linear SVM classifier for each single-character image. The classification score reflects the confidence that the character image belongs to the predicted category, such as the value of the decision function or probability estimate. This step utilizes the effectiveness of HOG features in character shape representation, as well as the efficiency and predictability of the linear SVM model during inference, to provide a reliable preliminary judgment of character category while meeting the requirements of low computational power and low memory on the edge.

[0108] In one possible implementation, the extraction parameters for HOG features are set as follows: the single character image is normalized to 24x24 pixels, the cell unit size is 8x8 pixels, the block size is 2x2 cell units, the number of directional gradient channels is 9, and the block contrast is normalized using the L2-Hys norm.

[0109] Step S70: Combine the field position of the MRZ cropping region, the predefined character set, and the check bit rules to generate a structural prior score, and then perform a weighted fusion of the structural prior score and the classification score to obtain the final recognition score.

[0110] It should be noted that in this embodiment, domain knowledge is utilized to improve recognition accuracy and robustness. The structural prior score refers to the additional reward or penalty score assigned to different candidate character categories at each character position based on structural knowledge of the machine-readable standard format. The field position refers to the specific paragraph and column index of the character to be recognized within the MRZ text line. The predefined character set refers to the set of characters allowed to appear at specific field positions, as specified by the standard. The check bit rule refers to the calculation rules used to verify the correctness of data in specific fields. This step compensates for potential misjudgments caused by poor image quality in pure image classification models. By introducing strong domain knowledge constraints, the system is guided to make decisions in a direction that conforms to the format specifications, thereby significantly suppressing common easily confused character errors and improving the overall recognition rate.

[0111] In one possible implementation, the generation of the structural prior score is divided into two parts: one is a prior based on field position and predefined character set, for example, in the field position that should be a number, a positive score is assigned to all candidate categories of numbers, and a zero or negative score is assigned to non-number categories; the other is a prior based on check bit rules, for example, for a character that serves as a check bit, all its candidate categories are traversed, and the category that enables the corresponding field to be calculated through the check bit is assigned a higher positive score.

[0112] Step S80: Determine the optimal category for each character based on the final recognition score, and assemble the recognized character sequence into a complete MRZ text according to preset rules and output it.

[0113] It should be noted that in this embodiment, the optimal category refers to selecting the category with the highest final recognition score from all candidate character categories for each character position as the final recognition result. The preset rules refer to the organization format of the machine-readable text, specifying the starting position, length, data type, and separators (such as "<") between different fields. Assembly refers to concatenating the optimal categories of each character recognized in sequence into a continuous text string conforming to a standard format, according to the preset MRZ format rules. This step integrates the final scores from multiple pieces of evidence to make a final, globally optimal character category decision and generate a structurally correct and standardized output result.

[0114] In one possible implementation, the preprocessing step of the input image includes:

[0115] Decode the input image to obtain an RGB image;

[0116] The RGB image is converted to a grayscale image, and the grayscale image is downsampled to obtain a preprocessed grayscale image.

[0117] It should be noted that in this embodiment, decoding refers to the process of restoring the input compressed image data or the image file pointed to by the file path into an RGB pixel matrix that the system can directly process. Its purpose is to unify the input interface and support multiple input formats. A grayscale image refers to a single-channel image that contains only brightness information and no color information, obtained by calculating a weighted average of RGB images. Downsampling refers to reducing the computational load required for processing by lowering the image resolution, typically implemented using algorithms such as bilinear interpolation.

[0118] Furthermore, referring to Figure 2 This application provides a flowchart of a second embodiment of an image recognition method based on chromaticity domain localization and topological constraints. Figure 2The embodiment shown further refines the step S20, "generating an initial mask for the image using dual criteria and filtering the initial mask based on the connected component topological properties to obtain a first mask," including steps A201 to A205:

[0119] Step A201: Perform black hat computation on the grayscale image, and binarize the black hat computation result using the Otsu thresholding method to obtain the contrast criterion mask;

[0120] It should be noted that in this embodiment, the black hat operation specifically involves performing a closing operation on the original image and then subtracting the result from the original image, effectively enhancing small areas in the image that are darker than the background. The Otsu thresholding method is an adaptive global thresholding method that automatically calculates an optimal threshold based on the image's grayscale histogram, dividing the image into foreground and background categories. The contrast criterion mask refers to the binary image obtained by enhancing dark details through the black hat operation and then binarizing it using the Otsu thresholding method, highlighting potential text regions with significant contrast to the background. This step utilizes morphological operations to enhance the local contrast difference between characters and the background, and uses adaptive thresholding segmentation to initially extract candidate text regions with significant contrast.

[0121] In one possible implementation, the structuring element used in the black hat operation is a rectangular kernel with an odd number of side lengths, ranging from 21 to 41 pixels, to accommodate different image resolutions and character stroke widths. Subsequently, the Otsu algorithm is applied to the resulting image from the black hat operation to calculate a global threshold and perform binarization, generating a contrast criterion mask.

[0122] Step A202: Gaussian blurring is performed on the grayscale image to obtain a local mean image. A preset constant bias value is subtracted from the local mean image to obtain an adaptive threshold. The grayscale value of each pixel in the grayscale image is compared with the adaptive threshold at the corresponding position to generate a darkness criterion mask.

[0123] It should be noted that in this embodiment, Gaussian blurring refers to a linear filter using a Gaussian function as the kernel to smooth the image, eliminate detail noise, and estimate local background brightness. The local mean image refers to the image obtained after Gaussian blurring, where each pixel value reflects the average brightness of its surrounding neighborhood. The preset constant bias value is a constant subtracted from the local mean, used to determine the offset of the adaptive threshold. The adaptive threshold refers to the binarization threshold dynamically calculated for each pixel position in the image based on its local background brightness. The darkness criterion mask refers to the binary image generated by comparing the grayscale value of each pixel in the original grayscale image with its corresponding adaptive threshold (if it is less than the threshold, it is judged as foreground). In cases of uneven lighting and local reflections, by estimating the local background and setting a relatively darker threshold, text pixels with low absolute brightness can be stably extracted, even when the overall image contrast is low.

[0124] Step A203: Perform a logical AND operation on the contrast criterion mask and the darkness criterion mask to fuse them and generate an initial mask;

[0125] It should be noted that in this embodiment, the detection results based on local contrast evidence and absolute darkness evidence are intersected. A pixel must be judged as a foreground by two relatively independent criteria at the same time in order to be finally retained. This fusion strategy can significantly reduce false alarms that may be generated by a single criterion.

[0126] Step A204: Perform hole-preserving connectivity analysis on the initial mask to identify all connected regions;

[0127] It should be noted that in this embodiment, hole-preserving connected component analysis refers to identifying and preserving the background "holes" contained within each connected foreground region in the labeled image. A connected region refers to an independent, continuous set of pixels formed by connecting adjacent foreground pixels. This step involves identifying all independent objects (including characters and any holes that may exist within them) in the initial mask and assigning a unique label to each object.

[0128] Step A205: Calculate the area and Euler number of each connected region, and filter the connected regions based on the preset area threshold range and Euler number threshold range to remove pseudo-connected regions, and construct the first mask based on the retained connected regions.

[0129] It should be noted that in this embodiment, the area refers to the total number of pixels contained within a connected region. For a connected region in a binary image, its Euler number refers to the number of objects within the region minus the number of holes it contains (for a single object, Euler number ≈ 1 - number of holes). The preset area threshold range and Euler number threshold range refer to reasonable value ranges for the area and Euler number used to determine whether a connected region is a valid text character, set based on prior knowledge. False connected regions refer to connected regions that do not conform to the characteristics of real characters in terms of area or topology, such as small spots formed by noise, large bright spots caused by reflection, or solid blocks without holes. The first mask refers to a purer binary mask that only contains high-confidence character regions after filtering. By utilizing the prior knowledge that real characters usually have a specific size range (area) and structural features (such as a specific number of holes, for example, "O" has 1 hole, "8" may have 2 holes, and "I" has no holes), false targets that obviously do not conform to these features are eliminated, thereby significantly improving the quality of the mask.

[0130] In one possible implementation, when filtering connected regions, the preset area threshold range is defined as: area ≥ ρ × H × W, where H and W are the height and width of the preprocessed grayscale image, respectively, and ρ is the area scaling factor, whose value range is

[10] . -5 10 -3 The Euler number threshold range is a preset closed interval [χ_min,χ_max], and only connected regions within this interval are retained during filtering.

[0131] This embodiment utilizes two complementary criteria, local contrast enhancement and absolute darkness analysis, to effectively overcome the limitations of single features under complex imaging conditions such as strong reflection and low contrast, and achieves preliminary robust extraction of potential text regions. Furthermore, by introducing topological property filtering based on the area of ​​connected regions and Euler number, this scheme can accurately identify and eliminate various pseudo-connected regions (such as noise spots and reflective blocks) that do not conform to the character shape in terms of structural features, fundamentally improving the quality and purity of the mask.

[0132] Furthermore, referring to Figure 3 This application provides a flowchart in the third embodiment of the image recognition method based on chromaticity domain localization and topological constraints. Figure 3 The embodiment shown further refines the step S30, "using artificial color embedding technology to render the first mask as the target color gamut, and performing MRZ color block positioning in the color space to extract the MRZ region," including steps A301 to A305:

[0133] Step A301: Affine color rendering is performed on the original image area corresponding to the original RGB image or the preprocessed grayscale image through the first mask to generate an affine color embedded image, wherein the foreground area is rendered as a first predetermined color and the background area is rendered as a second predetermined color.

[0134] It should be noted that, in this embodiment, affine color rendering refers to an operation that systematically maps different types of regions (foreground / background) in an image to a specified color based on mask information. The first predetermined color is the rendering color specified for the foreground region. The second predetermined color is the rendering color specified for the background region, which forms a high contrast with the first predetermined color. By actively constructing an image representation with distinct color features and noise suppression, the problem of region localization, which may be difficult to handle in the grayscale domain due to texture, reflection, or low contrast, is transformed into a relatively simple color block separation problem in the color domain. For example, the first predetermined color is set to black (RGB: 0,0,0), and the second predetermined color is set to red (RGB: 255,0,0) to form a strong color contrast.

[0135] Step A302: Convert the affine color-embedded image from the RGB color space to the HSV color space;

[0136] It should be noted that in this embodiment, the HSV color space is a color model that represents color as three components: hue, saturation, and lightness. The image is converted from the RGB space, which is sensitive to changes in illumination, to the HSV space, which can separate color information from lightness information to a certain extent. In the HSV space, the hue and saturation channels can more stably describe the inherent color attributes of an object, reducing the interference of illumination changes on color judgment. For example, the system embeds the generated "black text on a red background" affine color into each pixel of the image (RGB format), calculates its corresponding hue, saturation, and lightness values ​​using standard conversion formulas, and thus obtains the HSV color space representation of the image.

[0137] Step A303: On the chroma channel of the HSV color space, threshold segmentation is performed based on the hue saturation threshold range corresponding to the second predetermined color to obtain candidate color block regions;

[0138] It should be noted that in this embodiment, the chroma channel in the HSV color space mainly refers to the hue channel representing the color type and the saturation channel representing the color purity. The hue and saturation threshold range corresponding to the second predetermined color refers to a range of values ​​set based on the typical value of the second predetermined color (such as red) in the HSV space, used to identify pixels in the image that are similar to that color. Thresholding segmentation refers to the operation of binarizing the image using the set threshold range, classifying pixels that match the color range as foreground, and the rest as background. By utilizing the characteristic that the background color of the MRZ is known and uniform after manual rendering, thresholding is performed on the chroma channel in the HSV space to quickly and directly filter out all possible target background color blocks, thereby initially locking the candidate positions of the MRZ.

[0139] Step A304: Perform geometric feature discrimination on the candidate color block regions and filter out connected regions that conform to the geometric layout features of the MRZ region. The geometric feature discrimination includes at least evaluating the region aspect ratio, region area, and color consistency.

[0140] It should be noted that in this embodiment, the region aspect ratio refers to the ratio of the width to the height of the bounding rectangle of the connected region. The region area refers to the total number of pixels contained within the connected region. Color uniformity refers to the uniformity of pixel color values ​​within the connected region. The MRZ region geometric layout characteristics refer to the typical geometric characteristics of the machine-readable area as a whole, such as it being a long and narrow rectangular region (with a large aspect ratio), occupying a certain proportion of the image area, and having a relatively uniform background color.

[0141] Step A305: Determine the target MRZ region from the filtered connected regions and output the bounding box of the target MRZ region to complete the MRZ region extraction.

[0142] It should be noted that in this embodiment, the bounding box refers to the smallest circumscribed rectangle that can completely enclose the target MRZ region. Its position and size are defined by the coordinates or equivalent information of the upper left and lower right corners of the rectangle. From the few remaining high-quality candidate regions after multiple rounds of screening, the unique and most probable MRZ region is determined. When multiple candidate regions exist, the system needs to make a final selection based on a certain strategy (such as selecting the one with the largest area or the highest overall score) and output precise positioning information in the form of a bounding box, completing the entire MRZ region extraction process.

[0143] This embodiment effectively overcomes the problem of unstable positioning in traditional grayscale methods caused by uneven illumination, local reflection, and background texture interference, and significantly improves the positioning accuracy and robustness of machine-readable areas under various complex imaging conditions.

[0144] Furthermore, referring to Figure 4This application provides a flowchart in the fourth embodiment of the image recognition method based on chromaticity domain localization and topological constraints. Figure 4 The embodiment shown further refines the step S40, "perform edge-line-based tilt estimation and maximum inscribed clipping on the MRZ region to obtain the MRZ clipping region," including steps A401 to A407:

[0145] Step A401: Based on the bounding box of the MRZ region, extract the MRZ sub-image from the original image or the preprocessed image;

[0146] It should be noted that, in this embodiment, the MRZ sub-image refers to the image region extracted from the source image based on the coordinate information of the bounding box, which contains only machine-readable content.

[0147] Step A402: Perform edge detection on the MRZ sub-image to obtain an edge point set;

[0148] It should be noted that in this embodiment, edge detection is used to identify pixels in the image whose grayscale values ​​change drastically (i.e., have edges).

[0149] Step A403: Based on the edge point set, calculate the edge direction consistency score under different candidate tilt angles within a preset angle search range;

[0150] It should be noted that, in this embodiment, the preset angle search range refers to the interval pre-set by the system for finding possible tilt angles of the machine-readable area, such as [-10°, +10°]. The candidate tilt angle refers to the discrete angle value selected within the angle search range for tentative evaluation. The edge direction consistency score is used to evaluate the degree of consistency between the edge direction and the horizontal (or vertical) direction in the edge point set after the image is rotated by a certain candidate angle.

[0151] Step A404: Select the candidate tilt angle with the highest edge direction consistency score as the estimated tilt angle;

[0152] It should be noted that, in this embodiment, the estimated tilt angle refers to the candidate tilt angle that the system recognizes as the most capable of correcting the tilt state of the machine-readable area.

[0153] Step A405: Based on the estimated tilt angle, perform rotation correction on the MRZ sub-image to obtain the rotated MRZ image;

[0154] It should be noted that in this embodiment, the image is rotated in the opposite direction based on the estimated tilt angle to compensate for its tilt and make the character lines in the machine-readable area horizontal.

[0155] In one specific implementation, the system uses the center of the MRZ sub-image as the rotation center and employs bilinear interpolation to rotate the sub-image by -2° (i.e., the tilt angle estimated by reverse rotation), thereby obtaining a rotated MRZ image. This image is larger in size than the atomic image and exhibits black invalid regions at the four corners.

[0156] Step A406: Calculate the largest inscribed axis alignment rectangle in the MRZ image after rotation;

[0157] It should be noted that in this embodiment, the aim is to find the maximum boundary of the valid content in the rotated image.

[0158] Step A407: Based on the maximum inscribed axis aligned rectangle, crop the rotated MRZ image to remove the black borders and jagged areas generated by the rotation, and obtain the MRZ cropped area.

[0159] It should be noted that, in this embodiment, the MRZ cropped area refers to the neat, machine-readable image obtained after cropping with the maximum inscribed rectangle, after removing all invalid edges. This step, based on the calculated maximum inscribed rectangle, precisely crops the rectified image, removing all interfering black backgrounds and jagged edges, ultimately outputting a clean and neat machine-readable image.

[0160] This embodiment first accurately extracts the target region, then intelligently estimates the tilt angle through edge analysis and performs rotation correction, effectively solving the text line tilt problem caused by the shooting angle; and by introducing a maximum inscribed axis aligned rectangle cropping strategy, the unavoidable angle estimation error and black edge interference during rotation are transformed into controllable uniform white space around the image, rather than distorted character projections or jagged edges, ensuring the geometric stability and purity of the input image in the character segmentation stage, and greatly improving the overall robustness and recognition accuracy of the system under slight tilt conditions.

[0161] Furthermore, referring to Figure 5 This application provides a flowchart in the fifth embodiment of the image recognition method based on chromaticity domain localization and topological constraints, based on the above. Figure 5 The embodiment shown further refines the step of "segmenting the MRZ clipping region into characters based on format constraints" in step S50, including steps A501 to A505:

[0162] Step A501: Perform vertical projection analysis on the MRZ cutting area to obtain the gray value distribution curve of the MRZ cutting area in the horizontal direction;

[0163] It should be noted that in this embodiment, vertical projection analysis refers to the sum of gray values ​​(or the number of foreground pixels) in each column of the image, resulting in a curve distributed along the horizontal direction. The gray value distribution curve of the MRZ cropped area in the horizontal direction is a curve obtained through vertical projection analysis. The horizontal axis of this curve corresponds to the horizontal direction (X-axis) of the image, while the vertical axis reflects the cumulative gray value or the number of foreground pixels in each column. In machine-readable images, the column containing characters usually has a higher projection value because it contains more black pixels, while the columns between characters have lower projection values. Specifically, the system performs vertical projection analysis on the upright MRZ cropped area (grayscale image), calculates the sum of the gray values ​​of all pixels in each column of the image, and thus obtains a gray value distribution curve with peaks at the character positions and troughs at the character gap positions.

[0164] Step A502: Based on the image width of the MRZ cropping region, select a corresponding segmentation threshold from a set of preset segmentation thresholds, wherein the segmentation threshold is negatively correlated with the image width;

[0165] It should be noted that in this embodiment, the image width is the number of pixels in the horizontal direction of the MRZ cropping region. The preset multiple segmentation thresholds refer to several segmentation thresholds pre-set by the system, corresponding to different image width ranges. The segmentation thresholds are used to determine whether the troughs of the projection curve are sufficient to constitute a character gap; regions with projection values ​​below this threshold are considered candidate gaps. This step dynamically adjusts the sensitivity of character segmentation based on the resolution characteristics of the input image. For wide images, character gaps appear wider and deeper on the projection curve, so a smaller threshold can be used for fine segmentation; for narrow images, gap features are not obvious, requiring a larger threshold to avoid misjudging small gaps within characters as character separations.

[0166] In one possible implementation, the segmentation threshold can be selected based on a lookup table or a piecewise function. For example, when the image width W < 700, a segmentation threshold of 5 is selected; when 700 ≤ W ≤ 900, a segmentation threshold of 2 is selected; and when W > 900, a segmentation threshold of 1 is selected.

[0167] Step A503: Based on the segmentation threshold, perform character gap positioning on the grayscale value distribution curve, perform initial character segmentation, and obtain an initial character sequence;

[0168] It should be noted that in this embodiment, initial character segmentation refers to determining the left and right boundaries of each character on the original image based on the located character gaps, thereby segmenting the text line image into a series of independent character image blocks. The initial character sequence refers to the set composed of the initially segmented character image blocks in sequence. This step utilizes the trough features of the projection curve, combined with an adaptively selected threshold, to accurately find the separation points between characters, achieving automated character segmentation and decomposing the continuous text line image into discrete individual character images.

[0169] Step A504: Based on the predefined MRZ layout information, the initial character sequence is detected, wherein the detection includes at least the number of characters, character spacing, and check digit verification;

[0170] It should be noted that in this embodiment, the number of characters refers to the total number of character image blocks segmented from the initial character sequence, which should be consistent with the number required by the standard layout. The horizontal distance between adjacent character image blocks should conform to the general rule of equal character width or uniform spacing under the MRZ layout. Checksum verification refers to calculating a specific field and verifying whether its checksum character matches the calculated result. By introducing high-level semantic constraints, the quality of the low-level image processing results is evaluated, and errors that may occur in the segmentation stage are detected in a timely manner, such as over-segmentation (more characters) or under-segmentation (fewer characters).

[0171] Step A505: When an abnormal character interval is detected, a backtracking and re-slicing mechanism is triggered. The backtracking and re-slicing mechanism includes deleting the previous segmentation character, adjusting the segmentation position, and then re-slicing.

[0172] It should be noted that in this embodiment, the backtracking reslicing mechanism can revert to a previous decision point and try different slice options when the system detects that the result under the current slice path does not meet expectations. Deleting the previous sliced ​​character means removing the most recently added character image block and its corresponding slice boundary from the initial character sequence. When an anomaly is detected based on the layout, the system eliminates slice errors caused by local projection curves by backtracking and fine-tuning the slice points, thereby converging to the correct slice result.

[0173] In one possible implementation, the backtracking and re-cutting mechanism can be controlled by a finite state machine to ensure a limited number of backtracking attempts and avoid getting stuck in an infinite loop.

[0174] This embodiment introduces format constraints and dynamic feedback mechanisms. First, the spatial distribution of the image is transformed into quantifiable curve features through vertical projection analysis, and the segmentation threshold is adaptively selected based on the image resolution, enhancing the method's adaptability to different input conditions. Simultaneously, the system introduces high-level semantic MRZ layout information (such as fixed character count, equal width characteristics, and check bit rules) as hard constraints into the segmentation verification process, enabling real-time quality assessment of low-level image processing results. When abnormal character spacing or layout mismatch is detected, the system can intelligently trigger a backtracking and re-segmentation mechanism, self-correcting by backtracking and adjusting the segmentation position. This effectively solves the problem of over-segmentation and under-segmentation of characters caused by local blurring of the projection curve or noise interference in traditional methods, significantly reducing the error rate and result jitter in the segmentation stage.

[0175] In one possible implementation, the step of adjusting the segmentation parameters and retry strategy using an uncertainty propagation scheduling mechanism to output multiple single-character images includes:

[0176] During the segmentation process, one or more quality indicators among mask coverage, boundary entropy, and hole ratio are calculated in real time.

[0177] Based on the comparison between the value of the quality indicator and the preset threshold, the segmentation threshold and retry strategy are adjusted. Specifically, when the quality indicator is lower than the first threshold, the segmentation threshold is increased and backtracking and re-segmentation are allowed; when the quality indicator is higher than the second threshold, an early stop mechanism is executed, where the first threshold is less than the second threshold.

[0178] When the initial character sequence meets the predefined MRZ format requirements and passes the check digit verification, the segmentation process is terminated early, and the final segmented single-character images are output.

[0179] It should be noted that in this embodiment, robust character segmentation is achieved by employing an uncertainty propagation scheduling mechanism to adjust segmentation parameters and retry strategies. This uncertainty propagation scheduling mechanism is a dynamic feedback control system that uses the quality assessment results of previous processing stages or the current processing state as the basis for adjusting subsequent operation parameters. Mask coverage refers to the proportion of the text foreground pixels identified by a high-quality mask within the MRZ cropping region, reflecting the integrity and clarity of the text region. Boundary entropy is an indicator used to quantify the degree of pixel value disorder at character boundaries; a high entropy value indicates blurred boundaries or noise interference. The hole ratio characterizes the ratio of the area of ​​internal holes within a character region to the total area of ​​the character, reflecting the integrity of the character's topological structure. These quality indicators collectively constitute a multi-dimensional evaluation of the reliability of the current intermediate processing results. The early stopping mechanism refers to a strategy that immediately terminates subsequent processing to improve efficiency when the result has reached sufficient quality.

[0180] This embodiment establishes a closed loop of perception-decision-execution, transforming the uncertainty of image quality into operable control signals. Specifically, it continuously monitors quality indicators that reflect the difficulty and quality of image processing. When the indicators show high uncertainty (e.g., poor image quality), a more conservative and lenient strategy is automatically adopted to enhance robustness; conversely, when the indicators show low uncertainty (e.g., good image quality), a more proactive and efficient strategy is employed to optimize speed. This effectively reduces the dependence of the segmentation process on a single fixed parameter, significantly improving the system's adaptability and overall efficiency under complex operating conditions.

[0181] Furthermore, referring to Figure 6 The sixth embodiment of the image recognition method based on chromaticity domain localization and topological constraints in this application provides a flowchart, based on the above. Figure 6 The embodiment shown further refines the step S60, "extracting HOG features from the single-character image and using a linear SVM classifier to classify the characters, obtaining a preliminary recognition result and classification score for each character," including steps A601 to A604:

[0182] Step A601: Normalize the size of each single character image to a preset fixed size;

[0183] Step A602: Calculate HOG features on the normalized single-character image;

[0184] It should be noted that in this embodiment, HOG features refer to Histogram of Oriented Gradients, where the appearance and shape of a local object can be well described by the distribution of gradient directions or edge directions in a local area of ​​the image. Specifically, the image is divided into small connected regions (cell units), and the histograms of gradient directions or edge directions of all pixels within each cell unit are statistically analyzed. These histograms are then combined to form a feature descriptor. To handle changes in illumination and shadows, these local histograms also need to be contrast-normalized within a larger image block (block region).

[0185] Step A603: Input the HOG features into a pre-trained multi-class linear support vector machine classifier and output the preliminary classification score of each character belonging to each candidate character category;

[0186] It should be noted that in this embodiment, the multi-class linear support vector machine classifier is a machine learning model trained offline using a large number of HOG feature samples labeled with real character categories. The preliminary classification score is the confidence measure of each candidate character category output by the classifier with the input HOG features, such as a function value calculated based on the distance to the decision boundary, or a calibrated probability estimate.

[0187] Step A604: In the preliminary classification score, the candidate character category with the highest score for each character is selected as the preliminary recognition result and classification score for each character.

[0188] It should be noted that in this embodiment, the best candidate character category is selected from all candidate character categories based on its corresponding preliminary classification score. The preliminary recognition result refers to the temporary category label determined for the character based on the current image features and classification model. The classification score specifically refers to the preliminary classification score corresponding to the selected category, representing the confidence level of the current model in this recognition result.

[0189] This embodiment achieves the core function of character recognition under low computational constraints through standardized feature extraction and efficient linear model classification. Specifically, size normalization eliminates scale and deformation differences in the input image, providing a unified benchmark for feature extraction. Then, leveraging the powerful characterization capabilities of HOG features for character shape and contour gradient direction, image information is transformed into stable and highly discriminative feature representations. Finally, a computationally efficient linear SVM classifier is used for rapid multi-class classification, outputting comparable classification scores. While ensuring recognition accuracy, it significantly reduces computational complexity and memory usage. Its predictable operator behavior and near-linear computational flow meet the real-time requirements and resource deterministic upper bounds of edge devices.

[0190] Furthermore, referring to Figure 7 The seventh embodiment of the image recognition method based on chromaticity domain localization and topological constraints in this application provides a flowchart, based on the above. Figure 7 The embodiment shown further refines the step S70 of "generating a structural prior score by combining the field position of the MRZ cropping region, the predefined character set, and the check bit rules, and then weighting and fusing the structural prior score with the classification score to obtain the final recognition score," including steps A701 to A707:

[0191] Step A701: Determine the position index of the currently recognized character in the field according to the standard layout of the MRZ cropping area;

[0192] It should be noted that in this embodiment, "field" refers to a data unit with specific semantics within an MRZ text line, such as document type, issuing country, name, document number, check digit, etc. The position index refers to the sequential number of the character to be identified within its MRZ text line, or more precisely, the character's position within its specific field. Based on known formatting specifications, the contextual position of the currently processed character within the overall MRZ string is precisely determined.

[0193] Step A702: Based on the position index, obtain the predefined character set of the currently identified character;

[0194] It should be noted that, in this embodiment, the predefined character set refers to the set of all valid characters allowed to appear in a specific position within a specific field, as specified by the MRZ standard format. For example, in the ID number field, typically only numbers (0-9) and the filler character < are allowed; while in the name field, uppercase letters (AZ), spaces, specific separators, and filler characters may be allowed. By limiting the range of candidate characters, character categories that are impossible to appear in a specific position can be effectively excluded, thereby reducing the possibility of misjudgment.

[0195] Step A703: Determine whether each candidate character category of the currently identified character belongs to the predefined character set. If it belongs to the predefined character set, assign a positive character set prior score; otherwise, assign zero or negative score.

[0196] It should be noted that in this embodiment, candidate character categories refer to all possible character types that the linear SVM classifier can recognize. The character set prior score refers to the reward or penalty score assigned based on whether a candidate character category conforms to the positional character set constraint. This step transforms the hard constraint of the character set into a soft score incentive, guiding the system to tend to select characters that meet the positional requirements. Giving positive scores to candidate categories that conform to the character set enhances their competitiveness; giving zero or negative scores to categories that do not conform reduces their likelihood of being selected.

[0197] Step A704: Based on the character sequence formed by the preliminary recognition results, calculate the check bit of the specified field according to the preset rules, and traverse all candidate character categories according to the character position of the check bit;

[0198] It should be noted that in this embodiment, the character sequence composed of the preliminary recognition results refers to a complete or partial MRZ string temporarily assembled based on the preliminary recognition results of all characters (i.e., the category with the highest score for each character). The preset rule refers to the algorithm defined in the standard for calculating the check digit of a specific field, such as the weighted modulo 10 check algorithm specified in ICAO DOC 9303. The "specified field" refers to a field explicitly required to undergo check digit verification in the standard, such as ID number, date of birth, and expiration date. Calculating the check digit of the specified field means calculating the theoretical check digit value according to the standard algorithm based on the preliminarily recognized data characters of that field. This step uses the check digit to verify and correct possible character recognition errors.

[0199] In one specific implementation, the system extracts the known data characters (assumed to be "123456789") from the "passport number" field based on the current preliminary identification results, and then calculates the check digit value according to the ICAO standard check digit algorithm to obtain the theoretical check digit value of "8".

[0200] Step A705: If there exists a character that belongs to the check bit, and the candidate character category of the character passes the check bit verification, then assign a positive check bit prior score to the candidate character category.

[0201] It should be noted that in this embodiment, the character position of the check bit refers to the position in the MRZ layout specifically used to store the check bit for a particular field. Check bit verification means that if, after substituting a candidate character category into the check bit position, the theoretical check bit calculated based on its corresponding field data character matches the candidate character category. This embodiment utilizes check bits to provide significant positive incentives for candidate character categories that enable the entire field to pass verification. It also helps correct characters that might be misclassified during image classification but are logically correct from a global perspective, especially effective for distinguishing easily confused characters such as "0 / O" and "1 / I".

[0202] Step A706: Add the character set prior score to the check bit prior score and merge them into a single structure prior score;

[0203] It should be noted that in this embodiment, the character set prior score is obtained based on the local position character set constraint. The check bit prior score is obtained based on the global field logic verification.

[0204] Step A707: For each candidate character category of each character, the classification score and the prior structure score of each character are linearly weighted and fused according to a preset weight formula to obtain the final recognition score.

[0205] It should be noted that in this embodiment, the classification score refers to the original score given by the linear SVM classifier based on HOG features, reflecting the similarity between the character image and each category. The preset weight formula refers to the linear equation used to balance the relative importance of the classification score and the structural prior score, which is S. final = S linear + λS prior Where λ is a preset weighting coefficient, and S linear It is a category score, S prior It is the structural prior score, and the final recognition score S. final It is a weighted score used for the final decision.

[0206] This embodiment effectively enhances character recognition decision-making capabilities by systematically introducing and fusing structural prior knowledge. Specifically, the hard constraints of the MRZ standard format (field position character set, checksum rules) are transformed into quantifiable soft scores. Through a dual mechanism of character set compliance rewards and checksum verification rewards, powerful domain knowledge guidance is injected into the image feature-based classification results. This fusion solves the common problem of misclassification of easily confused characters when relying solely on image classification, significantly improving the ability to distinguish visually similar characters such as "0 / O" and "1 / I". Simultaneously, through linear weighted fusion, the system flexibly introduces semantic-level correction capabilities based on image evidence. This ensures classification accuracy when image quality is good, while maintaining the rationality of the recognition results through structural constraints, thereby significantly improving the overall accuracy and robustness of the final recognition results.

[0207] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the image recognition method based on chromaticity domain localization and topological constraints of this application. Any simple transformations based on this technical concept are within the protection scope of this application.

[0208] This application also provides an image recognition device based on chromaticity domain localization and topological constraints. Please refer to [link / reference]. Figure 8 The image recognition device based on chromaticity domain localization and topological constraints includes:

[0209] An image receiving module is used to receive input images;

[0210] A mask generation module is used to generate an initial mask for the image using dual criteria, and to filter the initial mask based on the topological properties of connected components to obtain a first mask;

[0211] The chromaticity gamut localization module is used to render the first mask into the target chromaticity gamut using artificial color embedding technology, and to perform MRZ color block localization in the chromaticity space and extract the MRZ region.

[0212] The geometric correction module is used to perform edge-line-based tilt estimation and maximum inscribed clipping on the MRZ region to obtain the MRZ clipping region;

[0213] The segmentation control module is used to segment the MRZ cropping region into characters based on format constraints, and to adjust the segmentation parameters and retry strategy using an uncertainty propagation scheduling mechanism to output multiple single-character images;

[0214] The character recognition module is used to extract HOG features from the single character image and use a linear SVM classifier to classify the characters, obtaining a preliminary recognition result and classification score for each character.

[0215] The prior fusion module is used to generate a structural prior score by combining the field position of the MRZ cropping region, the predefined character set and the check bit rules, and to perform a weighted fusion of the structural prior score and the classification score to obtain the final recognition score.

[0216] The assembly output module is used to determine the optimal category of each character based on the final recognition score, and to assemble the recognized character sequence into a complete MRZ text and output it according to preset rules.

[0217] The image recognition device based on chromaticity domain localization and topological constraints provided in this application, employing the image recognition method based on chromaticity domain localization and topological constraints in the above embodiments, can solve the technical problem of how to achieve stable, efficient, and predictable performance boundaries for MRZ recognition under low computing power terminals and complex imaging conditions. Compared with the prior art, the beneficial effects of the image recognition device based on chromaticity domain localization and topological constraints provided in this application are the same as those of the image recognition method based on chromaticity domain localization and topological constraints provided in the above embodiments, and other technical features in the image recognition device based on chromaticity domain localization and topological constraints are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0218] This application provides an image recognition device based on chromaticity gamut localization and topological constraints. The image recognition device based on chromaticity gamut localization and topological constraints includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the image recognition method based on chromaticity gamut localization and topological constraints in the above embodiment 1.

[0219] The following is for reference. Figure 9 This document illustrates a structural schematic diagram of an image recognition device based on chromaticity gamut localization and topological constraints suitable for implementing embodiments of this application. The image recognition device based on chromaticity gamut localization and topological constraints in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 9 The image recognition device based on chromaticity domain localization and topological constraints shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0220] like Figure 9 As shown, an image recognition device based on chromaticity gamut localization and topological constraints may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the image recognition device based on chromaticity gamut localization and topological constraints. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows the image recognition device based on chromaticity gamut localization and topology constraints to communicate wirelessly or wiredly with other devices to exchange data. While the figures show image recognition devices based on chromaticity gamut localization and topology constraints with various systems, it should be understood that implementing or having all of the systems shown is not required. More or fewer systems may be implemented alternatively.

[0221] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0222] The image recognition device based on chromaticity domain localization and topological constraints provided in this application, employing the image recognition method based on chromaticity domain localization and topological constraints in the above embodiments, can solve the technical problem of how to achieve stable, efficient, and predictable MRZ recognition under low computing power terminals and complex imaging conditions. Compared with the prior art, the beneficial effects of the image recognition device based on chromaticity domain localization and topological constraints provided in this application are the same as those of the image recognition method based on chromaticity domain localization and topological constraints provided in the above embodiments, and other technical features in this image recognition device based on chromaticity domain localization and topological constraints are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0223] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0224] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0225] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the image recognition method based on chromaticity gamut localization and topological constraints in the above embodiments.

[0226] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0227] The aforementioned computer-readable storage medium may be included in an image recognition device based on chromaticity gamut localization and topological constraints; or it may exist independently and not be assembled into an image recognition device based on chromaticity gamut localization and topological constraints.

[0228] The aforementioned computer-readable storage medium carries one or more programs that, when executed by an image recognition device based on chromaticity domain localization and topological constraints, cause the image recognition device based on chromaticity domain localization and topological constraints to: receive an input image; generate an initial mask for the image using dual criteria, and filter the initial mask based on connected component topological properties to obtain a first mask; render the first mask as a target color gamut using artificial color embedding technology, and perform MRZ color block localization in the chromaticity space to extract MRZ regions; perform edge-line-based tilt estimation and maximum incircle clipping on the MRZ regions to obtain MRZ clipped regions; and perform format constraints on the image... The MRZ cropping region is used for character segmentation, and an uncertainty propagation scheduling mechanism is employed to adjust the segmentation parameters and retry strategy, outputting multiple single-character images. HOG features are extracted from the single-character images, and a linear SVM classifier is used for character classification to obtain preliminary recognition results and classification scores for each character. A structural prior score is generated by combining the field position of the MRZ cropping region, a predefined character set, and checksum rules. The structural prior score and the classification score are then weighted and fused to obtain the final recognition score. The optimal category for each character is determined based on the final recognition score, and the recognized character sequences are assembled into a complete MRZ text according to preset rules and output.

[0229] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0230] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0231] The modules described in this embodiment can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0232] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described image recognition method based on chromaticity domain localization and topological constraints. This solves the technical problem of how to achieve stable, efficient, and predictable performance boundaries for MRZ recognition under low-computing-power terminals and complex imaging conditions. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the image recognition method based on chromaticity domain localization and topological constraints provided in the above embodiments, and will not be repeated here.

[0233] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the image recognition method based on chromaticity gamut localization and topological constraints as described above.

[0234] The computer program product provided in this application can solve the technical problem of how to achieve stable, efficient, and predictable performance boundaries for MRZ recognition under low computing power terminals and complex imaging conditions. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the image recognition method based on chromaticity domain localization and topological constraints provided in the above embodiments, and will not be repeated here.

[0235] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A method for image recognition based on chroma domain positioning and topological constraints, characterized in that, The image recognition method based on colorimetric domain positioning and topological constraint comprises the following steps: receiving an input image; generating an initial mask for the image by using double criteria, and filtering the initial mask based on a connected domain topological property to obtain a first mask; wherein the double criteria refer to two independent criteria for distinguishing based on local contrast and pixel absolute darkness respectively; the initial mask refers to a binary image that may contain a text region and is preliminarily screened out by the double criteria; the connected domain topological property refers to an overall structural feature of a connected pixel region in the image that remains unchanged under continuous deformation, including Euler number of the region and connectivity of the region itself; rendering the first mask into a target color gamut by using an artificial color embedding technology, and positioning an MRZ block in a colorimetric space to extract an MRZ region; performing edge line-based tilt estimation and maximum inscribed cutting on the MRZ region to obtain an MRZ cutting region; performing character segmentation on the MRZ cutting region based on format constraint, and adjusting segmentation parameters and retry strategies by using an uncertainty conduction scheduling mechanism to output a plurality of single character images; wherein the step of performing character segmentation on the MRZ cutting region based on format constraint comprises: performing vertical projection analysis on the MRZ cutting region to obtain a gray value distribution curve of the MRZ cutting region in the horizontal direction; selecting a corresponding segmentation threshold from a plurality of preset segmentation thresholds according to the image width of the MRZ cutting region, wherein the segmentation threshold is negatively correlated with the image width; positioning a character gap based on the segmentation threshold to perform initial character segmentation on the gray value distribution curve to obtain an initial character sequence; detecting the initial character sequence based on predefined MRZ format information, wherein the detection at least includes character quantity, character interval and check bit verification; when an abnormal character interval is detected, triggering a backtracking and re-cutting mechanism, wherein the backtracking and re-cutting mechanism includes deleting the last segmented character, adjusting the segmentation position, and then re-segmenting; extracting HOG features from the single character images, and performing character classification by using a linear SVM classifier to obtain a preliminary recognition result and a classification score of each character; combining the field position of the MRZ cutting region, the predefined character set and the check bit rule to generate a structure prior score, and weighting and fusing the structure prior score and the classification score to obtain a final recognition score; determining the optimal category of each character through the final recognition score, and assembling the recognized character sequence into a complete MRZ text according to a preset rule and outputting the MRZ text.

2. The image recognition method based on chromaticity domain positioning and topology constraints according to claim 1, characterized in that, The step of preprocessing the input image comprises: decoding the input image to obtain an RGB image; converting the RGB image into a gray image, and down-sampling the gray image to obtain a preprocessed gray image.

3. The image recognition method based on chroma domain positioning and topology constraints as claimed in claim 2, wherein, The step of generating an initial mask for the image by using double criteria, and filtering the initial mask based on a connected domain topological property to obtain a first mask comprises: performing a black hat operation on the gray image, and binarizing the black hat operation result by using an Otsu threshold method to obtain a contrast criterion mask; The grayscale image is subjected to Gaussian blur processing to obtain a local mean image, and the local mean image is subtracted by a preset constant bias value to obtain an adaptive threshold value. The grayscale value of each pixel in the grayscale image is compared with the adaptive threshold value at the corresponding position to generate a darkness criterion mask; The contrast criterion mask and the darkness criterion mask are subjected to logical AND operation to generate an initial mask; The initial mask is subjected to hole-preserving connected component analysis to identify all connected regions; The area and Euler number of each connected region are calculated, and the connected regions are filtered based on a preset area threshold range and Euler number threshold range to remove false connected regions. The first mask is formed based on the remaining connected regions.

4. The image recognition method based on chroma domain positioning and topology constraints as claimed in claim 3, wherein, The step of rendering the first mask into a target color gamut using an artificial color embedding technique and positioning the MRZ color block in the color space to extract the MRZ region includes: The original RGB image or the original image region corresponding to the preprocessed grayscale image is subjected to affine color rendering through the first mask to generate an affine color embedded image, wherein the foreground region is rendered into a first predetermined color and the background region is rendered into a second predetermined color; The affine color embedded image is converted from the RGB color space to the HSV color space; In the color channel of the HSV color space, threshold segmentation is performed based on a hue saturation threshold range corresponding to the second predetermined color to obtain a candidate color block region; The candidate color block region is subjected to geometric feature discrimination to screen out connected regions that meet the geometric layout features of the MRZ region, wherein the geometric feature discrimination at least includes evaluating the area aspect ratio, area, and color consistency of the region; The target MRZ region is determined from the screened connected regions, and the bounding box of the target MRZ region is output to complete the extraction of the MRZ region.

5. The image recognition method based on chromaticity domain positioning and topology constraints according to claim 4, characterized in that, The step of performing edge line-based tilt estimation and maximum inscribed cropping on the MRZ region to obtain an MRZ cropped region includes: Based on the bounding box of the MRZ region, an MRZ sub-image is extracted from the original image or the preprocessed image; Edge detection is performed on the MRZ sub-image to obtain an edge point set; Based on the edge point set, the edge direction consistency score under different candidate tilt angles is calculated within a preset angle search range; The candidate tilt angle with the maximum edge direction consistency score is selected as the estimated tilt angle; The MRZ sub-image is rotated and corrected according to the estimated tilt angle to obtain a rotated MRZ image; The maximum inscribed axis-aligned rectangle in the rotated MRZ image is calculated; The rotated MRZ image is cropped based on the maximum inscribed axis-aligned rectangle to remove the black edges and jagged regions generated by rotation, and an MRZ cropped region is obtained.

6. The image recognition method based on chromaticity domain positioning and topology constraints according to claim 5, characterized in that, The step of adjusting the segmentation parameters and retry strategy using an uncertainty propagation scheduling mechanism to output multiple single character images includes: During the segmentation process, one or more quality indicators such as mask coverage, boundary entropy, and hole ratio are calculated in real time; According to a comparison result of the value of the quality index and a preset threshold, the segmentation threshold and a retry strategy are adjusted, wherein when the quality index is lower than a first threshold, the segmentation threshold is increased and a backtracking re-segmentation is allowed; when the quality index is higher than a second threshold, an early stopping mechanism is executed, and the first threshold is lower than the second threshold; When the initial character sequence meets a predefined MRZ format requirement and passes a check digit verification, the segmentation process is terminated in advance, and a plurality of single character images obtained by final segmentation are output.

7. The image recognition method based on chromaticity domain positioning and topology constraints according to claim 6, characterized in that, The step of extracting HOG features from the single character images and classifying the characters using a linear SVM classifier to obtain a preliminary recognition result and a classification score of each character includes: normalizing a size of each single character image to a preset fixed size; calculating HOG features on the normalized single character image; inputting the HOG features into a pre-trained multi-class linear support vector machine classifier to output a preliminary classification score of each character belonging to each candidate character category; in the preliminary classification score, filtering a candidate character category with the highest score of each character as a preliminary recognition result and a classification score of each character.

8. The image recognition method based on chromaticity domain positioning and topology constraints according to claim 7, characterized in that, The step of generating a structure prior score in combination with a field position of the MRZ cutting region, a predefined character set and a check digit rule, and weighting and fusing the structure prior score and the classification score to obtain a final recognition score includes: determining a position index of a current recognized character in the field according to a standard format of the MRZ cutting region; based on the position index, obtaining a predefined character set of the current recognized character; judging whether each candidate character category of the current recognized character belongs to the predefined character set, if yes, assigning a positive character set prior score, otherwise, assigning zero or negative score; based on a character sequence composed of the preliminary recognition result, calculating a check digit of a specified field according to a preset rule, and traversing all candidate character categories according to a character position of the check digit; if there is a character belonging to the check digit, and the candidate character category of the character passes the check digit verification, assigning a positive check digit prior score to the candidate character category; adding the character set prior score and the check digit prior score to obtain a single structure prior score; for each candidate character category of each character, linearly weighting and fusing the classification score and the structure prior score of each character according to a preset weight formula to obtain a final recognition score.

9. An image recognition device based on chroma domain positioning and topology constraints, characterized in that, The device includes a memory, a processor and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the image recognition method based on colorimetric domain positioning and topological constraint according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Image detection method and device and electronic equipment

    CN120833615A