Picture detection method and device, equipment and medium

Through portrait orientation confirmation and highlighting area processing, non-reflective areas of the ID picture are identified, and the pre-trained model is used to identify complete text and portrait areas, which solves the problem of interference in the ID picture, and achieves efficient and accurate extraction of key information, improving the security of financial transactions.

CN120375381APending Publication Date: 2025-07-25WELAB INFORMATION TECH SHENZHEN LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510333736.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

When existing document picture recognition technology encounters reflective areas, it cannot effectively identify key information areas, resulting in inefficient identification.

Method used

Through portrait orientation confirmation, highlight area recognition and reflection judgment, non-reflective area pictures are obtained, and the pre-trained text area boundary and portrait area boundary recognition model recognizes the complete text and portrait area in the document picture to divide the key information area.

Benefits of technology

It improves the accuracy and efficiency of document image detection, ensures the complete acquisition of key information, and improves the security of financial transactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120375381A_ABST
    Figure CN120375381A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of picture recognition, and discloses a picture detection method and device, equipment and a medium, and the method comprises the steps: carrying out the portrait direction confirmation of a certificate picture, obtaining a certificate picture in a straightening state, obtaining a highlight region of the certificate picture in the straightening state, judging whether the highlight region is a light reflection region, and if not, carrying out the recognition of the certificate picture; if yes, sending the certificate picture in the straightening state to a server, otherwise, acquiring a non-reflective area picture of the certificate picture in the straightening state, identifying character area incomplete features and portrait area incomplete features in the non-reflective area picture, and identifying a complete character area according to the character area incomplete features by utilizing a character area boundary identification model; identifying a complete portrait area according to the incomplete features of the portrait area by utilizing a portrait area boundary identification model, segmenting a key information area of the certificate picture in the straightening state according to the complete character area and the complete portrait area to obtain a key information picture, and sending the key information picture to a server, and the accuracy and efficiency of picture detection are 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 recognition technology, and in particular to an image detection method, device, equipment and medium. Background Art

[0002] In the field of image processing and computer vision, reflective areas in ID images often interfere with the recognition of key information areas. For example, in a scenario where an ID image is required, the reflection on the ID image surface will cause part of the key information area (such as name, gender, date of birth, ID number, etc.) in the image captured by the camera to be covered by the reflection, making it difficult for the computer to accurately recognize the complete key information area.

[0003] At present, the document image recognition technology mainly relies on text detection and text recognition technology, which converts the document image into text content and extracts key information from it and saves it as a structured output in the form of key-value pairs. However, after the existing method identifies the reflection in the key information area of the document image, it will prompt the user to re-upload the image and cannot proceed to the next step of processing, which reduces the efficiency of document image detection and recognition. Summary of the invention

[0004] The present invention provides an artificial intelligence image detection method, device, equipment and medium to solve the problem of low efficiency of existing image detection methods.

[0005] In a first aspect, a method for image detection is provided, comprising:

[0006] Obtain the ID picture uploaded by the user, confirm the portrait orientation of the ID picture, and obtain the ID picture in a straightened state;

[0007] Obtaining the highlighted area of the straightened ID card image;

[0008] Determining whether the highlighted area is a reflective area;

[0009] If the highlighted area is not a reflective area, sending the straightened ID card image to the server;

[0010] If the highlighted area is a reflective area, a non-reflective area image of the straightened ID image is obtained, and incomplete features of the text area and incomplete features of the portrait area in the non-reflective area image are identified;

[0011] Using a pre-trained text region boundary recognition model to identify a complete text region in the straightened ID image according to the incomplete features of the text region, and using a pre-trained portrait region boundary recognition model to identify a complete portrait region in the straightened ID image according to the incomplete features of the portrait region;

[0012] The key information area of the straightened ID card image is segmented according to the complete text area and the complete portrait area to obtain a key information image, and the key information image is sent to a server.

[0013] In a second aspect, a picture detection device is provided, comprising:

[0014] The image orientation confirmation module is used to obtain the ID image uploaded by the user, confirm the orientation of the portrait in the ID image, and obtain the ID image in a straightened state;

