Card image recognition method and device, electronic equipment and storage medium

By using a card and document image recognition method, the problems of adaptability and accurate positioning in card and document image recognition technology have been solved, enabling efficient recognition and structured processing of different card and document types, thereby improving recognition efficiency and accuracy.

CN121861676APending Publication Date: 2026-04-14HEBEI CHANGFENG INFORMATION TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-22
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing card and document image recognition technologies lack adaptability, cannot accurately identify the layout characteristics of different types of cards and documents, and their positioning accuracy is greatly affected by the shooting angle and quality. Furthermore, text recognition and structured processing are disconnected, resulting in low recognition efficiency.

Method used

By identifying types, correcting them, and mapping coordinates, the system accurately matches card types, extracts information field areas, and generates structured information.

Benefits of technology

It enables accurate identification of different card and certificate types, reduces manual intervention, improves identification efficiency and accuracy, and meets the needs of subsequent data applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121861676A_ABST
    Figure CN121861676A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer vision, and discloses a card image recognition method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a to-be-identified card image; performing type identification on the card image to determine a card type corresponding to the card image; based on the card type, carrying out correction processing including rotation correction, boundary cutting and resolution standardization on the card image; according to the card type, a corresponding coordinate mapping relation is obtained from a preset configuration library, and the coordinate mapping relation comprises coordinate ranges of a plurality of information fields; based on the corrected card image, extracting an image area corresponding to each information field according to the coordinate mapping relation; performing text recognition on each image area to obtain text content of each information field; and according to a preset sequence of the information fields, combining the text contents to generate structured card information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, specifically to card and certificate image recognition methods and devices, electronic devices, and storage media. Background Technology

[0002] Current card and document image recognition primarily employs fixed template matching or general OCR region detection. Existing technologies lack effective adaptive recognition mechanisms for different types of cards and documents, often relying on a uniform processing flow. Fixed image correction parameters fail to adapt to the varied layouts of different cards and documents. Field localization methods are simplistic, depending on manually set rules, and their accuracy is significantly affected by the shooting angle and quality. Text recognition and structured processing are disconnected, resulting in output results lacking standardized data organization. Existing methods need to address key technical challenges such as multi-type adaptive recognition, accurate localization, and structured output.

[0003] The shortcomings of traditional card and document recognition methods are also reflected in their handling of details and scalability. The type recognition stage relies on manual selection or simple feature matching, lacking an efficient automatic classification mechanism, resulting in a high false recognition rate. The coordinate mapping library is outdated, offering insufficient support for new card and document formats and failing to adapt to constantly evolving styles. The text recognition engine is simplistic, and its recognition rate drops significantly when dealing with cards and documents featuring mixed fonts and complex layouts. Furthermore, the unified processing flow across card and document types does not consider the unique information layout of each type of card and document. For example, the arrangement of personal information on an ID card differs significantly from the layout of property ownership information on a real estate certificate. A unified process can easily lead to incomplete extraction of key information, requiring substantial additional manual labor for subsequent data processing, further reducing recognition efficiency and application value. Summary of the Invention

[0004] The purpose of this invention is to provide a card image recognition method and apparatus, electronic device, and storage medium to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides a card / certificate image recognition method, the method comprising: Acquire the image of the card or document to be identified, wherein the image of the card or document includes at least one of an ID card, social security card, property ownership certificate, or real estate certificate; The card image is subjected to type recognition to determine the card type corresponding to the card image; Based on the card type, the card image is corrected, including rotation correction, boundary cropping, and resolution normalization. Based on the card type, the corresponding coordinate mapping relationship is obtained from the preset configuration library, and the coordinate mapping relationship includes the coordinate range of multiple information fields; Based on the corrected card image, the image region corresponding to each information field is extracted according to the coordinate mapping relationship; Text recognition is performed on each of the image regions to obtain the text content of each information field; The text content is combined according to the preset order of the information fields to generate structured card information.

[0006] Preferably, the step of performing type recognition on the card image includes: Extract global features from the card image, including color distribution, texture features, and shape features; The global features are input into a pre-trained classification model, which outputs the probability that the card image belongs to each card type. Based on the probability, the card type with the highest probability is selected as the card type corresponding to the card image.

[0007] Preferably, the correction processing of the card image includes: Detect multiple key points in the card image, the multiple key points corresponding to corner points or marker points of the card; Based on the aforementioned key points, the rotation angle and bounding box of the card image are calculated; The card image is rotated and corrected according to the rotation angle so that the card image is horizontally aligned; The rotated card image is cropped according to the bounding box to remove the background area; Resize the cropped card image to a standard size.

