Face identity recognition method, device and equipment and storage medium
By projecting the face image to be verified onto the same plane as the standard face image, and using scaling and Euclidean distance for face recognition, the problem of inaccurate recognition caused by camera angle and pose deviation is solved, and the recognition efficiency of multi-pose faces is improved.
Patent Information
- Application Number
- CN202311095822.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-28
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2043-08-28
AI Technical Summary
Existing technologies may result in inaccurate facial recognition when the camera is positioned at a high angle or when the person's posture deviates significantly, leading to low accuracy in identity verification.
The face image to be verified is projected onto the same plane as the standard face image, and face identification is performed by determining the scaling ratio and Euclidean distance.
Without camera calibration and measurement of the face rotation angle during capture, the system corrects multi-pose faces, reducing the sensitivity of identity comparison to face rotation angle and improving the efficiency of facial identity recognition.
Smart Images

Figure CN117133036B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for facial recognition. Background Technology
[0002] With the widespread application of facial recognition technology in various scenarios, numerous facial comparison and identity verification algorithms have emerged. Currently, facial matching is mainly used in security checks at turnstiles. This involves installing specialized capture devices at the turnstile entrance to obtain faces and compare them with photos of individuals in a database to verify if they are the same person. However, in practical applications, when cameras are positioned at high angles or when individuals' postures deviate significantly, captured faces that are not facing directly at the camera may fail the identity verification process. This sensitivity to capture posture and angle limits the application of facial recognition in certain scenarios, resulting in low accuracy in facial identity verification. Summary of the Invention
[0003] The main objective of this invention is to provide a facial recognition method, apparatus, device, and storage medium, aiming to solve the technical problem that facial recognition results are inaccurate when the camera angle is high or the person's posture deviates significantly.
[0004] To achieve the above objectives, the present invention provides a facial recognition method, the method comprising the following steps:
[0005] The face image to be verified is projected onto the same plane as the standard face image to obtain the target face image;
[0006] Determine the scaling ratio of the target face image and the standard face image;
[0007] The Euclidean distance between the face image to be verified and the standard face image is determined based on the scaling ratio;
[0008] The facial recognition result is determined based on the Euclidean distance.
[0009] Optionally, the step of determining the Euclidean distance between the face image to be verified and the standard face image based on the scaling ratio includes:
[0010] The target coordinates of the preset face comparison feature points in the target face image are determined based on the scaling ratio and the target face image.
[0011] Determine the standard coordinates of the preset face comparison feature points in the standard face image;
[0012] The Euclidean distance between the face image to be verified and the standard face image is determined based on the standard coordinates and the target coordinates.
[0013] Optionally, the step of determining the facial recognition result based on the Euclidean distance includes:
[0014] The Euclidean distance is normalized to obtain the normalized Euclidean distance;
[0015] The target Euclidean distance is determined based on the normalized Euclidean distance.
[0016] The facial recognition result is determined based on the target Euclidean distance and the preset face comparison distance.
[0017] Optionally, the step of determining the scaling ratio of the target face image and the standard face image includes:
[0018] The rotation angle combination is determined based on the preset discretization interval angle;
[0019] The scaling ratios of the target face image and the standard face image are determined based on the rotation angle combination and the preset discrete correction algorithm.
[0020] Optionally, the step of projecting the face image to be verified onto the same plane as the standard face image to obtain the target face image includes:
[0021] Align the face image to be verified with the standard face image to obtain the aligned face image to be verified;
[0022] The aligned face image to be verified is projected and transformed to lie in the same plane as the standard face image to obtain the target face image.
[0023] Optionally, the step of aligning the face image to be verified with a standard face image to obtain an aligned face image to be verified includes:
[0024] Align the preset feature points in the face image to be verified with the preset feature points in the standard face image to obtain a face image to be verified with overlapping feature points;
[0025] The face image to be verified with overlapping feature points is rotated to obtain an aligned face image to be verified. The line connecting the target feature points in the aligned face image to be verified is parallel to the line connecting the target feature points in the standard face image.
[0026] Optionally, the step of projecting and transforming the aligned face image to be verified to lie in the same plane as the standard face image to obtain the target face image includes:
[0027] The projection transformation angle is determined based on a preset discrete correction algorithm;
[0028] The aligned face image to be verified is projected and transformed to lie in the same plane as the standard face image according to the projection transformation angle, thereby obtaining the target face image.
[0029] Furthermore, to achieve the above objectives, the present invention also provides a facial recognition device, the device comprising:
[0030] The projection module is used to project the face image to be verified onto the same plane as the standard face image to obtain the target face image;
[0031] A scaling ratio calculation module is used to determine the scaling ratio between the target face image and the standard face image;
[0032] The Euclidean distance calculation module is used to determine the Euclidean distance between the face image to be verified and the standard face image based on the scaling ratio;
[0033] The recognition module is used to determine the facial recognition result based on the Euclidean distance.
[0034] Furthermore, to achieve the above objectives, the present invention also proposes a facial recognition device, the device comprising: a memory, a processor, and a facial recognition program stored in the memory and executable on the processor, the facial recognition program being configured to implement the steps of the facial recognition method described above.
[0035] In addition, to achieve the above objectives, the present invention also proposes a storage medium storing a face recognition program, which, when executed by a processor, implements the steps of the face recognition method described above.
[0036] This invention projects a face image to be verified onto the same plane as a standard face image to obtain a target face image; determines the scaling ratio of the target face image and the standard face image; determines the Euclidean distance between the face image to be verified and the standard face image based on the scaling ratio; and determines the face recognition result based on the Euclidean distance. This invention enables the correction of multi-pose faces without camera calibration or measuring the face rotation angle during capture, reducing the sensitivity of personnel identity comparison to face rotation angle and improving face recognition efficiency. Attached Figure Description
[0037] Figure 1 This is a schematic diagram of the structure of a face recognition device in the hardware operating environment involved in the embodiments of the present invention;
[0038] Figure 2This is a flowchart illustrating the first embodiment of the facial recognition method of the present invention;
[0039] Figure 3 This is a flowchart illustrating the second embodiment of the facial recognition method of the present invention;
[0040] Figures 4-7 This is a schematic diagram of image transformation for a second embodiment of the facial recognition method of the present invention;
[0041] Figure 8 This is a flowchart illustrating the third embodiment of the facial recognition method of the present invention;
[0042] Figure 9 This is a structural block diagram of the first embodiment of the facial recognition device of the present invention.
[0043] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0044] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0045] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a face recognition device in the hardware operating environment involved in the embodiments of the present invention.
[0046] like Figure 1 As shown, the facial recognition device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0047] Those skilled in the art will understand that Figure 1The structure shown does not constitute a limitation on the facial recognition device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0048] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and a facial recognition program.
[0049] exist Figure 1 In the face recognition device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the face recognition device of the present invention can be set in the face recognition device, and the face recognition device calls the face recognition program stored in the memory 1005 through the processor 1001 and executes the face recognition method provided in the embodiment of the present invention.
[0050] Based on the aforementioned facial recognition device, this invention provides a facial recognition method, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the facial recognition method of the present invention.
[0051] In this embodiment, the facial recognition method includes the following steps:
[0052] Step S10: Project the face image to be verified onto the same plane as the standard face image to obtain the target face image.
[0053] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a mobile phone, tablet computer, or personal computer, or an electronic device or facial recognition device capable of performing the above functions. The following description uses the facial recognition device as an example to illustrate this embodiment and the subsequent embodiments.
[0054] It should be noted that the face image to be verified can be an image that requires facial identity comparison, such as a face image captured by a camera at a turnstile. This captured face image needs to be compared with multiple standard face images in a face database to identify the user corresponding to the captured face image. The standard face images can be face images from a face database that stores face images and corresponding user information.
[0055] It should be understood that there is an affine transformation relationship between the standard face in the face database and the face image to be verified. The faces in the two images are equivalent to projections of a person's face onto different camera imaging platforms. Therefore, spatial transformation can be used to correct the angle between the standard face and the face to be extracted and verified, reducing misidentification caused by the affine transformation during face matching. Therefore, projecting the face image to be verified onto the same plane as the standard face image to obtain the target face image can be a projection transformation of the face image to be verified, projecting both the face image to be verified and the standard face image onto the same plane.
[0056] Step S20: Determine the scaling ratio of the target face image and the standard face image.
[0057] It should be noted that determining the scaling ratio between the target face image and the standard face image can be done by determining the coordinates p′ of a feature point (e.g., the left corner of the eye in the target face image) in the projected face image. erβ (x′ erβ ,y′ erβ The coordinates P′ of a feature point (e.g., the left corner of the eye in the target face image) in the standard face image after inverse affine transformation (i.e., projection transformation) and affine transformation (i.e., projection transformation) are given. er (x′ ER ,y′ ER Based on the two coordinates mentioned above, the scaling factor γ is calculated using the following formula:
[0058]
[0059] Step S30: Determine the Euclidean distance between the face image to be verified and the standard face image based on the scaling ratio.
[0060] It should be noted that determining the Euclidean distance between the face image to be verified and the standard face image based on the scaling ratio can be achieved by determining the position coordinates of each feature point in the face image to be verified and the standard face image projected onto the same plane based on the scaling ratio. N feature points are selected from the face image to be verified, and the coordinates of these N feature points are determined, hereinafter referred to as the verification coordinates. N is the number of feature points selected in the face image, which can be customized as needed. The position coordinates of the corresponding feature points in the standard face image for the selected N feature points are determined, hereinafter referred to as the standard coordinates. The Euclidean distance between the feature points is calculated based on the verification coordinates and the standard coordinates, and this distance is used as the Euclidean distance between the face image to be verified and the standard face image.
[0061] Furthermore, to avoid facial recognition errors caused by excessively large capture angles, step S30 may include: determining the target coordinates of preset facial comparison feature points in the target facial image based on the scaling ratio and the target facial image;
[0062] Determine the standard coordinates of the preset face comparison feature points in the standard face image;
[0063] The Euclidean distance between the face image to be verified and the standard face image is determined based on the standard coordinates and the target coordinates.
[0064] It should be noted that the preset face comparison feature points can be at least one of the 68 pre-selected face features. Determining the target coordinates of the preset face comparison feature points in the target face image based on the scaling ratio and the target face image can be defined as determining the target coordinates of the preset face comparison feature points in the target face image. Determining the Euclidean distance between the face image to be verified and the standard face image based on the standard coordinates and the target coordinates can be defined as calculating the Euclidean distance between the standard coordinates and the target coordinates, and using the calculated Euclidean distance as the Euclidean distance between the face image to be verified and the standard face image.
[0065] In practical implementation, N feature points p are selected from the face image to be verified, where N is the number of feature points selected in the face image. The number of feature points selected can be customized as needed. Substituting into the formula p′ γ =Rp+T, find the transformed coordinates p′ γ R represents the rotation matrix, and T represents the offset matrix. R and T are determined based on the projection transformation and a preset discrete correction algorithm. Substituting the N-point features P of a standard face from the face database into the formula P′=PP el Find P′ and P. el Let (β, α) be the coordinates of the left eye corner in a standard face image. Multiple sets of R are calculated using the obtained (β, α) combinations. k T k Combine values, and then calculate different R values. k T k The corresponding p′ γk The values are then calculated using the following formula: n feature points P′ on the standard face and n feature points p′ on the target face to be verified. γ Euclidean distance between them:
[0066]
[0067] Among them, dis kThe Euclidean distance corresponding to the k-th (β, α) combined value is used, where (β, α) represents the rotation angles on the y-axis and x-axis when performing a projection transformation on the face image to be verified. R k T k The values of R and T are used to characterize the k-th rotation angle combination. p′ γk P' is used to represent the coordinates of the selected feature points in the target image corresponding to the k-th rotation angle combination. P' represents the coordinates of the feature points in the standard face image corresponding to the selected feature points, and n represents the number of selected feature points. Wherein, P'... n Coordinates are (x′) n y′ n ), p′ γn Coordinates are (x′) γn y′ γn )
[0068] Step S40: Determine the facial recognition result based on the Euclidean distance.
[0069] It should be noted that determining the facial recognition result based on the Euclidean distance can be used to determine different R... k T k The average of multiple Euclidean distances corresponding to different feature points is calculated and compared with a preset Euclidean distance. If the average is greater than the preset Euclidean distance, the face recognition result is determined to be a mismatch, and the next standard face image in the face database is selected for recognition until a standard image matching the face image to be verified is identified or all standard face images in the face database have been traversed. If the average is less than or equal to the preset Euclidean distance, the face recognition result is determined to be a match. The preset Euclidean distance can be a pre-set Euclidean distance threshold used to determine whether the face image to be verified matches the standard face image.
[0070] This embodiment projects the image of the face to be verified onto the same plane as a standard face image to obtain a target face image; determines the scaling ratio of the target face image and the standard face image; determines the Euclidean distance between the image of the face to be verified and the standard face image based on the scaling ratio; and determines the face recognition result based on the Euclidean distance. This embodiment can correct multi-pose faces without camera calibration or measuring the face rotation angle during capture, reducing the sensitivity of personnel identity comparison to face rotation angle and improving face recognition efficiency.
[0071] refer to Figure 3 , Figure 3 This is a flowchart illustrating the second embodiment of the facial recognition method of the present invention.
[0072] Based on the first embodiment described above, in this embodiment, step S10 includes:
[0073] Step S101: Align the face image to be verified with the standard face image to obtain the aligned face image to be verified.
[0074] It should be noted that aligning the face image to be verified with the standard face image to obtain the aligned face image to be verified can be achieved by selecting two feature points in the face image to be verified, and making the line connecting these two feature points parallel to the line connecting the corresponding two feature points in the standard face image.
[0075] Furthermore, in order to improve the accuracy of facial recognition, step S101 may include: aligning preset feature points in the face image to be verified with preset feature points in a standard face image to obtain a face image to be verified with overlapping feature points.
[0076] The face image to be verified with overlapping feature points is rotated to obtain an aligned face image to be verified. The line connecting the target feature points in the aligned face image to be verified is parallel to the line connecting the target feature points in the standard face image.
[0077] It should be noted that aligning the preset feature points in the face image to be verified with the preset feature points in the standard face image to obtain a face image to be verified with overlapping feature points can be achieved by selecting preset feature points in the face image to be verified, aligning the selected preset feature points with the corresponding feature points in the standard face image, and then obtaining the aligned face image to be verified. The preset feature points can be corner feature points, specifically the left corner feature point.
[0078] Specifically, this could involve first extracting 68 features from a standard face in a face database, then taking the coordinates of the two inner corners of the eyes in the standard face image, with the left eye P... el (x EL ,y EL ), right eye P er (x ER ,y ER Extract the coordinates of the two inner corners of the face image to be verified, left eye p. el (x el ,y el ), right eye p er (x er ,y er ). p el With P el Alignment. Obtain the aligned face image to be verified.
[0079] In specific implementation, p el With P elAfter alignment, the coordinates of the feature point p at the left corner of the eye in the face image to be verified become p′.
[0080]
[0081]
[0082]
[0083] Where, p t (x t y t T1(t) is used to characterize the coordinates of feature point p in the face image to be verified after aligning the left corner of the face image to the left corner of the standard face image. 1x ,t 1y The coordinates of feature point p in the face image to be verified are used to represent the offset coordinates of the feature point p in the face image to be verified after the left corner of the face image to be verified is aligned with the left corner of the standard face image. p(x,y) represents the coordinates of feature point p in the face image to be verified before alignment, and t represents the number of feature points.
[0084] The step of rotating the face image to be verified, where the feature points coincide, to obtain the aligned face image to be verified can be achieved by rotating the face image to be verified counterclockwise by an angle θ around p′ to a straight line p. el p er With line P el P er After overlapping and rotation, the coordinates of the left eye corner on the face image to be verified become p. θ :
[0085]
[0086]
[0087] By the Law of Cosines, we can obtain:
[0088]
[0089]
[0090] Step S102: Project and transform the aligned face image to be verified to be in the same plane as the standard face image to obtain the target face image.
[0091] It should be noted that there is an affine transformation relationship between the standard face image in the face database and the face image to be verified. The faces in the two images are equivalent to projections of the human face onto different camera imaging platforms. Therefore, spatial transformation can be used to correct the angle between the standard face and the face to be extracted and verified, reducing misidentification caused by affine transformation during face matching. A three-dimensional coordinate system is established with the left eye corner coordinates in the two images as the origin. An x-axis is established along the line connecting the two eye corner coordinates of the standard face in the face database. A y-axis is established perpendicular to the x-axis in the plane of the image, and the z-axis is perpendicular to the plane of the image. In the above steps, the left eye corner coordinates in the two images have been aligned, and the line connecting the two eye corners has been rotated to be parallel. Therefore, the line connecting the left and right eye corners of the face image to be verified lies in the xoz plane. The face to be verified can be corrected through two rotation transformations to make the face to be verified parallel to the standard face image. Specifically, this can be done by first rotating the standard face image in the face database with P... el (x EL ,y EL Using the origin as the coordinate point, the coordinates of any point on the standard face image in the face database become P′, p θ p el With P el After alignment, with the origin as the coordinate point, the coordinates of any point on the face image to be verified become p′. θ :
[0092]
[0093]
[0094] The face image to be verified is obtained by projecting a standard face through photographic transformation. The photographic transformation between the standard face and the face to be verified can be decomposed, as shown in the following figure. Figures 4-7 , Figures 4-7 This is a schematic diagram of image transformation for a second embodiment of the facial recognition method of the present invention; the face image to be verified is on plane l (the coordinates of any point on this plane are marked as p′). θ For reference Figure 4 First, project the plane onto a plane l′ that is rotated counterclockwise by an angle α along the y-axis (the coordinates of any point on this plane are p′). α For reference Figure 5 Project plane l′ onto plane l″, which is the result of rotating l′ counterclockwise by an angle β along the x-axis. l″ lies in the same plane as the standard human face, and the coordinates of any point on this plane are p′. β For reference Figure 6 , Figure 7 The following is a schematic diagram of a standard human face image in plane l″, and the final coordinate representation is shown below:
[0095]
[0096]
[0097]
[0098] At this point, l″ and the standard face image have a scaling ratio γ, and after the inverse affine transformation, p′ erθ (x′ erθ ,y′ erθ The coordinates become p′ erβ (x′ erβ ,y′ erβ Standard face with P el (x EL ,y EL The coordinates of the right eye corner of the image are transformed using P' as the origin. er (x′ ER ,y′ ER ):
[0099]
[0100] After scaling and restoration, the final converted coordinates of the face to be verified are p′. γ :
[0101] p′ γ =γp′ β =γR αβ p′ θ =γR αβ R θt p t +γR αβ R θe p el +γR αβ R θT T1-γR αβ P el
[0102] =γR αβ R θt (p+T1)+γR αβ R θe p el +γR αβ R θT T1-γR αβ P el
[0103] γR αβ R θt p+(γR αβ R θt T1+γR αβ R θe p el+γR αβ R θT T1-γR αβ P el )
[0104] =Rp+T
[0105] Where R = γR αβ R θt T = γR αβ R θt T1+γR αβ R θe p el +γR αβ R θT T1-γR αβ P el R is the rotation matrix, and T is the offset matrix.
[0106] Furthermore, in the actual face comparison process, if the angle between the face and the camera imaging platform exceeds 45 degrees, there will be partial facial occlusion and face matching will not be possible. Therefore, step S102 may also include: determining the projection transformation angle based on a preset discrete correction algorithm.
[0107] The aligned face image to be verified is projected and transformed to lie in the same plane as the standard face image according to the projection transformation angle, thereby obtaining the target face image.
[0108] It should be noted that the determination of the projection transformation angle based on the preset discrete correction algorithm can be achieved by discretizing the angles in the x-axis and y-axis directions according to a preset discretization interval angle d, resulting in multiple combinations of (β, α). For example, it can be assumed that the angle between the face and the camera imaging plane in the x-axis direction and the y-axis direction is between -45° and +45°, respectively. Discretization is performed according to the preset discretization interval angle d. Here, d = 3° is used as an example. d can be customized according to the actual usage scenario. 31 angle values are discretized in the x-axis and y-axis directions respectively, resulting in a total of 961 combinations of (β, α). The following are some of the combinations of (β, α):
[0109]
[0110]
[0111] In practice, it is necessary to iterate through the above combinations to determine the rotation angle combination that allows the face image to be verified and the standard face image to lie in the same plane. That is, the projection transformation angle.
[0112] The aligned face image to be verified is projected and transformed to be in the same plane as the standard face image according to the projection transformation angle. The target face image can be obtained by rotating the face image to be verified in the x and y directions according to β and α in the projection transformation angle to obtain the target face image in the same plane as the standard face image.
[0113] In this embodiment, the initial alignment of the image is completed by two pairs of inner corners of the eyes, eliminating the rotation angle along the z-axis in the spatial pose. This means that only the angle rotation along the x-axis and y-axis is needed in space to correct the pose, reducing the amount of calculation required for subsequent correction and simplifying the correction equation.
[0114] In practice, after determining the combination of rotation angles that allows the face image to be verified and the standard face image to lie in the same plane, the face image to be verified can be rotated to lie in the same plane as the standard face image. At this point, the N-point features p of the face on the face image to be verified are substituted into the formula p′. γ =Rp+T, find the transformed coordinates p′ γ Substitute the N-point features P of a standard face from the face database into the formula P′=PP el Find P′. Use the combination of (β, α) to find multiple sets of R. k T k Combine values, and then calculate different R values. k T k The corresponding p′ γk The value is then calculated. Then, n feature points P′ on the standard face and n feature points p′ on the target face to be verified are calculated. γ Euclidean distance between them:
[0115]
[0116] Then, the Euclidean distance is normalized, and the left eye P... el (x EL ,y EL ), right eye P er (x ER ,y ER ), normalized parameters dis' k =λ·dis k The multiple sets of p′ corresponding to (β, α) are obtained. γk Substitute into the above formula to find the corresponding dis′ k The minimum value Dmin is obtained by using the following formula: Dmin=min(dis′1,…,dis′) k Finally, Dmin is used as the Euclidean distance value to determine whether two photos depict the same person.
[0117] This embodiment aligns the face image to be verified with a standard face image to obtain an aligned face image to be verified. The aligned face image to be verified is then projected and transformed to lie on the same plane as the standard face image, resulting in the target face image. This embodiment improves the accuracy of face identity comparison by aligning and projecting the face image to be verified, ensuring that the face image to be verified and the standard image are on the same plane. This significantly reduces the sensitivity of identity comparison to facial pose angles and also reduces the computational cost. It solves the problem of high false recognition rates caused by facial pose in current face identity verification algorithms based on facial features.
[0118] refer to Figure 8 , Figure 8 This is a flowchart illustrating the third embodiment of the facial recognition method of the present invention.
[0119] Based on the above embodiments, in this embodiment, step S40 includes:
[0120] Step S401: Normalize the Euclidean distance to obtain the normalized Euclidean distance.
[0121] It should be noted that the normalization of the Euclidean distance can be performed based on the left-eye coordinate P in the standard image. el (x EL ,y EL ) and right eye coordinate P er (x ER ,y ER The normalization parameter λ is calculated using the following formula:
[0122]
[0123] Then, the Euclidean distance is normalized using the following formula:
[0124] dis' k =λ·dis k
[0125] Among them, dis' k For Euclidean distance dis k Normalized Euclidean distance.
[0126] Step S402: Determine the target Euclidean distance based on the normalized Euclidean distance.
[0127] It should be noted that determining the target Euclidean distance based on the normalized Euclidean distance can be achieved by selecting the minimum value among the normalized Euclidean distances as the target Euclidean distance. The target Euclidean distance Dmin = min(dis′1,…,dis′) k ).
[0128] Step S403: Determine the facial recognition result based on the target Euclidean distance and the preset face comparison distance.
[0129] It should be noted that the preset face comparison distance can be a pre-set Euclidean distance threshold used to determine whether the face image to be verified matches a standard face image. Determining the face recognition result based on the target Euclidean distance and the preset face comparison distance can involve comparing the target Euclidean distance with the preset face comparison distance. If the target Euclidean distance is greater than the preset face comparison distance, the face recognition result is determined to be a mismatch, and the next standard face image in the face database is selected for recognition until a standard image matching the face image to be verified is identified, or all standard face images in the face database have been traversed. If the target Euclidean distance is less than or equal to the preset face comparison distance, the face recognition result is determined to be a match.
[0130] In practice, the two photos to be verified are first aligned using the inner corner coordinates of the eyes. θ =R θt p t +R θe p el +R θT T1; then through the derived affine transformation equation p′ γ =Rp+T, where R=γR αβ R θt T = γR αβ R θt T1+γR αβ R θe p el +γR αβ R θT T1-γR αβ P el The imaging plane is discretized at intervals d within the range of -45° to +45° along the x-axis and y-axis, resulting in a set of discretized correction equations. Finally, the coordinates of the image to be verified are corrected using these equations, and the value with the shortest Euclidean distance to the original image is selected: Dmin = min(dis1′,…,dis′). k ) is used as the threshold for identity comparison, where
[0131] This embodiment normalizes the Euclidean distance to obtain a normalized Euclidean distance; a target Euclidean distance is determined based on the normalized Euclidean distance; and the facial recognition result is determined based on the target Euclidean distance and a preset face comparison distance. To improve the accuracy of facial identity comparison, a discretized correction equation system is derived by combining the coordinates of two pairs of corresponding points at the inner corners of the eyes of the standard image in the known identity face database and the image of the face to be verified with discrete rotation angles along the x and y axes. The image of the face to be verified is input into the discretized correction equation system, and the minimum corrected Euclidean distance is calculated as the judgment value for identity comparison. This significantly reduces the sensitivity of identity comparison to facial pose angles and also reduces the computational cost. This solves the problem of high false recognition rates caused by facial pose in current facial identity verification algorithms based on facial features.
[0132] Using this embodiment and the above embodiments, we can: 1. Correct the angle of images using the formulas and methods derived in this paper, reducing errors in identity matching caused by excessively large capture angles; 2. Simplify the correction equation and improve calculation speed by aligning the inner corners of the eyes in two photos; 3. Solve the problem of quantitatively calculating the deflection angle by discretizing the deflection angle and combining it with the minimum Euclidean distance, thereby correcting multi-pose faces without camera calibration or measuring the deflection angle of captured faces, reducing the sensitivity of personnel identity comparison to the face deflection angle.
[0133] Reference Figure 9 , Figure 9 This is a structural block diagram of the first embodiment of the facial recognition device of the present invention.
[0134] like Figure 9 As shown, the facial recognition device proposed in this embodiment of the invention includes:
[0135] Projection module 10 is used to project the face image to be verified onto the same plane as the standard face image to obtain the target face image;
[0136] The scaling ratio calculation module 20 is used to determine the scaling ratio between the target face image and the standard face image;
[0137] Euclidean distance calculation module 30 is used to determine the Euclidean distance between the face image to be verified and the standard face image according to the scaling ratio;
[0138] The recognition module 40 is used to determine the face recognition result based on the Euclidean distance.
[0139] This embodiment projects the image of the face to be verified onto the same plane as a standard face image to obtain a target face image; determines the scaling ratio of the target face image and the standard face image; determines the Euclidean distance between the image of the face to be verified and the standard face image based on the scaling ratio; and determines the face recognition result based on the Euclidean distance. This embodiment can correct multi-pose faces without camera calibration or measuring the face rotation angle during capture, reducing the sensitivity of personnel identity comparison to face rotation angle and improving face recognition efficiency.
[0140] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.
[0141] In addition, for technical details not described in detail in this embodiment, please refer to the face recognition method provided in any embodiment of the present invention, which will not be repeated here.
[0142] Based on the first embodiment of the facial recognition device of the present invention described above, a second embodiment of the facial recognition device of the present invention is proposed.
[0143] In this embodiment, the Euclidean distance calculation module 30 is further configured to determine the target coordinates of preset face comparison feature points in the target face image based on the scaling ratio and the target face image;
[0144] Determine the standard coordinates of the preset face comparison feature points in the standard face image;
[0145] The Euclidean distance between the face image to be verified and the standard face image is determined based on the standard coordinates and the target coordinates.
[0146] Furthermore, the identification module 40 is also used to normalize the Euclidean distance to obtain a normalized Euclidean distance.
[0147] The target Euclidean distance is determined based on the normalized Euclidean distance.
[0148] The facial recognition result is determined based on the target Euclidean distance and the preset face comparison distance.
[0149] Furthermore, the scaling ratio calculation module 20 is also used to determine the rotation angle combination based on the preset discretization interval angle;
[0150] The scaling ratios of the target face image and the standard face image are determined based on the rotation angle combination and the preset discrete correction algorithm.
[0151] Furthermore, the projection module 10 is also used to align the face image to be verified with a standard face image to obtain an aligned face image to be verified.
[0152] The aligned face image to be verified is projected and transformed to lie in the same plane as the standard face image to obtain the target face image.
[0153] Furthermore, the projection module 10 is also used to align the preset feature points in the face image to be verified with the preset feature points in the standard face image to obtain a face image to be verified with overlapping feature points.
[0154] The face image to be verified with overlapping feature points is rotated to obtain an aligned face image to be verified. The line connecting the target feature points in the aligned face image to be verified is parallel to the line connecting the target feature points in the standard face image.
[0155] Furthermore, the projection module 10 is also used to determine the projection transformation angle based on a preset discrete correction algorithm;
[0156] The aligned face image to be verified is projected and transformed to lie in the same plane as the standard face image according to the projection transformation angle, thereby obtaining the target face image.
[0157] Other embodiments or specific implementations of the facial recognition device of the present invention can be referred to the above-described method embodiments, and will not be repeated here.
[0158] Furthermore, this embodiment of the invention also proposes a storage medium storing a face recognition program, which, when executed by a processor, implements the steps of the face recognition method described above.
[0159] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0160] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0161] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0162] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A facial recognition method, characterized in that, The facial recognition method includes the following steps: The face image to be verified is projected onto the same plane as the standard face image to obtain the target face image; Determine the scaling ratio of the target face image and the standard face image; The Euclidean distance between the face image to be verified and the standard face image is determined based on the scaling ratio; The facial recognition result is determined based on the Euclidean distance. Determining the scaling ratio of the target face image and the standard face image includes: The rotation angle combination is determined based on the preset discretization interval angle; The scaling ratio of the target face image and the standard face image is determined according to the rotation angle combination and the preset discrete correction algorithm. The preset discrete correction algorithm is used to discretize the angle between the face and the camera imaging plane in the x-axis and y-axis directions according to the preset discretization interval angle. The step of projecting the face image to be verified onto the same plane as the standard face image to obtain the target face image includes: Align the preset feature points in the face image to be verified with the preset feature points in the standard face image to obtain a face image to be verified with overlapping feature points; The face image to be verified with overlapping feature points is rotated to obtain an aligned face image to be verified. The line connecting the target feature points in the aligned face image to be verified is parallel to the line connecting the target feature points in the standard face image. The projection transformation angle is determined based on a preset discrete correction algorithm; The aligned face image to be verified is projected and transformed to lie in the same plane as the standard face image according to the projection transformation angle, thereby obtaining the target face image.
2. The facial recognition method as described in claim 1, characterized in that, The step of determining the Euclidean distance between the face image to be verified and the standard face image based on the scaling ratio includes: The target coordinates of the preset face comparison feature points in the target face image are determined based on the scaling ratio and the target face image. Determine the standard coordinates of the preset face comparison feature points in the standard face image; The Euclidean distance between the face image to be verified and the standard face image is determined based on the standard coordinates and the target coordinates.
3. The facial recognition method as described in claim 1, characterized in that, The step of determining the facial recognition result based on the Euclidean distance includes: The Euclidean distance is normalized to obtain the normalized Euclidean distance; The target Euclidean distance is determined based on the normalized Euclidean distance. The facial recognition result is determined based on the target Euclidean distance and the preset face comparison distance.
4. A facial recognition device, characterized in that, The facial recognition device includes: The projection module is used to project the face image to be verified onto the same plane as the standard face image to obtain the target face image; A scaling ratio calculation module is used to determine the scaling ratio between the target face image and the standard face image; The Euclidean distance calculation module is used to determine the Euclidean distance between the face image to be verified and the standard face image based on the scaling ratio; The recognition module is used to determine the facial recognition result based on the Euclidean distance; Determining the scaling ratio of the target face image and the standard face image includes: The rotation angle combination is determined based on the preset discretization interval angle; The scaling ratio of the target face image and the standard face image is determined according to the rotation angle combination and the preset discrete correction algorithm. The preset discrete correction algorithm is used to discretize the angle between the face and the camera imaging plane in the x-axis and y-axis directions according to the preset discretization interval angle. The step of projecting the face image to be verified onto the same plane as the standard face image to obtain the target face image includes: Align the preset feature points in the face image to be verified with the preset feature points in the standard face image to obtain a face image to be verified with overlapping feature points; The face image to be verified with overlapping feature points is rotated to obtain an aligned face image to be verified. The line connecting the target feature points in the aligned face image to be verified is parallel to the line connecting the target feature points in the standard face image. The projection transformation angle is determined based on a preset discrete correction algorithm; The aligned face image to be verified is projected and transformed to lie in the same plane as the standard face image according to the projection transformation angle, thereby obtaining the target face image.
5. A facial recognition device, characterized in that, The device includes: a memory, a processor, and a face recognition program stored in the memory and executable on the processor, the face recognition program being configured to implement the steps of the face recognition method as described in any one of claims 1 to 3.
6. A storage medium, characterized in that, The storage medium stores a facial recognition program, which, when executed by a processor, implements the steps of the facial recognition method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Image cross reconstruction-based single-sample registered image face recognition method
CN101739546A
Face key point alignment algorithm based on deep learning
CN105678248A