[0015] A highlight region recognition module, used to obtain the highlight region of the straightened document image;

[0016] a reflection judgment module, used to judge whether the highlighted area is a reflection area, and if the highlighted area is not a reflection area, send the straightened state document image to a server; if the highlighted area is a reflection area, obtain a non-reflective area image of the straightened state document image, and identify the incomplete features of the text area and the incomplete features of the portrait area in the non-reflective area image;

[0017] A complete region recognition module, used to recognize the complete text region in the straightened state ID image according to the incomplete features of the text region using a pre-trained text region boundary recognition model, and to recognize the complete portrait region in the straightened state ID image according to the incomplete features of the portrait region using a pre-trained portrait region boundary recognition model;

[0018] The key information picture recognition module is used to segment the key information area of the straightened document picture according to the complete text area and the complete portrait area, obtain the key information picture, and send the key information picture to the server.

[0019] In a third aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned image detection method when executing the computer program.

[0020] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned image detection method are implemented.

[0021] In the scheme implemented by the above-mentioned image detection method, device, computer equipment and storage medium, the ID card image uploaded by the user can be obtained, the portrait direction of the ID card image can be confirmed, the ID card image in the straightened state can be obtained, the highlight area of the ID card image in the straightened state can be obtained, and it can be determined whether the highlight area is a reflective area. If the highlight area is not a reflective area, the ID card image in the straightened state can be sent to a server. If the highlight area is a reflective area, the non-reflective area image of the ID card image in the straightened state can be obtained, the incomplete features of the text area and the incomplete features of the portrait area in the non-reflective area image can be identified, the complete text area in the ID card image in the straightened state can be identified according to the incomplete features of the text area using a pre-trained text area boundary recognition model, the complete portrait area of the ID card image in the straightened state can be identified according to the incomplete features of the portrait area using a pre-trained portrait area boundary recognition model, the key information area of the ID card image in the straightened state can be segmented according to the complete text area and the complete portrait area, the key information image can be obtained, and the key information image can be sent to a server. The security of financial transactions is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0023] Figure 1 is a schematic diagram of an application environment of a picture detection method in one embodiment of the present invention;

[0024] Figure 2 is a schematic diagram of a process of a picture detection method in one embodiment of the present invention;

[0025] Figure 3 is a structural schematic diagram of an image detection device in one embodiment of the present invention;

[0026] Figure 4 is a schematic diagram of a structure of a computer device in one embodiment of the present invention;

[0027] Figure 5 It is another structural schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0028] 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 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.

[0029] The image detection method provided by the embodiment of the present invention can be applied in Figure 1 In an application environment, the client communicates with the server through a network. The server can obtain the ID card picture uploaded by the user through the client, confirm the portrait direction of the ID card picture, obtain the ID card picture in the straightened state, obtain the highlight area of the ID card picture in the straightened state, determine whether the highlight area is a reflective area, if the highlight area is not a reflective area, then send the ID card picture in the straightened state to the server, if the highlight area is a reflective area, then obtain the non-reflective area picture of the ID card picture in the straightened state, identify the text area defect features and the portrait area defect features in the non-reflective area picture, use the pre-trained text area boundary recognition model to identify the complete text area in the ID card picture in the straightened state according to the text area defect features, use the pre-trained portrait area boundary recognition model to identify the complete portrait area of the ID card picture in the straightened state according to the portrait area defect features, segment the key information area of the ID card picture in the straightened state according to the complete text area and the complete portrait area, obtain the key information picture, and send the key information picture to the server. The efficiency and accuracy of image detection are improved. The client can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server can be implemented by an independent server or a server cluster composed of multiple servers. The present invention is described in detail below through specific embodiments.

[0030] See also Figure 2 As shown, Figure 2 A schematic flow chart of a picture detection method provided by an embodiment of the present invention includes the following steps:

[0031] S1. Obtain the ID picture uploaded by the user, confirm the portrait direction of the ID picture, and obtain the ID picture in a straightened state.

[0032] In the embodiment of the present invention, the step of confirming the orientation of the portrait on the ID picture to obtain the ID picture in a straightened state includes:

[0033] Obtain the portrait orientation of the certificate image;

[0034] Determining whether the portrait direction is a preset alignment direction;

[0035] If the portrait direction of the said ID photo is the preset correct direction, then confirm that the said ID photo is an ID photo in the correct state;

[0036] If the portrait direction of the said ID photo is not the preset correct direction, then rotate the said ID photo so that the portrait direction of the said ID photo is the said correct direction, and obtain an ID photo in the correct state.

[0037] Specifically, to obtain the portrait direction of the said ID photo, an edge recognition algorithm is used to recognize the portrait contour of the said ID photo, and the recognized portrait contour is matched with portrait contour templates in different preset directions, and the portrait direction of the said ID photo is confirmed according to the direction of the matched portrait contour template.

[0038] Specifically, to determine whether the portrait direction is the preset correct direction, the portrait direction and the correct direction are represented by numbers or codes, and it is determined whether the portrait direction is the preset correct direction by judging whether the numbers or codes corresponding to the portrait direction and the correct direction are the same.

[0039] Specifically, to rotate the said ID photo so that the portrait direction of the said ID photo is the said correct direction and obtain an ID photo in the correct state, after each rotation of the ID photo, the portrait direction of the ID photo is obtained once and compared with the said correct direction until the portrait direction of the rotated ID photo is the said correct direction, and it is confirmed that the said ID photo is in the correct state.

[0040] In the embodiment of the present invention, by obtaining the ID photo uploaded by the user, confirming the portrait direction of the said ID photo, and obtaining an ID photo in the correct state, it can be ensured that the said ID photo is in the correct state to improve the efficiency of subsequent processing.

[0041] S2. Obtain the highlighted area of the said ID photo in the correct state.

[0042] In the embodiment of the present invention, obtaining the highlighted area of the said ID photo in the correct state includes:

[0043] Obtain the histogram of the said ID photo in the correct state;

[0044] Based on the histogram, identify the pixel points in the said ID photo in the correct state whose pixel values are greater than the preset highlight threshold to obtain the highlighted area.

[0045] Specifically, the histogram is a graphical representation that shows the distribution of each pixel value in the image. For a grayscale image, the histogram shows the number of pixels for each gray level from 0 (black) to 255 (white); for a color image, there are usually three histograms corresponding to the pixel values of the red, green, and blue channels respectively.

[0046] Specifically, the highlighting threshold is a threshold set for distinguishing whether a pixel point is highlighted. The pixel value of a highlighted pixel point is usually close to 255, and the highlighting threshold can be set according to requirements.

[0047] In the embodiment of the present invention, obtaining the highlighted area of the correctly positioned ID card picture improves the efficiency of subsequent determination of whether the highlighted area is a reflective area.

[0048] S3. Determine whether the highlighted area is a reflective area.

[0049] In the embodiment of the present invention, determining whether the highlighted area is a reflective area is to determine whether it is a reflective area by calculating the relationship between the pixel clarity in the highlighted area and a preset clarity threshold.

[0050] If the highlighted area is not a reflective area, then execute S4. Send the correctly positioned ID card picture to the server.

[0051] In the embodiment of the present invention, when it is determined that the highlighted area is not a reflective area, it indicates that the key information area in the ID card picture is not blocked by reflection and the information is completely displayed. Therefore, it can be sent to the server for the next step of recognition.

[0052] If the highlighted area is a reflective area, then execute S5. Obtain the non-reflective area picture of the correctly positioned ID card picture, and identify the incomplete feature of the text area and the incomplete feature of the portrait area in the non-reflective area picture.

[0053] In the embodiment of the present invention, when it is determined that the highlighted area is a reflective area, it indicates that the key information area of the correctly positioned ID card picture is affected by reflection, and there may be a problem of inaccurate recognition. Therefore, it is necessary to obtain the non-reflective area of the correctly positioned ID card picture for the next step of processing to re-identify the key information area.

