Identity card image processing method and device, electronic equipment and storage medium

By identifying the four corner points of the ID card image and cropping and correcting them, the problem of redundant information and distortion in the ID card image affecting the recognition accuracy is solved, and the financial system's recognition accuracy of customer identity information is improved.

CN118736614APending Publication Date: 2024-10-01BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410877388.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In the financial field, redundant information and distortion in customer ID card images will affect the accuracy of the financial backend system's identification of customer identity information, leading to misjudgment or identification failure.

Method used

The four corner points of the ID card image are identified through the pre-trained target image detection model, the ID card area is cropped, and the front and back images of the ID card are subjected to image correction processing to remove redundant information and straighten the image to obtain a standard ID card image. .

Benefits of technology

It improves the recognition accuracy of customer identity information by the financial backend system and ensures the accuracy and consistency of ID card image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736614A_ABST
    Figure CN118736614A_ABST
Patent Text Reader

Abstract

The invention discloses an identity card image processing method and device, electronic equipment and a storage medium, and can be applied to the field of big data or finance. The method comprises the following steps: acquiring an identity card image, identifying four corners of the identity card image by using a pre-trained target image detection model, cutting an area enclosed by the four corners on the identity card image to obtain an identity card area, and judging an identity card front image and an identity card back image of the identity card area, and respectively carrying out image correction processing on the front image and the back image of the identity card to obtain a standard identity card image. Before the identity information of the client is identified based on the identity card image of the client, redundant information on the identity card image is removed and the identity card image is corrected by cutting the identity card image and correcting the image, so that a standard identity card image meeting requirements is obtained; and the identification accuracy of the financial background system on the client identity information is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and more specifically, to an identity card image processing method, device, electronic equipment and storage medium. Background Art

[0002] In the financial field, when customers conduct business, in order to ensure the security of customer transactions and the orderly operation of the financial system, it is usually necessary to identify the customer's identity information. However, if the ID card image uploaded by the customer is redundant or even distorted, it will affect the accuracy of the financial backend system in identifying the customer's identity information, which may cause misjudgment, recognition failure, etc. Summary of the invention

[0003] In view of this, the present invention discloses an ID card image processing method, device, electronic device and storage medium, so as to achieve, before identifying the customer's identity information based on the customer's ID card image, removing redundant information on the ID card image and straightening the ID card image by cropping and image correction processing, so as to obtain a standard ID card image that meets the requirements, thereby improving the accuracy of the financial back-end system in identifying the customer's identity information.

[0004] A method for processing an ID card image, comprising:

[0005] Get the ID card image;

[0006] Using a pre-trained target image detection model to identify the four corner points of the ID card image;

[0007] Cutting the area enclosed by the four corner points on the ID card image to obtain the ID card area;

[0008] Identify the front image of the ID card and the back image of the ID card in the ID card area;

[0009] The front side image of the ID card and the back side image of the ID card are respectively subjected to image correction processing to obtain a standard ID card image.

[0010] Optionally, the step of distinguishing the front image and the back image of the ID card in the ID card area includes:

[0011] Using face detection technology to determine whether a face image is detected on the current image plane of the ID card area;

[0012] If yes, determining that the current image surface is the reverse image of the ID card;

[0013] If not, it is determined that the current image surface is the front image of the ID card.

[0014] Optionally, performing image correction processing on the front side image of the ID card and the back side image of the ID card respectively to obtain a standard ID card image includes:

[0015] Determine whether the position of the first reference mark in the front image of the ID card in the entire ID card area is a first preset standard area;

[0016] If not, rotating the front image of the ID card until the position of the first reference mark in the entire ID card area is the first preset standard area;

[0017] Determine whether the position of the second reference mark in the back side image of the ID card in the entire ID card area is a second preset standard area;

[0018] If not, the back side image of the ID card is rotated until the position of the second reference mark in the entire ID card area is the second preset standard area.

