Face recognition method and related apparatus
By acquiring the image of the face to be identified and the actual angle information, the feature sample set is divided into sub-feature sample sets with different reference angles, and the sub-feature sample sets are prioritized for comparison according to the actual angle information. This solves the problem of low accuracy and efficiency of side face recognition in the existing technology and achieves more efficient and accurate face recognition.
Patent Information
- Application Number
- CN202111146558.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-28
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2041-09-28
AI Technical Summary
Existing facial recognition technology has low accuracy and efficiency when recognizing profiles, and suffers from a high false alarm rate.
By acquiring the image of the face to be identified and the actual angle information, the feature sample set is divided into sub-feature sample sets with different reference angles. The sub-feature sample sets are then assigned priorities based on the actual angle information and compared in descending order to determine the identity information.
It improves the accuracy and efficiency of facial recognition by prioritizing the identification of more likely sub-feature sample sets, thereby reducing the false alarm rate.
Smart Images

Figure CN114022924B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of intelligent application, in particular to a face recognition method and related device. BACKGROUND
[0002] Face recognition is a technology of identity recognition based on face feature information. However, in the existing technical solution, identity recognition is mostly based on front face, but in actual recognition scene, there are many side faces, so the existing face recognition technology has certain limitations, such as slow recognition speed, many false positives, low accuracy, and the like, so a technical solution is needed to solve the above problems. SUMMARY
[0003] The technical problem solved by the present application is to provide a face recognition method and related device, which can improve the accuracy and efficiency of face recognition.
[0004] To solve the above technical problem, one technical solution adopted by the present application is to provide a face recognition method, which comprises:
[0005] acquiring an image including a face to be recognized and determining actual angle information of the face to be recognized;
[0006] acquiring a feature sample set, wherein the feature sample set includes a plurality of sub-feature sample sets corresponding to different reference angle information;
[0007] setting different priorities for the plurality of sub-feature sample sets according to the actual angle information and the reference angle information;
[0008] comparing the face to be recognized with feature samples in the plurality of sub-feature sample sets in order from high to low priority to obtain a comparison result;
[0009] determining identity information of the face to be recognized according to the comparison result.
[0010] To solve the above technical problem, another technical solution adopted by the present application is to provide a face recognition device, which comprises:
[0011] an image acquisition module for acquiring an image including a face to be recognized and determining actual angle information of the face to be recognized;
[0012] a feature sample set acquisition module for acquiring a feature sample set, wherein the feature sample set includes a plurality of sub-feature sample sets corresponding to different reference angle information;
[0013] The priority setting module is used to set different priorities for multiple sub-feature sample sets based on the actual angle information and the reference angle information;
[0014] The identity recognition module is used to compare the face to be recognized with the feature samples in the multiple sub-feature sample sets in descending order of priority to obtain the comparison result, and determine the identity information of the face to be recognized based on the comparison result.
[0015] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide an electronic device, the electronic device including a processor and a memory coupled to the processor;
[0016] in,
[0017] The memory is used to store computer programs;
[0018] The processor is used to run the computer program to perform the method described above.
[0019] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium that stores a computer program that can be executed by a processor, the computer program being used to implement the method described above.
[0020] The beneficial effects of this application are as follows: Unlike existing technologies, the technical solution provided in this application acquires an image including the face to be identified, determines the actual angle information of the face to be identified, obtains a feature sample set, which includes multiple sub-feature sample sets corresponding to different reference angle information, and then assigns different priorities to the multiple sub-feature sample sets based on the actual angle information and the reference angle information. The face to be identified is then compared sequentially with the feature samples in the multiple sub-feature sample sets according to the order of priority from high to low to obtain the comparison results. The identity information of the face to be identified is then determined based on the comparison results. In the technical solution provided in this application, different priorities are assigned to the multiple sub-feature sample sets based on the actual angle information of the face to be identified, and the face to be identified is compared sequentially with the feature samples in different sub-feature sample sets according to the order of priority from high to low. This prioritizes the comparison of feature samples in the sub-feature sample sets that are more likely to identify the face's identity information, thereby improving the efficiency and accuracy of face recognition and achieving good technical results. Attached Figure Description
[0021] Figure 1 This is a flowchart illustrating one embodiment of a face recognition method according to this application;
[0022] Figure 2This is a flowchart illustrating another embodiment of a face recognition method according to this application;
[0023] Figure 3 This is a flowchart illustrating another embodiment of a face recognition method according to this application;
[0024] Figure 4 This is a flowchart illustrating another embodiment of a face recognition method according to this application;
[0025] Figure 5 This is a schematic diagram of the structure of a face recognition device according to one embodiment of this application;
[0026] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application;
[0027] Figure 7 This is a schematic diagram of an embodiment of a computer-readable storage medium according to this application. Detailed Implementation
[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It is understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0029] In the description of this application, "a plurality of" means at least two, such as two, three, etc., unless otherwise expressly and specifically defined. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.
[0030] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0031] Please see Figure 1 , Figure 1 This is a flowchart illustrating one embodiment of a face recognition method according to this application. In the current embodiment, the method provided by this application includes steps S110 to S150.
[0032] S110: Acquire an image including the face to be identified and determine the actual angle information of the face to be identified.
[0033] Electronic devices used for facial recognition acquire images including the face to be identified and further determine the actual angle information of the face. The face to be identified is the face whose identity information needs to be determined. The actual angle information of the face to be identified is the angle between the field of view of the imaging device and the frontal view of the face when the face is captured.
[0034] In one embodiment, the angle information may include the shooting angle and the face orientation. The shooting angle includes an angle value and a shooting direction. Specifically, the angle value can be understood as the angle between a center line passing through the center of the shooting field of view and perpendicular to the plane containing the shooting field of view, and a center line passing through the center of the face and perpendicular to the plane containing the frontal view of the face. The angle value ranges from 0° to 90°. The shooting direction is the direction of the center line passing through the center of the shooting field of view and perpendicular to the plane containing the shooting field of view relative to a reference plane. The reference plane is the plane containing the center line passing through the center of the face and perpendicular to the plane containing the frontal view of the face. Specifically, different shooting directions can be marked with positive and negative signs. For example, in one embodiment, shooting angles with a shooting direction to the left (i.e., to the left of the reference plane) are recorded as 0° to 90°; shooting angles with a shooting direction to the right (i.e., to the right of the reference plane) are recorded as 0° to -90°.
[0035] Here, "frontal view" refers to a face image taken when the center line of the shooting field of view coincides with the center line of the face. The center line of the shooting field of view is a line that passes through the center of the shooting field of view and is perpendicular to the shooting field of view. The center line of the face is a line that passes through the center of the face and is perpendicular to the plane on which the face is located.
[0036] In another embodiment, the angle information can also be understood as a decomposition of the first plane angle and the second plane angle on the first plane and the second plane. The first plane is perpendicular to the second plane, the first plane angle is the angle between the center line of the shooting field of view, which is perpendicular to the plane containing the shooting field of view, and the first plane; the second plane angle is the angle between the center line of the shooting field of view, which is perpendicular to the plane containing the shooting field of view, and the second plane. Furthermore, the first plane can be a horizontal plane, and correspondingly, the second plane can be a vertical plane.
[0037] Specifically, a single image may include multiple faces to be identified. Since the angle of each face relative to the camera device is uncertain, when multiple faces are included in the same image, the actual angle information of each face will be determined separately. If the same image includes n faces, the actual angle information corresponding to each of the n faces will be determined separately when performing the above step S110.
[0038] Furthermore, in one embodiment, the angle information may include: shooting angle, shooting height, shooting direction, and shooting distance. Here, the shooting height is the height of the shooting device from the face to be identified, the shooting direction is the direction of the shooting device relative to the frontal view of the face to be identified, and the shooting distance is the distance between the shooting device and the face to be identified.
[0039] Furthermore, in another embodiment, when the first plane is a horizontal plane and the second plane is a vertical plane, the corresponding angles of the first plane are horizontal and the angles of the second plane are vertical. The horizontal angles can be classified according to the shooting direction according to a preset rule. The specific classifications can include: front shooting angle, left shooting angle and right shooting angle. Correspondingly, the vertical angles can be classified according to the shooting direction as: front shooting angle, top shooting angle and bottom shooting angle.
[0040] S120: Obtain the feature sample set.
[0041] Electronic devices used for facial recognition also acquire a set of feature samples.
[0042] Understandably, in other embodiments, the feature sample set may be acquired by other devices and fed back to the electronic device for face recognition, or fed back to a device accessible to the electronic device for face recognition.
[0043] The feature sample set contains a large number of feature samples used to identify and obtain the identity information of the face to be identified. In the technical solution provided in this application, each feature sample in the feature sample set will be divided into multiple different sub-feature sample sets according to the angle information.
[0044] Specifically, in one embodiment, the sub-feature samples in the feature sample set can be divided according to the shooting angle. Each sub-feature sample set will include feature samples corresponding to different faces taken at the same shooting angle, and each sample in the feature sample set is associated with and stored with its corresponding identity information. In another embodiment, the feature samples in the feature sample set can be divided according to the angular value range in the shooting angle. For example, combining the shooting direction, the feature samples in the feature sample set can be divided into different sub-feature sample sets with a division interval of 5°. For example, the left side (0°, 5°) is divided into one sub-feature sample set, the left side (5°, 10°) into another sub-feature sample set, the left side (10°, 15°) into another sub-feature sample set, and so on. Similarly, the right side (0°, -5°) is divided into one sub-feature sample set, the right side (-5°, -10°) into another sub-feature sample set, the right side (-10°, -15°) into another sub-feature sample set, and so on. The "-" indicates the shooting direction is to the right, used to distinguish it from the shooting angle on the left.
[0045] It should be noted that different sub-feature sample sets can include feature samples of the same face under different shooting angles. For example, for face A, when constructing the feature sample set, features of face A will be collected from different shooting angles and stored as feature samples in the feature sample set. Furthermore, the collected features of face A will be stored in sub-feature sample sets for different shooting angles according to the shooting angle. Additionally, steps S110 and S120 can be executed simultaneously, or step S110 can be executed first and then step S120, depending on the actual settings.
[0046] In another embodiment, when there is only one feature sample set and the feature sample set is fixed, step S120 does not need to be executed when performing the face recognition method. After executing step S110, step S130 can be executed directly.
[0047] Even when there is only one feature sample set, the feature samples included in the feature sample set will still be divided based on the shooting angle to obtain multiple sub-feature sample sets. Therefore, it can also be understood that the feature sample set includes multiple sub-feature sample sets corresponding to different reference angle information, and each sub-feature sample set includes feature samples corresponding to different faces taken under the same reference angle information.
[0048] S130: Based on the actual angle information and the reference angle information, set different priorities for multiple sub-feature sample sets.
[0049] After determining the actual angle information of the face to be identified, different priorities are set for multiple sub-feature sample sets based on the actual angle information and the reference angle information.
[0050] The set priorities are used to define the comparison order between different sub-feature sample sets and the face to be identified. For example, based on the actual angle information, the priority order of the sub-feature sample sets with shooting angle 'a', 'b', and 'c' is set from high to low as follows: sub-feature sample set with shooting angle 'b', sub-feature sample set with shooting angle 'c', and sub-feature sample set with shooting angle 'a'. When comparing the face to be identified with the feature samples in multiple sub-feature sample sets to obtain the comparison result, the face to be identified will first be compared with each sample included in the sub-feature sample set with shooting angle 'b' in order of high to low priority, then compared with each sample included in the sub-feature sample set with shooting angle 'c', and then compared with each sample included in the sub-feature sample set with shooting angle 'a', thus obtaining the comparison result.
[0051] It should be noted that if multiple faces to be identified are obtained in the same image, different priorities will be set for each sub-feature sample set based on the actual angle information of each face to be identified and the reference angle information of each sub-feature sample set. Then, the priority setting results corresponding to each face to be identified will be obtained. In step S140 below, each face to be identified will be compared with each sub-feature sample set according to the priority setting results corresponding to each face to be identified and in order of priority from high to low.
[0052] For example, if faces A and B to be identified are obtained in an image, and the actual angle information corresponding to faces A and B is different, then when executing step S130, the priority of multiple sub-feature sample sets used for comparison with face A will be set according to the actual angle information of face A and the reference angle information of each sub-feature sample set in the feature sample set, thereby limiting the comparison order of multiple sub-feature sample sets with face A; at the same time, the priority of multiple sub-feature sample sets used for comparison with face B will also be set according to the actual angle information of face B and the reference angle information of each sub-feature sample set in the feature sample set, thereby limiting the comparison order of multiple sub-feature sample sets with face B.
[0053] S140: According to the priority from high to low, the face to be identified is compared with the feature samples in multiple sub-feature sample sets to obtain the comparison results.
[0054] After assigning different priorities to multiple sub-feature sample sets according to actual angle information and reference angle information, the face to be identified is further compared with the feature samples in the multiple sub-feature sample sets in descending order of priority to obtain the comparison results.
[0055] Furthermore, if multiple faces are detected in the same image, each face will be compared with each feature sample in each sub-feature sample set according to the priority of its corresponding sub-feature sample set from high to low, thereby obtaining the comparison result.
[0056] Further, in one embodiment, the above step of comparing the face to be identified with feature samples in multiple sub-feature sample sets to obtain a comparison result further includes: sequentially calculating the similarity between the face to be identified and each feature sample in the multiple sub-feature sample sets, and outputting the similarity as a comparison result. Even further, the similarity between the face to be identified and each feature sample can be determined by calculating the Euclidean distance and / or cosine similarity separately. It is understood that in other embodiments, the similarity between the face to be identified and each feature sample can also be determined using other parameters. Similarity calculation is not the focus of this case, and therefore will not be elaborated upon here.
[0057] S150: Determine the identity information of the face to be identified based on the comparison results.
[0058] When comparing the face to be identified with feature samples from multiple sub-feature sample sets to obtain the comparison results, the identity information of the face to be identified will be further determined based on the comparison results.
[0059] Furthermore, step S150 further includes: outputting the identity information of the feature sample with the highest similarity as the identity information of the face to be identified. After sequentially calculating the similarity between the face to be identified and each feature sample in the multiple sub-feature sample sets, the identity information of the feature sample with the highest similarity to the face to be identified is further output as the identity information of the face to be identified.
[0060] Furthermore, in another embodiment, a similarity threshold is preset to determine the identity information of the face to be identified. Then, step S150 further includes: outputting the identity information of the feature sample with a similarity greater than or equal to the similarity threshold as the identity information of the face to be identified. Here, the similarity threshold is a preset empirical value used to determine whether the face to be identified matches the feature sample.
[0061] Furthermore, in another embodiment, step S150 further includes: determining whether the similarity of the obtained current feature sample is greater than or equal to a similarity threshold; if so, outputting the identity information of the feature sample with a similarity greater than or equal to the similarity threshold as the identity information of the face to be identified, and ending the recognition loop for the current face to be identified. Conversely, if it is determined that the similarity between the current feature sample and the face to be identified is less than the similarity threshold, then continue to calculate the similarity between the next feature sample and the face to be identified, and again cyclically determine whether the currently obtained similarity is greater than or equal to the similarity threshold. If it is determined that the similarity between all feature samples in the current sub-feature sample set and the face to be identified is less than the similarity threshold, then the process can be repeated to traverse each sample in the next priority sub-feature sample set.
[0062] Furthermore, if after traversing all samples in all sub-feature sample sets of the feature sample set, and after determining that the similarity between all feature samples and the face to be identified is less than the similarity threshold, then the identity information of the feature sample corresponding to the maximum similarity will be output as the identity information of the face to be identified.
[0063] Furthermore, in another embodiment, after traversing all samples in all sub-feature sample sets of the feature sample set, and determining that the similarity between a certain feature sample and the face to be identified is greater than the similarity threshold, the similarity between the next feature sample and the face to be identified will continue to be calculated until all feature samples in the feature sample set are traversed. Then, the identity information of the feature sample with the highest similarity value among all feature samples with similarity greater than the similarity threshold will be output as the identity information of the face to be identified.
[0064] The technical solution provided in this application acquires an image including a face to be identified, determines the actual angle information of the face to be identified, and obtains a feature sample set. The feature sample set includes multiple sub-feature sample sets corresponding to different reference angle information. Each sub-feature sample set includes feature samples corresponding to different faces taken under the same reference angle information. Then, different priorities are set for the multiple sub-feature sample sets according to the actual angle information and the reference angle information. The face to be identified is compared with the feature samples in the multiple sub-feature sample sets in descending order of priority to obtain the comparison result. The identity information of the face to be identified is then determined based on the comparison result. In the technical solution provided in this application, different priorities are set for multiple sub-feature sample sets according to the actual angle information of the face to be identified, and the face to be identified is compared with the feature samples in the higher priority sub-feature sample sets. This achieves priority comparison of feature samples in the sub-feature sample sets that are more likely to identify the identity information of the face, thereby improving the efficiency and accuracy of face recognition and achieving good technical results.
[0065] Please see Figure 2 , Figure 2 This is a flowchart illustrating another embodiment of a face recognition method according to this application. In this embodiment, the angle information includes the shooting angle, and correspondingly, the actual angle information includes the actual shooting angle, and the reference angle information includes the reference shooting angle. The above step S130 further includes step S201.
[0066] S201: Set the sub-feature sample set whose absolute value of the difference between the reference shooting angle and the actual shooting angle is less than or equal to a preset threshold as the first priority.
[0067] After determining the actual shooting angle of the face to be identified and obtaining the feature sample set, when assigning different priorities to multiple sub-feature sample sets based on the actual shooting angle and the reference shooting angle, the absolute value of the difference between the reference shooting angle of each sub-feature sample set and the actual shooting angle of the face to be identified is first determined. Then, it is determined whether the absolute value of the difference between the sub-feature sample set and the face to be identified is less than or equal to a preset threshold. If the absolute value of the difference is determined to be less than or equal to the preset threshold, then the sub-feature sample set is set as the first priority.
[0068] The preset threshold is a pre-set empirical value of the difference. The specific preset threshold is set according to the requirements. When the absolute value of the difference is less than or equal to the preset threshold, it indicates that the shooting angle of the current sub-feature sample set is very close to the shooting angle of the face to be identified. Therefore, the feature samples in the sub-feature sample set whose absolute value of the difference is less than or equal to the preset threshold can be compared with the face to be identified.
[0069] Furthermore, if there are two or more sub-feature sample sets in the feature sample set that satisfy the condition that the absolute value of the difference between the reference shooting angle and the actual shooting angle is less than or equal to a preset threshold, then the priority of the multiple sub-feature sample sets that satisfy the condition that the absolute value of the difference between the reference shooting angle and the actual shooting angle is less than or equal to the preset threshold will be set to the first priority. When comparing the face to be identified with the feature samples in the first priority sub-feature sample set, for multiple sub-feature sample sets that are all first priority, the face to be identified will be compared with the feature samples in the sub-feature sample set in order of the absolute value of the difference between the reference shooting angle and the actual shooting angle from smallest to largest.
[0070] Furthermore, in another embodiment, please continue to see Figure 2 According to whether it is a frontal shot, the shooting angle is divided into a frontal shooting angle and a non-frontal shooting angle. That is, when the shooting angle includes a frontal shooting angle and a non-frontal shooting angle, the above step S130 further includes step S202. That is, in the current embodiment, step S130 includes steps S201 to S202.
[0071] S202: Set the priority of the sub-feature sample set corresponding to the frontal shooting angle in the first type of sub-feature sample set that has not been prioritized to the second priority.
[0072] In the current embodiment, after setting the sub-feature sample set whose absolute value of the difference between the reference shooting angle and the actual shooting angle is less than or equal to a preset threshold as the first priority, the priority of the sub-feature sample set corresponding to the frontal shooting angle in the first type of sub-feature sample set that has not been prioritized will be further set as the second priority.
[0073] Specifically, in one embodiment, after executing step S201, it is first determined whether the first type of sub-feature sample set without priority setting contains a sub-feature sample set corresponding to the frontal face shooting angle. The first type of sub-feature sample set refers to the other sub-feature sample sets in the feature sample set excluding the sub-feature sample sets with the first priority.
[0074] Among them, the frontal shooting angle is the angle of shooting the face from the front, and the line connecting the center of the shooting field of view of the frontal shooting angle and the center of the face to be identified is perpendicular to the plane of the shooting field of view and the plane of the face to be identified, respectively.
[0075] If, after evaluation, it is determined that the first type of sub-feature sample set without priority settings contains a sub-feature sample set corresponding to the frontal shooting angle, then the priority of the sub-feature sample set corresponding to the frontal shooting angle will be set to the second priority, so that the priority of the sub-feature sample set corresponding to the frontal shooting angle is higher than the other sub-feature sample sets of the first type of sub-feature sample set.
[0076] For example, if the first type of sub-feature sample set includes 10 sub-feature sample sets, and it is determined that there is a sub-feature sample set whose reference angle information is a frontal shooting angle, then the priority of this sub-feature sample set will be set higher than the priority of the remaining 9 sub-feature sample sets.
[0077] Furthermore, in another embodiment, please continue to see Figure 2 The above-mentioned step S130 further includes steps S203 to S204. In the current embodiment, the angle information also includes the facial orientation of the face. Step S130 includes steps S201 to S204.
[0078] S203: Determine the facial orientation of the face to be identified based on the actual angle information.
[0079] In the current embodiment, the facial orientation of the face to be identified is further determined based on the actual angle information of the face to be identified. Here, facial orientation refers to the direction of the face relative to the shooting device, and the facial orientation can be determined based on the shooting direction.
[0080] Specifically, the face to be identified is further categorized according to its orientation into frontal face, left side face, and right side face. A frontal face is an image captured when the face is directly facing the camera; a left side face is an image captured when the face is directly facing the right side of the camera; and a right side face is an image captured when the face is directly facing the left side of the camera. Correspondingly, when the camera is positioned to the left, the face is categorized as a left side face; when the camera is positioned to the right, the face is categorized as a right side face; and when the camera is positioned directly in front, the face is categorized as a frontal face.
[0081] S204: Set the priority of the sub-feature sample set in the second type of sub-feature sample set that has not been prioritized to the third priority if it is the same as the facial orientation of the face to be identified.
[0082] The second type of sub-feature sample set consists of feature sample sets that have had their first and second priorities removed from the feature sample set. After determining the facial orientation of the face to be identified based on the actual angle information, the sub-feature sample sets in the second type of sub-feature sample set that have the same facial orientation as the face to be identified are further prioritized as the third priority.
[0083] Specifically, it can be determined whether the second type of sub-feature sample set without priority setting contains a sub-feature sample set with the same facial orientation as the face to be identified. If it is determined that the second type of sub-feature sample set without priority setting contains a sub-feature sample set with the same facial orientation as the face to be identified, then the priority of the sub-feature sample set with the same facial orientation will be set to the third priority.
[0084] For example, if the face to be identified is classified as a left face according to the orientation of the face, it is further determined whether the second type of sub-feature sample set also contains a sub-feature sample set of the left face. If it is determined that the second type of sub-feature sample set contains a sub-feature sample set of the left face, the priority of the left face sub-feature sample set in the second type of sub-feature sample set will be set to the third priority.
[0085] Alternatively, if the face to be identified is classified as a right-side face according to facial orientation, then it is further determined whether the second type of sub-feature sample set contains a right-side face sub-feature sample set. If it is determined that the second type of sub-feature sample set contains a right-side face sub-feature sample set, then the priority of the right-side face sub-feature sample set in the second type of sub-feature sample set will be set to the third priority.
[0086] It should be noted that, in Figure 2 In the corresponding embodiments, the terms "first priority," "second priority," and "third priority" are used to distinguish different priorities, rather than specifying a fixed priority order of first, second, and third priority. The specific priority order can be set according to actual needs. For example, in one embodiment, the priority order from high to low can be: third priority, first priority, and second priority. In another embodiment, the priority order from high to low can be: third priority, second priority, and first priority. Alternatively, in yet another embodiment, the priority order from high to low can also be: first priority, third priority, and second priority, with the specific priority order depending on the actual situation.
[0087] In the current embodiment, by combining whether the absolute value of the difference between the reference angle information and the actual angle information is less than or equal to a preset threshold, whether it is a frontal shooting angle, and the facial orientation of the face to be identified, priority is set for the sub-feature sample sets in the feature sample set. This enables the sub-feature sample sets that are more likely to identify the identity information of the face to be identified to be compared with the face to be identified, thereby improving the efficiency of face recognition to a certain extent.
[0088] Please see Figure 3 , Figure 3This is a flowchart illustrating another embodiment of a face recognition method according to this application. In this current embodiment, the angle information includes a first plane angle and a second plane angle, wherein the first plane is perpendicular to the second plane. Specifically, the first plane angle, categorized by shooting direction, includes: a frontal shooting angle, a left-side shooting angle, and a right-side shooting angle; the second plane angle, categorized by shooting direction, includes: a frontal shooting angle, a top-down shooting angle, and a bottom-up shooting angle.
[0089] The frontal shooting angle is the angle at which the camera is shot directly in front of the face. In this angle, the vertical height of the center of the camera's field of view is the same as the vertical height of the center of the face to be recognized, and the line connecting the center of the field of view and the center of the face is perpendicular to both the screen displaying the field of view and the screen displaying the face. The left-side shooting angle is the angle at which the camera is shot to the left of the center of the face; the right-side shooting angle is the angle at which the camera is shot to the right of the center of the face; the top-down shooting angle is the angle at which the camera is shot above the center of the face; and the bottom-up shooting angle is the angle at which the camera is shot below the center of the face.
[0090] In the current embodiment, step S130 above further includes S301.
[0091] S301: Set the priority of the sub-feature sample set that belongs to the same category as the first plane angle and the first plane angle of the face to be identified, and whose second plane angle belongs to the same category as the second plane angle of the face to be identified, to the first priority.
[0092] When constructing the feature sample set, the categories to which the first and second plane angles of each sub-feature sample set belong are pre-labeled, i.e., the corresponding classification labels for the first and second plane angles are affixed. In the current embodiment, each sub-feature sample set will simultaneously include the shooting direction label from the reference angle information, and the labels for the categories to which the first and second plane angles belong according to the shooting direction.
[0093] Correspondingly, when setting priorities for each sub-feature sample set, the sub-feature sample set whose first plane angle belongs to the same category as the first plane angle of the face to be identified, and whose second plane angle belongs to the same category as the second plane angle of the face to be identified, will be given the first priority. For example, if the first plane angle of the face to be identified is classified as the left shooting angle according to the shooting direction, and the second plane angle of the face to be identified is classified as the top shooting angle according to the shooting direction, then step S301 will set the sub-feature sample set whose first plane angle is the left shooting angle and whose second plane angle is the top shooting angle as the first priority.
[0094] Further reading is available upon request. Figure 3The above step S130 also includes step S302, that is, in the current embodiment, step S130 includes steps S301 to S302.
[0095] S302: Set the priority of sub-feature sample sets in the third category of sub-feature sample sets that have no priority settings, where only the first plane angle belongs to the same category as the first plane angle of the face to be identified, or only the second plane angle belongs to the same category as the second plane angle of the face to be identified, to the second priority.
[0096] After setting the first priority sub-feature sample set, the priority of sub-feature sample sets in the third category that only have the first plane angle belonging to the same category as the first plane angle of the face to be identified, or only have the second plane angle belonging to the same category as the second plane angle of the face to be identified, will be set to the second priority. For example, continuing with the example of the first plane angle of the face to be identified being the left shooting angle and the second plane angle of the face to be identified being the top shooting angle, the priority of sub-feature sample sets in the third category that only have the first plane angle as the left shooting angle, or only have the second plane angle as the top shooting angle, will be set to the second priority.
[0097] Furthermore, in another embodiment, the first plane angle is a horizontal angle, and the second plane angle is a vertical angle, meaning the angle information includes both horizontal and vertical angles. Specifically, as described above, the horizontal angles, categorized by shooting direction, include: front-facing shooting angle, left-side shooting angle, and right-side shooting angle; the vertical angles, categorized by shooting direction, include: front-facing shooting angle, top-down shooting angle, and bottom-up shooting angle.
[0098] In the current embodiment, step S130 further includes the following step: setting the priority of the sub-feature sample set whose horizontal angle belongs to the same category as the horizontal angle of the face to be identified and whose vertical angle belongs to the same category as the vertical angle of the face to be identified to have the highest priority.
[0099] As described above, in the current embodiment, each sub-feature sample set in the feature sample set is labeled with corresponding horizontal and vertical angle classification tags according to the above-mentioned shooting angle classification rules. For example, if the horizontal angle in the reference angle information of a sub-feature sample set belongs to the front shooting angle and the vertical angle in the reference angle information belongs to the top shooting angle, then the corresponding horizontal and vertical angle category tags will be set as "front shooting angle, top shooting angle". This is so that when setting priorities for sub-feature sample sets, the category to which the horizontal and vertical angles of the current sub-feature sample set belong can be quickly determined according to the category tags of the horizontal and vertical angles, and then the priorities can be set in combination with the horizontal and vertical angle tags of each sub-feature sample set.
[0100] In the current embodiment, when setting different priorities for multiple sub-feature sample sets, the sub-feature sample set whose horizontal angle belongs to the same category as the horizontal angle of the face to be identified, and whose vertical angle belongs to the same category as the vertical angle of the face to be identified, is first given priority. For example, if the horizontal angle in the actual angle information of the face to be identified is a frontal shooting angle, and the vertical angle in the actual angle information of the face to be identified is a top-down shooting angle, then the sub-feature sample set whose horizontal angle is a frontal shooting angle and whose vertical angle is a top-down shooting angle will be set as the first priority.
[0101] Furthermore, step S130 also includes setting the priority of sub-feature sample sets in the third category of sub-feature sample sets that have only horizontal angles belonging to the same category as the horizontal angles of the face to be identified, or only vertical angles belonging to the same category as the vertical angles of the face to be identified, to the second priority.
[0102] The third type of sub-feature sample set is the remaining sub-feature sample set excluding the "feature sample set whose horizontal angle belongs to the same category as the horizontal angle of the face to be identified, and whose vertical angle belongs to the same category as the vertical angle of the face to be identified".
[0103] In the current embodiment, after setting the priority of the feature sample set whose horizontal angle belongs to the same category as the horizontal angle of the face to be identified and whose vertical angle belongs to the same category as the vertical angle of the face to be identified as the first priority, the priority of the sub-feature sample set in the third category whose only horizontal angle belongs to the same category as the horizontal angle of the face to be identified, or whose only vertical angle belongs to the same category as the vertical angle of the face to be identified, is set as the second priority.
[0104] Specifically, after prioritizing the feature sample set whose horizontal angle category is the same as the horizontal angle of the face to be identified and whose vertical angle category is the same as the vertical angle of the face to be identified as the first priority, it can be further determined whether the third type of sub-feature sample set includes: a sub-feature sample set whose only horizontal angle category is the same as the horizontal angle of the face to be identified, and simultaneously determine whether the third type of sub-feature sample set includes a sub-feature sample set whose only vertical angle category is the same as the vertical angle of the face to be identified. If the determination finds that the third type of sub-feature sample set includes a sub-feature sample set whose only horizontal angle category is the same as the horizontal angle of the face to be identified, then the priority of the sub-feature sample set whose only horizontal angle category is the same as the horizontal angle of the face to be identified is set to the second priority; or if the determination finds that the third type of sub-feature sample set includes a sub-feature sample set whose only vertical angle category is the same as the vertical angle of the face to be identified, then the priority of the sub-feature sample set whose only vertical angle category is the same as the vertical angle of the face to be identified is set to the second priority.
[0105] Furthermore, after step S302, the method provided in this application further includes: automatically setting the priority of other sub-feature sample sets in the third type of sub-feature sample set to the third priority.
[0106] In the current embodiment, by combining the categories of the first and second plane angles in the actual angle information of the face to be identified, and the categories of the first and second plane angles in each sub-feature sample set, priority is set for each sub-feature sample set. This allows sub-feature sample sets that are close to the actual angle information of the face to be identified at the shooting angle to be set as having priority for comparison with the face to be identified, thereby improving the face recognition speed.
[0107] Please see Figure 4 , Figure 4 This is a flowchart illustrating another embodiment of a face recognition method according to this application. In this embodiment, the first plane angle is a horizontal angle, and the second plane angle is a vertical angle. The horizontal angle, according to the shooting direction, includes: front shooting angle, left shooting angle, and right shooting angle. The vertical angle, according to the shooting direction, includes: front shooting angle, top-down shooting angle, and bottom-up shooting angle. For the specific definitions of the above-mentioned front shooting angle, left shooting angle, right shooting angle, top-down shooting angle, and bottom-up shooting angle, please refer to the corresponding descriptions above, which will not be repeated here.
[0108] In the current embodiment, step S130 above further includes step S401.
[0109] S401: Set the priority of the feature sample set whose absolute value of the difference between the horizontal angle and the horizontal angle of the face to be identified is less than or equal to a preset threshold, and whose absolute value of the difference between the vertical angle and the numerical angle of the face to be identified is less than or equal to a preset threshold, to the first priority.
[0110] In the current embodiment, when setting priorities for sub-feature sample sets, the absolute values of the differences in reference horizontal angles and vertical angles are further combined to set priorities for multiple sub-feature sample sets.
[0111] It should be noted that, in the current embodiment, when constructing the feature sample set, the horizontal angle, vertical angle, category to which the horizontal angle belongs, and category to which the vertical angle belongs in the reference angle information of each sub-feature sample set are determined respectively.
[0112] For example, in one embodiment, the horizontal angle of the reference angle information of a certain sub-feature sample set is 45°, and the category to which the horizontal angle of the reference angle information belongs is left shooting angle. The vertical angle of the reference angle information of the sub-feature sample set is 0°, and the category to which the horizontal angle of the reference angle information belongs is front shooting angle. And so on, the horizontal angle, the category to which the horizontal angle belongs, the vertical angle, and the category to which the vertical angle belong in the reference angle information of each sub-feature sample set in the feature sample set will be determined respectively. The horizontal angle, the category to which the horizontal angle belongs, the vertical angle, and the category to which the vertical angle belong in the reference angle information of each sub-feature sample set will be associated and saved with the sub-feature sample set in the form of a label. So that when setting the priority of the sub-feature sample set, the horizontal angle, the category to which the horizontal angle belongs, the vertical angle, and the category to which the vertical angle belong in the reference angle information of the sub-feature sample set can be quickly determined according to the label.
[0113] In the current embodiment, the absolute values of the differences between the horizontal angles in each sub-feature sample set and the horizontal angles in the actual angle information of the face to be identified, as well as the absolute values of the differences between the vertical angles in each sub-feature sample set and the vertical angles in the actual angle information of the face to be identified, are first determined. Then, the feature sample sets whose absolute values of the differences between the horizontal angles and the horizontal angles of the face to be identified are less than or equal to a preset threshold, and whose absolute values of the differences between the vertical angles and the numerical angles of the face to be identified are less than or equal to a preset threshold, are set to the first priority.
[0114] The preset threshold is a pre-set empirical value used to determine whether the shooting angle of the face to be identified is close to that of the feature sample set based on the absolute value of the angle difference.
[0115] Furthermore, in another embodiment, please continue to see Figure 4The above step S130 further includes step S402, that is, in the current embodiment, step S130 includes steps S401 to S402.
[0116] S402: Set the priority of the feature sample set in the fourth category of sub-feature sample set that has no priority setting to the second priority if the horizontal shooting angle category is the same as the horizontal angle of the face to be identified and / or the vertical shooting angle category is the same as the vertical angle of the face to be identified.
[0117] In the current embodiment, specifically, it is determined whether the fourth type of sub-feature sample set without priority setting contains a feature sample set whose horizontal shooting angle category is the same as the horizontal angle of the face to be identified, and / or whose vertical shooting angle category is the same as the vertical angle of the face to be identified. If it is determined that the fourth type of sub-feature sample set contains a feature sample set whose horizontal shooting angle category is the same as the horizontal angle of the face to be identified, and / or whose vertical shooting angle category is the same as the vertical angle of the face to be identified, then the feature sample set whose horizontal shooting angle category is the same as the horizontal angle of the face to be identified, and / or whose vertical shooting angle category is the same as the vertical angle of the face to be identified will be set to the second priority.
[0118] Among them, the fourth type of sub-feature sample set is: the feature sample set excluding "the sub-feature sample set in which the absolute value of the difference between the horizontal angle and the horizontal angle of the face to be identified is less than or equal to a preset threshold, and the absolute value of the difference between the vertical angle and the numerical angle of the face to be identified is less than or equal to a preset threshold".
[0119] In the current embodiment, by combining the absolute value of the horizontal angle difference, the absolute value of the vertical angle difference, the category to which the horizontal angle belongs, and the category to which the vertical angle belongs, priority can be set for each sub-feature sample set. This allows for a more precise priority order to be set for the sub-feature sample sets, further improving the efficiency of face recognition.
[0120] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a face recognition device according to an embodiment of this application. In the current embodiment, the face recognition device 500 provided by this application includes an image acquisition module 501, a feature sample set acquisition module 502, a priority setting module 503, and an identity recognition module 504.
[0121] The image acquisition module 501 is used to acquire an image including the face to be identified and to determine the actual angle information of the face to be identified.
[0122] The feature sample set acquisition module 502 is used to acquire a feature sample set. This feature sample set includes multiple sub-feature sample sets corresponding to different reference angle information.
[0123] The priority setting module 503 is used to set different priorities for multiple sub-feature sample sets based on actual angle information and reference angle information.
[0124] In one embodiment, the angle information includes the shooting angle, the actual angle information includes the actual shooting angle, and the reference angle information includes the reference shooting angle. Then, the priority setting module 503 is further used to set the sub-feature sample set whose absolute value of the difference between the reference shooting angle and the actual shooting angle is less than or equal to a preset threshold as the first priority.
[0125] Furthermore, if the shooting angle includes a frontal shooting angle and a non-frontal shooting angle, then the priority setting module 503 is also used to set the priority of the sub-feature sample set corresponding to the frontal shooting angle in the first type of sub-feature sample set that has not been prioritized to the second priority.
[0126] Furthermore, if the angle information includes the facial orientation of the face, the priority setting module 503 is also used to determine the facial orientation of the face to be identified based on the actual angle information, and set the priority of the sub-feature sample set in the second type of sub-feature sample set that has not been prioritized and has the same facial orientation as the face to be identified as the third priority.
[0127] In another embodiment, the angle information includes a first plane angle and a second plane angle, where the first plane is perpendicular to the second plane. Then, the priority setting module 503 is used to set the priority of the sub-feature sample set that belongs to the same category as the first plane angle of the face to be identified and the second plane angle of the face to be identified as belonging to the same category as the second plane angle of the face to be identified as the first priority.
[0128] Furthermore, the priority setting module 503 is also used to set the priority of sub-feature sample sets in the third type of sub-feature sample set that have not been prioritized, where only the first plane angle and the first plane angle of the face to be identified belong to the same category, or only the second plane angle and the second plane angle of the face to be identified belong to the same category, as the second priority.
[0129] The identity recognition module 504 is used to compare the face to be recognized with feature samples in multiple sub-feature sample sets in order of priority from high to low to obtain the comparison result, and determine the identity information of the face to be recognized based on the comparison result.
[0130] Furthermore, the identity recognition module 504 is further used to sequentially calculate the similarity between the face to be recognized and each feature sample in the multiple sub-feature sample sets, output the similarity as the comparison result, and output the identity information of the feature sample with the highest similarity as the identity information of the face to be recognized.
[0131] Please see Figure 6 , Figure 6 This is a schematic diagram illustrating the structure of an electronic device according to an embodiment of this application. In the current embodiment, the electronic device 600 provided by this application includes a processor 601 and a memory 602 coupled to the processor 601. The electronic device 600 can perform... Figures 1 to 4 The method described in any of the corresponding embodiments.
[0132] The memory 602 includes local storage (not shown) and is used to store computer programs, which, when executed, can achieve... Figures 1 to 4 The method described in any of the corresponding embodiments.
[0133] Processor 601 is coupled to memory 602. Processor 601 is used to run computer programs to perform the above-mentioned tasks. Figures 1 to 4 The method described in any of the corresponding embodiments. Further, in some embodiments, the electronic device may include any one of a mobile terminal, vehicle terminal, camera, computer terminal, computer, image acquisition device with computing and storage capabilities, server, etc., and may also include any other device with computing processing capabilities.
[0134] See Figure 7 , Figure 7 This is a schematic diagram illustrating an embodiment of a computer-readable storage medium according to this application. The computer-readable storage medium 700 stores a computer program 701 executable by a processor, which is used to implement the above-described... Figures 1 to 4 The methods described in any of the corresponding embodiments. Specifically, the computer-readable storage medium 700 described above may be one of the following: a memory, a personal computer, a server, a network device, or a USB flash drive, etc., without any specific limitation herein.
[0135] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A face recognition method, characterized in that, The method includes: Acquire an image including the face to be identified, and determine the actual angle information of the face to be identified; Obtain a feature sample set, wherein the feature sample set includes multiple sub-feature sample sets corresponding to different reference angle information; Based on the actual angle information and the reference angle information, different priorities are set for multiple sub-feature sample sets to obtain priority setting results; wherein, when there are multiple faces to be identified, each face to be identified corresponds to one priority setting result; The face to be identified is compared with the feature samples in the multiple sub-feature sample sets in order of priority from high to low to obtain the comparison result; The identity information of the face to be identified is determined based on the comparison results.
2. The method according to claim 1, characterized in that, The angle information includes the shooting angle, the actual angle information includes the actual shooting angle, and the reference angle information includes the reference shooting angle; The step of assigning different priorities to multiple sub-feature sample sets based on the actual angle information and the reference angle information includes: The sub-feature sample set whose absolute value of the difference between the reference shooting angle and the actual shooting angle is less than or equal to a preset threshold is set as the first priority.
3. The method according to claim 2, characterized in that, The shooting angles include front-facing shooting angles and off-facing shooting angles; The step of assigning different priorities to multiple sub-feature sample sets based on the actual angle information and the reference angle information further includes: Set the priority of the sub-feature sample set corresponding to the frontal shooting angle in the first type of sub-feature sample set that has not been prioritized to the second priority.
4. The method according to claim 3, characterized in that, The angle information includes the orientation of the face; The step of assigning different priorities to multiple sub-feature sample sets based on the actual angle information and the reference angle information further includes: The facial orientation of the face to be identified is determined based on the actual angle information; The priority of the sub-feature sample set in the second type of sub-feature sample set that has the same facial orientation as the face to be identified is set to the third priority.
5. The method according to claim 1, characterized in that, The angle information includes a first plane angle and a second plane angle, wherein the first plane is perpendicular to the second plane; The step of assigning different priorities to multiple sub-feature sample sets based on the actual angle information and the reference angle information includes: The priority of the sub-feature sample set that belongs to the same category as the first plane angle and the first plane angle of the face to be identified, and the second plane angle belongs to the same category as the second plane angle of the face to be identified, is set to the first priority.
6. The method according to claim 5, characterized in that, The step of assigning different priorities to multiple sub-feature sample sets based on the actual angle information and the reference angle information further includes: The sub-feature sample sets in the third category of sub-feature sample sets that have no priority settings, where only the first plane angle belongs to the same category as the first plane angle of the face to be identified, or where only the second plane angle belongs to the same category as the second plane angle of the face to be identified, are set to the second priority.
7. The method according to claim 5 or 6, characterized in that, The first plane angle is a horizontal angle, and the second plane angle is a vertical angle.
8. The method according to claim 1, characterized in that, Each of the sub-feature sample sets includes feature samples corresponding to different faces taken under the same reference angle information; The step of comparing the face to be identified with feature samples in the multiple sub-feature sample sets to obtain a comparison result further includes: The similarity between the face to be identified and each feature sample in the multiple sub-feature sample sets is calculated sequentially, and the similarity is output as the comparison result.
9. The method according to claim 8, characterized in that, The step of determining the identity information of the face to be identified based on the comparison result further includes: The identity information of the feature sample with the highest similarity is output as the identity information of the face to be identified.
10. A face recognition device, characterized in that, The device includes: The image acquisition module is used to acquire an image including the face to be identified and to determine the actual angle information of the face to be identified; A feature sample set acquisition module is used to acquire a feature sample set, wherein the feature sample set includes multiple sub-feature sample sets corresponding to different reference angle information; The priority setting module is used to set different priorities for multiple sub-feature sample sets according to the actual angle information and the reference angle information, and obtain priority setting results; wherein, when there are multiple faces to be identified, each face to be identified corresponds to one priority setting result; The identity recognition module is used to compare the face to be recognized with the feature samples in the multiple sub-feature sample sets in descending order of priority to obtain the comparison result, and determine the identity information of the face to be recognized based on the comparison result.
11. An electronic device, characterized in that, The electronic device includes a processor and a memory coupled to the processor; wherein, The memory is used to store computer programs; The processor is used to run the computer program to perform the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that can be executed by a processor, the computer program being used to implement the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Face identification method and system with self-learning function
CN104537336A
Face recognition method and related products
CN107590464A
Face recognition method, bottom library input method and device and electronic equipment
CN109684951A