[0054] In the embodiment of the present invention, obtaining the non-reflective area picture of the correctly positioned ID card picture is to perform picture segmentation according to the highlighted area, obtain the part outside the highlighted area in the ID card picture, and obtain the non-reflective area picture.

[0055] In the embodiment of the present invention, identifying the incomplete feature of the text area and the incomplete feature of the portrait area in the non-reflective area picture includes:

[0056] Perform binarization processing on the non-reflective area picture to obtain a binarized picture;

[0057] Use an edge detection algorithm to identify the discontinuous boundary features and incomplete regular edge features in the binarized picture;

[0058] Use a text detection algorithm to perform text detection on the discontinuous boundary features and the incomplete regular edge features to obtain text region incomplete features;

[0059] Match the discontinuous boundary features and the incomplete regular edge features with the human portrait contour to obtain human portrait region incomplete features.

[0060] In an embodiment of the present invention, the binary image is a type of image after digital image processing. It is to convert a grayscale image (each pixel point of the image has a grayscale value, usually in the range of 0-255) by setting a threshold, and convert the grayscale value of each pixel point into an image with only two values (usually 0 and 1, or 0 and 255) according to the size relationship between the grayscale value of each pixel point and the threshold. Therefore, the binary image is an image with only two colors (usually black and white).

[0061] In an embodiment of the present invention, perform binary processing on the non-reflective region picture to obtain a binary picture:

[0062] Perform grayscale processing on the non-reflective region picture to obtain a grayscale picture;

[0063] Obtain the grayscale value of each pixel point of the grayscale picture to obtain grayscale value data;

[0064] Obtain the median of the grayscale value data to obtain a grayscale threshold;

[0065] According to the grayscale value data, set the grayscale value of the pixel points in the grayscale picture that are greater than the grayscale threshold to 1, and set the grayscale value of the pixel points that are less than or equal to the grayscale threshold to 0 to obtain a binary image.

[0066] Specifically, the grayscale processing is a basic step in image processing. It converts a color image into a grayscale image, that is, each pixel has only one intensity value representing its brightness, which can simplify the image data, reduce the subsequent calculation complexity, and at the same time retain the image information.

[0067] In an embodiment of the present invention, the text detection algorithm is an algorithm for identifying text regions from pictures. Traditional text detection algorithms include steps such as reading pictures, converting to grayscale pictures, binary processing, dilation and erosion operations to highlight contours, finding contours and removing borders that do not conform to text characteristics, etc., and finally returning the border results of text detection.

[0068] In the embodiments of the present invention, the matching of the portrait contour for the discontinuous boundary feature and the incomplete regular edge feature is to calculate the matching degree by calculating the distance between the vectors of the discontinuous boundary feature and the incomplete regular edge feature and a preset portrait contour target. When the matching degree is greater than a certain threshold, the matching is successful.

[0069] In the embodiments of the present invention, by obtaining the non-reflective area picture of the correctly placed ID card picture and identifying the text area incomplete feature and the portrait area incomplete feature in the non-reflective area picture, the accuracy of identifying the text area incomplete feature and the portrait area incomplete feature is improved.

[0070] S6. Use the pre-trained text area boundary recognition model to identify the complete text area in the correctly placed ID card picture according to the text area incomplete feature, and use the pre-trained portrait area boundary recognition model to identify the complete portrait area in the correctly placed ID card picture according to the portrait area incomplete feature.

[0071] In the embodiments of the present invention, the portrait area boundary recognition model is a neural network model, and an attention mechanism is introduced to improve the recognition accuracy of the model.

[0072] In the embodiments of the present invention, the use of the pre-trained text area boundary recognition model to identify the complete text area in the correctly placed ID card picture according to the text area incomplete feature includes:

[0073] Use a neural network model to perform average pooling processing and max pooling processing on the text area incomplete feature to obtain an average pooling feature and a max pooling feature;

[0074] Concatenate the average pooling feature and the max pooling feature in the channel dimension to obtain a concatenated feature;

[0075] Perform convolutional processing and activation processing on the concatenated feature to obtain a spatial attention map;

[0076] Multiply the spatial attention map by the text area incomplete feature to obtain an attention weight;