[0019] Optionally, the determining whether the position of the second reference mark in the back side image of the ID card in the entire ID card area is a second preset standard area includes:

[0020] Using face recognition technology to determine the face image in the back image of the ID card;

[0021] The facial image is used as the second reference identifier to determine whether the position of the facial image in the entire ID card area is the second preset standard area.

[0022] Optionally, the training process of the target image detection model includes:

[0023] Get the original ID card image set;

[0024] Marking the four corner points of each ID card original image in the ID card original image set to obtain an ID card image sample set;

[0025] Dividing the ID card image sample set into a training set and a test set;

[0026] Using the training set to train the YOLOv5 model to obtain an initial image detection model;

[0027] The test set is used to adjust the parameters of the initial image detection model to obtain the target image detection model.

[0028] Optionally, after performing image deflection correction processing on the front image of the ID card and the back image of the ID card respectively to obtain a standard ID card image, the method further includes:

[0029] Extracting text content and facial data from the standard identity image;

[0030] The customer's identity is authenticated based on the text content and the facial data.

[0031] An ID card image processing device, comprising:

[0032] An acquisition unit, used for acquiring an ID card image;

[0033] A recognition unit, used to recognize the four corner points of the ID card image using a pre-trained target image detection model;

[0034] A cropping unit, used for cropping the area enclosed by the four corner points on the ID card image to obtain an ID card area;

[0035] A front-side and back-side distinguishing unit, used for distinguishing the front-side image of the ID card and the back-side image of the ID card in the ID card area;

[0036] The deflection correction unit is used to perform image deflection correction processing on the front image of the ID card and the back image of the ID card respectively to obtain a standard ID card image.

[0037] Optionally, the positive and negative discrimination unit includes:

[0038] A face image determination subunit, used to determine whether a face image is detected on the current image plane of the ID card area by using face detection technology;

[0039] A reverse image determination subunit, configured to determine that the current image surface is the reverse image of the ID card if the face image determination subunit determines that it is yes;

[0040] The front image determination subunit is used to determine that the current image surface is the front image of the ID card when the face image determination subunit determines that it is not.

[0041] An electronic device comprising a memory and a processor;

[0042] The memory is used to store at least one instruction;

[0043] The processor is used to execute the at least one instruction to implement the above-mentioned ID card image processing method.

[0044] A computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the above-mentioned ID card image processing method is implemented.

[0045] From the above technical solution, it can be known that the present invention discloses an ID card image processing method, device, electronic device and storage medium, obtains an ID card image, uses a pre-trained target image detection model to identify the four corner points of the ID card image, and crops the area enclosed by the four corner points on the ID card image to obtain the ID card area, distinguishes the ID card front image and the ID card back image in the ID card area, and performs image correction processing on the ID card front image and the ID card back image to obtain a standard ID card image. Before identifying the customer's identity information based on the customer's ID card image, the present invention removes redundant information on the ID card image and straightens the ID card image by cropping and image correction processing on the ID card image, thereby obtaining a standard ID card image that meets the requirements, and improving the accuracy of the financial back-end system in identifying the customer's identity information. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without paying creative work.

[0047] Figure 1 A flow chart of an ID card image processing method disclosed in an embodiment of the present invention;

[0048] Figure 2 A flow chart of a method for distinguishing a front image of an ID card and a back image of an ID card region disclosed in an embodiment of the present invention;

[0049] Figure 3 A flowchart of a method disclosed in an embodiment of the present invention for performing image correction processing on the front side image and the back side image of an ID card to obtain a standard ID card image;

[0050] Figure 4 A schematic diagram of the structure of an ID card image processing device disclosed in an embodiment of the present invention;

[0051] Figure 5 A schematic diagram of the structure of an ID card image processing device disclosed in an embodiment of the present invention;

