Image detection method and related device

By extracting facial contours and determining matching degrees from facial images, selecting the optimal facial contour and determining its key point location set, the problem of low accuracy in facial image key point detection is solved, achieving higher detection accuracy.

CN112487847BActive Publication Date: 2025-11-21SHENZHEN INTELLIFUSION TECHNOLOGIES CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910860979.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-11
Publication Date
2025-11-21
Estimated Expiration
2039-09-11

AI Technical Summary

Technical Problem

The accuracy of facial image key point detection in existing technologies is relatively low.

Method used

By performing facial contour extraction on the target face image, the face contour with the highest matching degree with the first face contour is selected as the second face contour, or the second face contour is determined based on the first face contour and the face contour model, and the corresponding set of target key point positions is determined, and then the key point extraction operation is performed.

Benefits of technology

It improves the accuracy of key point detection in facial images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112487847B_ABST
    Figure CN112487847B_ABST
Patent Text Reader

Abstract

The application discloses an image detection method and related equipment. The method comprises the following steps: performing a face contour extraction operation on a target face image to obtain a first face contour corresponding to the target face image; selecting a face contour with the highest matching degree with the first face contour from a face contour set as a second face contour; or determining the second face contour according to the first face contour and a face contour model; determining a target key point position set corresponding to the second face contour; and performing a key point extraction operation on the target face image according to the target key point position set to obtain a target key point set corresponding to the target face image. The embodiments of the application can help improve the accuracy of face image key point detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, in particular to an image detection method and related equipment. BACKGROUND

[0002] At present, the process of face image key point detection is as follows: an electronic device acquires a face image, predicts a plurality of key point positions according to the face image, performs a key point detection operation on the face image according to the plurality of key point positions, and obtains a plurality of key points corresponding to the face image, which are in one-to-one correspondence with the plurality of key point positions. This approach results in low accuracy of face image key point detection. SUMMARY

[0003] Embodiments of the present application provide an image detection method and related equipment to improve the accuracy of face image key point detection.

[0004] In a first aspect, an image detection method is provided, comprising:

[0005] performing a face contour extraction operation on a target face image to obtain a first face contour corresponding to the target face image;

[0006] selecting a face contour with the highest matching degree with the first face contour from a face contour set as a second face contour; or determining the second face contour according to the first face contour and a face contour model;

[0007] determining a target key point position set corresponding to the second face contour;

[0008] performing a key point extraction operation on the target face image according to the target key point position set to obtain a target key point set corresponding to the target face image.

[0009] In one possible example, the selecting a face contour with the highest matching degree with the first face contour from a face contour set as a second face contour comprises:

[0010] calculating the matching degree between the first face contour and the i-th face contour to obtain an i-th matching degree corresponding to the i-th face contour, the i-th face contour being any one of N face contours included in the face contour set, and N being an integer greater than 1;

[0011] After obtaining the i-th matching degree, the matching degree between the first face contour and the (i+1)-th face contour is calculated to obtain a (i+1)-th matching degree corresponding to the (i+1)-th face contour;

[0012] until i=N, obtaining N matching degrees, the N matching degrees correspond to the N face contours one by one, the i is an initial value of 1, an increasing integer with an interval of 1;

[0013] The face contour corresponding to the highest matching degree in the N matching degrees is determined as the second face contour.

[0014] In one possible example, the determination of the target key point position set corresponding to the second face contour comprises:

[0015] The mapping table of face contour and key point position is called;

[0016] According to the mapping table of face contour and key point position, a plurality of target key point positions corresponding to the second face contour are determined;

[0017] The key point position set composed of the plurality of target key point positions is determined as the target key point position set corresponding to the second face contour.

[0018] In one possible example, the determination of the second face contour according to the first face contour and the face contour model comprises:

[0019] The face contour adjustment parameter is determined according to the first face contour;

[0020] The face contour adjustment parameter is input into the face contour model, and the face contour model comprises a standard face contour;

[0021] The face contour model is controlled to perform a face contour adjustment operation on the standard face contour according to the face contour adjustment parameter, and a face contour adjusted standard face contour is obtained;

[0022] The face contour adjusted standard face contour is determined as the second face contour.

[0023] In one possible example, the determination of the target key point position set corresponding to the second face contour comprises:

[0024] The key point position adjustment parameter is determined according to the standard face contour and the second face contour;

[0025] According to the key point position adjustment parameter, a plurality of key point positions corresponding to the standard face contour are executed to perform a key point position adjustment operation, and a plurality of key point positions adjusted in key point position are obtained;

[0026] The key point position set composed of the plurality of key point positions adjusted in key point position is determined as the target key point position set corresponding to the second face contour.

[0027] In a second aspect, an embodiment of the present application provides an image detection device, comprising:

[0028] A first extraction unit is configured to perform a face contour extraction operation on the target face image to obtain a first face contour corresponding to the target face image.

[0029] A first determination unit is configured to select a face contour with the highest matching degree with the first face contour from the face contour set as a second face contour, or determine the second face contour according to the first face contour and a face contour model.

[0030] A second determination unit is configured to determine a target key point position set corresponding to the second face contour.

[0031] A second extraction unit is configured to perform a key point extraction operation on the target face image according to the target key point position set to obtain a target key point set corresponding to the target face image.