[0077] Use a neural network model to output the complete text area of the ID card picture according to the attention weight and the text area incomplete feature.

[0078] In the embodiment of the present invention, the attention mechanism is an information processing method that imitates the human visual system, which enables the model to focus on certain important parts of the data when processing data (especially sequence data or data with spatial structure, such as text, images, etc.), rather than treating all input information equally. For example, in the task of identifying complete boundaries based on incomplete features, by adding an attention mechanism, the model can pay more attention to the arc part of the incomplete feature and the pixels around it, so as to improve the recognition accuracy of the complete boundary.

[0079] In an embodiment of the present invention, the convolution processing and activation processing are performed on the splicing feature to obtain a spatial attention map, which is to use a convolution kernel with a size of 1*1 to perform convolution processing to obtain a convolution result with a size of 1*1*N (N is the number of output channels), and then expand the convolution result in the spatial dimension to obtain a tensor with a size of N*H*W (H*W is the size of the splicing feature), and use the sigmoid activation function to map each element in the tensor to the interval of (0, 1) to obtain the spatial attention map.

[0080] In the embodiment of the present invention, the convolution processing and activation processing are performed on the splicing features to obtain a spatial attention map, including:

[0081] Use a convolution kernel of size 1*1 to convolve all the concatenated features to obtain a convolution result of size 1*1*N, where N is the number of output channels;

[0082] Expand the convolution result in the spatial dimension to obtain a feature tensor of size N*H*W, where H*W is the size of the concatenated feature;

[0083] Each element in the feature tensor is mapped to between 0 and 1 using a preset activation function to obtain a spatial attention map.

[0084] In the embodiment of the present invention, the step of using a pre-trained portrait area boundary recognition model to identify the complete portrait area of the straightened ID picture according to the incomplete features of the portrait area is the same as the step of using a pre-trained text area boundary recognition model to identify the complete text area in the straightened ID picture according to the incomplete features of the text area, and will not be repeated here.

[0085] In an embodiment of the present invention, a pre-trained text area boundary recognition model is used to identify the complete text area in the straightened state document image according to the incomplete features of the text area, and a pre-trained portrait area boundary recognition model is used to identify the complete portrait area of the straightened state document image according to the incomplete features of the portrait area, thereby improving the accuracy of identifying the complete text area and the complete portrait area.

[0086] It can be seen that in the embodiment of the present invention, in view of the problem of reflection in the certificate picture, by dividing the non-reflective area in the certificate picture, identifying the incomplete features of the non-reflective area, and using a pre-trained neural network model to identify the complete information area according to the incomplete features. This method can detect

[0087] S7. Segment the key information area of the correctly oriented certificate picture according to the complete text area and the complete portrait area to obtain a key information picture, and send the key information picture to the server.

[0088] In the embodiment of the present invention, the step of segmenting the key information area of the correctly oriented certificate picture according to the complete text area and the complete portrait area to obtain a key information picture means segmenting the rated area where the complete text area and the complete portrait area are located in the correctly oriented certificate picture to obtain the key information picture.

[0089] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

[0090] In one embodiment, a picture detection device is provided, and the picture detection device corresponds one-to-one with the picture detection method in the above embodiment. As Figure 3 shown, the picture detection device includes a picture orientation confirmation module 101, a highlighted area recognition module 102, a reflection judgment module 103, a complete area recognition module 104, and a key information picture recognition module 105. The detailed description of each functional module is as follows:

[0091] The picture orientation confirmation module 101 is configured to obtain a certificate picture uploaded by a user, confirm the portrait orientation of the certificate picture, and obtain a correctly oriented certificate picture;

[0092] The highlighted area recognition module 102 is configured to obtain the highlighted area of the correctly oriented certificate picture;

[0093] The reflection judgment module 103 is configured to judge whether the highlighted area is a reflective area. If the highlighted area is not a reflective area, the correctly oriented certificate picture is sent to the server. If the highlighted area is a reflective area, a non-reflective area picture of the correctly oriented certificate picture is obtained, and the text area incomplete features and the portrait area incomplete features in the non-reflective area picture are identified;