[0052] Figure 6 The present invention is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0053] It should be noted that the ID card image processing method, device, electronic device and storage medium provided by the present invention can be used in the field of big data or finance. The above is only an example and does not limit the application field of the ID card image processing method, device, electronic device and storage medium provided by the present invention.

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] The embodiment of the present invention discloses an ID card image processing method, device, electronic device and storage medium, which obtains an ID card image, uses a pre-trained target image detection model to identify the four corner points of the ID card image, and cuts the area enclosed by the four corner points on the ID card image to obtain the ID card area, distinguishes the ID card front image and the ID card back image in the ID card area, and performs image correction processing on the ID card front image and the ID card back image to obtain a standard ID card image. Before identifying the customer's identity information based on the customer's ID card image, the present invention cuts the ID card image and performs image correction processing to remove redundant information on the ID card image and straighten the ID card image, thereby obtaining a standard ID card image that meets the requirements, thereby improving the accuracy of the financial back-end system in identifying the customer's identity information.

[0056] See also Figure 1 , a flow chart of an ID card image processing method disclosed in an embodiment of the present invention, the method comprising:

[0057] Step S101, obtaining an ID card image;

[0058] In the financial field, when customer information needs to be verified, the ID card image stored in its own database can be obtained through the server, or the ID card image can be obtained by taking a photo of the smart device, or the ID card image can be obtained directly from the gallery of the smart device.

[0059] Step S102, using a pre-trained target image detection model to identify the four corner points of the ID card image;

[0060] In practical applications, by inputting the acquired ID card image into the target image detection model, the four corner points of the ID card image can be identified. The four corner points specifically refer to the coordinates of the four fixed points of the ID card image.

[0061] Step S103, cropping the area enclosed by the four corner points on the ID card image to obtain an ID card area;

[0062] This embodiment cuts out the area enclosed by the four corner points on the ID card image to remove redundant background information on the ID card image, thereby obtaining a more accurate ID card area.

[0063] Step S104, identifying the front image of the ID card and the back image of the ID card in the ID card area;

[0064] In practical applications, when distinguishing the front and back sides of the ID card area, the distinction can be made based on the feature information of the front and back images of the ID card.

[0065] The characteristic information of the back side image of the ID card includes but is not limited to the face image, name, gender, ID number, etc.

[0066] The characteristic information of the front image of the ID card includes but is not limited to the issuing authority, validity period, etc.

[0067] Step S105: performing image deflection correction processing on the front side image and the back side image of the ID card respectively to obtain a standard ID card image.

[0068] Taking into account that the front and back images of the ID card may be vertical or flipped, which may have a certain impact on the recognition accuracy of the subsequent ID card images, this embodiment further performs correction processing on the cropped front and back images of the ID card to obtain a standard ID card image that meets the requirements, thereby improving the accuracy of the financial back-end system in identifying customer identity information.

[0069] In summary, the present invention discloses an ID card image processing method, which obtains an ID card image, uses a pre-trained target image detection model to identify the four corner points of the ID card image, and crops the area enclosed by the four corner points on the ID card image to obtain the ID card area, distinguishes the ID card front image and the ID card back image in the ID card area, and performs image correction processing on the ID card front image and the ID card back image to obtain a standard ID card image. Before identifying the customer's identity information based on the customer's ID card image, the present invention crops the ID card image and performs image correction processing, removes redundant information on the ID card image, and straightens the ID card image, thereby obtaining a standard ID card image that meets the requirements, thereby improving the accuracy of the financial backend system in identifying the customer's identity information.

[0070] To further optimize the above embodiment, see Figure 2 , a flowchart of a method for distinguishing a front image of an ID card and a back image of an ID card region disclosed in an embodiment of the present invention, the method comprising:

[0071] Step S201, using face detection technology to determine whether a face image is detected on the current image plane of the ID card area, if yes, executing step S202, if not, executing step S203;

[0072] Step S202, determining that the current image surface is the back image of the ID card;

[0073] Step S203: Determine that the current image surface is the front image of the ID card.