[0032] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, a communication interface, and one or more programs, the one or more programs are stored in the memory and configured to be executed by the processor, and the programs comprise instructions for performing steps in the method of the first aspect of the present application.

[0033] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, configured to store a computer program, and the computer program is executed by a processor to implement some or all of the steps described in the method of the first aspect of the present application.

[0034] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a non-transitory computer readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform some or all of the steps described in the method of the first aspect of the present application. The computer program product can be a software installation package.

[0035] It can be seen that, compared with the electronic device performing the key point detection operation on the face image according to the plurality of key point positions predicted from the face image to obtain the plurality of key points corresponding to the face image, in the embodiment of the present application, the image detection device performs the face contour extraction operation on the target face image to obtain the first face contour, selects the face contour with the highest matching degree with the first face contour from the face contour set as the second face contour or determines the second face contour according to the first face contour and the face contour model, determines the target key point position set corresponding to the second face contour, and performs the key point extraction operation on the face image according to the target key point position set to obtain the target key point set corresponding to the target face image. Since the target key point position set corresponding to the second face contour is more accurate than the plurality of key points predicted from the face image, this helps to improve the accuracy of face image key point detection.

[0036] These aspects or other aspects of the present application will be more apparent from the following description of the embodiments of the present application. BRIEF DESCRIPTION OF DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background art, the drawings needed to be used in the embodiments of the present application or the background art will be described below.

[0038] Figure 1 is an architecture schematic diagram of an image detection system provided by the embodiments of the present application;

[0039] Figure 2A is a flow schematic diagram of an image detection method provided by the embodiments of the present application;

[0040] Figure 2B is a schematic diagram of calculating a target angle difference between a target direction and a positive direction of any one coordinate axis on a preset coordinate system provided by the embodiments of the present application;

[0041] Figure 3 is a flow schematic diagram of another image detection method provided by the embodiments of the present application;

[0042] Figure 4 is a function unit component block diagram of an image detection device provided by the embodiments of the present application;

[0043] Figure 5 is a structural schematic diagram of an electronic device provided by the embodiments of the present application.

[0044] DETAILED DESCRIPTION

[0045] In order to enable personnel in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application.

[0046] The electronic device can include various handheld devices, vehicle-mounted devices, wearable devices, computing devices, or other processing devices connected to a wireless modem having a wireless communication function, and various forms of User Equipment (UE), Mobile Station (MS), terminal device, and the like.

[0047] The embodiments of the present application are described in detail below.

[0048] Please refer to Figure 1 , Figure 1 is a schematic diagram of an image detection system architecture provided by an embodiment of the present application, which includes a processor, wherein:

[0049] The processor is configured to perform a face contour extraction operation on the target face image to obtain a first face contour corresponding to the target face image.

[0050] The processor is further configured to select, from the set of face contours, a face contour with the highest matching degree with the first face contour as a second face contour; or determine the second face contour according to the first face contour and a face contour model.

[0051] The processor is further configured to determine a set of target key point positions corresponding to the second face contour.

[0052] The processor is further configured to perform a key point extraction operation on the target face image according to the set of target key point positions to obtain a set of target key points corresponding to the target face image.

[0053] In one possible example, before performing the face contour extraction operation on the target face image to obtain the first face contour corresponding to the target face image, the processor is further configured to:

[0054] Obtain an initial face image, and determine a target direction of a perpendicular line of a line connecting two eyes in the initial face image in a preset coordinate system.

[0055] Calculate a target angle difference value between the target direction and a positive direction of any coordinate axis of the preset coordinate system.

[0056] Determine a target rotation direction and a target rotation angle corresponding to the target angle difference value according to a mapping relationship between the angle difference value and the rotation direction and the rotation angle.

[0057] Perform a rotation operation on the initial face image according to the target rotation direction and the target rotation angle to obtain the target face image.

[0058] In one possible example, in selecting, from the set of face contours, a face contour with the highest matching degree with the first face contour as the second face contour, the processor is specifically configured to:

[0059] calculate a matching degree between the first face contour and the i-th face contour, to obtain an i-th matching degree corresponding to the i-th face contour, the i-th face contour being any one of N face contours included in the set of face contours, N being an integer greater than 1;

[0060] after obtaining the i-th matching degree, calculate a matching degree between the first face contour and the (i+1)-th face contour, to obtain a (i+1)-th matching degree corresponding to the (i+1)-th face contour;

[0061] until i=N, N matching degrees are obtained, the N matching degrees corresponding to the N face contours one by one, i being an incremental integer with an initial value of 1 and an interval of 1;

[0062] determine a face contour corresponding to the highest matching degree among the N matching degrees as the second face contour.

[0063] In one possible example, in determining a set of target key point positions corresponding to the second face contour, the processor is specifically configured to:

[0064] invoke a mapping table of face contours and key point positions;

[0065] determine a plurality of target key point positions corresponding to the second face contour according to the mapping table of face contours and key point positions;

[0066] determine a set of key point positions formed by the plurality of target key point positions as the set of target key point positions corresponding to the second face contour.

[0067] In one possible example, in determining the second face contour according to the first face contour and a face contour model, the processor is specifically configured to:

[0068] determine a face contour adjustment parameter according to the first face contour;

[0069] input the face contour adjustment parameter into a face contour model, the face contour model including a standard face contour;

[0070] control the face contour model to perform a face contour adjustment operation on the standard face contour according to the face contour adjustment parameter, to obtain a face contour adjusted standard face contour;