[0094] The complete region recognition module 104 is configured to recognize the complete text region in the rectified state document image according to the text region mutilation features by using a pre-trained text region boundary recognition model, and recognize the complete portrait region of the rectified state document image according to the portrait region mutilation features by using a pre-trained portrait region boundary recognition model;

[0095] The key information image recognition module 105 is configured to segment the key information region of the rectified state document image according to the complete text region and the complete portrait region, obtain a key information image, and send the key information image to the server.

[0096] In one embodiment, the picture orientation confirmation module 101 is specifically configured to:

[0097] Obtain the portrait orientation of the document image;

[0098] Determine whether the portrait orientation is a preset rectified orientation;

[0099] If the portrait orientation is the preset rectified orientation, confirm that the document image is a rectified state document image;

[0100] If the portrait orientation is not the preset rectified orientation, rotate the document image so that the portrait orientation of the document image is the rectified orientation, and obtain a rectified state document image.

[0101] In one embodiment, the highlighted region recognition module 102 is specifically configured to:

[0102] Obtain the histogram of the rectified state document image;

[0103] Based on the histogram, recognize the pixel points in the rectified state document image whose pixel values are greater than a preset highlighted threshold to obtain a highlighted region.

[0104] In one embodiment, the reflection judgment module 103 is specifically configured to:

[0105] Perform binarization processing on the non-reflective region image to obtain a binarized image;

[0106] Use an edge detection algorithm to recognize the discontinuous boundary features and mutilated regular edge features in the binarized image;

[0107] Use a text detection algorithm to perform text detection on the discontinuous boundary features and the mutilated regular edge features to obtain text region mutilation features;

[0108] Match the discontinuous boundary features and the mutilated regular edge features with the portrait contour to obtain portrait region mutilation features.

[0109] In one embodiment, the reflection judgment module 103 is specifically used for:

[0110] Performing grayscale processing on the non-reflective area image to obtain a grayscale image;

[0111] Obtaining the grayscale value of each pixel of the grayscale image to obtain grayscale value data;

[0112] Obtaining the median of the gray value data to obtain a gray threshold;

[0113] According to the gray value data, the gray values of the pixels in the grayscale image that are greater than the gray threshold are set to 1, and the gray values of the pixels that are less than or equal to the gray threshold are set to 0, so as to obtain a binary image.

[0114] In one embodiment, the complete region identification module 104 is specifically configured to:

[0115] Using a neural network model to perform average pooling processing and maximum pooling processing on the incomplete features of the text area to obtain average pooling features and maximum pooling features;

[0116] Concatenate the average pooling feature and the maximum pooling feature in the channel dimension to obtain a concatenated feature;

[0117] Performing convolution processing and activation processing on the splicing features to obtain a spatial attention map;

[0118] Multiplying the spatial attention map by the incomplete features of the text area to obtain an attention weight;

[0119] A neural network model is used to output the complete text area of the document image according to the attention weight and the incomplete features of the text area.

[0120] In one embodiment, the complete region identification module 104 is specifically configured to:

[0121] Use a convolution kernel of size 1*1 to convolve all the concatenated features to obtain a convolution result of size 1*1*N, where N is the number of output channels;

[0122] Expand the convolution result in the spatial dimension to obtain a feature tensor of size N*H*W, where H*W is the size of the concatenated feature;

[0123] Each element in the feature tensor is mapped to between 0 and 1 using a preset activation function to obtain a spatial attention map.

[0124] The present invention provides a picture detection device, which performs dual status information verification on the user's bank card and ID card, and ensures that the user's bank card information and ID card data can be accurately obtained. It generates front and back pictures of the ID card according to the ID card data, and then verifies the user-entered key by downloading and decrypting a pre-set key, ensuring the reliability of user ID card verification. Finally, it accesses services based on the bank card information and the front and back pictures of the ID card, improving the security of financial transactions.

[0125] For the specific limitations of the picture detection device, reference can be made to the limitations of the picture detection method in the above text, which will not be elaborated here. Each module in the above picture detection device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.