[0074] In order to determine whether the current image surface of the ID card area is the back image of the ID card or the front image of the ID card, this embodiment uses a facial image as a distinguishing mark between the back image and the front image of the ID card. If a facial image is detected on the current image surface of the ID card area, the current image surface is determined to be the back image of the ID card, and the back of the current image surface is the front image of the ID card; conversely, if no facial image is detected on the current image surface of the ID card area, the current image surface is determined to be the front image of the ID card, and the back of the current image surface is the back image of the ID card.

[0075] In practical applications, the existing face detection model can be used to distinguish the front and back sides of the ID card image. The face detection model is based on the combination of image processing methods and deep learning models.

[0076] It should be noted that in addition to facial images, other identification marks may be used to distinguish between the back image and the front image of the ID card, such as identity number, name, gender, etc.

[0077] To further optimize the above embodiment, see Figure 3 , a flowchart of a method for performing image correction processing on the front side image and the back side image of an ID card respectively to obtain a standard ID card image is disclosed in an embodiment of the present invention, the method comprising:

[0078] Step S301, determining whether the position of the first reference mark in the front image of the ID card in the entire ID card area is a first preset standard area, if not, executing step S302;

[0079] In this embodiment, the first preset standard area refers to: the area of ​​the first reference mark in the front image of the standard ID card.

[0080] For example, if the first reference mark is "expiration date", if the "expiration date" is located in the lower one-third of the entire ID card area, then the position of the "expiration date" in the entire ID card area is determined to be the first preset standard area; if the "expiration date" is located in the upper one-third of the entire ID card area, then the position of the "expiration date" in the entire ID card area is determined not to be the first preset standard area, and the front image of the ID card needs to be corrected.

[0081] Step S302, rotating the front image of the ID card until the position of the first reference mark in the entire ID card area is the first preset standard area;

[0082] When correcting the front image of the ID card, this embodiment mainly adopts a method of rotating the front image of the ID card. By rotating the front image of the ID card by a certain angle, the first reference mark is adjusted to a position in the entire ID card area that is a first preset standard area.

[0083] The angle value for rotating the front image of the ID card is determined according to actual needs, such as 180 degrees, and the present invention is not limited thereto.

[0084] Step S303, determining whether the position of the second reference mark in the back side image of the ID card in the entire ID card area is a second preset standard area, if not, executing step S304;

[0085] In this embodiment, the second preset standard area refers to: the area of ​​the second reference mark in the image representing the back side of the ID card.

[0086] For example, if the second reference identifier is "face image", if the "face image" is located in the one-third area on the right side of the entire ID card area, then the position of the "face image" in the entire ID card area is determined to be the second preset standard area; if the "face image" is located in the one-half area of ​​the entire ID card area, then it is determined that the position of the "face image" in the entire ID card area is not the second preset standard area, and at this time, the back image of the ID card needs to be corrected.

[0087] It should be noted that, when the second reference identifier is a “face image”, step S303 may specifically include:

[0088] Using face recognition technology to determine the face image in the reverse side of the ID card;

[0089] The facial image is used as a second reference mark to determine whether the position of the facial image in the entire ID card area is a second preset standard area.

[0090] Step S304: Rotate the back side image of the ID card until the position of the second reference mark in the entire ID card area is the second preset standard area.

[0091] When correcting the back image of the ID card, this embodiment mainly adopts a method of rotating the back image of the ID card. By rotating the back image of the ID card by a certain angle, the second reference mark is adjusted to a position in the entire ID card area that is the second preset standard area.

[0092] The angle value for rotating the back side image of the ID card is determined according to actual needs, such as 90 degrees, and the present invention does not limit this.

[0093] In summary, the present invention realizes the straightening of the ID card image by performing image correction processing on the front image and the back image of the ID card respectively, thereby obtaining a standard ID card image that meets the requirements and improving the accuracy of the financial back-end system in identifying customer identity information.

[0094] To further optimize the above embodiment, see Figure 4 , a flow chart of a method for training a target image detection model disclosed in an embodiment of the present invention, the method comprising:

[0095] Step S401, obtaining an original ID card image set;

[0096] The ID card original image set in this embodiment refers to a data set consisting of many ID card original images, wherein each ID card original image in the ID card original image set is a standard ID card image.

[0097] Step S402, marking the four corner points of each ID card original image in the ID card original image set to obtain an ID card image sample set;

[0098] The four corner points of the original ID card image refer to the coordinates of the four orders of the ID card image.

[0099] In practical applications, a preset mark can be used to mark the four corners of the original ID card image. The specific form of the preset mark can be determined according to actual needs. For example, the preset mark is a red dot mark.

[0100] Step S403, dividing the ID card image sample set into a training set and a test set;

[0101] In practical applications, the ID card image sample set can be divided into a training set and a test set according to a preset division ratio. The value of the preset division ratio is determined according to actual needs, such as 7:3.

[0102] Step S404: training the YOLOv5 model using the training set to obtain an initial image detection model;

[0103] In this embodiment, the existing known YOLOv5 model is used as the basic model, and the basic model is trained using the training set to obtain an initial image detection model.

[0104] Step S405: Use the test set to adjust the parameters of the initial image detection model to obtain the target image detection model.

[0105] In order to improve the accuracy of the initial image detection model obtained from the training set, this embodiment uses the test set to adjust the parameters of the initial image detection model to obtain a target image detection model with higher accuracy.

[0106] To further optimize the above embodiment, after obtaining the standard ID card image, the ID card image processing method may further include:

[0107] Extract text content and facial data from standard identity images;

[0108] Authenticate customers based on text content and facial data.

[0109] The text content extracted from the standard ID card image includes but is not limited to name, gender, ID number, etc.

[0110] Facial data includes but is not limited to the eyes, nose, mouth and the distance between them in the facial image on the ID card.

[0111] Corresponding to the above method embodiment, the present invention also discloses an ID card image processing device.

[0112] See also Figure 5 , a schematic diagram of the structure of an ID card image processing device disclosed in an embodiment of the present invention, the device comprises:

[0113] An acquisition unit 501 is used to acquire an ID card image;

[0114] In actual applications, when customer information needs to be verified, the server can obtain the ID card image stored in its own database, or obtain the ID card image taken by the smart device, or directly obtain the ID card image from the gallery of the smart device.

[0115] The recognition unit 502 is used to recognize the four corner points of the ID card image using a pre-trained target image detection model;

[0116] In practical applications, by inputting the acquired ID card image into the target image detection model, the four corner points of the ID card image can be identified. The four corner points specifically refer to the coordinates of the four fixed points of the ID card image.

[0117] A cropping unit 503, used for cropping the area enclosed by the four corner points on the ID card image to obtain an ID card area;

[0118] This embodiment cuts out the area enclosed by the four corner points on the ID card image to remove redundant background information on the ID card image, thereby obtaining a more accurate ID card area.

[0119] A front-side and back-side distinguishing unit 504, used to distinguish the front-side image of the ID card and the back-side image of the ID card area;

[0120] In practical applications, when distinguishing the front and back sides of the ID card area, the distinction can be made based on the feature information of the front and back images of the ID card.

[0121] The characteristic information of the back side image of the ID card includes but is not limited to the face image, name, gender, ID number, etc.

[0122] The characteristic information of the front image of the ID card includes but is not limited to the issuing authority, validity period, etc.

[0123] The deflection correction unit 505 is used to perform image deflection correction processing on the front side image of the ID card and the back side image of the ID card respectively to obtain a standard ID card image.

[0124] Taking into account that the front and back images of the ID card may be vertical or flipped, which may have a certain impact on the recognition accuracy of the subsequent ID card images, this embodiment further performs correction processing on the cropped front and back images of the ID card to obtain a standard ID card image that meets the requirements, thereby improving the accuracy of the financial back-end system in identifying customer identity information.