[0071] determine the face contour adjusted standard face contour as the second face contour.

[0072] In one possible example, in determining the target key point position set corresponding to the second face contour, the processor is specifically configured to:

[0073] determine a key point position adjustment parameter according to the standard face contour and the second face contour;

[0074] perform a key point position adjustment operation on a plurality of key point positions corresponding to the standard face contour according to the key point position adjustment parameter to obtain a plurality of key point positions after key point position adjustment;

[0075] determine a key point position set composed of the plurality of key point positions after key point position adjustment as the target key point position set corresponding to the second face contour.

[0076] See Figure 2A , Figure 2A is a schematic diagram of an image detection method provided by an embodiment of the present application, which includes steps 201-204, and specifically as follows:

[0077] 201: The image detection device performs a face contour extraction operation on a target face image to obtain a first face contour corresponding to the target face image.

[0078] Specifically, the implementation manner of the image detection device performing the face contour extraction operation on the target face image to obtain the first face contour corresponding to the target face image can be as follows:

[0079] The image detection device calls a face contour extraction algorithm.

[0080] The image detection device performs the face contour extraction operation on the target face image using the face contour extraction algorithm to obtain the first face contour corresponding to the target face image.

[0081] The face contour extraction algorithm is pre-stored in the image detection device, and the face contour extraction algorithm includes a front face contour extraction algorithm based on skin color and face shape constraint, a front face contour extraction algorithm based on a skin color model and a gradient operator, a face contour extraction algorithm based on skin color and depth information, etc.

[0082] In one possible example, before the image detection device performs the face contour extraction operation on the target face image to obtain the first face contour corresponding to the target face image, the method further includes:

[0083] The image detection device acquires an initial face image, and determines a target direction of a perpendicular line of a line connecting two eyes in the initial face image in a preset coordinate system.

[0084] The image detection device calculates the target angle difference between the target direction and the positive direction of any coordinate axis of the preset coordinate system;

[0085] The image detection device determines the target rotation direction and target rotation angle corresponding to the target angle difference based on the mapping relationship between the angle difference and the rotation direction and rotation angle.

[0086] The image detection device performs a rotation operation on the initial face image according to the target rotation direction and the target rotation angle to obtain the target face image.

[0087] For example, such as Figure 2B As shown, Figure 2B This is a schematic diagram of calculating the target angle difference between the target direction and the positive direction of any coordinate axis in the preset coordinate system, provided by an embodiment of this application. The image detection determines that the target direction of the perpendicular line connecting the two eyes in the initial face image is direction 1 in the preset coordinate system, and the angle value of direction 1 in the preset coordinate system is α. The image detection device calculates the target angle difference between direction 1 and the positive Y-axis direction of the preset coordinate system as (α-90°).

[0088] The mapping relationship between the angle difference and the rotation direction and rotation angle is pre-stored in the image detection device. The mapping relationship between the angle difference and the rotation direction and rotation angle is shown in Table 1 below:

[0089] Table 1

[0090] angle difference value rotation direction rotation angle +β rotate right β -β rotate left β

[0091] As can be seen, compared to performing face contour extraction on face images that are neither vertical nor horizontal to obtain the corresponding face contour, in this example, the image detection device performs a rotation operation on the initial face image according to the target rotation direction and target rotation angle to obtain the target face image. Since the target face image is a vertical or horizontal face image, this helps to improve the extraction speed and accuracy of the face contour.

[0092] In one possible example, the image detection device includes a camera. Before the image detection device performs a face contour extraction operation on the target face image to obtain a first face contour corresponding to the target face image, the method further includes:

[0093] The image detection device determines whether there are obstacles between the camera and the target face;

[0094] If there is an obstacle between the camera and the target face, the image detection device will perform an obstacle warning operation;

[0095] After the preset time length, the image detection apparatus determines again whether there is an obstacle between the camera and the target face.

[0096] If there is no obstacle between the camera and the target face, the image detection apparatus performs a shooting operation on the target face by the camera to obtain a target face image.

[0097] The preset time length can be customized by a user, for example, the preset time length is 2 seconds.

[0098] It can be seen that, compared with the case where the image detection apparatus performs a shooting operation on the target face by the camera to obtain a target face image when there is an obstacle between the camera and the target face, in the present example, the image detection apparatus performs an obstacle prompting operation when there is an obstacle between the camera and the target face, and after the preset time length, the image detection apparatus performs a shooting operation on the target face by the camera to obtain a target face image when there is no obstacle between the camera and the target face, which helps to improve the accuracy of the target face image, and further improves the extraction rate and accuracy of the face contour.

[0099] 202: The image detection apparatus selects a face contour with the highest matching degree from the set of face contours as a second face contour, or determines the second face contour according to the first face contour and a face contour model.

[0100] In one possible example, the image detection apparatus selects a face contour with the highest matching degree from the set of face contours as a second face contour, including:

[0101] The image detection apparatus calculates the matching degree between the first face contour and the ith face contour to obtain an ith matching degree corresponding to the ith face contour, the ith face contour being any one of N face contours included in the set of face contours, and N being an integer greater than 1;

[0102] After obtaining the ith matching degree, the image detection apparatus calculates the matching degree between the first face contour and the (i+1)th face contour to obtain a (i+1)th matching degree corresponding to the (i+1)th face contour;