[0008] Preferably, the coordinate mapping relationship is obtained by analyzing the standard card template, and the coordinate range of each information field is defined based on the pixel position; The step of obtaining the preset coordinate mapping relationship according to the card type includes loading the coordinate mapping relationship from a local database or a remote server.

[0009] Preferably, the text recognition for each of the image regions includes: The image region is preprocessed, including binarization, noise reduction, and character segmentation; The segmented characters are identified and verified using a character recognition algorithm. Errors are corrected based on a dictionary or rules to obtain the text content.

[0010] Preferably, the step of combining the text content according to the preset order of the information fields includes: Obtain the information field order configuration file corresponding to the card type, wherein the information field order configuration file defines a preset order of multiple information fields; The text content of each information field is read sequentially according to the order in the information field order configuration file. Match the text content of each information field with the corresponding field name to generate key-value pairs of field name and text content; According to the order in the information field sequence configuration file, multiple key-value pairs are concatenated into a structured text string to generate structured card information.

[0011] Preferably, the extraction of global features from the card image includes color distribution, texture features, and shape features, including: The card image is subjected to color space conversion, and the histogram distribution of each color channel is calculated to obtain the color distribution characteristics; The card image is converted into a grayscale image, the grayscale co-occurrence matrix of the grayscale image is calculated, and the contrast and energy values ​​are extracted from the grayscale co-occurrence matrix as texture features. The card image is processed by an edge detection algorithm to obtain a set of card outline points. The outline area and the angle of the minimum bounding rectangle are calculated based on the outline point set as shape features.

[0012] Preferably, the present invention further includes a card image recognition device, comprising: The image acquisition module is used to acquire images of the cards or certificates to be recognized. A type recognition module is used to perform type recognition on the card image to determine the card type corresponding to the card image; The correction processing module is used to perform correction processing on the card image based on the card type. The correction processing includes rotation correction, boundary cropping, and resolution normalization. The coordinate mapping acquisition module is used to acquire a preset coordinate mapping relationship from a preset configuration library according to the card type. The coordinate mapping relationship includes the coordinate range of multiple information fields. The region extraction module extracts the image region corresponding to each information field based on the corrected card image and according to the coordinate mapping relationship. The text recognition module is used to perform text recognition on the image region to obtain the text content of each information field; The information generation module is used to combine text content according to the preset order of information fields to generate structured card information.

[0013] Preferably, the present invention further includes an electronic device, comprising a processor and a memory, wherein the memory stores a computer program, and the computer program, when executed by the processor, implements the above-described card image recognition method.

[0014] Preferably, the present invention further includes a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-described card image recognition method.

[0015] Compared with the prior art, the beneficial effects of the present invention are: Type identification is performed on card images to determine their specific card type. Type identification accurately distinguishes the layout and content features of different cards. By accurately identifying the card type, the correct processing path is provided for subsequent processing. Corrective processing based on the card type, including rotation correction, boundary cropping, and resolution normalization, can accurately match the size and corner features of various cards, reduce interference from complex backgrounds, and improve the accuracy of image preprocessing.

[0016] Based on the identified card type, the corresponding coordinate mapping relationship is retrieved from a pre-defined configuration library. The configuration library stores field coordinate information for different card types, including the location range of each information item. The coordinate mapping relationship is obtained through training with a large number of samples to ensure positioning accuracy. The mapping relationship is dynamically updated according to the card version to adapt to layout changes. Precise field positioning is achieved through the coordinate mapping corresponding to the card type.

[0017] Based on the card / certificate type, the system extracts information field image regions by calling the corresponding coordinate mapping relationship, reducing over-reliance on manually set rules and minimizing the impact of shooting angle and image quality on field positioning, thus reducing field overlap or omissions. After text recognition of each image region, the information fields are combined in a preset order to generate structured card / certificate information. This transforms scattered text content into a standardized data organization format, achieving a seamless connection between text recognition and structured processing. This directly meets the needs of subsequent data applications without requiring additional manual processing costs, comprehensively improving the adaptability, accuracy, and practicality of card / certificate recognition. Attached Figure Description

