Face clarity analysis method, device, computer equipment and storage medium
By obtaining the three-dimensional information of the face to generate motion vectors, calculate the blur value and judge the clarity, the problem of image clarity selection in face recognition in video streams is solved, and efficient and accurate face recognition is achieved.
Patent Information
- Application Number
- CN201910064449.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-01-23
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2039-01-23
AI Technical Summary
In the face recognition process based on video stream, how to automatically select a clear face image from the video stream for recognition, taking into account the face blur problem caused by factors such as motion and rotation.
By obtaining the motion vector of the face in the target image, generating a vector using three-dimensional information, calculating the blur value, and judging whether it meets the preset clarity conditions, the image with the clarity that meets the conditions is selected.
It effectively filters out clear images that meet the standards, improves the accuracy and efficiency of face recognition, and reduces the trouble of storage and search.
Smart Images

Figure CN111476060B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image analysis, and in particular to a method, device, computer equipment and storage medium for analyzing human face clarity. Background Art
[0002] In the face recognition process based on video streams, the face recognition algorithm needs to capture specific frames in the video stream for face recognition. The clarity of the face in the captured image has a direct impact on the final recognition accuracy. Since video streams are continuous images, the same person can produce thousands to tens of thousands of images depending on the length of time they appear. Recording all of them is a waste of space and also causes great trouble for later search work. Therefore, selecting a high-definition image for recognition is an intuitive and feasible method. Due to factors such as motion and rotation, the faces detected in the video are not always clear and may be blurred. Automatically selecting a clear face from the video stream has become a difficult problem. Summary of the Invention
[0003] The embodiments of the present invention can provide a face clarity analysis method, device, computer equipment and storage medium for effectively judging the clarity of a face in an image.
[0004] To solve the above technical problems, the present invention provides a method for analyzing facial clarity, comprising the following steps:
[0005] Obtaining a motion vector of a face in a target image, wherein the motion vector is a vector generated based on three-dimensional information of facial feature points in the target image;
[0006] Calculating a blur value of the target image according to the motion vector and a preset calculation rule, wherein the calculation rule is a data processing rule for obtaining a blur value by performing a weighted average on the motion vector;
[0007] Determine whether the target image meets a preset clarity condition, wherein the clarity condition is that the blur value is less than a preset threshold.
[0008] Optionally, before the step of obtaining the motion vector of the face in the target image, the following steps are included:
[0009] Acquiring three-dimensional information of a face in the target image;
[0010] The motion vector is generated according to the three-dimensional information and preset three-dimensional data, wherein the three-dimensional data is three-dimensional information of a human face in an image acquired by a previous acquisition node.
[0011] Optionally, before the step of acquiring the three-dimensional information of the face in the target image, the following steps are included:
[0012] Acquiring feature point information in the target image;
[0013] Generate a corresponding three-dimensional face model according to the feature point information;
[0014] The three-dimensional information is determined based on the three-dimensional face model.
[0015] Optionally, the step of generating the motion vector according to the three-dimensional information and preset three-dimensional data includes the following steps:
[0016] defining data information of a target feature in the three-dimensional information as first feature data;
[0017] Acquire second feature data, wherein the second feature data is data information of the target feature in the three-dimensional data;
[0018] The motion vector is generated based on the first feature data and the second feature data.
[0019] Optionally, the step of generating the motion vector according to the three-dimensional information and preset three-dimensional data includes the following steps:
[0020] generating a first expression feature vector of the target face according to the three-dimensional information;
[0021] Subtracting the first expression feature vector from a preset second expression feature vector to obtain an expression vector, wherein the second expression feature vector is an expression feature vector generated according to the preset three-dimensional data;
[0022] The expression vector is defined as the motion vector.
[0023] Optionally, before the step of obtaining feature point information in the target image, the following steps are included:
[0024] Get the video screen;
[0025] Extracting a frame from the video, and determining whether a face image exists in the frame;
[0026] When a face image exists in the frame image, the frame image is defined as the target image.
[0027] Optionally, after the step of determining whether the target image meets a preset clarity condition, the following steps are included:
[0028] When the target image meets the clarity condition, defining the target image as a clear image;
[0029] When the target image does not meet the clarity condition, a preset candidate image is selected for clarity judgment.
[0030] To solve the above technical problems, an embodiment of the present invention further provides a face clarity analysis device, comprising:
[0031] An acquisition module, configured to acquire a motion vector of a face in a target image, wherein the motion vector is a vector generated based on three-dimensional information of facial feature points in the target image;
[0032] a processing module, configured to calculate a blur value of the target image according to the motion vector and a preset calculation rule, wherein the calculation rule is a data processing rule for obtaining a blur value by performing a weighted average on the motion vector;
[0033] The execution module is used to determine whether the target image meets a preset clarity condition, wherein the clarity condition is that the blur value is less than a preset threshold.
[0034] Optionally, the face clarity analysis device further includes:
[0035] A first acquisition submodule is used to acquire three-dimensional information of a face in the target image;
[0036] The first processing submodule is configured to generate the motion vector according to the three-dimensional information and preset three-dimensional data, wherein the three-dimensional data is three-dimensional information of a face in an image acquired by a previous acquisition node.
[0037] Optionally, the face clarity analysis device further includes:
[0038] A second acquisition submodule is used to acquire feature point information in the target image;
[0039] A first reconstruction submodule is used to generate a corresponding three-dimensional face model according to the feature point information;
[0040] The second processing submodule is configured to determine the three-dimensional information based on the three-dimensional face model.
[0041] Optionally, the face clarity analysis device further includes:
[0042] A first execution submodule, configured to define data information of a target feature in the three-dimensional information as first feature data;
[0043] A third acquisition submodule is configured to acquire second feature data, wherein the second feature data is data information of the target feature in the three-dimensional data;
[0044] The third processing submodule is configured to generate the motion vector according to the first feature data and the second feature data.
[0045] Optionally, the face clarity analysis device further includes:
[0046] a fourth processing submodule, configured to generate a first expression feature vector of the target face according to the three-dimensional information;
[0047] a first calculation submodule, configured to obtain an expression vector by calculating a difference between the first expression feature vector and a preset second expression feature vector, wherein the second expression feature vector is an expression feature vector generated according to the preset three-dimensional data;
[0048] The second execution submodule is configured to define the expression vector as the motion vector.
[0049] Optionally, the face clarity analysis device further includes:
[0050] The fourth acquisition submodule is used to acquire video images;
[0051] a fifth processing submodule, configured to extract a frame from the video and determine whether a face image exists in the frame;
[0052] The third execution submodule is configured to define the frame image as the target image when a face image exists in the frame image.
[0053] Optionally, the face clarity analysis device further includes:
[0054] a fourth execution submodule, configured to define the target image as a clear image when the target image meets the clarity condition;
[0055] The fifth execution submodule is configured to select a preset candidate image for clarity judgment when the target image does not meet the clarity condition.
[0056] To solve the above technical problems, an embodiment of the present invention further provides a computer device, comprising a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the above-mentioned facial clarity analysis method.
[0057] To solve the above technical problems, an embodiment of the present invention further provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the above-mentioned face clarity analysis method.
[0058] The beneficial effects of the embodiments of the present invention are as follows: by analyzing the three-dimensional information of the feature points of a face in an image, a motion vector is obtained to reflect the amplitude of the face's motion in the image. After determining the motion vector, a weighted average is performed on the modulus of the motion vector to obtain a blur value for the target image. The weights of the various data points during the weighted average can be adjusted according to actual conditions to make the resulting blur value more suitable for actual application scenarios. The resulting blur value is then compared with a preset threshold to ultimately determine the clarity of the target image. The calculated blur value can intuitively reflect the blur of the target image. At the same time, by setting the judgment threshold according to actual needs, a clear image that meets the standard can be effectively screened from the video stream.
[0059] The method involves obtaining a motion vector of a face in a target image, wherein the motion vector is a vector generated based on the three-dimensional information of the target facial feature points; calculating the blurriness value of the target image based on the motion vector and a preset calculation rule, wherein the calculation rule is a data processing rule that obtains the blurriness value by weighted averaging the motion vectors; and determining whether the target image meets a preset clarity condition, wherein the clarity condition is that the blurriness value is less than a preset threshold. A facial model is reconstructed using facial feature points to obtain three-dimensional information, and the changes in the three-dimensional information of the previous and next frames of the face are analyzed as motion vectors. A blurriness value is then calculated based on the motion vectors to determine the image clarity, thereby selecting a relatively clear facial image with controllable dynamic amplitude from the video. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0061] Figure 1 Schematic diagram of the basic flow of the face clarity analysis method according to an embodiment of the present invention;
[0062] Figure 2 A schematic diagram of a process for generating a motion vector based on three-dimensional information according to an embodiment of the present invention;
[0063] Figure 3 A schematic diagram of the process of obtaining three-dimensional information according to an embodiment of the present invention;
[0064] Figure 4 A schematic diagram of a process for generating a motion vector based on feature data according to an embodiment of the present invention;
[0065] Figure 5 A schematic diagram of a process for generating motion vectors based on facial expression features according to an embodiment of the present invention;
[0066] Figure 6 A schematic diagram of a process for determining a target image according to an embodiment of the present invention;
[0067] Figure 7 Schematic diagram of a process for determining subsequent steps according to image clarity according to an embodiment of the present invention;
[0068] Figure 8 This is a basic structural block diagram of a face clarity analysis device according to an embodiment of the present invention;
[0069] Figure 9 This is a basic structural block diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0070] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0071] In some of the processes described in the specification and claims of the present invention and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., and do not represent the order of precedence, nor do they limit "first" and "second" to be different types.
[0072] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work shall fall within the scope of protection of the present invention.
[0073] As will be understood by those skilled in the art, the terms "terminal" and "terminal device" as used herein include both devices having a wireless signal receiver, which are devices having only a wireless signal receiver without transmission capability, and devices having receiving and transmitting hardware, which are devices having receiving and transmitting hardware capable of performing two-way communication over a two-way communication link. Such devices may include: cellular or other communication devices having a single-line display, a multi-line display, or a cellular or other communication device without a multi-line display; a PCS (Personal Communications Service) which may combine voice, data processing, fax, and / or data communication capabilities; a PDA (Personal Digital Assistant) which may include a radio frequency receiver, a pager, Internet / Intranet access, a web browser, a notepad, a calendar, and / or a GPS (Global Positioning System) receiver; and conventional laptop and / or palmtop computers or other devices having and / or including a radio frequency receiver. As used herein, the term "terminal" or "terminal device" may be portable, transportable, installed in a vehicle (air, sea, and / or land), or adapted and / or configured to operate locally, and / or in a distributed manner, at any other location on Earth and / or in space. The term "terminal" or "terminal device" as used herein may also refer to a communication terminal, an Internet terminal, or a music / video playback terminal, such as a PDA, an MID (Mobile Internet Device), and / or a mobile phone with music / video playback capabilities, or a smart TV, a set-top box, or other device.
[0074] Please refer to Figure 1 , Figure 1 Schematic diagram of the basic flow of the face clarity analysis method of this embodiment.
[0075] like Figure 1 As shown, a face clarity analysis method includes the following steps:
[0076] S1100, obtaining a motion vector of a face in a target image, wherein the motion vector is a vector generated based on three-dimensional information of facial feature points in the target image;
[0077] By obtaining facial feature points, the face is reconstructed to obtain the corresponding three-dimensional face model. Based on the three-dimensional model, the corresponding three-dimensional face information is obtained. The three-dimensional information includes posture information, movement information and feature point positions. Among them, the posture information is the posture angle (Euler angle) data of the face, including pitch value (pitch angle), yaw value (yaw angle) and roll value (roll angle); the movement information is the position data of the face, taking the spatial rectangular coordinate system as an example, including X value (front and back), Y value (left and right) and Z value (height); the feature point position is the position coordinates of one or more preset feature points.
[0078] After acquiring the 3D information, it is compared with the pre-set 3D data to obtain a corresponding vector, which serves as the motion vector. The pre-set 3D data is the 3D facial information collected by the previous acquisition node. The motion vector includes the pose vector, translation vector, and expression vector. The pose vector is the difference between the pose angle data in the two sets of 3D information. The translation vector is the difference between the position data in the two sets of 3D information. The expression vector is the difference between the expression feature vectors in the two sets of 3D information.
[0079] S1200, calculating a blur value of the target image according to the motion vector and a preset calculation rule, wherein the calculation rule is a data processing rule of obtaining a blur value by performing a weighted average on the motion vector;
[0080] After obtaining the motion vector, the modulus of the motion vector is taken for weighted averaging to obtain the blur value of the target image. The calculation method of the blur value is described as follows:
[0081] S=a*(|pitch|+|yaw|+|roll|)+b*(|tx|+|ty|+|tz|)+c*|E|
[0082] Among them, S represents the ambiguity value, a represents the weight of the attitude vector, b represents the weight of the translation vector, c represents the weight of the expression vector, pitch, yaw, and roll represent the pitch, yaw, and roll angle vectors corresponding to the attitude vector, tx, ty, and tz represent the front-back, left-right, and height change vectors in the translation vector, and E represents the expression vector.
[0083] The weights a, b, and c can be adjusted based on the actual application scenario. For example, if the expression change has little impact on the required clarity, the values of a and b can be increased, while the value of c can be decreased. Adjustment of the weights includes but is not limited to the above methods.
[0084] S1300: Determine whether the target image meets a preset clarity condition, wherein the clarity condition is that the blur value is less than a preset threshold;
[0085] After calculating the blurriness value of the target image, the blurriness value is compared with a preset threshold to determine whether the blurriness value is greater than the preset threshold. If the blurriness value is less than the preset threshold, the target image is determined to meet the clarity condition. If the blurriness value is greater than or equal to the preset threshold, the target image is determined to not meet the clarity condition. The threshold value can be adjusted according to the actual application scenario. For example, when the image clarity requirement is high, the threshold value can be lowered; when the image clarity requirement is low, the threshold value can be increased.
[0086] like Figure 2 As shown, before step S1100, the following steps are also included:
[0087] S1010, obtaining three-dimensional information of a face in the target image;
[0088] By obtaining facial feature points, the face is reconstructed to obtain the corresponding three-dimensional face model. Based on the three-dimensional model, the corresponding three-dimensional face information is obtained. The three-dimensional information includes posture information, movement information and feature point positions. Among them, the posture information is the posture angle (Euler angle) data of the face, including pitch value (pitch angle), yaw value (yaw angle) and roll value (roll angle); the movement information is the position data of the face, taking the spatial rectangular coordinate system as an example, including X value (front and back), Y value (left and right) and Z value (height); the feature point position is the position coordinates of one or more preset feature points.
[0089] S1020: Generate the motion vector based on the three-dimensional information and preset three-dimensional data, wherein the three-dimensional data is three-dimensional information of a face in an image acquired by a previous acquisition node;
[0090] After obtaining the three-dimensional information, it is compared with the preset three-dimensional data to obtain the corresponding vector as the motion vector. The preset three-dimensional data is the three-dimensional information of the face collected by the previous collection node. The motion vector includes the posture vector, translation vector and expression vector.
[0091] Specifically, the positions of feature points in the two sets of three-dimensional information are first extracted to generate corresponding expression feature vectors. In some embodiments, information of specific target points in the face (such as the center point of the left eye, the center point of the right eye, the center point of the nose, the left corner of the mouth, and the right corner of the mouth, etc., but not limited to these) can be input into a preset expression vector generation model, and the corresponding expression feature vector is determined according to the output result of the expression vector generation model, wherein the expression vector generation model is a neural network model that has been trained to convergence and is used to output a feature vector based on the input information.
[0092] The attitude vector is the difference vector of the corresponding attitude angle data in the two sets of three-dimensional information, the translation vector is the difference vector of the corresponding position data in the two sets of three-dimensional information, and the expression vector is the difference of the expression feature vectors in the two sets of three-dimensional information.
[0093] By comparing the three-dimensional information of the front and back images and using motion vectors, the movement amplitude of the face in the image can be accurately and effectively determined. According to the image acquisition principle of the camera equipment, the movement amplitude can reflect the degree of blur of the corresponding image from the side, improving the efficiency and accuracy of image blur judgment.
[0094] like Figure 3 As shown, before step S1010, the following steps are also included:
[0095] S1004, acquiring feature point information in the target image;
[0096] The target image is identified and its feature points are determined. Feature point information, which is the coordinate information corresponding to the feature points, is used to determine the location of one or more facial features. Feature points include, but are not limited to, the center of the left eye, the center of the right eye, the center of the nose, and the left and right corners of the mouth. The number of feature points can be adjusted depending on the actual application scenario. For example, if a more precise 3D model is required, the number of feature points can be increased; if computational performance needs to be reduced during 3D model construction, the number of feature points can be reduced.
[0097] Specifically, after determining the target image, the image is first classified and identified to determine the locations of the various feature points therein, and then the relative positions of the feature points are determined. In some embodiments, the identification of feature points can be performed using an existing neural network model that has been trained to convergence for recognizing facial parts, and the relative positions of feature points can be determined using methods such as Shape-from-Shading (SFS), obtaining the corresponding position coordinates as feature point information.
[0098] S1005, generating a corresponding three-dimensional face model according to the feature point information;
[0099] After acquiring the feature point information, a corresponding 3D facial model is reconstructed based on the feature point information. In some embodiments, an initial 3D shape (i.e., an average facial shape) is first selected. Regression calculations are then used to continuously adjust the shape of the 3D model based on the feature point information until the feature point data of the 3D model's two-dimensional projection matches the acquired feature point data. The adjusted 3D model is then determined to be the corresponding 3D facial model.
[0100] S1006, determining the three-dimensional information according to the three-dimensional face model;
[0101] After establishing a three-dimensional face model, three-dimensional information of the three-dimensional model is obtained. In some embodiments, a reference model is set in the reconstruction space of the three-dimensional model to determine the relative position and orientation of the three-dimensional model. The three-dimensional information includes posture information, movement information, and feature point positions, among others. The posture information is the posture angle (Euler angle) data of the face, including pitch value (pitch angle), yaw value (yaw angle), and roll value (roll angle); the movement information is the position data of the face, taking the spatial rectangular coordinate system as an example, including X value (front and back), Y value (left and right), and Z value (height); the feature point position is the position coordinate of the corresponding feature point in the acquired feature point information.
[0102] The feature point information is used to perform three-dimensional reconstruction to obtain a three-dimensional model of the face, and then the three-dimensional information is determined based on the three-dimensional model. After the image is acquired, the corresponding three-dimensional information can be quickly obtained based on the image for subsequent motion vector calculation.
[0103] like Figure 4 As shown, step S1020 specifically includes the following steps:
[0104] S1021. Define data information of a target feature in the three-dimensional information as first feature data;
[0105] 3D information includes posture information, motion information, and feature point locations. The posture information is used to determine the angle of the face in the target image, including pitch, yaw, and roll. Motion information is used to determine the position of the face in the target image, and feature point locations are used to determine the positions of target feature points, including X values (front and back), Y values (left and right), and Z values (height). After acquiring the 3D information, one of the features included in the posture vector or motion information is determined as the target feature. For example, the target feature is the front and back direction in the motion information, and the data defining the target feature (corresponding to the X value) is defined as the first feature data.
[0106] S1022. Acquire second feature data, wherein the second feature data is data information of the target feature in the three-dimensional data;
[0107] After determining the first feature data, data information corresponding to the target feature is determined in the three-dimensional data as the second feature data. For example, if the target feature corresponding to the first feature data is the front-to-back direction in the movement information, the data information (i.e., the X value) corresponding to the front-to-back direction of the movement information in the three-dimensional data is extracted as the second feature data.
[0108] S1023: Generate the motion vector according to the first feature data and the second feature data;
[0109] After obtaining the first feature data and the second feature data, the difference vector of the first feature data and the second feature data is calculated as the motion vector. When the target feature is a feature in the posture information, the corresponding difference vector reflects the angular offset corresponding to the face in the two sets of three-dimensional information, that is, the pitch vector, yaw vector or roll vector. It can be understood as vectorizing the two obtained angle values and then calculating the difference between them. When the target feature is a feature in the movement information, the corresponding difference vector reflects the translation of the face in the two sets of three-dimensional information. At this time, the first feature data and the second feature data are both corresponding coordinate information. It can be understood that the difference vector is a vector pointing from the first feature data to the second feature data.
[0110] According to the above method, vectors of corresponding features in the posture information and movement information are respectively obtained, and all the obtained vectors are defined as motion vectors.
[0111] like Figure 5 As shown, step S1020 specifically includes the following steps:
[0112] S1024, generating a first expression feature vector of the target face according to the three-dimensional information;
[0113] After acquiring the three-dimensional information, the locations of the feature points therein are extracted, and corresponding feature vectors are generated as the first expression feature vector. Specifically, the location information of target feature points on the face (such as, but not limited to, the center of the left eye, the center of the right eye, the center of the nose, the left corner of the mouth, and the right corner of the mouth) can be input into a preset expression vector generation model, and the expression feature vector is determined based on the output of the expression vector generation model. The expression vector generation model is a neural network model that has been trained to convergence and is used to output a feature vector based on the input information.
[0114] S1025. Subtract the first expression feature vector from a preset second expression feature vector to obtain an expression vector, wherein the second expression feature vector is an expression feature vector generated according to the preset three-dimensional data;
[0115] After determining the first expression feature vector, the feature point position in the three-dimensional data is obtained, and the corresponding second expression feature vector is obtained according to the above method. The difference between the obtained first expression feature vector and the second expression feature vector is calculated to obtain the corresponding difference vector as the expression vector, which is used to reflect the changes in facial expressions in the two sets of three-dimensional data.
[0116] S1026, defining the expression vector as the motion vector;
[0117] After the expression vector is calculated, the expression vector is defined as the motion vector of the target image.
[0118] The facial expression in the target image is determined by the position of the feature points, and then the facial expressions corresponding to the two sets of three-dimensional information are compared. The obtained expression vector can effectively reflect the changes in the facial expressions corresponding to the two sets of three-dimensional information. The expression vector is defined as a motion vector and used as a parameter in the numerical calculation of image blur, which can more accurately determine the image clarity.
[0119] like Figure 6 As shown, the following steps are also included before step S1004:
[0120] S1001, obtaining video images;
[0121] The video image to be detected is obtained. The video image can be a real-time image collected by the collection setting, or a video file pre-stored in the server or uploaded by the administrator, which is not limited here.
[0122] S1002: extracting a frame from the video, and determining whether a face image exists in the frame;
[0123] The video is processed using video processing software (such as, but not limited to, OpenCV) to split the video into several frames. Multiple frames are sequentially extracted from the multiple frames using a timed extraction method (e.g., extracting one image every 0.5 seconds), and then the frames are input into a preset face recognition model to determine whether a face image exists in the frame. In some embodiments, the face recognition model can be a CNN convolutional neural network model or a VGG convolutional neural network model that has been trained to convergence to determine whether a face exists in an image.
[0124] S1003: When a face image exists in the frame image, define the frame image as the target image;
[0125] The classification result of the output of the face recognition model is obtained, and whether a face exists in the input frame image is determined based on the classification result. When it is determined that a face image exists in the frame image, the corresponding frame image is defined as the target image.
[0126] This method can quickly and accurately obtain a target image with a face, avoiding the problem of incorrect or inaccurate face clarity judgment caused by the absence of a face in the obtained target image.
[0127] like Figure 7 As shown, after step S1300, the following steps are also included:
[0128] S1310: When the target image meets the clarity condition, define the target image as a clear image;
[0129] After calculating the target image's blurriness value, the system compares it with a preset threshold to determine whether it exceeds the threshold. If the blurriness value is less than the threshold, the target image is considered to meet the clarity requirements. The threshold value can be adjusted based on the actual application scenario. For example, if higher image clarity is required, the threshold value can be lowered; if lower image clarity is required, the threshold value can be increased.
[0130] When the target image meets the clarity condition, it means that the motion amplitude of the face in the image is within a controllable range. At this time, the image can show the face clearly, and the target image is defined as a clear image.
[0131] S1320: When the target image does not meet the clarity condition, select a preset candidate image for clarity determination;
[0132] When the blur value is greater than or equal to a preset threshold, it is determined that the target image does not meet the clarity condition, indicating that the movement amplitude of the face in the image exceeds the controllable range, the image is relatively blurry, and the face cannot be clearly displayed. Obtain a candidate image and perform clarity judgment on the candidate image according to the above-mentioned clarity judgment steps, and repeat the process of changing the target image and clarity judgment until an image that meets the clarity condition is obtained. In some embodiments, the candidate image may be an image file collected by a node after the target image, such as an image collected after a certain time interval (e.g., 1 second) after the target image. In other embodiments, the candidate image may be multiple images collected in advance from the video stream.
[0133] To solve the above technical problems, the present invention also provides a face clarity analysis device. Figure 8 , Figure 8 This is the basic structural block diagram of the face clarity analysis device implemented in this paper.
[0134] like Figure 8 As shown, the face clarity analysis device includes: an acquisition module 2100, a processing module 2200, and an execution module 2300. The acquisition module is used to obtain a motion vector of a face in a target image, wherein the motion vector is a vector generated based on three-dimensional information of facial feature points in the target image; the processing module is used to calculate a blur value of the target image based on the motion vector and a preset calculation rule, wherein the calculation rule is a data processing rule for obtaining a blur value by performing a weighted average on the motion vector; and the execution module is used to determine whether the target image meets a preset clarity condition, wherein the clarity condition is that the blur value is less than a preset threshold.
[0135] By analyzing the three-dimensional information of facial feature points in an image, a motion vector is derived to represent the amplitude of facial motion. After determining the motion vector, a weighted average is performed on the modulus of the motion vector to obtain the target image's blurriness value. The weights of each data point during the weighted average can be adjusted based on actual conditions to make the resulting blurriness value more suitable for the actual application scenario. The resulting blurriness value is then compared with a preset threshold to ultimately determine the target image's clarity. The calculated blurriness value intuitively reflects the blurriness of the target image. Furthermore, by setting the judgment threshold based on actual needs, a clear image that meets the standard can be effectively selected from the video stream.
[0136] In some embodiments, the face clarity analysis device further includes: a first acquisition submodule and a first processing submodule. The first acquisition submodule is configured to acquire three-dimensional information of a face in the target image; and the first processing submodule is configured to generate the motion vector based on the three-dimensional information and preset three-dimensional data, wherein the three-dimensional data is the three-dimensional information of the face in the image acquired by the previous acquisition node.
[0137] In some embodiments, the facial clarity analysis device further includes: a second acquisition submodule, a first reconstruction submodule, and a second processing submodule. The second acquisition submodule is configured to acquire feature point information from the target image; the first reconstruction submodule is configured to generate a corresponding three-dimensional facial model based on the feature point information; and the second processing submodule is configured to determine the three-dimensional information based on the three-dimensional facial model.
[0138] In some embodiments, the facial clarity analysis device further includes: a first execution submodule, a third acquisition submodule, and a third processing submodule. The first execution submodule is configured to define data information of a target feature in the three-dimensional information as first feature data; the third acquisition submodule is configured to acquire second feature data, wherein the second feature data is data information of the target feature in the three-dimensional data; and the third processing submodule is configured to generate the motion vector based on the first feature data and the second feature data.
[0139] In some embodiments, the facial clarity analysis device further includes: a fourth processing submodule, a first calculation submodule, and a second execution submodule. The fourth processing submodule is configured to generate a first expression feature vector of the target face based on the three-dimensional information; the first calculation submodule is configured to calculate the difference between the first expression feature vector and a preset second expression feature vector to obtain an expression vector, wherein the second expression feature vector is generated based on the preset three-dimensional data; and the second execution submodule is configured to define the expression vector as the motion vector.
[0140] In some embodiments, the facial clarity analysis device further includes: a fourth acquisition submodule, a fifth processing submodule, and a third execution submodule. The fourth acquisition submodule is configured to acquire a video image; the fifth processing submodule is configured to extract a frame from the video image and determine whether a facial image exists in the frame; and the third execution submodule is configured to define the frame as the target image when a facial image exists in the frame.
[0141] In some embodiments, the face clarity analysis device further includes: a fourth execution submodule and a fifth execution submodule. The fourth execution submodule is configured to define the target image as a clear image when the target image meets the clarity condition; and the fifth execution submodule is configured to select a preset candidate image for clarity determination when the target image does not meet the clarity condition.
[0142] To solve the above technical problems, the embodiment of the present invention also provides a computer device. Figure 9 , Figure 9 This is a basic structural block diagram of the computer device in this embodiment.
[0143] like Figure 9 As shown in the figure, the internal structure diagram of the computer equipment. Figure 9 As shown, the computer device includes a processor, a non-volatile storage medium, a memory, and a network interface connected via a system bus. The non-volatile storage medium of the computer device stores an operating system, a database, and computer-readable instructions. The database may store a control information sequence. When the computer-readable instructions are executed by the processor, the processor may implement a method for analyzing facial clarity. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor may implement a method for analyzing facial clarity. The network interface of the computer device is used to connect and communicate with a terminal. Those skilled in the art will understand that the structure shown in the figure is merely a block diagram of a portion of the structure related to the present application solution and does not constitute a limitation on the computer device to which the present application solution is applied. Specific computer devices may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0144] In this embodiment, the processor is used to execute Figure 8The memory stores the program code and various data required to execute the specific functions of the acquisition module 2100, processing module 2200, and execution module 2300. The network interface is used to transmit data between user terminals or servers. In this embodiment, the memory stores the program code and data required to execute all submodules in the face clarity analysis device. The server can call the server's program code and data to execute the functions of all submodules.
[0145] The present invention also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the face clarity analysis method described in any of the above embodiments.
[0146] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-described method embodiments. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0147] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0148] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0149] The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A method for analyzing face clarity, characterized in that: The following steps are involved: Acquire three-dimensional information of a face in a target image; generate a motion vector based on the three-dimensional information and preset three-dimensional data, wherein the three-dimensional data is the three-dimensional information of the face in the image acquired by the previous acquisition node, and the motion vector is a vector generated based on the three-dimensional information of facial feature points in the target image, and the motion vector includes a posture vector, a translation vector, and an expression vector; Calculating a blur value of the target image according to the motion vector and a preset calculation rule, wherein the calculation rule is a data processing rule for obtaining a blur value by performing a weighted average on the posture vector, the translation vector, and the expression vector; Determine whether the target image meets a preset clarity condition, wherein the clarity condition is that the blur value is less than a preset threshold.
2. The method for analyzing facial clarity according to claim 1, wherein: Before the step of obtaining the three-dimensional information of the face in the target image, the following steps are included: Acquiring feature point information in the target image; Generate a corresponding three-dimensional face model according to the feature point information; The three-dimensional information is determined based on the three-dimensional face model.
3. The face definition analysis method according to claim 1, wherein: The step of generating a motion vector according to the three-dimensional information and preset three-dimensional data includes the following steps: defining data information of a target feature in the three-dimensional information as first feature data; Acquire second feature data, wherein the second feature data is data information of the target feature in the three-dimensional data; The motion vector is generated based on the first feature data and the second feature data.
4. The method for analyzing facial clarity according to claim 1, wherein: The step of generating a motion vector according to the three-dimensional information and preset three-dimensional data comprises the following steps: generating a first facial expression feature vector of the human face according to the three-dimensional information; Subtracting the first expression feature vector from a preset second expression feature vector to obtain an expression vector, wherein the second expression feature vector is an expression feature vector generated according to the preset three-dimensional data; The expression vector is defined as the motion vector.
5. The method for analyzing facial clarity according to claim 2, wherein: Before the step of obtaining feature point information in the target image, the following steps are included: Get the video screen; Extracting a frame from the video, and determining whether a face image exists in the frame; When a face image exists in the frame image, the frame image is defined as the target image.
6. The face clarity analysis method according to any one of claims 1 to 5, characterized in that: After the step of determining whether the target image meets the preset clarity condition, the following steps are included: When the target image meets the clarity condition, defining the target image as a clear image; When the target image does not meet the clarity condition, a preset candidate image is selected for clarity judgment.
7. A face clarity analysis device, characterized in that: include: An acquisition module is used to obtain three-dimensional information of the face in the target image; Generate a motion vector based on the three-dimensional information and preset three-dimensional data, wherein the three-dimensional data is three-dimensional information of a face in an image acquired by a previous acquisition node, and the motion vector is a vector generated based on the three-dimensional information of facial feature points in the target image, and the motion vector includes a posture vector, a translation vector, and an expression vector; a processing module, configured to calculate a blur value of the target image based on the motion vector and a preset calculation rule, wherein the calculation rule is a data processing rule for obtaining a blur value by performing a weighted average on the posture vector, the translation vector, and the expression vector; The execution module is used to determine whether the target image meets a preset clarity condition, wherein the clarity condition is that the blur value is less than a preset threshold.
8. A computer device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the facial clarity analysis method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a mobile terminal, enables the mobile terminal to execute a facial clarity analysis method, the method comprising the facial clarity analysis method described in any one of claims 1 to 6 above.
Citation Information
Patent Citations
Construction method and device of three-dimensional face model, equipment and storage medium
CN111710036A
High-precision image information identification method, system and device and storage medium
CN115171197A
Face image selection method and device and electronic equipment
CN117058568A
Big data-based information acquisition and analysis method, apparatus and device, and storage medium
CN117854138A
Image processing method and apparatus, image device, and storage medium
JP2021525431A