[0103] Until i=N, the image detection apparatus obtains N matching degrees, the N matching degrees corresponding to the N face contours one by one, and i being an increasing integer with an initial value of 1 and an interval of 1;

[0104] The image detection apparatus determines the face contour corresponding to the highest matching degree in the N matching degrees as the second face contour.

[0105] Specifically, the image detection device calculates the matching degree between the first face contour and the i-th face contour, and the implementation of the i-th matching degree corresponding to the i-th face contour can be:

[0106] The image detection device performs a feature vector extraction operation on the first face contour using a feature vector extraction algorithm to obtain a first feature vector corresponding to the first face contour.

[0107] The image detection device performs a feature vector extraction operation on the i-th face contour using a feature vector extraction algorithm to obtain a second feature vector corresponding to the i-th face contour.

[0108] The image detection device determines the matching degree between the first feature vector and the second feature vector according to the first feature vector, the second feature vector, and a matching degree formula.

[0109] The image detection device determines the matching degree between the first feature vector and the second feature vector as the i-th matching degree corresponding to the i-th face contour.

[0110] The feature vector extraction algorithm is pre-stored in the image detection device, and the feature vector extraction algorithm includes a local reciprocal mode algorithm, a singular value decomposition algorithm, a 2D discrete cosine transform algorithm, etc.

[0111] The matching degree formula is pre-stored in the image detection device, and the matching degree formula is:

[0112]

[0113] wherein Z is the matching degree between the first feature vector and the second feature vector (i.e. the i-th matching degree corresponding to the i-th face contour), γ(m, n) is the Euclidean distance, the first feature vector is (m1, m2, m3, …, m p ), the second feature vector is (n1, n2, n3, …, n p ), m j represents the j-th feature value in the first feature vector, and n j represents the j-th feature value in the second feature vector.

[0114] The image detection device can calculate N matching degrees between the first face contour and N face contours included in the face contour set in a parallel manner, and the N matching degrees correspond to the N face contours one by one, which will not be described here.

[0115] In one possible example, the image detection device determines the second face contour according to the first face contour and a face contour model, including:

[0116] The image detection device determines a face contour adjustment parameter according to the first face contour.

[0117] The image detection device inputs the face contour adjustment parameter into a face contour model, and the face contour model comprises a standard face contour;

[0118] The image detection device controls the face contour model to perform a face contour adjustment operation on the standard face contour according to the face contour adjustment parameter, to obtain a face contour adjusted standard face contour;

[0119] The image detection device determines the face contour adjusted standard face contour as a second face contour.

[0120] Specifically, the implementation of the image detection device determining the face contour adjustment parameter according to the first face contour can be:

[0121] The image detection device parses the first face contour to obtain M first face contour lines included in the first face contour, and M is an integer greater than 1;

[0122] The image detection device determines the M first face contour lines as the face contour adjustment parameter.

[0123] Specifically, the implementation of the image detection device controlling the face contour model to perform the face contour adjustment operation on the standard face contour according to the face contour adjustment parameter to obtain the face contour adjusted standard face contour can be:

[0124] The image detection device controls the face contour model to perform a kth face contour adjustment operation on the standard face contour according to a kth first face contour line to obtain a kth face contour adjusted standard face contour, and the kth first face contour line is any one of the M first face contour lines;

[0125] After obtaining the kth face contour adjusted standard face contour, the image detection device controls the face contour model to perform a (k+1)th face contour adjustment operation on the kth face contour adjusted standard face contour according to a (k+1)th first face contour line to obtain a (k+1)th face contour adjusted standard face contour;

[0126] Until k=M, the image detection device obtains an Mth face contour adjusted standard face contour, and k is an incremental integer with an initial value of 1 and an interval of 1;

[0127] The image detection device determines the Mth face contour adjusted standard face contour as the face contour adjusted standard face contour.

[0128] Specifically, the implementation of the image detection device controlling the face contour model to perform the kth face contour adjustment operation on the standard face contour according to the kth first face contour line to obtain the kth face contour adjusted standard face contour can be:

[0129] The image detection device determines a first face part corresponding to the kth first face contour line;

[0130] The image detection device selects a kth second face contour line corresponding to the first face part from M second face contour lines included in the standard face contour;

[0131] The image detection device controls the face contour model to perform a contour line adjustment operation on the kth second face contour line, to obtain a contour line adjusted kth second face contour line, which has the same size and shape as the kth first face contour line.

[0132] The image detection device can control the face contour model to perform a face contour adjustment operation on the standard face contour according to the M first face contour lines in a parallel manner, and the face contour adjusted standard face contour is not described herein.

[0133] 203: The image detection device determines a target key point position set corresponding to the second face contour.

[0134] In one possible example, the image detection device determines a target key point position set corresponding to the second face contour, including:

[0135] The image detection device calls a face contour and key point position mapping table;

[0136] The image detection device determines a plurality of target key point positions corresponding to the second face contour according to the face contour and key point position mapping table;

[0137] The image detection device determines a key point position set formed by the plurality of target key point positions as the target key point position set corresponding to the second face contour.

[0138] The face contour and key point position mapping table is pre-stored in the image detection device, each of a plurality of face contours corresponds to a plurality of key point positions, and the face contour and key point position mapping table is shown in Table 2 as follows:

[0139] Table 2