[0126] In one embodiment, a computer device is provided. This computer device can be a server, and its internal structure diagram can be as Figure 4 shown. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage media. The network interface of the computer device is used to communicate with an external client through a network connection. When the computer program is executed by the processor, it realizes the functions or steps on the server side of a picture detection method.

[0127] In one embodiment, a computer device is provided. This computer device can be a client, and its internal structure diagram can be as Figure 5 shown. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes non-volatile storage media and internal memory. The non-volatile storage media stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage media. The network interface of the computer device is used to communicate with an external server through a network connection. When the computer program is executed by the processor, it realizes the functions or steps on the client side of a picture detection method.

[0128] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0129] Obtain the ID picture uploaded by the user, confirm the portrait orientation of the ID picture, and obtain the ID picture in a straightened state;

[0130] Obtaining the highlighted area of the straightened ID card image;

[0131] Determining whether the highlighted area is a reflective area;

[0132] If the highlighted area is not a reflective area, sending the straightened ID card image to the server;

[0133] If the highlighted area is a reflective area, a non-reflective area image of the straightened ID image is obtained, and incomplete features of the text area and incomplete features of the portrait area in the non-reflective area image are identified;

[0134] Using a pre-trained text region boundary recognition model to identify a complete text region in the straightened ID image according to the incomplete features of the text region, and using a pre-trained portrait region boundary recognition model to identify a complete portrait region in the straightened ID image according to the incomplete features of the portrait region;

[0135] The key information area of the straightened ID card image is segmented according to the complete text area and the complete portrait area to obtain a key information image, and the key information image is sent to a server.

[0136] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0137] Obtain the ID picture uploaded by the user, confirm the portrait orientation of the ID picture, and obtain the ID picture in a straightened state;

[0138] Obtaining the highlighted area of the straightened ID card image;

[0139] Determining whether the highlighted area is a reflective area;

[0140] If the highlighted area is not a reflective area, sending the straightened ID card image to the server;

[0141] If the highlighted area is a reflective area, a non-reflective area image of the straightened ID image is obtained, and incomplete features of the text area and incomplete features of the portrait area in the non-reflective area image are identified;

[0142] Use the pre-trained text area boundary recognition model to recognize the complete text area in the rectified state ID card picture according to the text area mutilation features, and use the pre-trained portrait area boundary recognition model to recognize the complete portrait area of the rectified state ID card picture according to the portrait area mutilation features;

[0143] Segment the key information area of the rectified state ID card picture according to the complete text area and the complete portrait area to obtain a key information picture, and send the key information picture to the server.

[0144] It should be noted that for the functions or steps that the above computer-readable storage medium or computer device can achieve, reference can be made to the relevant descriptions on the server side and the client side in the foregoing method embodiments. To avoid repetition, they will not be described in detail here.

[0145] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above method embodiments. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0146] Those skilled in the art can clearly understand that for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.

[0147] Finally, it should be noted that if software tools or components of other companies appear in the application embodiments, they are only used for illustrative introduction and do not represent actual use. The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. An image detection method, characterized in that, include: Obtain the ID picture uploaded by the user, confirm the portrait orientation of the ID picture, and obtain the ID picture in a straightened state; Obtaining the highlighted area of the straightened ID card image; Determining whether the highlighted area is a reflective area; If the highlighted area is not a reflective area, sending the straightened ID card image to the server; If the highlighted area is a reflective area, a non-reflective area image of the straightened ID image is obtained, and incomplete features of the text area and incomplete features of the portrait area in the non-reflective area image are identified; Using a pre-trained text region boundary recognition model to identify a complete text region in the straightened ID image according to the incomplete features of the text region, and using a pre-trained portrait region boundary recognition model to identify a complete portrait region in the straightened ID image according to the incomplete features of the portrait region; The key information area of the straightened ID card image is segmented according to the complete text area and the complete portrait area to obtain a key information image, and the key information image is sent to a server.