[0125] In summary, the present invention discloses an ID card image processing device, which obtains an ID card image, uses a pre-trained target image detection model to identify the four corner points of the ID card image, and crops the area enclosed by the four corner points on the ID card image to obtain the ID card area, distinguishes the ID card front image and the ID card back image in the ID card area, and performs image correction processing on the ID card front image and the ID card back image to obtain a standard ID card image. Before identifying the customer's identity information based on the customer's ID card image, the present invention crops the ID card image and performs image correction processing, removes redundant information on the ID card image, and straightens the ID card image, thereby obtaining a standard ID card image that meets the requirements, thereby improving the accuracy of the financial backend system in identifying the customer's identity information.

[0126] To further optimize the above embodiment, the positive and negative discrimination unit 504 may specifically include:

[0127] A face image determination subunit, used to determine whether a face image is detected on the current image plane of the ID card area by using face detection technology;

[0128] A reverse image determination subunit, configured to determine that the current image surface is the reverse image of the ID card if the face image determination subunit determines that it is yes;

[0129] The front image determination subunit is used to determine that the current image surface is the front image of the ID card when the face image determination subunit determines that it is not.

[0130] In order to determine whether the current image surface of the ID card area is the back image of the ID card or the front image of the ID card, this embodiment uses a facial image as a distinguishing mark between the back image and the front image of the ID card. If a facial image is detected on the current image surface of the ID card area, the current image surface is determined to be the back image of the ID card, and the back of the current image surface is the front image of the ID card; conversely, if no facial image is detected on the current image surface of the ID card area, the current image surface is determined to be the front image of the ID card, and the back of the current image surface is the back image of the ID card.

[0131] In practical applications, the existing face detection model can be used to distinguish the front and back sides of the ID card image. The face detection model is based on the combination of image processing methods and deep learning models.

[0132] It should be noted that in addition to facial images, other identification marks may be used to distinguish between the back image and the front image of the ID card, such as identity number, name, gender, etc.

[0133] To further optimize the above embodiment, the correction unit 505 may specifically include:

[0134] A first area determination subunit is used to determine whether the position of the first reference mark in the front image of the ID card is in the first preset standard area in the entire ID card area;

[0135] In this embodiment, the first preset standard area refers to: the area of ​​the first reference mark in the front image of the standard ID card.

[0136] For example, if the first reference mark is "expiration date", if the "expiration date" is located in the lower one-third of the entire ID card area, then the position of the "expiration date" in the entire ID card area is determined to be the first preset standard area; if the "expiration date" is located in the upper one-third of the entire ID card area, then the position of the "expiration date" in the entire ID card area is determined not to be the first preset standard area, and the front image of the ID card needs to be corrected.

[0137] A first deflection correction subunit is used to rotate the front image of the ID card until the position of the first reference mark in the entire ID card area is the first preset standard area if the first area judgment subunit judges that it is not.

[0138] When correcting the front image of the ID card, this embodiment mainly adopts a method of rotating the front image of the ID card. By rotating the front image of the ID card by a certain angle, the first reference mark is adjusted to a position in the entire ID card area that is a first preset standard area.

[0139] The angle value for rotating the front image of the ID card is determined according to actual needs, such as 180 degrees, and the present invention is not limited thereto.

[0140] A second area determination subunit is used to determine whether the position of the second reference mark in the back side image of the ID card in the entire ID card area is a second preset standard area;

[0141] In this embodiment, the second preset standard area refers to: the area of ​​the second reference mark in the image representing the back side of the ID card.

[0142] For example, if the second reference identifier is "face image", if the "face image" is located in the one-third area on the right side of the entire ID card area, then the position of the "face image" in the entire ID card area is determined to be the second preset standard area; if the "face image" is located in the one-half area of ​​the entire ID card area, then it is determined that the position of the "face image" in the entire ID card area is not the second preset standard area, and at this time, the back image of the ID card needs to be corrected.

[0143] The second deflection correction subunit is used to rotate the back image of the ID card when the second area judgment subunit judges that it is no, until the position of the second reference mark in the entire ID card area is the second preset standard area.