[0140] face contour key point position face contour 1 key point position 1 - key point position 10 face contour 2 key point position 11 - key point position 20 face contour 3 key point position 21 - key point position 30 …… ……

[0141] In one possible example, the image detection device determines a target key point position set corresponding to the second face contour, including:

[0142] The image detection device determines a key point position adjustment parameter according to the standard face contour and the second face contour;

[0143] The image detection device performs a key point position adjustment operation on the plurality of key point positions corresponding to the standard face contour according to the key point position adjustment parameter to obtain a plurality of key point positions after key point position adjustment.

[0144] The image detection device determines a key point position set composed of the plurality of key point positions after key point position adjustment as a target key point position set corresponding to the second face contour.

[0145] Specifically, the first face contour includes M first face contour lines, the standard face contour includes M second face contour lines, the second face contour includes M third face contour lines, the M third face contour lines correspond to the M second face contour lines one by one, the second face contour is a labeled face contour after the image detection device performs a face contour adjustment operation on the standard face contour, the M third face contour lines correspond to the M first face contour lines one by one, and any third contour line in the M third face contour lines is the same in size and shape as the first face contour line corresponding thereto, and the image detection device determines the key point position adjustment parameter according to the standard face contour and the second face contour:

[0146] The image detection device calculates a plurality of stretching parameters of the qth third face contour line compared to the qth second face contour line to obtain a qth stretching parameter set corresponding to the qth third face contour line.

[0147] After obtaining the qth stretching parameter set, the image detection device calculates a plurality of stretching parameters of the (q+1)th third face contour line compared to the (q+1)th second face contour line to obtain a (q+1)th stretching parameter set corresponding to the (q+1)th third face contour line.

[0148] Until q=M, the image detection device obtains M stretching parameter sets, the M stretching parameter sets correspond to the M third face contour lines one by one, and q is an incremental integer with an interval of 1 starting from 1.

[0149] The image detection device determines the M stretching parameter sets as the key point position adjustment parameter.

[0150] The image detection device can determine the M stretching parameter sets according to the M third face contour lines and the M second face contour lines in a parallel manner, and the M stretching parameter sets correspond to the M third face contour lines one by one, which will not be described here.

[0151] Specifically, the image detection device performs a key point position adjustment operation on the plurality of position points corresponding to the standard face contour according to the key point position adjustment parameter to obtain a plurality of key point positions after key point position adjustment, including:

[0152] The image detection apparatus determines a second face part corresponding to the stretching parameter set A, and the stretching parameter set A is any one of M stretching parameter sets;

[0153] The image detection apparatus selects a key point position sub-set A corresponding to the second face part from a plurality of key point positions corresponding to the standard face contour;

[0154] The image detection apparatus performs a key point adjustment operation on the key point position sub-set A according to the stretching parameter set A to obtain a key point position sub-set A after key point position adjustment;

[0155] The image detection apparatus performs the same operation on (M-1) stretching parameter sets other than the stretching parameter set A in the M stretching parameter sets to obtain (M-1) key point position sub-sets after key point position adjustment, and the (M-1) key point position sub-sets after key point position adjustment correspond to the (M-1) stretching parameter sets one by one;

[0156] The image detection apparatus determines the key point position sub-set A after key point position adjustment and the (M-1) key point position sub-sets after key point position adjustment as a plurality of key point positions after key point position adjustment.

[0157] Specifically, the stretching parameter set A includes P stretching parameters, the key point position sub-set A includes P key point positions, the P key point positions correspond to the P stretching parameters one by one, P is an integer greater than 1, and the implementation of the image detection apparatus performing the key point adjustment operation on the key point position sub-set A according to the stretching parameter set A to obtain the key point position sub-set A after key point position adjustment can be:

[0158] The image detection apparatus adjusts the key point position of the s-th key point position in the P key point positions according to the s-th stretching parameter in the P stretching parameters to obtain the s-th key point position after key point position adjustment, and the s-th key point position is any one of the P key point positions, P is an integer greater than 1;

[0159] After obtaining the s-th key point position after key point position adjustment, the image detection apparatus adjusts the (s+1)-th key point position in the P key point positions according to the (s+1)-th stretching parameter in the P stretching parameters to obtain the (s+1)-th key point position after key point position adjustment;

[0160] Until s=P, the image detection apparatus obtains the P key point positions after key point position adjustment, and s is an incremental integer with an initial value of 1 and an interval of 1;

[0161] The image detection apparatus determines the key point position sub-set composed of the P key point positions after the adjustment as the key point position sub-set A after the adjustment.

[0162] 204: The image detection apparatus performs a key point extraction operation on the target face image according to the target key point position set to obtain a target key point set corresponding to the target face image.

[0163] Specifically, the target key point position set includes Q target key point positions, and Q is an integer greater than 1. The implementation of the image detection apparatus performing a key point extraction operation on the target face image according to the target key point position set to obtain a target key point set corresponding to the target face image can be:

[0164] The image detection apparatus performs a key point extraction operation on the target face image according to the tth target key point position to obtain a tth target key point corresponding to the tth target key point position, and the tth target key point is any one of the Q target key point positions;

[0165] After obtaining the tth target key point, the image detection apparatus performs a key point extraction operation on the target face image according to the (t+1)th target key point position to obtain a (t+1)th target key point corresponding to the (t+1)th target key point position;