2. The picture detection method according to claim 1, characterized in that The step of confirming the orientation of the portrait in the ID picture to obtain the ID picture in a straightened state includes: Obtain the portrait orientation of the certificate image; Determining whether the portrait direction is a preset alignment direction; If the orientation of the portrait is the preset straightening orientation, confirming that the ID picture is an ID picture in a straightening state; If the portrait direction is not the preset straightening direction, the ID picture is rotated so that the portrait direction of the ID picture is the straightening direction, thereby obtaining the ID picture in a straightened state.

3. The picture detection method according to claim 1, wherein The step of obtaining the highlighted area of the straightened document image includes: Obtaining a histogram of the straightened document image; Based on the histogram, pixel points in the straightened state document image whose pixel values are greater than a preset highlight threshold are identified to obtain a highlight area.

4. The picture detection method according to claim 1, characterized in that The identifying of the incomplete features of the text area and the incomplete features of the portrait area in the non-reflective area image includes: Binarizing the non-reflective area image to obtain a binary image; Using an edge detection algorithm to identify discontinuous boundary features and incomplete regular edge features in the binary image; Performing text detection on the discontinuous boundary features and the incomplete regular edge features using a text detection algorithm to obtain incomplete features of the text area; The discontinuous boundary features and the incomplete regular edge features are matched with the portrait contour to obtain the incomplete features of the portrait area.

5. The picture detection method according to claim 4, characterized in that The non-reflective area image is binarized to obtain a binarized image: Performing grayscale processing on the non-reflective area image to obtain a grayscale image; Obtaining the grayscale value of each pixel of the grayscale image to obtain grayscale value data; Obtaining the median of the gray value data to obtain a gray threshold; According to the gray value data, the gray values of the pixels in the grayscale image that are greater than the gray threshold are set to 1, and the gray values of the pixels that are less than or equal to the gray threshold are set to 0, so as to obtain a binary image.

6. The picture detection method according to claim 1, wherein The method of using the pre-trained text region boundary recognition model to recognize the complete text region in the straightened document image according to the incomplete features of the text region includes: Using a neural network model to perform average pooling processing and maximum pooling processing on the incomplete features of the text area to obtain average pooling features and maximum pooling features; Concatenate the average pooling feature and the maximum pooling feature in the channel dimension to obtain a concatenated feature; Performing convolution processing and activation processing on the splicing features to obtain a spatial attention map; Multiplying the spatial attention map by the incomplete features of the text area to obtain an attention weight; A neural network model is used to output the complete text area of the document image according to the attention weight and the incomplete features of the text area.

7. The picture detection method according to claim 6, wherein The convolution processing and activation processing are performed on the splicing features to obtain a spatial attention map, including: Use a convolution kernel of size 1*1 to convolve all the concatenated features to obtain a convolution result of size 1*1*N, where N is the number of output channels; Expand the convolution result in the spatial dimension to obtain a feature tensor of size N*H*W, where H*W is the size of the concatenated feature; Each element in the feature tensor is mapped to between 0 and 1 using a preset activation function to obtain a spatial attention map.

8. An image detection device, characterized in that, include: The image orientation confirmation module is used to obtain the ID image uploaded by the user, confirm the orientation of the portrait in the ID image, and obtain the ID image in a straightened state; A highlight region recognition module, used to obtain the highlight region of the straightened document image; a reflection judgment module, used to judge whether the highlighted area is a reflection area, and if the highlighted area is not a reflection area, send the straightened state document image to a server; if the highlighted area is a reflection area, obtain a non-reflective area image of the straightened state document image, and identify the incomplete features of the text area and the incomplete features of the portrait area in the non-reflective area image; A complete region recognition module, used to recognize the complete text region in the straightened state ID image according to the incomplete features of the text region using a pre-trained text region boundary recognition model, and to recognize the complete portrait region in the straightened state ID image according to the incomplete features of the portrait region using a pre-trained portrait region boundary recognition model; The key information picture recognition module is used to segment the key information area of the straightened document picture according to the complete text area and the complete portrait area, obtain the key information picture, and send the key information picture to the server.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the image detection method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, the steps of the image detection method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Foreign certificate identification method and system based on multi-modal fusion

    CN122135187A

  • A method and system for foreign affairs document recognition based on multimodal fusion

    CN122135187B