[0144] When correcting the back image of the ID card, this embodiment mainly adopts a method of rotating the back image of the ID card. By rotating the back image of the ID card by a certain angle, the second reference mark is adjusted to a position in the entire ID card area that is the second preset standard area.

[0145] The angle value for rotating the back side image of the ID card is determined according to actual needs, such as 90 degrees, and the present invention does not limit this.

[0146] In summary, the present invention realizes the straightening of the ID card image by performing image correction processing on the front image and the back image of the ID card respectively, thereby obtaining a standard ID card image that meets the requirements and improving the accuracy of the financial back-end system in identifying customer identity information.

[0147] To further optimize the above embodiment, the second region determination subunit may be specifically used for:

[0148] Using face recognition technology to determine the face image in the back image of the ID card;

[0149] The facial image is used as the second reference identifier to determine whether the position of the facial image in the entire ID card area is the second preset standard area.

[0150] To further optimize the above embodiment, the ID card image processing device may further include:

[0151] A model training unit is used to train the target image detection model.

[0152] The model training unit can be used specifically for:

[0153] Get the original ID card image set;

[0154] Marking the four corner points of each ID card original image in the ID card original image set to obtain an ID card image sample set;

[0155] Dividing the ID card image sample set into a training set and a test set;

[0156] Using the training set to train the YOLOv5 model to obtain an initial image detection model;

[0157] The test set is used to adjust the parameters of the initial image detection model to obtain the target image detection model.

[0158] To further optimize the above embodiment, the ID card image processing device may further include:

[0159] An extraction unit, used to extract text content and face data from the standard identity image;

[0160] The identity verification unit is used to verify the identity of the customer based on the text content and the facial data.

[0161] The text content extracted from the standard ID card image includes but is not limited to name, gender, ID number, etc.

[0162] Facial data includes but is not limited to the eyes, nose, mouth and the distance between them in the facial image on the ID card.

[0163] Corresponding to the above embodiment, Figure 6 As shown, the present invention also provides an electronic device, which may include: a processor 1 and a memory 2;

[0164] The processor 1 and the memory 2 communicate with each other via a communication bus 3;

[0165] Processor 1, configured to execute at least one instruction;

[0166] Memory 2, used to store at least one instruction;

[0167] The processor 1 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.

[0168] The memory 2 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0169] The processor executes at least one instruction to implement the steps shown in the embodiment of the ID card image processing method.

[0170] In summary, the present invention discloses an electronic device, which obtains an ID card image, identifies the four corner points of the ID card image using a pre-trained target image detection model, and crops the area enclosed by the four corner points on the ID card image to obtain the ID card area, distinguishes the ID card front image and the ID card back image in the ID card area, and performs image correction processing on the ID card front image and the ID card back image to obtain a standard ID card image. Before identifying the customer's identity information based on the customer's ID card image, the present invention crops the ID card image and performs image correction processing, removes redundant information on the ID card image, and straightens the ID card image, thereby obtaining a standard ID card image that meets the requirements, thereby improving the accuracy of the financial backend system in identifying the customer's identity information.

[0171] Corresponding to the above-mentioned embodiment, the present invention further discloses a computer-readable storage medium, which stores at least one instruction. When the at least one instruction is executed by a processor, the steps shown in the embodiment of the ID card image processing method are implemented.

[0172] Computer storage media can be tangible media that can contain or store programs for use by or in conjunction with an instruction execution system, device, or equipment. Computer storage media can be machine-readable signal media or machine-readable storage media. Computer storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the above. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0173] In summary, the present invention discloses a computer storage medium, which obtains an ID card image, uses a pre-trained target image detection model to identify the four corner points of the ID card image, and cuts the area enclosed by the four corner points on the ID card image to obtain the ID card area, distinguishes the ID card front image and the ID card back image in the ID card area, and performs image correction processing on the ID card front image and the ID card back image to obtain a standard ID card image. Before identifying the customer's identity information based on the customer's ID card image, the present invention cuts and corrects the ID card image, removes redundant information on the ID card image, and straightens the ID card image, thereby obtaining a standard ID card image that meets the requirements, thereby improving the accuracy of the financial backend system in identifying the customer's identity information.