[0166] Until t=Q, the image detection apparatus obtains Q target key points, and t is an incremental integer with an initial value of 1 and an interval of 1.

[0167] The image detection apparatus determines the key point set composed of the Q target key points as the target key point set corresponding to the target face image.

[0168] The image detection apparatus can perform a key point extraction operation on the target face image according to the Q target key point positions in a parallel manner to obtain Q target key points, and the Q target key points correspond to the Q target key point positions one by one, which is not described here.

[0169] It can be seen that, compared to the electronic device performing the key point detection operation on the face image according to the plurality of key point positions predicted from the face image to obtain the plurality of key points corresponding to the face image, in the embodiment of the present application, the image detection apparatus performs the face contour extraction operation on the target face image to obtain the first face contour, selects the face contour with the highest matching degree with the first face contour from the face contour set as the second face contour or determines the second face contour according to the first face contour and the face contour model, determines the target key point position set corresponding to the second face contour, and performs the key point extraction operation on the face image according to the target key point position set to obtain the target key point set corresponding to the target face image. Since the target key point position set corresponding to the second face contour is more accurate than the plurality of key points predicted from the face image, this helps to improve the accuracy of face image key point detection.

[0170] Please refer to Figure 3 , Figure 3 is a flowchart of another image detection method provided by the embodiment of the present application, which includes steps 301-312, as follows:

[0171] 301: The image detection apparatus acquires an initial face image, and determines a target direction of a perpendicular line of a line connecting two eyes in the initial face image in a preset coordinate system.

[0172] 302: The image detection apparatus calculates a target angle difference value of the target direction and a positive direction of any coordinate axis of the preset coordinate system.

[0173] 303: The image detection apparatus determines a target rotation direction and a target rotation angle corresponding to the target angle difference value according to a mapping relationship of the angle difference value and the rotation direction and the rotation angle.

[0174] 304: The image detection apparatus performs a rotation operation on the initial face image according to the target rotation direction and the target rotation angle to obtain a target face image.

[0175] 305: The image detection apparatus performs a face contour extraction operation on the target face image to obtain a first face contour corresponding to the target face image.

[0176] 306: The image detection apparatus calculates a matching degree of the first face contour and an i-th face contour to obtain an i-th matching degree corresponding to the i-th face contour, the i-th face contour being any one of N face contours included in a face contour set, and the N being an integer greater than 1.

[0177] 307: After obtaining the ith matching degree, the image detection device calculates a matching degree between the first face contour and an (i+1)th face contour, and obtains an (i+1)th matching degree corresponding to the (i+1)th face contour.

[0178] 308: Until i=N, the image detection device obtains N matching degrees, which correspond to the N face contours, and i is an incremental integer with an initial value of 1 and an interval of 1.

[0179] 309: The image detection device determines a face contour corresponding to the highest matching degree in the N matching degrees as a second face contour.

[0180] 310: The image detection device calls a mapping table of face contours and key point positions.

[0181] 311: The image detection device determines a plurality of target key point positions corresponding to the second face contour according to the mapping table of face contours and key point positions.

[0182] 312: The image detection device determines a key point position set composed of the plurality of target key point positions as a target key point position set corresponding to the second face contour.

[0183] It should be noted that, Figure 3 The specific implementation process of each step of the method shown can be referred to the specific implementation process of the method described above, which will not be described here.

[0184] Please refer to Figure 4 , Figure 4 is a functional unit composition block diagram of an image detection device provided by an embodiment of the present application, and the image detection device 400 includes:

[0185] A first extraction unit 401 is configured to perform a face contour extraction operation on a target face image, and obtain a first face contour corresponding to the target face image.

[0186] A first determination unit 402 is configured to select a face contour with the highest matching degree with the first face contour from a face contour set as a second face contour, or determine the second face contour according to the first face contour and a face contour model.

[0187] A second determination unit 403 is configured to determine a target key point position set corresponding to the second face contour.

[0188] A second extraction unit 404 is configured to perform a key point extraction operation on the target face image according to the target key point position set, and obtain a target key point set corresponding to the target face image.

[0189] In one possible example, the image detection apparatus 400 described above further includes:

[0190] The acquisition unit 405 is configured to acquire an initial face image.

[0191] The third determination unit 406 is configured to determine a target direction of a perpendicular line of a line connecting two eyes in the initial face image in a preset coordinate system.

[0192] The calculation unit 407 is configured to calculate a target angle difference value between the target direction and a positive direction of any coordinate axis of the preset coordinate system.

[0193] The fourth determination unit 408 is configured to determine a target rotation direction and a target rotation angle corresponding to the target angle difference value according to a mapping relationship between the angle difference value and the rotation direction and the rotation angle.

[0194] The rotation unit 409 is configured to perform a rotation operation on the initial face image according to the target rotation direction and the target rotation angle to obtain a target face image.

[0195] In one possible example, in selecting a face contour with the highest matching degree from the face contour set as the second face contour, the first determination unit 402 is specifically configured to:

[0196] Calculate a matching degree between the first face contour and the i-th face contour to obtain an i-th matching degree corresponding to the i-th face contour, the i-th face contour being any one of N face contours included in the face contour set, and N being an integer greater than 1.

[0197] After obtaining the i-th matching degree, a matching degree between the first face contour and the (i+1)-th face contour is calculated to obtain a (i+1)-th matching degree corresponding to the (i+1)-th face contour.