[0018] Figure 1 This is a schematic diagram illustrating the working principle of the card image recognition method described in this invention. Figure 2 A flowchart for card image type recognition; Figure 3 This is a flowchart for the image correction process for ID cards. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Please see Figure 1 The present invention provides a card image recognition method, the specific implementation of which is as follows: The process involves: acquiring the image of the card or document to be identified, including ID cards, social security cards, property ownership certificates, or real estate certificates; performing type recognition on the image to determine the corresponding card or document type; performing correction processing on the image based on the card or document type, including rotation correction, boundary cropping, and resolution normalization; obtaining the corresponding coordinate mapping relationship from a preset configuration library according to the card or document type, the coordinate mapping relationship including the coordinate range of multiple information fields; extracting the image region corresponding to each information field based on the corrected image and the coordinate mapping relationship; performing text recognition on each image region to obtain the text content of each information field; and combining the text content according to the preset order of the information fields to generate structured card or document information.

[0021] Example 1: See Figure 2 In specific implementation, the global features extracted from the card image include color distribution features, texture features, and shape features. Color distribution features are obtained by performing a color space transformation on the card image and calculating the histogram distribution of each color channel. The color space transformation converts the card image from the RGB color space to the HSV color space, and then calculates the histogram distributions for the hue, saturation, and lightness channels respectively. The histogram distribution represents the pixel frequency of each color interval in vector form. Texture features are extracted by converting the card image to a grayscale image and calculating the gray-level co-occurrence matrix (GLCM). Contrast and energy values ​​are extracted from the GLCM as texture features. The contrast value reflects the degree of local variation in the image, and the energy value represents the uniformity of the image texture. Shape features are obtained by processing the card image using an edge detection algorithm to obtain a card contour point set. Based on the contour point set, the contour area and the minimum bounding rectangle angle are calculated. The edge detection algorithm uses the Canny operator to detect edge points. The contour point set forms a closed contour by connecting the edge points. The contour area is obtained by pixel counting, and the minimum bounding rectangle angle is the angle between the long side of the rectangle and the horizontal direction. In some embodiments, the gray-level co-occurrence matrix (GLCM) is calculated based on specific distance and orientation parameters, such as using a pixel distance of 1 and an orientation of 0 degrees to generate the GLCM. Optionally, the color space conversion can be performed using other color spaces, such as the Lab color space.

[0022] In practice, global features are input into a pre-trained classification model. The model outputs the probability value of the card image belonging to each card type. The classification model employs a convolutional neural network structure and is trained using a dataset of labeled images containing multiple card types. Based on the output probability values, the card type with the highest probability is selected as the card type corresponding to the card image. Probability calculation is implemented using a softmax function, ensuring that the sum of the probabilities of all card types is 1. The formula for calculating the contrast value is:

[0023] in: Indicates contrast. and Indicates a grayscale index. This represents the probability that gray levels i and j co-occur in the gray-level co-occurrence matrix. This represents the total number of gray levels. In some embodiments, the classification model can be a support vector machine or a random forest model. Optionally, a threshold can be set in the probability selection process, confirming the card type only when the maximum probability exceeds the threshold.

[0024] When extracting energy values ​​from the gray-level co-occurrence matrix, the probability value of each element in the gray-level co-occurrence matrix is ​​first determined. This probability value is obtained by statistically analyzing the frequency of occurrence of gray-level combinations of adjacent pixels at specific distances and directions in the gray-level image, and then normalizing the frequency. The normalization formula is as follows:

[0025] in: Represents the gray levels in the gray-level co-occurrence matrix and The probability of adjacent occurrences Represents grayscale level and Frequency of adjacent occurrences This represents the total number of gray levels in a grayscale image. The energy value is calculated by squaring the probability values ​​of all elements in the gray-level co-occurrence matrix and summing all the squared results:

[0026] in: This indicates the extracted energy value. The same meaning applies above; the accumulated value is the energy value, which is used to quantitatively reflect the uniformity of image texture.

[0027] Example 2: See Figure 3In practice, multiple key points in the card image are detected. These key points correspond to corner points or marker points on the card. Corner point detection uses the Harris corner detection algorithm on the edge contour of the card image. Marker point detection uses template matching to locate specific patterns or marks on the card. The number of key points is pre-set according to the card type; for example, four corner points are typically detected for ID cards. Based on these key points, the rotation angle and bounding box of the card image are calculated. The rotation angle is obtained by calculating the average angle between the line connecting the key points and the horizontal axis of the image. The bounding box is determined by the minimum bounding rectangle of the key points, defined by the maximum and minimum horizontal and vertical coordinate values ​​of all key points. The card image is rotated and corrected according to the rotation angle by using an affine transformation to rotate the card image around its center by a negative rotation angle value, making the card image horizontally aligned. The rotated card image is then cropped according to the bounding box. The cropping operation directly extracts the pixel area within the bounding box and removes the background area. The cropped card image is then scaled to a standard size, which is a predefined fixed width and height. The scaling uses a bilinear interpolation algorithm to maintain image sharpness. The formula for calculating the rotation angle θ is:

[0028] in: Indicates the rotation angle. This represents the number of keypoint pairs used in the calculation. and This represents the coordinates of the k-th key point. The function is the arctangent function. In some embodiments, keypoint detection may employ a scale-invariant feature transformation method. Optionally, a fixed aspect ratio constraint may be incorporated into the bounding box calculation.

[0029] In practical implementation, the bounding box calculation needs to handle outliers in keypoint coordinates. A random sampling consensus algorithm is used to filter keypoints that deviate from the main plane, ensuring the accuracy of the bounding box. During rotation correction, the transformation matrix of the affine transformation is calculated from the rotation center and rotation angle. Blank areas that may appear in the image after rotation are filled with edge pixels or set to a white background. The cropping operation strictly extracts pixels according to the bounding box coordinates, removing non-target areas outside the card image. When scaling to the standard size, the standard size is set differently according to the card type. For example, the standard size of an ID card is set to 856 pixels wide multiplied by 540 pixels high. The scaling process maintains the original aspect ratio of the card image to avoid distortion. In some embodiments, rotation correction can be performed in steps, first with a coarse rotation and then with a fine rotation. Optionally, for card images without obvious keypoints, Hough transform can be used to detect lines and calculate the tilt angle.

[0030] Example 3: In specific implementation, the coordinate mapping relationship is obtained by analyzing the standard card template. The analysis process involves calibrating the positions of each information field on the standard card template image. The coordinate range of each information field is defined based on pixel position. The coordinate range is represented by a rectangular area and defined by the horizontal and vertical coordinates of the top-left vertex, as well as the width and height of the area. A preset coordinate mapping relationship is obtained according to the card type, including loading the coordinate mapping relationship from a local database or a remote server. The local database stores structured configuration files such as JSON or XML format. The remote server receives card type parameters through an application programming interface and returns the corresponding coordinate mapping data. The coordinate mapping relationship is strictly bound to the card type. For example, the ID card type corresponds to a set of coordinate mapping relationships including name, gender, ethnicity, date of birth, address, and citizen identification number, while the social security card type corresponds to another different set of field coordinates. The definition of the coordinate range is based on the resolution of the standard card template image. For example, for a standard template image with a resolution of 1000 pixels by 600 pixels, the coordinate range of the name field may be defined as a rectangular area with top-left coordinates (200, 150), a width of 300 pixels, and a height of 50 pixels. In some embodiments, standard card template analysis can employ manual annotation to determine the precise boundaries of each field. Optionally, the coordinate mapping relationship can include the expected data type or format constraint information of the fields.

[0031] In practical implementation, loading coordinate mapping relationships from a local database requires establishing a database connection and executing a query statement. The query condition is the card / certificate type identifier, and the returned result is parsed into a data structure in memory for use by the region extraction module. Loading coordinate mapping relationships from a remote server requires constructing a network request, handling network transmission delays or errors, and parsing the server's response data. The data structure of the coordinate mapping relationship typically uses key-value pairs, where the key is the name of the information field, and the value is a numeric tuple describing the coordinate range. The version of the coordinate mapping relationship configuration file needs to be compatible with the version of the card / certificate image recognition program. Updating the coordinate mapping relationship can be achieved by replacing the local configuration file or obtaining the latest version from the server. The coordinate range values ​​of each information field in the coordinate mapping relationship need to be validated, for example, checking whether the coordinate values ​​are non-negative integers and do not exceed the boundaries of the standard template image. The area of ​​the field's rectangular region is calculated by multiplying the width by the height, used to initially determine whether the region is reasonable. The formula for calculating the area A of the field's rectangular region is:

[0032] in: This represents the area of ​​the rectangular region of the field. This represents the width of the rectangular region in pixels. This represents the height in pixels of the rectangular region. In some embodiments, the coordinate mapping relationship may include the relative positional relationship between fields for auxiliary verification. Optionally, for the same type of card or document of different versions or issuing locations, multiple sets of coordinate mapping relationships can be maintained and selected based on image features.