[0174] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0175] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0176] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for processing an ID card image, characterized in that: include: Get the ID card image; Using a pre-trained target image detection model to identify the four corner points of the ID card image; Cutting the area enclosed by the four corner points on the ID card image to obtain the ID card area; Identify the front image of the ID card and the back image of the ID card in the ID card area; The front side image of the ID card and the back side image of the ID card are respectively subjected to image correction processing to obtain a standard ID card image.

2. The ID card image processing method according to claim 1, characterized in that: The step of distinguishing the front image of the ID card and the back image of the ID card area includes: Using face detection technology to determine whether a face image is detected on the current image plane of the ID card area; If yes, determining that the current image surface is the reverse image of the ID card; If not, it is determined that the current image surface is the front image of the ID card.

3. The ID card image processing method according to claim 1, characterized in that: Performing image correction processing on the front side image of the ID card and the back side image of the ID card respectively to obtain a standard ID card image, including: Determine whether the position of the first reference mark in the front image of the ID card in the entire ID card area is a first preset standard area; If not, rotating the front image of the ID card until the position of the first reference mark in the entire ID card area is the first preset standard area; Determine whether the position of the second reference mark in the back side image of the ID card in the entire ID card area is a second preset standard area; If not, the back side image of the ID card is rotated until the position of the second reference mark in the entire ID card area is the second preset standard area.

4. The ID card image processing method according to claim 3, characterized in that: The step of determining whether the position of the second reference mark in the back side image of the ID card is in the second preset standard area of ​​the entire ID card area includes: Using face recognition technology to determine the face image in the back image of the ID card; The facial image is used as the second reference identifier to determine whether the position of the facial image in the entire ID card area is the second preset standard area.

5. The ID card image processing method according to claim 1, characterized in that: The training process of the target image detection model includes: Get the original ID card image set; Marking the four corner points of each ID card original image in the ID card original image set to obtain an ID card image sample set; Dividing the ID card image sample set into a training set and a test set; Using the training set to train the YOLOv5 model to obtain an initial image detection model; The test set is used to adjust the parameters of the initial image detection model to obtain the target image detection model.

6. The ID card image processing method according to any one of claims 1 to 5, characterized in that: After performing image correction processing on the front image of the ID card and the back image of the ID card respectively to obtain a standard ID card image, the method further includes: Extracting text content and facial data from the standard identity image; The customer's identity is authenticated based on the text content and the facial data.

7. An ID card image processing device, characterized in that: include: An acquisition unit, used for acquiring an ID card image; A recognition unit, used to recognize the four corner points of the ID card image using a pre-trained target image detection model; A cropping unit, used for cropping the area enclosed by the four corner points on the ID card image to obtain an ID card area; A front-side and back-side distinguishing unit, used for distinguishing the front-side image of the ID card and the back-side image of the ID card in the ID card area; The deflection correction unit is used to perform image deflection correction processing on the front image of the ID card and the back image of the ID card respectively to obtain a standard ID card image.

8. The ID card image processing device according to claim 7, characterized in that: The positive and negative discrimination unit comprises: A face image determination subunit, used to determine whether a face image is detected on the current image plane of the ID card area by using face detection technology; A reverse image determination subunit, configured to determine that the current image surface is the reverse image of the ID card if the face image determination subunit determines that it is yes; The front image determination subunit is used to determine that the current image surface is the front image of the ID card when the face image determination subunit determines that it is not.

9. An electronic device, characterized in that: The electronic device comprises a memory and a processor; The memory is used to store at least one instruction; The processor is used to execute the at least one instruction to implement the ID card image processing method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the ID card image processing method according to any one of claims 1 to 6 is implemented.