[0198] Until i=N, N matching degrees are obtained, the N matching degrees corresponding to the N face contours one by one, and i being an incremental integer with an initial value of 1 and an interval of 1.

[0199] The face contour corresponding to the highest matching degree in the N matching degrees is determined as the second face contour.

[0200] In one possible example, in determining the target key point position set corresponding to the second face contour, the second determination unit 403 is specifically configured to:

[0201] Call a mapping table of face contours and key point positions.

[0202] determine a plurality of target key point positions corresponding to the second face contour according to the mapping table of the face contour and the key point positions;

[0203] determine a key point position set composed of the plurality of target key point positions as a target key point position set corresponding to the second face contour.

[0204] In one possible example, in terms of determining a second face contour according to the first face contour and a face contour model, the first determining unit 402 is specifically configured to:

[0205] determine a face contour adjustment parameter according to the first face contour;

[0206] input the face contour adjustment parameter into a face contour model, the face contour model including a standard face contour;

[0207] control the face contour model to perform a face contour adjustment operation on the standard face contour according to the face contour adjustment parameter, to obtain a standard face contour after face contour adjustment;

[0208] determine the standard face contour after face contour adjustment as the second face contour.

[0209] In one possible example, in terms of determining a target key point position set corresponding to the second face contour, the second determining unit 403 is specifically configured to:

[0210] determine a key point position adjustment parameter according to the standard face contour and the second face contour;

[0211] perform a key point position adjustment operation on a plurality of key point positions corresponding to the standard face contour according to the key point position adjustment parameter, to obtain a plurality of key point positions after key point position adjustment;

[0212] determine a key point position set composed of the plurality of key point positions after key point position adjustment as the target key point position set corresponding to the second face contour.

[0213] See Figure 5 , Figure 5 is a structural schematic diagram of an electronic device provided by an embodiment of the present application, the electronic device 500 including a processor, a memory, a communication interface, and one or more programs, the one or more programs being stored in the memory and configured to be executed by the processor, the programs including instructions for performing the following steps:

[0214] perform a face contour extraction operation on a target face image, to obtain a first face contour corresponding to the target face image;

[0215] select a face contour with the highest matching degree from the face contour set as the second face contour; or, determine the second face contour according to the first face contour and a face contour model;

[0216] determine a target key point position set corresponding to the second face contour;

[0217] perform a key point extraction operation on the target face image according to the target key point position set to obtain a target key point set corresponding to the target face image.

[0218] In one possible example, the above program further includes instructions for performing the following steps:

[0219] obtain an initial face image, and determine a target direction of a perpendicular line of a line connecting two eyes in the initial face image in a preset coordinate system;

[0220] calculate a target angle difference value between the target direction and a positive direction of any coordinate axis of the preset coordinate system;

[0221] determine a target rotation direction and a target rotation angle corresponding to the target angle difference value according to a mapping relationship between angle difference values and rotation directions and rotation angles;

[0222] perform a rotation operation on the initial face image according to the target rotation direction and the target rotation angle to obtain a target face image.

[0223] In one possible example, in selecting a face contour with the highest matching degree from the face contour set as the second face contour, the above program includes instructions specifically for performing the following steps:

[0224] calculate a matching degree between the first face contour and an i-th face contour to obtain an i-th matching degree corresponding to the i-th face contour, the i-th face contour being any one of N face contours included in the face contour set, N being an integer greater than 1;

[0225] after obtaining the i-th matching degree, calculate a matching degree between the first face contour and an (i+1)-th face contour to obtain an (i+1)-th matching degree corresponding to the (i+1)-th face contour;

[0226] until i=N, N matching degrees are obtained, the N matching degrees corresponding to the N face contours one by one, i being an increasing integer with an initial value of 1 and an interval of 1;

[0227] determine a face contour corresponding to the highest matching degree in the N matching degrees as the second face contour.

[0228] In one possible example, in determining the target key point position set corresponding to the second face contour, the above procedure includes instructions specifically for performing the following steps:

[0229] calling a mapping table of face contour and key point position;

[0230] determining a plurality of target key point positions corresponding to the second face contour according to the mapping table of face contour and key point position;

[0231] determining a key point position set composed of the plurality of target key point positions as the target key point position set corresponding to the second face contour.

[0232] In one possible example, in determining the second face contour according to the first face contour and a face contour model, the above procedure includes instructions specifically for performing the following steps:

[0233] determining a face contour adjustment parameter according to the first face contour;

[0234] inputting the face contour adjustment parameter into a face contour model, the face contour model including a standard face contour;

[0235] controlling the face contour model to perform a face contour adjustment operation on the standard face contour according to the face contour adjustment parameter, to obtain a face contour adjusted standard face contour;

[0236] determining the face contour adjusted standard face contour as the second face contour.

[0237] In one possible example, in determining the target key point position set corresponding to the second face contour, the above procedure includes instructions specifically for performing the following steps:

[0238] determining a key point position adjustment parameter according to the standard face contour and the second face contour;

[0239] performing a key point position adjustment operation on a plurality of key point positions corresponding to the standard face contour according to the key point position adjustment parameter, to obtain a plurality of key point positions after key point position adjustment;

[0240] determining a key point position set composed of the plurality of key point positions after key point position adjustment as the target key point position set corresponding to the second face contour.