[0033] Example 4: In specific implementation, image region preprocessing includes binarization, denoising, and character segmentation. Binarization converts the image region into a black-and-white binary image. A global thresholding method is used to determine the grayscale threshold; pixels with grayscale values ​​higher than the threshold are set to white, otherwise they are set to black. In specific implementation, the global thresholding method determines a unified grayscale threshold by analyzing the grayscale value distribution of the entire image region. This threshold is calculated based on the overall pixel grayscale statistical characteristics of the image. The grayscale threshold is selected based on the grayscale histogram of the image region, which represents the distribution of the number of pixels at each grayscale level. After the threshold is determined, the grayscale value of each pixel in the image region is compared with the threshold. Pixels with grayscale values ​​higher than the threshold are set to white, and pixels with grayscale values ​​lower than or equal to the threshold are set to black, thus completing the binarization process. Denoising processing targets isolated noise points or small connected regions in the binary image, using morphological opening operations or median filters to eliminate interference. Character segmentation divides the image region into individual character image blocks based on the gaps between characters. The vertical projection method is used to analyze the horizontal distribution of pixel values, and regions with projection values ​​below a threshold are identified as character gap positions. Refer to Table 1 for the selection of image region preprocessing methods.

[0034] Table 1: Image Region Preprocessing Methods

[0035] Character recognition algorithms are used to identify segmented characters. These algorithms employ convolutional neural network models or support vector machine classifiers. Character image blocks are input into a trained recognition model, which outputs the corresponding character encoding. The training data for the character recognition model includes character samples of various fonts and sizes. After recognizing the segmented characters, the algorithm performs verification, correcting misidentifications based on dictionaries or rules. The dictionary contains all possible correct character sequences, and the rules define valid patterns for character combinations, such as the check digit rules for citizen identification numbers. The formula for calculating the character recognition accuracy P is:

[0036] in: Indicates the accuracy of character recognition. Indicates the number of correctly recognized characters. This represents the total number of characters identified. In some embodiments, character segmentation can be optimized by incorporating prior knowledge of character width. Optionally, dictionary correction can use an edit distance algorithm to find the most similar legal words.

[0037] In specific implementations, the threshold selection for binarization needs to adapt to the uneven illumination of the image area. The local adaptive threshold method divides the image into multiple sub-regions and calculates the threshold for each sub-region separately. For denoising, the morphological opening operation uses a structuring element of a specific size, and the shape and size of the structuring element need to match the size of the noise points. For character segmentation, the vertical projection method needs to handle character adhesion situations, and the adhered characters are split by analyzing the local minimum points of the projection curve. The convolutional neural network model for character recognition uses multiple convolutional layers and pooling layers to extract features, and the fully connected layer outputs the probability distribution of each character category. In the verification process, dictionary correction matches the recognized character sequence with the vocabulary in the standard dictionary and selects the vocabulary with the minimum edit distance as the correction result. Rule correction is implemented for specific field formats. For example, the date field needs to conform to the format specification of "YYYY-MM-DD". In some embodiments, character recognition can be implemented in combination with an optical character recognition engine. Optionally, characters with low recognition confidence can be marked for manual review.

[0038] Embodiment 5: In specific implementations, an information field order configuration file corresponding to the card type is obtained. The information field order configuration file defines the preset order of multiple information fields. The information field order configuration file is stored in the local file system or a remote server in JSON format or XML format. The configuration file contains a list of field names and order index values. According to the order in the information field order configuration file, the text content of each information field is read sequentially. The reading operation retrieves the recognized result text of the corresponding field from the text content storage data structure in memory by parsing the field name sequence in the configuration file. The loading process of the information field order configuration file involves file reading or network requests, and the parsed order data is used to guide the text content combination process. In some embodiments, the information field order configuration file can additionally contain information such as the encoding format or verification rules of the fields.

[0039] In specific implementations, the text content of each information field is matched with the corresponding field name to generate key-value pairs of field names and text content. In the matching process, the field name is used as the key, and the text content is used as the value. A key-value pair object is created and stored in memory. According to the order in the information field order configuration file, multiple key-value pairs are sequentially concatenated into a structured text string. The concatenation operation uses a string concatenation function, and delimiters such as colons and spaces are added between key-value pairs as key-value delimiters, and semicolons and spaces are used as key-value pair delimiters. The formula for generating the total length of the structured string is:

[0040] Where: represents the total length of the structured string S, represents the number of information fields, This indicates the length of the string representing the name of the i-th field. Indicates the length of the key-value separator. This represents the length of the i-th text content string. This indicates the length of the key-value pair separator. The concatenated structured text string can be converted to a JSON object or XML format for data exchange. In some embodiments, key-value pair generation may include escaping special characters to prevent injection errors.