[0241] Embodiments of the present application further provide a computer readable storage medium for storing a computer program, wherein the computer program is executed by a processor to implement some or all steps of any method described in the above method embodiments, and the computer includes an electronic device.

[0242] The embodiment of the application further provides a computer program product, which comprises a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any method described in the above method embodiments. The computer program product can be a software installation package, and the computer comprises an electronic device.

[0243] It should be noted that, for the above-mentioned method embodiments, in order to simply describe, they are all described as a series of action combinations, but those skilled in the art should know that the application is not limited to the action sequence described, because according to the application, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily necessary for the application.

[0244] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0245] In several embodiments provided in the application, it should be understood that the disclosed device can be implemented by other means. For example, the device embodiments described above are only schematic, for example, the division of the above units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed mutual units can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical or other forms.

[0246] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0247] In addition, each functional unit in each embodiment of the application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit.

[0248] If the above integrated units are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable memory. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a memory and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the above-mentioned methods of various embodiments of the present application. The aforementioned memory includes: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.

[0249] A person of ordinary skill in the art can understand that all or part of the steps in the above-mentioned various methods of the embodiments can be completed by a program instructing relevant hardware, and the program can be stored in a computer readable memory, which can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0250] The embodiments of the present application are described in detail above, and the principles and implementation manners of the present application are described by applying specific examples. The above description of the embodiments is only used to help understand the method of the present application and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present application, the specific implementation manner and application range will be changed, and the above description of the present application should not be understood as a limitation.

Claims

1. An image detection method, characterized in that, include: Acquire an initial face image and determine the target direction of the perpendicular line connecting the two eyes in the initial face image in a preset coordinate system; Calculate the difference in target angle between the target direction and the positive direction of any coordinate axis of the preset coordinate system; The target rotation direction and target rotation angle corresponding to the target angle difference are determined based on the mapping relationship between the angle difference and the rotation direction and rotation angle. A rotation operation is performed on the initial face image according to the target rotation direction and the target rotation angle to obtain the target face image; The face contour extraction algorithm is invoked to perform face contour extraction operation on the target face image to obtain the first face contour corresponding to the target face image; The face contour adjustment parameters are determined based on the first face contour, wherein the first face contour is parsed to obtain M first face contour lines, where M is an integer greater than 1, and the M first face contour lines are determined as the face contour adjustment parameters. The second face contour is determined based on the face contour adjustment parameters and the face contour model, wherein the face contour model includes a standard face contour. The set of target key point positions corresponding to the second face contour is determined based on the positions of multiple key points corresponding to the standard face contour. Based on the set of target key point locations, a key point extraction operation is performed on the target face image to obtain the set of target key points corresponding to the target face image.

2. The method according to claim 1, characterized in that, The step of determining the second face contour based on the face contour adjustment parameters and the face contour model includes: Input the face contour adjustment parameters into the face contour model; The face contour model is controlled to perform a face contour adjustment operation on the standard face contour according to the face contour adjustment parameters to obtain the standard face contour after face contour adjustment. The standard face contour after the face contour is adjusted is determined as the second face contour.

3. The method according to claim 2, characterized in that, Determining the set of target key point locations corresponding to the second facial contour includes: The key point position adjustment parameters are determined based on the standard face contour and the second face contour; Based on the key point position adjustment parameters, the key point position adjustment operation is performed on multiple key point positions corresponding to the standard face contour to obtain the multiple key point positions after key point position adjustment. The set of key point positions formed by the adjusted key point positions is determined as the target key point position set corresponding to the second face contour.

4. An image detection device, characterized in that, include: The acquisition unit is used to acquire the initial face image; The third determining unit is used to determine the target direction of the perpendicular line connecting the two eyes in the initial face image in the preset coordinate system. The calculation unit is used to calculate the target angle difference between the target direction and any positive direction of the coordinate axis of the preset coordinate system; The fourth determining unit is used to determine the target rotation direction and target rotation angle corresponding to the target angle difference based on the mapping relationship between the angle difference and the rotation direction and rotation angle. A rotation unit is used to perform a rotation operation on the initial face image according to the target rotation direction and the target rotation angle to obtain a target face image; The first extraction unit is used to call a face contour extraction algorithm to perform a face contour extraction operation on the target face image to obtain the first face contour corresponding to the target face image; The first determining unit is used to determine face contour adjustment parameters based on the first face contour, wherein the first face contour is parsed to obtain M first face contour lines, where M is an integer greater than 1, and the M first face contour lines are determined as the face contour adjustment parameters. The first determining unit is further configured to determine a second face contour based on the face contour adjustment parameters and the face contour model, wherein the face contour model includes a standard face contour; The second determining unit is used to determine the set of target key point positions corresponding to the second face contour based on the multiple key point positions corresponding to the standard face contour. The second extraction unit is used to perform key point extraction operation on the target face image according to the target key point location set, so as to obtain the target key point set corresponding to the target face image.

5. An electronic device, characterized in that, The method includes a processor, a memory, a communication interface, and one or more programs, said one or more programs being stored in the memory and configured to be executed by the processor, said programs including instructions for performing some or all of the steps in the method as described in any one of claims 1-3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program that is executed by a processor to implement the method as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Contour point positioning method and contour point positioning device

    CN105550637A

  • Face key point detection method and device, computing device and storage medium

    CN110175558A