[0041] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0042] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A card / certificate image recognition method, characterized in that, Includes the following steps: Acquire the image of the card or document to be identified, wherein the image of the card or document includes at least one of an ID card, social security card, property ownership certificate, or real estate certificate; The card image is subjected to type recognition to determine the card type corresponding to the card image; Based on the card type, the card image is corrected, including rotation correction, boundary cropping, and resolution normalization. Based on the card type, the corresponding coordinate mapping relationship is obtained from the preset configuration library, and the coordinate mapping relationship includes the coordinate range of multiple information fields; Based on the corrected card image, the image region corresponding to each information field is extracted according to the coordinate mapping relationship; Text recognition is performed on each of the image regions to obtain the text content of each information field; The text content is combined according to the preset order of the information fields to generate structured card information.

2. The card image recognition method according to claim 1, characterized in that, The process of identifying the type of the card image includes: Extract global features from the card image, including color distribution features, texture features, and shape features; The global features are input into a pre-trained classification model, which outputs the probability that the card image belongs to each card type. Based on the probability, the card type with the highest probability is selected as the card type corresponding to the card image.

3. The card image recognition method according to claim 1, characterized in that, The correction process for the card image includes: Detect multiple key points in the card image, the multiple key points corresponding to corner points or marker points of the card; Based on the aforementioned key points, the rotation angle and bounding box of the card image are calculated; The card image is rotated and corrected according to the rotation angle so that the card image is horizontally aligned; The rotated card image is cropped according to the bounding box to remove the background area; Resize the cropped card image to a standard size.

4. The card image recognition method according to claim 1, characterized in that, The coordinate mapping relationship is obtained by analyzing the standard card template, and the coordinate range of each information field is defined based on the pixel position; obtaining the preset coordinate mapping relationship according to the card type includes loading the coordinate mapping relationship from a local database or a remote server.

5. The card image recognition method according to claim 1, characterized in that, The text recognition for each of the image regions includes: Each of the image regions is preprocessed, including binarization, noise reduction, and character segmentation; The segmented characters are identified and verified using a character recognition algorithm. Errors are corrected based on a dictionary or rules to obtain the text content.

6. The card image recognition method according to claim 1, characterized in that, The step of combining the text content according to the preset order of the information fields to generate structured card information includes: Obtain the information field order configuration file corresponding to the card type, wherein the information field order configuration file defines a preset order of multiple information fields; The text content of each information field is read sequentially according to the order in the information field order configuration file. Match the text content of each information field with the corresponding field name to generate key-value pairs of field name and text content; According to the order in the information field sequence configuration file, multiple key-value pairs are concatenated into a structured text string to generate structured card information.

7. The card image recognition method according to claim 2, characterized in that, The extraction of global features from the card image, including color distribution features, texture features, and shape features, includes: The card image is subjected to color space conversion, and the histogram distribution of each color channel is calculated to obtain the color distribution characteristics; The card image is converted into a grayscale image, the grayscale co-occurrence matrix of the grayscale image is calculated, and the contrast and energy values ​​are extracted from the grayscale co-occurrence matrix as texture features. The card image is processed by an edge detection algorithm to obtain a set of card outline points. The outline area and the angle of the minimum bounding rectangle are calculated based on the outline point set as shape features.

8. A card / certificate image recognition device, characterized in that, include: The image acquisition module is used to acquire images of the cards or certificates to be recognized. A type recognition module is used to perform type recognition on the card image to determine the card type corresponding to the card image; The correction processing module is used to perform correction processing on the card image based on the card type. The correction processing includes rotation correction, boundary cropping, and resolution normalization. The coordinate mapping acquisition module is used to acquire a preset coordinate mapping relationship from a preset configuration library according to the card type. The coordinate mapping relationship includes the coordinate range of multiple information fields. The region extraction module is used to extract the image region corresponding to each information field based on the corrected card image and according to the coordinate mapping relationship. The text recognition module is used to perform text recognition on the image region to obtain the text content of each information field; The information generation module is used to combine text content according to the preset order of information fields to generate structured card information.

9. An electronic device comprising a processor and a memory, the memory storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the card image recognition method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the card image recognition method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Information identification method for card image with background

    CN110119741A

  • Character recognition method and device for card image with fixed format

    CN114445843A

  • Certificate general structuring method and system based on template

    CN114913320A

  • Panax plant leaf identification method based on multi-feature extraction

    CN115578603A

  • Method and device for card information structured identification, and terminal equipment

    CN118262366A