WO2022205843A1 - 唇动检测方法、装置、终端设备及计算机可读存储介质 - Google Patents

唇动检测方法、装置、终端设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2022205843A1
WO2022205843A1 PCT/CN2021/125042 CN2021125042W WO2022205843A1 WO 2022205843 A1 WO2022205843 A1 WO 2022205843A1 CN 2021125042 W CN2021125042 W CN 2021125042W WO 2022205843 A1 WO2022205843 A1 WO 2022205843A1
Authority
WO
WIPO (PCT)
Prior art keywords
lip
distance
current
key point
face
Prior art date
Application number
PCT/CN2021/125042
Other languages
English (en)
French (fr)
Inventor
曾钰胜
庞建新
Original Assignee
深圳市优必选科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市优必选科技股份有限公司 filed Critical 深圳市优必选科技股份有限公司
Publication of WO2022205843A1 publication Critical patent/WO2022205843A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • G06V40/165Detection; Localisation; Normalisation using facial parts and geometric relationships
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships

Definitions

  • the present application belongs to the technical field of image processing, and in particular, relates to a lip movement detection method, device, terminal device and computer-readable storage medium.
  • Lip motion detection technology refers to a technology that determines the lip motion state by detecting the lip region in the face image. This technology plays a huge role in human-computer interaction. For example, lip motion detection technology can be used to detect whether the user has issued an instruction, and then control the smart device to wake up.
  • the lip key points in the face image detected at the current moment are usually matched with the lip key points in the face image at the historical moment, and then the position of each key point is determined according to the matching result. changes have occurred, which in turn determine the lip movement state.
  • the existing lip motion detection methods need to match key points one by one, which requires a large amount of calculation and low detection efficiency, which affects the sensitivity of human-computer interaction; in addition, the detection error of key points may also cause wrong key point matching results. , which in turn affects the accuracy of the lip motion detection results.
  • the embodiments of the present application provide a lip movement detection method, apparatus, terminal device, and computer-readable storage medium, which can improve the efficiency and accuracy of lip movement detection.
  • an embodiment of the present application provides a lip motion detection method, including:
  • the historical lip distance represents the upper and lower lip distances corresponding to the lip region on the target face in the t-nth frame image of the target video, and n is a positive integer less than t ;
  • a lip movement detection result is determined according to a lip distance difference between the current lip distance and the historical lip distance.
  • the distance between the upper and lower lips is calculated according to the detected lip key points, and then it is determined whether the lip distance between the two frames of images has changed by comparing the corresponding lip distances of the two frames of images before and after. , and determine the lip movement state according to the change of the lip distance.
  • the lip key points on the target face in the t-th frame image of the target video are detected, and the lip key point information is obtained, including:
  • the t-th frame image of the target video is input into the keypoint detection model after training to obtain the lip keypoint information;
  • the key point detection model is a detection model after training based on a preset logarithmic loss function
  • the logarithmic loss function is The x is a loss value
  • the ⁇ , the ⁇ and the C are preset parameters.
  • the calculating the current lip distance according to the lip key point information includes:
  • the current lip distance corresponding to the lip region is calculated according to the lip key point information.
  • the lip key point information includes respective pixel coordinates of multiple lip key points
  • the determining of the lip region on the target face in the t-th frame image according to the lip key point information includes:
  • the lip region on the face of the target person in the t-th frame image is determined according to a preset rule and the center point of the lip.
  • the judging whether the lip region is blocked includes:
  • the feature information of the directional gradient histogram is input into the trained support vector machine discriminator, and a judgment result is output, wherein the judgment result includes existence of occlusion or no occlusion.
  • calculating the current lip distance corresponding to the lip region according to the lip key point information including:
  • the lip key points are divided into M pairs of key points, wherein each pair of key points includes an upper lip key point and a lower lip key point, and M is a positive integer;
  • the lipDist represents the current lip distance
  • the (x down_i , y down_i ) represents the pixel of the lower lip key point in the ith pair of key points coordinates
  • the (x up_i , y up_i ) represents the pixel coordinates of the upper lip key point in the ith pair of key points.
  • the determining a lip movement detection result according to a lip distance difference between the current lip distance and the historical lip distance includes:
  • Kalman filtering is performed on the current lip distance to obtain the filtered current lip distance
  • the lip movement detection result is determined according to the lip distance difference between the filtered current lip distance and the historical lip distance.
  • the determining a lip movement detection result according to a lip distance difference between the current lip distance and the historical lip distance includes:
  • the lip movement detection result is determined according to the lip distance difference between the adjusted current lip distance and the historical lip distance.
  • an embodiment of the present application provides a lip movement detection device, including:
  • the key point detection unit is used to detect the lip key points on the target face in the t-th frame image of the target video, and obtain the lip key point information, where t is a positive integer greater than 1;
  • a lip distance calculation unit configured to calculate a current lip distance according to the lip key point information, wherein the current lip distance represents the upper and lower lip distances corresponding to the lip region on the target face in the t-th frame image ;
  • a historical data acquisition unit configured to acquire historical lip distances, wherein the historical lip distances represent the upper and lower lip distances corresponding to the lip region on the target face in the t-nth frame image of the target video, and the n is a positive integer less than t;
  • a lip movement detection unit configured to determine a lip movement detection result according to a lip distance difference between the current lip distance and the historical lip distance.
  • an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes all
  • the lip movement detection method according to any one of the above-mentioned first aspect is realized when the computer program is used.
  • an embodiment of the present application provides a computer-readable storage medium, and an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, wherein the When the computer program is executed by the processor, the lip movement detection method according to any one of the above first aspects is implemented.
  • an embodiment of the present application provides a computer program product that, when the computer program product runs on a terminal device, causes the terminal device to execute the lip movement detection method described in any one of the first aspects above.
  • FIG. 1 is a schematic flowchart of a lip motion detection method provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a face key point provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a curve of a loss function provided by an embodiment of the present application.
  • FIG. 4 is a structural block diagram of a lip motion detection device provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
  • the term “if” may be contextually interpreted as “when” or “once” or “in response to determining” or “in response to detecting ".
  • references in this specification to "one embodiment” or “some embodiments” and the like mean that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically emphasized otherwise.
  • FIG. 1 it is a schematic flowchart of a lip motion detection method provided by an embodiment of the present application.
  • the method may include the following steps:
  • S101 Detect the lip key points on the face of the target person in the t-th frame image of the target video, and obtain the lip key point information.
  • t is a positive integer greater than 1.
  • the lip motion detection method in this embodiment of the present application performs detection based on a video stream. First, it is necessary to detect the target face in each frame of the target video. In order to correlate the target face of the previous and subsequent frames, face tracking can be introduced. For each frame of image tracked to the target face, detect the lip key points in the frame of image.
  • the method for detecting lip key points may be: inputting the t-th frame image of the target video into a post-training key point detection model to obtain lip key point information.
  • the keypoint detection model can be used to detect the lip region on the target face in the image to obtain lip keypoint information.
  • the key point detection model is used to detect the target face in the image to obtain the face key point information; and then determine the lip key point information according to the face key point information.
  • the quality of key points determines the accuracy of lip motion detection results.
  • the detection quality of face key points is highly correlated with the dataset. For example, the dataset of 68 face key points has relatively few lip points, which is not suitable for subsequent lip distance judgment; there are 106 commonly used face key points, which are relatively rough in labeling, focusing on the overall distribution and ignoring the lips. The precise positioning of the lips results in basically no change in the key points of the lips when speaking.
  • the WFLW98 face key points are used in the embodiments of the present application, and this type of annotation can better reflect the changes of the lip key points.
  • FIG. 2 it is a schematic diagram of a face key point provided by an embodiment of the present application.
  • the t-th frame image is input into the keypoint detection model, and the face key points 0-97 on the target face in the t-th frame image are output.
  • the 20 key points of 76-95 among the detected 0-97 face key points can be determined as the lip key points, that is, the lip key point information is determined.
  • the key point detection is usually performed by the dlib method.
  • the dlib method has poor detection effect on key points in large-angle images (such as the face in the image is a side face, bowed head, or a raised posture), is prone to interference, and has a slow response to subtle differences.
  • a preset logarithmic loss function is used when training the key point detection model.
  • FIG. 3 it is a schematic diagram of a curve of a loss function provided by an embodiment of the present application.
  • curve I is a curve of an exponential function
  • curve II is a curve of a logarithmic function.
  • the logarithmic function is more sensitive than that of the exponential function. Therefore, using the logarithmic function as the loss function to train the keypoint detection model can improve the accuracy of the keypoint detection results.
  • the prediction weight of large-angle can be increased, so that the training of large-angle can be better compensated.
  • the preset logarithmic loss function is:
  • x is the loss value
  • ⁇ , ⁇ and C are preset parameters.
  • is the prediction weight.
  • the face in the image is a large-angle image such as a side face, a bowed head, or a raised head, increase the value of ⁇ ; otherwise, decrease the value of ⁇ .
  • the prediction deviation of large angles can be effectively reduced.
  • the key point detection model can use existing neural network models, such as mobilenetv2 and so on.
  • channel clipping can be performed on mobilenetv2.
  • random horizontal mirror enhancement, light disturbance enhancement and/or motion blur enhancement can also be performed. This can not only learn key point features more broadly, but also ensure the stability of video frame detection, and also improve the robustness of the key point detection model.
  • S102 Calculate the current lip distance according to the lip key point information.
  • the current lip distance represents the upper and lower lip distance corresponding to the lip region on the target face in the t-th frame image.
  • a calculation method of the current lip distance may be: calculating the maximum longitudinal distance of the key points of the lips; and determining the maximum longitudinal distance as the current lip distance. Specifically, the key point with the largest ordinate among the lip key points is selected to obtain the first boundary point; the key point with the smallest ordinate among the lip key points is selected to obtain the second boundary point; the first boundary point and the second boundary are calculated. The ordinate difference value of the point; the ordinate difference value is determined as the maximum longitudinal distance, that is, the current lip distance.
  • the above method is equivalent to only selecting a pair of key points for calculation, which is random, resulting in a low accuracy of the lip distance calculation result.
  • a calculation method of the current lip distance is:
  • the lip key points are divided into M pairs of key points, wherein each pair of key points includes an upper lip key point and a lower lip key point, and M is a positive integer; through the formula Calculate the current lip distance, where lipDist represents the current lip distance, (x down_i , y down_i ) represents the pixel coordinates of the lower lip key point in the ith pair of key points, (x up_i , y up_i ) represents the upper lip in the ith pair of key points The pixel coordinates of the keypoint.
  • 77 and 87 may be determined as a pair of key points
  • 78 and 86 may be determined as a pair of key points
  • 79 and 85 may be determined as a pair of key points
  • 80 and 84 may be determined as a pair of key points.
  • the key points, 81 and 83 are determined as a pair of key points
  • 89 and 95 are determined as a pair of key points
  • 90 and 94 are determined as a pair of key points
  • 91 and 93 are determined as a pair of key points.
  • the middle part of the upper lip and the middle part of the lower lip change greatly during the lip movement, some key points of the lip can be selected.
  • three key points 89-91 of the upper lip can be selected, and three key points of 93-95 of the lower lip can be selected.
  • the 6 key points are divided into 3 pairs, that is, 89 and 95 are determined as a pair of key points, 90 and 94 are determined as a pair of key points, and 91 and 93 are determined as a pair of key points.
  • a calculation method of the current lip distance is:
  • the lip key point information includes respective pixel coordinates of multiple lip key points.
  • the method for determining the lip region may include: determining boundary points of the lip region according to key points of the lip; and determining the lip region according to the boundary points.
  • the boundary point detection method can be used to detect boundary points 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86 and 87, and then outline the lips according to the detected boundary points. Department area.
  • another method for determining the lip region is provided in this embodiment of the present application, which may include: determining the lip region according to the respective pixel coordinates of multiple lip key points Center point; determine the lip area on the target face in the t-th frame image according to the preset rule and the lip center point.
  • (centerpointX, centerpointY) is the pixel coordinate of the center point of the lip
  • (Point_x i , Point_y i ) is the pixel coordinate of the i-th lip key point.
  • the preset rule is: taking the center point of the lip as the center of the rectangle, intercepting a rectangular area with a preset size in the t-th frame image; and determining the rectangular area as the lip area.
  • the preset size may be a predetermined fixed size. For example: Make sure the length is 50mm and the width is 30mm.
  • lip height is the width of the lip area
  • lip weight is the length of the lip area
  • face height is the width of the corresponding area of the target face
  • lip weight is the length of the corresponding area of the target face
  • the method for judging whether there is occlusion in the lip region may include: extracting the directional gradient histogram feature information of the lip region in the t-th frame image; inputting the directional gradient histogram feature information into the trained support vector machine In the discriminator, a judgment result is output, wherein the judgment result includes existence of occlusion or no occlusion.
  • the current lip distance corresponding to the lip area is calculated according to the lip key point information.
  • the method for calculating the current lip distance in S102 which will not be repeated here.
  • the historical lip distance represents the distance between the upper and lower lips corresponding to the lip region on the target face in the t-nth frame image of the target video, and n is a positive integer less than t.
  • the calculation method of the historical lip distance is the same as the calculation method of the current lip distance.
  • the calculation method of the current lip distance in S102 please refer to the calculation method of the current lip distance in S102, which will not be repeated here.
  • the current lip distance is the upper and lower lip distance corresponding to the lip area on the target face in the third frame image; the historical lip distance is the upper and lower lip distance corresponding to the lip area on the target face in the second frame image.
  • the lip motion detection starts from the second frame image.
  • the lip movement threshold can be set. When the lip distance difference is greater than the lip movement threshold, it means that lip movement occurs; when the lip movement difference is less than or equal to the lip movement threshold, it means that lip movement does not occur.
  • the lip movement threshold can be adjusted appropriately. It should be noted that when the lip movement threshold is low, false alarms may also occur; and when the lip movement threshold is large, the detection accuracy is low. Therefore, it is necessary to set the lip movement threshold reasonably.
  • an implementation of S104 includes: performing Kalman filtering on the current lip distance to obtain the filtered current lip distance; according to the difference between the filtered current lip distance and the historical lip distance The difference between the lip distances determines the lip movement detection result.
  • another implementation of S104 includes: detecting the face key points on the target face in the t-th frame image, and obtaining face key point information; according to the face key point information Determine the face area in the t-th frame image; determine the adjustment weight according to the area ratio of the face area in the t-th frame image; adjust the current lip distance according to the adjustment weight to obtain the adjusted current lip distance; The lip distance difference between the current current lip distance and the historical lip distance determines the lip movement detection result.
  • several ranges of the area ratio occupied by the face region in the whole image may be preset, and then the adjustment weight corresponding to each range is set. Assuming that the calculated area ratio of the face area in the t-th frame image in the t-th frame image is 0.5, and the corresponding adjustment weight is 0.8, then multiply the current lip distance by 0.8 to obtain the adjusted current lip distance .
  • another implementation manner of S104 includes:
  • Detect the face key points on the target face in the t-th frame image and obtain the face key point information; determine the face area in the t-th frame image according to the face key point information; According to the face area, in the t-th frame image The proportion of the area occupied determines the adjustment weight; adjust the current lip distance according to the adjustment weight to obtain the adjusted current lip distance; perform Kalman filtering on the adjusted current lip distance to obtain the filtered current lip distance; The lip distance difference between the current current lip distance and the historical lip distance determines the lip movement detection result.
  • the order of adjusting the weight value processing and filtering can also be changed, that is, another implementation of S104 includes: performing Kalman filtering processing on the current lip distance to obtain the filtered current lip distance; detecting the t-th frame image.
  • the face key points on the target face are obtained, and the face key point information is obtained; the face area in the t-th frame image is determined according to the face key point information; the area ratio of the face area in the t-th frame image is determined.
  • Adjust the weight adjust the filtered current lip distance according to the adjustment weight to obtain the adjusted current lip distance; determine the lip movement detection result according to the lip distance difference between the adjusted current lip distance and the historical lip distance.
  • the distance between the upper and lower lips is calculated according to the detected lip key points, and then it is determined whether the lip distance between the two frames of images has changed by comparing the corresponding lip distances of the two frames of images before and after. , and determine the lip movement state according to the change of the lip distance.
  • FIG. 4 is a structural block diagram of the lip movement detection apparatus provided by the embodiment of the present application. For convenience of description, only the part related to the embodiment of the present application is shown.
  • the device includes:
  • the key point detection unit 41 is configured to detect the lip key points on the target face in the t-th frame image of the target video, and obtain the lip key point information, where t is a positive integer greater than 1.
  • the lip distance calculation unit 42 is configured to calculate the current lip distance according to the lip key point information, wherein the current lip distance represents the upper and lower lips corresponding to the lip region on the target face in the t-th frame image distance.
  • the historical data obtaining unit 43 is used to obtain the historical lip distance, wherein the historical lip distance represents the upper and lower lip distances corresponding to the lip region on the target face in the t-nth frame image of the target video, so The n is a positive integer smaller than t.
  • the lip movement detection unit 44 is configured to determine a lip movement detection result according to the lip distance difference between the current lip distance and the historical lip distance.
  • the key point detection unit 41 is also used for:
  • the t-th frame image of the target video is input into the keypoint detection model after training, and the lip keypoint information is obtained; wherein, the keypoint detection model is trained based on a preset logarithmic loss function After arriving at the detection model, the logarithmic loss function is The x is a loss value, and the ⁇ , the ⁇ and the C are preset parameters.
  • the lip distance calculation unit 42 includes:
  • a lip region determination module configured to determine the lip region on the face of the target person in the t-th frame image according to the lip key point information.
  • An occlusion judging module is used for judging whether the lip region is occluded.
  • a lip distance calculation module configured to calculate the current lip distance corresponding to the lip region according to the lip key point information if there is no occlusion in the lip region.
  • the lip key point information includes respective pixel coordinates of multiple lip key points.
  • the lip region determination module is also used to:
  • the lip center point is determined according to the respective pixel coordinates of the plurality of lip key points; the lip region on the target face in the t-th frame image is determined according to a preset rule and the lip center point .
  • the occlusion judgment module is also used to:
  • the lip distance calculation module is also used to:
  • the lip key points are divided into M pairs of key points, wherein each pair of key points includes an upper lip key point and a lower lip key point, and M is a positive integer; through the formula Calculate the current lip distance corresponding to the lip region, where the lipDist represents the current lip distance, and the (x down_i , y down_i ) represents the pixel of the lower lip key point in the ith pair of key points coordinates, the (x up_i , y up_i ) represents the pixel coordinates of the upper lip key point in the ith pair of key points.
  • the lip movement detection unit 44 is also used for:
  • Kalman filtering is performed on the current lip distance to obtain the filtered current lip distance; the lip distance is determined according to the lip distance difference between the filtered current lip distance and the historical lip distance motion detection results.
  • the lip movement detection unit 44 is also used for:
  • Detect the face key points on the target face in the t-th frame image and obtain face key point information; determine the face area in the t-th frame image according to the face key point information; The area ratio occupied by the face area in the t-th frame image determines an adjustment weight; adjusts the current lip distance according to the adjustment weight, and obtains the adjusted current lip distance; The lip movement detection result is determined by a lip distance difference between the current lip distance and the historical lip distance.
  • the lip movement detection device shown in FIG. 4 may be a software unit, a hardware unit, or a unit combining software and hardware built into the existing terminal equipment, or may be integrated into the terminal equipment as an independent pendant, and also Can exist as an independent terminal device.
  • FIG. 5 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
  • the terminal device 5 in this embodiment includes: at least one processor 50 (only one is shown in FIG. 5 ), a processor, a memory 51 , and a processor stored in the memory 51 and can be processed in the at least one processor
  • a computer program 52 running on the processor 50 when the processor 50 executes the computer program 52, the steps in any of the above-mentioned embodiments of the lip movement detection method are implemented.
  • the terminal device may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the terminal device may include, but is not limited to, a processor and a memory.
  • FIG. 5 is only an example of the terminal device 5, and does not constitute a limitation on the terminal device 5. It may include more or less components than the one shown, or combine some components, or different components , for example, may also include input and output devices, network access devices, and the like.
  • the so-called processor 50 may be a central processing unit (Central Processing Unit, CPU), and the processor 50 may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuits) , ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 51 may be an internal storage unit of the terminal device 5 in some embodiments, such as a hard disk or a memory of the terminal device 5 .
  • the memory 51 may also be an external storage device of the terminal device 5 in other embodiments, such as a plug-in hard disk equipped on the terminal device 5, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc.
  • the memory 51 may also include both an internal storage unit of the terminal device 5 and an external storage device.
  • the memory 51 is used to store an operating system, an application program, a boot loader (Boot Loader), data, and other programs, such as program codes of the computer program, and the like.
  • the memory 51 can also be used to temporarily store data that has been output or will be output.
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented.
  • the embodiments of the present application provide a computer program product, when the computer program product runs on a terminal device, so that the terminal device can implement the steps in the foregoing method embodiments when executed.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium.
  • the present application realizes all or part of the processes in the methods of the above embodiments, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium.
  • the computer program includes computer program code
  • the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like.
  • the computer-readable medium may include at least: any entity or device capable of carrying the computer program code to the device/terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunication signals, and software distribution media.
  • ROM read-only memory
  • RAM Random Access Memory
  • electrical carrier signals telecommunication signals
  • software distribution media For example, U disk, mobile hard disk, disk or CD, etc.
  • computer readable media may not be electrical carrier signals and telecommunications signals.
  • the disclosed apparatus/terminal device and method may be implemented in other manners.
  • the apparatus/terminal device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units. Or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

本申请适用于图像处理技术领域,提供了一种唇动检测方法、装置、终端设备及计算机可读存储介质,包括:检测目标视频的第t帧图像中目标人脸上的唇部关键点,获得唇部关键点信息;根据所述唇部关键点信息计算当前唇距,其中,所述当前唇距表示所述第t帧图像中所述目标人脸上的唇部区域对应的上下唇距离;获取历史唇距,其中,所述历史唇距表示所述目标视频的第t-n帧图像中所述目标人脸上的所述唇部区域对应的上下唇距离;根据所述当前唇距和所述历史唇距之间的唇距差值确定唇动检测结果。通过上述方法,能够有效提高唇动检测的效率和准确度。

Description

唇动检测方法、装置、终端设备及计算机可读存储介质
本申请要求于2021年03月29日在中国专利局提交的、申请号为202110333133.0的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于图像处理技术领域,尤其涉及一种唇动检测方法、装置、终端设备及计算机可读存储介质。
背景技术
唇动检测技术是指,通过对人脸图像中唇部区域进行检测、以确定唇部运动状态的一项技术。该项技术在人机交互方面发挥着巨大作用。例如:可以通过唇动检测技术检测用户是否发出指令,进而控制智能设备唤醒。
现有技术中,通常是将当前时刻检测出的人脸图像中的唇部关键点与历史时刻人脸图像中的唇部关键点进行一一匹配,然后根据匹配结果确定各个关键点的位置是否发生了变化,进而确定唇动状态。现有的唇动检测方法需要进行关键点的逐一匹配,计算量较大,检测效率较低,进而影响人机交互的灵敏性;另外,关键点的检测误差也可能造成错误的关键点匹配结果,进而影响唇动检测结果的准确性。
技术问题
本申请实施例提供了一种唇动检测方法、装置、终端设备及计算机可读存储介质,可以提高唇动检测的效率和准确率。
技术解决方案
第一方面,本申请实施例提供了一种唇动检测方法,包括:
检测目标视频的第t帧图像中目标人脸上的唇部关键点,获得唇部关键点信息,所述t为大于1的正整数;
根据所述唇部关键点信息计算当前唇距,其中,所述当前唇距表示所述第t帧图像中所述目标人脸上的唇部区域对应的上下唇距离;
获取历史唇距,其中,所述历史唇距表示所述目标视频的第t-n帧图像中所述目标人脸上的所述唇部区域对应的上下唇距离,所述n为小于t的正整数;
根据所述当前唇距和所述历史唇距之间的唇距差值确定唇动检测结果。
在本申请实施例中,根据检测出的唇部关键点计算上下唇距离(即唇距),然后通过对比前后两帧图像各自对应的唇距确定前后两帧图像之间唇距是否发生了变化,根据唇距的变化情况确定唇动状态。通过上述方法,避免了唇部关键点的逐一比对,减少了数据处理量,有效提高了唇动检测的效率;同时避免了由于错误的关键点匹配结果造成的错误的 唇动状态检测结果,有效提高了唇动检测的准确率。
在第一方面的一种可能的实现方式中,所述检测目标视频的第t帧图像中目标人脸上的唇部关键点,获得唇部关键点信息,包括:
将所述目标视频的所述第t帧图像输入到训练后到关键点检测模型中,获得所述唇部关键点信息;
其中,所述关键点检测模型为基于预设的对数损失函数训练后到检测模型,所述对数损失函数为
Figure PCTCN2021125042-appb-000001
所述x为损失值,所述ω、所述∈和所述C为预设参数。
在第一方面的一种可能的实现方式中,所述根据所述唇部关键点信息计算当前唇距,包括:
根据所述唇部关键点信息确定所述第t帧图像中所述目标人脸上的所述唇部区域;
判断所述唇部区域是否存在遮挡;
若所述唇部区域未存在遮挡,则根据所述唇部关键点信息计算所述唇部区域对应的所述当前唇距。
在第一方面的一种可能的实现方式中,所述唇部关键点信息包括多个唇部关键点各自的像素坐标;
所述根据所述唇部关键点信息确定所述第t帧图像中所述目标人脸上的所述唇部区域,包括:
根据所述多个唇部关键点各自的像素坐标确定唇部中心点;
根据预设规则和所述唇部中心点确定所述第t帧图像中所述目标人脸上的所述唇部区域。
在第一方面的一种可能的实现方式中,所述判断所述唇部区域是否存在遮挡,包括:
提取所述第t帧图像中所述唇部区域的方向梯度直方图特征信息;
将所述方向梯度直方图特征信息输入到训练后的支持向量机判别器中,输出判断结果,其中,所述判断结果包括存在遮挡或未存在遮挡。
在第一方面的一种可能的实现方式中,所述若所述唇部区域未存在遮挡,则根据所述唇部关键点信息计算所述唇部区域对应的所述当前唇距,包括:
将所述唇部关键点划分为M对关键点,其中,每对关键点中包括一个上唇关键点和一个下唇关键点,所述M为正整数;
通过公式
Figure PCTCN2021125042-appb-000002
计算所述唇部区域对应的所述当前唇距,其中,所述lipDist表示所述当前唇距,所述(x down_i,y down_i)表示第i对关键点中所 述下唇关键点的像素坐标,所述(x up_i,y up_i)表示第i对关键点中所述上唇关键点的像素坐标。
在第一方面的一种可能的实现方式中,所述根据所述当前唇距和所述历史唇距之间的唇距差值确定唇动检测结果,包括:
对所述当前唇距进行卡尔曼滤波处理,获得滤波后的所述当前唇距;
根据所述滤波后的所述当前唇距和所述历史唇距之间的唇距差值确定所述唇动检测结果。
在第一方面的一种可能的实现方式中,所述根据所述当前唇距和所述历史唇距之间的唇距差值确定唇动检测结果,包括:
检测所述第t帧图像中目标人脸上的人脸关键点,获得人脸关键点信息;
根据所述人脸关键点信息确定所述第t帧图像中的人脸区域;
根据所述人脸区域在所述第t帧图像中所占的面积比例确定调整权值;
根据所述调整权值调整所述当前唇距,获得调整后的所述当前唇距;
根据所述调整后的所述当前唇距和所述历史唇距之间的唇距差值确定所述唇动检测结果。
第二方面,本申请实施例提供了一种唇动检测装置,包括:
关键点检测单元,用于检测目标视频的第t帧图像中目标人脸上的唇部关键点,获得唇部关键点信息,所述t为大于1的正整数;
唇距计算单元,用于根据所述唇部关键点信息计算当前唇距,其中,所述当前唇距表示所述第t帧图像中所述目标人脸上的唇部区域对应的上下唇距离;
历史数据获取单元,用于获取历史唇距,其中,所述历史唇距表示所述目标视频的第t-n帧图像中所述目标人脸上的所述唇部区域对应的上下唇距离,所述n为小于t的正整数;
唇动检测单元,用于根据所述当前唇距和所述历史唇距之间的唇距差值确定唇动检测结果。
第三方面,本申请实施例提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如上述第一方面中任一项所述的唇动检测方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如上述第一方面中任一项所述的唇动检测方法。
第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备 上运行时,使得终端设备执行上述第一方面中任一项所述的唇动检测方法。
可以理解的是,上述第二方面至第五方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的唇动检测方法的流程示意图;
图2是本申请实施例提供的人脸关键点的示意图;
图3是本申请实施例提供的损失函数的曲线示意图;
图4是本申请实施例提供的唇动检测装置的结构框图;
图5是本申请实施例提供的终端设备的结构示意图。
本发明的实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
如在本申请说明书和所附权利要求书中所使用的那样,术语“若”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。
参见图1,是本申请实施例提供的唇动检测方法的流程示意图,作为示例而非限定,所述方法可以包括以下步骤:
S101,检测目标视频的第t帧图像中目标人脸上的唇部关键点,获得唇部关键点信息。
t为大于1的正整数。
本申请实施例中的唇动检测方法是基于视频流进行检测的。首先需要检测出目标视频中各帧图像中的目标人脸,为了关联前后帧的目标人脸,可以引入人脸跟踪。对于跟踪到目标人脸的每一帧图像,检测该帧图像中的唇部关键点。
在一个实施例中,唇部关键点的检测方法可以为:将目标视频的第t帧图像输入到训练后到关键点检测模型中,获得唇部关键点信息。
可选的,关键点检测模型可以用于检测图像中目标人脸上的唇部区域,获得唇部关键点信息。
这种情况下,训练关键点检测模型时,只需对样本图像中人脸的唇部区域进行标注即可,无需标注人脸其他部分的关键点,可以减少标准工作量。但是,由于这种方式仅检测唇部区域,而忽视了人脸各个部分之间的关联,检测出的唇部关键点的位置很容易发生偏差,导致检测出的唇部关键点信息的准确性较低。
为了提高唇部关键点信息的准确性,可选的,关键点检测模型用于检测图像中的目标人脸,获得人脸关键点信息;然后根据人脸关键点信息确定唇部关键点信息。
关键点的质量决定着唇动检测结果的准确性。人脸关键点的检测质量,又与数据集高度相关。如68个人脸关键点点的数据集唇部点比较少,不太适合展开做后续的唇距判断;还有就是常用的106个人脸关键点,标注相对粗糙,注重了整体的分布而忽略了唇部的精定位,导致说话的时候唇部关键点基本没什么变化。
优选的,本申请实施例中采用WFLW98个人脸关键点,该类型的标注能比较好地反应唇部关键点的变化。示例性的,参见图2,是本申请实施例提供的人脸关键点的示意图。如图2所示,将第t帧图像输入到关键点检测模型中,输出第t帧图像中目标人脸上的人脸关键点0-97。根据预先的标注规则,可以确定检测出的0-97个人脸关键点中76-95这20个关键点为唇部关键点,即确定出唇部关键点信息。
这种情况下,训练关键点检测模型时,需要对样本图像中人脸上各个部位的关键点进行标注。如上示例中所述的98个人脸关键点的关键点检测模型,在训练时,需要标注98个人脸关键点。
现有技术中,通常是用dlib方法进行关键点检测的。但是dlib方法对大角度图像(如图像中的人脸为侧脸、低头或抬头的姿态)中关键点的检测效果较差,容易产生干扰,且对细微差异的响应较迟缓。
为了解决上述问题,在本申请实施例中,在训练关键点检测模型时,采用预设的对数损失函数。
参见图3,是本申请实施例提供的损失函数的曲线示意图。如图3所示,曲线I为指数函数的曲线,曲线II为对数函数的曲线。从图3中可以看出,当x值较小(表示损失值较小,即差异较小)时,对数函数的响应比指数函数的响应要灵敏。因此,利用对数函数作为损失函数对关键点检测模型进行训练,能够提高关键点检测结果的精确度。
针对大角度预测的偏差,可选的,可以加大大角度的预测权重,使训练大角度的时候能够得到更好的弥补。具体的,预设的对数损失函数为:
Figure PCTCN2021125042-appb-000003
x为损失值,ω、∈和C为预设参数。
其中,ω为预测权重。当图像中人脸为侧脸、低头或抬头等大角度图像时,增加ω的值;反之,减小ω的值。通过这种方法,能够有效减小大角度的预测偏差。
关键点检测模型可以采用现有的神经网络模型,如mobilenetv2等。为了提高检测效率,可以对mobilenetv2进行通道剪裁。另外,在训练过程中,还可以进行随机的水平镜像增强、光线扰动增强和/或运动模糊增强。这样既能够更宽泛地学习到关键点特征,又能够保证视频帧检测的稳定性,还会提高关键点检测模型的鲁棒性。
S102,根据唇部关键点信息计算当前唇距。
其中,当前唇距表示第t帧图像中目标人脸上的唇部区域对应的上下唇距离。
当前唇距的一种计算方式可以为:计算唇部关键点的最大纵向距离;将最大纵向距离确定为当前唇距。具体的,选取唇部关键点中纵坐标最大的关键点,得到第一边界点;选取唇部关键点中纵坐标最小的关键点,得到第二边界点;计算第一边界点与第二边界点的纵坐标差值;将纵坐标差值确定为最大纵向距离,即当前唇距。
上述方法相当于仅选取了一对关键点进行计算,存在随机性,导致唇距计算结果的准确性较低。
为了提高唇距计算的准确性,可以选取多对关键点进行计算。可选的,当前唇距的一种计算方式为:
将唇部关键点划分为M对关键点,其中,每对关键点中包括一个上唇关键点和一个下唇关键点,M为正整数;通过公式
Figure PCTCN2021125042-appb-000004
计算当前唇距,其中,lipDist表示当前唇距,(x down_i,y down_i)表示第i对关键点中下唇关键点的像素坐标,(x up_i,y up_i)表示第i对关键点中上唇关键点的像素坐标。
示例性的,如图2所示,可以将77和87确定为一对关键点,将78和86确定为一对关键点,79和85确定为一对关键点,80和84确定为一对关键点,81和83确定为一对关键的,将89和95确定为一对关键点,将90和94确定为一对关键点,将91和93确定为 一对关键点。
由于唇部动作时,变化较大的为上唇中间部位和下唇中间部位,因此,可以选取部分唇部关键点。如图2中,可以选取上唇的89-91三个关键点,选取下唇的93-95三个关键点。然后将着6个关键点划分为3对,即将89和95确定为一对关键点,将90和94确定为一对关键点,将91和93确定为一对关键点。
实际应用中,一帧图像中目标人脸上的唇部区域有可能存在遮挡。这种情况是无法计算当前唇距的,进而导致唇动检测失效。
为了提高唇动检测方法的可行性,综合考虑各种可能出现的情况,在一个实施例中,当前唇距的一种计算方式为:
根据唇部关键点信息确定第t帧图像中目标人脸上的唇部区域;判断唇部区域是否存在遮挡;若唇部区域未存在遮挡,则根据唇部关键点信息计算唇部区域对应的当前唇距;若唇部区域存在遮挡,则获取历史唇距,并将历史唇距确定为当前唇距。
其中,唇部关键点信息包括多个唇部关键点各自的像素坐标。
可选的,唇部区域的确定方法可以包括:根据唇部关键点确定唇部区域的边界点;根据边界点确定唇部区域。
示例性的,选取唇部关键点中纵坐标最大的关键点,得到第一边界点;选取唇部关键点中纵坐标最小的关键点,得到第二边界点;选取唇部关键点中横坐标最大的关键点,得到第三边界点;选取唇部关键点中横坐标最小的关键点,得到第四边界点;根据第一边界点、第二边界点、第三边界点和第四边界点确定最小矩形,将该最小矩形确定为唇部区域。
另一示例,可以采用边界点检测方法,检测出边界点为76、77、78、79、80、81、82、83、84、85、86和87,然后根据检测出的边界点勾勒出唇部区域。
为了减少计算量,简化唇部区域的确定步骤,可选的,本申请实施例中提供唇部区域的另一种确定方法,可以包括:根据多个唇部关键点各自的像素坐标确定唇部中心点;根据预设规则和唇部中心点确定第t帧图像中目标人脸上的唇部区域。
示例性的,如图2所示,唇部关键点有76-95共20个,通过以下公式计算20个唇部关键点的唇部中心点:
Figure PCTCN2021125042-appb-000005
Figure PCTCN2021125042-appb-000006
其中,(centerpointX,centerpointY)为唇部中心点的像素坐标,(Point_x i,Point_y i)为第i个唇部关键点的像素坐标。
预设规则为:以唇部中心点为矩形中心,截取第t帧图像中一个预设尺寸的矩形区域;将该矩形区域确定为唇部区域。
其中,预设尺寸可以是预先确定的一个固定尺寸。例如:确定长为50mm,宽为30mm。
但由于个体差异,不同人脸的尺寸不同,对应的不同人脸中唇部大小也不同。利用固定尺寸确定出的唇部区域可能会存在偏差。为了解决该问题,可选的,预设尺寸可以为:lip height=face height×p 1;lip weight=face weight×p 2
其中,lip height为唇部区域的宽,lip weight为唇部区域的长,face height为目标人脸对应区域的宽,lip weight为目标人脸对应区域的长,p 1和p 2为预设比例。例如:p 1=0.3,p 2=0.5。通过这种方法,能够根据目标人脸的尺寸适应性地确定唇部区域的大小。
在确定唇部区域之后,需要判断唇部区域是否存在遮挡。
在一个实施例中,判断唇部区域是否存在遮挡的方法可以包括:提取第t帧图像中唇部区域的方向梯度直方图特征信息;将方向梯度直方图特征信息输入到训练后的支持向量机判别器中,输出判断结果,其中,判断结果包括存在遮挡或未存在遮挡。
当然,也可以提取其他特征信息、采用其他的判别器。在此不做具体限定。
在确定唇部区域未被遮挡的情况下,根据唇部关键点信息计算唇部区域对应的当前唇距。具体方法可参见S102中计算当前唇距的方法,在此不再赘述。
S103,获取历史唇距。
其中,历史唇距表示目标视频的第t-n帧图像中目标人脸上的唇部区域对应的上下唇距离,n为小于t的正整数。
在本申请实施例中,历史唇距的计算方式与当前唇距的计算方式相同,具体可参见S102中当前唇距的计算方式,在此不再赘述。
示例性的,t=3,n=1。当前唇距为第3帧图像中目标人脸上的唇部区域对应的上下唇距离;历史唇距为第2帧图像中目标人脸上的唇部区域对应的上下唇距离。
有时计算资源充足,计算整套算法的速度很快,可能相邻帧之间的唇动特征并不明显,在跟踪过程中需要进行跳帧判断,如每3帧统计唇距变化、获得唇动的效果。大部分机器人算力都比较有限,无需跳帧就能捕捉到唇距的变化。
S104,根据当前唇距和历史唇距之间的唇距差值确定唇动检测结果。
本申请实施例中,对于目标视频中的第1帧图像,由于无历史唇距,因此可以只计算并存储唇距,无需进行唇动检测。从第2帧图像开始进行唇动检测。
可以设置唇动阈值。当唇距差值大于唇动阈值时,表示发生唇动;当唇动差值小于或等于唇动阈值时,表示未发生唇动。
当需要控制检测灵敏度时,可以适当地调整唇动阈值。需要说明的是,当唇动阈值较低时,也可能发生虚警;而唇动阈值较大时,检测精度又较低。因此,需要合理的设定唇动阈值。
唇动检测时,可能会由于关键点抖动造成唇距计算误差,进而导致唇动误检。为了提高检测准确率,在一个实施例中,S104的一种实现方式包括:对当前唇距进行卡尔曼滤波处理,获得滤波后的当前唇距;根据滤波后的当前唇距和历史唇距之间的唇距差值确定唇动检测结果。
另外,由于人脸距摄像头的距离的远近会影响唇距计算的偏差,离得近唇距变化就大,离得远唇距变化就小。为了减少这种偏差,在一个实施例中,S104的另一种实现方式包括:检测第t帧图像中目标人脸上的人脸关键点,获得人脸关键点信息;根据人脸关键点信息确定第t帧图像中的人脸区域;根据人脸区域在第t帧图像中所占的面积比例确定调整权值;根据调整权值调整当前唇距,获得调整后的当前唇距;根据调整后的当前唇距和历史唇距之间的唇距差值确定唇动检测结果。
示例性的,可以预先设定,人脸区域在整幅图像所占的面积比例的几个范围,然后设定每个范围对应的调整权值。假设计算出的第t帧图像中人脸区域在第t帧图像中所占的面积比例为0.5,对应的调整权值为0.8,那么将当前唇距乘以0.8,得到调整后的当前唇距。
当然,还可以综合考虑由于关键点抖动造成唇距计算误差,和由于人脸距摄像头的距离的远近会影响唇距计算的偏差。在一个实施例中,S104的另一种实现方式包括:
检测第t帧图像中目标人脸上的人脸关键点,获得人脸关键点信息;根据人脸关键点信息确定第t帧图像中的人脸区域;根据人脸区域在第t帧图像中所占的面积比例确定调整权值;根据调整权值调整当前唇距,获得调整后的当前唇距;对调整后的当前唇距进行卡尔曼滤波处理,获得滤波后的当前唇距;根据滤波后的当前唇距和历史唇距之间的唇距差值确定唇动检测结果。
可选的,还可以改变调整权值处理和滤波的顺序,即S104的另一种实现方式包括:对当前唇距进行卡尔曼滤波处理,获得滤波后的当前唇距;检测第t帧图像中目标人脸上的人脸关键点,获得人脸关键点信息;根据人脸关键点信息确定第t帧图像中的人脸区域;根据人脸区域在第t帧图像中所占的面积比例确定调整权值;根据调整权值调整滤波后的当前唇距,获得调整后的当前唇距;根据调整后的当前唇距和历史唇距之间的唇距差值确定唇动检测结果。
在本申请实施例中,根据检测出的唇部关键点计算上下唇距离(即唇距),然后通过对比前后两帧图像各自对应的唇距确定前后两帧图像之间唇距是否发生了变化,根据唇距的变化情况确定唇动状态。通过上述方法,避免了唇部关键点的逐一比对,减少了数据处理量,有效提高了唇动检测的效率;同时避免了由于错误的关键点匹配结果造成的错误的唇动状态检测结果,有效提高了唇动检测的准确率。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
对应于上文实施例所述的唇动检测方法,图4是本申请实施例提供的唇动检测装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。
参照图4,该装置包括:
关键点检测单元41,用于检测目标视频的第t帧图像中目标人脸上的唇部关键点,获得唇部关键点信息,所述t为大于1的正整数。
唇距计算单元42,用于根据所述唇部关键点信息计算当前唇距,其中,所述当前唇距表示所述第t帧图像中所述目标人脸上的唇部区域对应的上下唇距离。
历史数据获取单元43,用于获取历史唇距,其中,所述历史唇距表示所述目标视频的第t-n帧图像中所述目标人脸上的所述唇部区域对应的上下唇距离,所述n为小于t的正整数。
唇动检测单元44,用于根据所述当前唇距和所述历史唇距之间的唇距差值确定唇动检测结果。
可选的,关键点检测单元41还用于:
将所述目标视频的所述第t帧图像输入到训练后到关键点检测模型中,获得所述唇部关键点信息;其中,所述关键点检测模型为基于预设的对数损失函数训练后到检测模型,所述对数损失函数为
Figure PCTCN2021125042-appb-000007
所述x为损失值,所述ω、所述∈和所述C为预设参数。
可选的,唇距计算单元42包括:
唇部区域确定模块,用于根据所述唇部关键点信息确定所述第t帧图像中所述目标人脸上的所述唇部区域。
遮挡判断模块,用于判断所述唇部区域是否存在遮挡。
唇距计算模块,用于若所述唇部区域未存在遮挡,则根据所述唇部关键点信息计算所述唇部区域对应的所述当前唇距。
其中,唇部关键点信息包括多个唇部关键点各自的像素坐标。
可选的,唇部区域确定模块还用于:
根据所述多个唇部关键点各自的像素坐标确定唇部中心点;根据预设规则和所述唇部中心点确定所述第t帧图像中所述目标人脸上的所述唇部区域。
可选的,遮挡判断模块还用于:
提取所述第t帧图像中所述唇部区域的方向梯度直方图特征信息;将所述方向梯度直 方图特征信息输入到训练后的支持向量机判别器中,输出判断结果,其中,所述判断结果包括存在遮挡或未存在遮挡。
可选的,唇距计算模块还用于:
将所述唇部关键点划分为M对关键点,其中,每对关键点中包括一个上唇关键点和一个下唇关键点,所述M为正整数;通过公式
Figure PCTCN2021125042-appb-000008
计算所述唇部区域对应的所述当前唇距,其中,所述lipDist表示所述当前唇距,所述(x down_i,y down_i)表示第i对关键点中所述下唇关键点的像素坐标,所述(x up_i,y up_i)表示第i对关键点中所述上唇关键点的像素坐标。
可选的,唇动检测单元44还用于:
对所述当前唇距进行卡尔曼滤波处理,获得滤波后的所述当前唇距;根据所述滤波后的所述当前唇距和所述历史唇距之间的唇距差值确定所述唇动检测结果。
可选的,唇动检测单元44还用于:
检测所述第t帧图像中目标人脸上的人脸关键点,获得人脸关键点信息;根据所述人脸关键点信息确定所述第t帧图像中的人脸区域;根据所述人脸区域在所述第t帧图像中所占的面积比例确定调整权值;根据所述调整权值调整所述当前唇距,获得调整后的所述当前唇距;根据所述调整后的所述当前唇距和所述历史唇距之间的唇距差值确定所述唇动检测结果。
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。
另外,图4所示的唇动检测装置可以是内置于现有的终端设备内的软件单元、硬件单元、或软硬结合的单元,也可以作为独立的挂件集成到所述终端设备中,还可以作为独立的终端设备存在。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
图5是本申请实施例提供的终端设备的结构示意图。如图5所示,该实施例的终端设备5包括:至少一个处理器50(图5中仅示出一个)处理器、存储器51以及存储在所述存储器51中并可在所述至少一个处理器50上运行的计算机程序52,所述处理器50执行所述计算机程序52时实现上述任意各个唇动检测方法实施例中的步骤。
所述终端设备可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。该终端设备可包括,但不仅限于,处理器、存储器。本领域技术人员可以理解,图5仅仅是终端设备5的举例,并不构成对终端设备5的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。
所称处理器50可以是中央处理单元(Central Processing Unit,CPU),该处理器50还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器51在一些实施例中可以是所述终端设备5的内部存储单元,例如终端设备5的硬盘或内存。所述存储器51在另一些实施例中也可以是所述终端设备5的外部存储设备,例如所述终端设备5上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器51还可以既包括所述终端设备5的内部存储单元也包括外部存储设备。所述存储器51用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器51还可以用于暂时地存储已经输出或者将要输出的数据。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。
本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行时实现可实现上述各个方法实施例中的步骤。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可 以包括:能够将计算机程序代码携带到装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (10)

  1. 一种唇动检测方法,其特征在于,所述方法包括:
    检测目标视频的第t帧图像中目标人脸上的唇部关键点,获得唇部关键点信息,所述t为大于1的正整数;
    根据所述唇部关键点信息计算当前唇距,其中,所述当前唇距表示所述第t帧图像中所述目标人脸上的唇部区域对应的上下唇距离;
    获取历史唇距,其中,所述历史唇距表示所述目标视频的第t-n帧图像中所述目标人脸上的所述唇部区域对应的上下唇距离,所述n为小于t的正整数;
    根据所述当前唇距和所述历史唇距之间的唇距差值确定唇动检测结果。
  2. 如权利要求1所述的唇动检测方法,其特征在于,所述检测目标视频的第t帧图像中目标人脸上的唇部关键点,获得唇部关键点信息,包括:
    将所述目标视频的所述第t帧图像输入到训练后到关键点检测模型中,获得所述唇部关键点信息;
    其中,所述关键点检测模型为基于预设的对数损失函数训练后到检测模型,所述对数损失函数为
    Figure PCTCN2021125042-appb-100001
    所述x为损失值,所述ω、所述ε和所述C为预设参数。
  3. 如权利要求1所述的唇动检测方法,其特征在于,所述根据所述唇部关键点信息计算当前唇距,包括:
    根据所述唇部关键点信息确定所述第t帧图像中所述目标人脸上的所述唇部区域;
    判断所述唇部区域是否存在遮挡;
    若所述唇部区域未存在遮挡,则根据所述唇部关键点信息计算所述唇部区域对应的所述当前唇距。
  4. 如权利要求3所述的唇动检测方法,其特征在于,所述唇部关键点信息包括多个唇部关键点各自的像素坐标;
    所述根据所述唇部关键点信息确定所述第t帧图像中所述目标人脸上的所述唇部区域,包括:
    根据所述多个唇部关键点各自的像素坐标确定唇部中心点;
    根据预设规则和所述唇部中心点确定所述第t帧图像中所述目标人脸上的所述唇部区域。
  5. 如权利要求3所述的唇动检测方法,其特征在于,所述判断所述唇部区域是否存在遮挡,包括:
    提取所述第t帧图像中所述唇部区域的方向梯度直方图特征信息;
    将所述方向梯度直方图特征信息输入到训练后的支持向量机判别器中,输出判断结果,其中,所述判断结果包括存在遮挡或未存在遮挡。
  6. 如权利要求3所述的唇动检测方法,其特征在于,所述若所述唇部区域未存在遮挡,则根据所述唇部关键点信息计算所述唇部区域对应的所述当前唇距,包括:
    将所述唇部关键点划分为M对关键点,其中,每对关键点中包括一个上唇关键点和一个下唇关键点,所述M为正整数;
    通过公式
    Figure PCTCN2021125042-appb-100002
    计算所述唇部区域对应的所述当前唇距,其中,所述lipDist表示所述当前唇距,所述(x down_i,y down_i)表示第i对关键点中所述下唇关键点的像素坐标,所述(x up_i,y up_i)表示第i对关键点中所述上唇关键点的像素坐标。
  7. 如权利要求1所述的唇动检测方法,其特征在于,所述根据所述当前唇距和所述历史唇距之间的唇距差值确定唇动检测结果,包括:
    对所述当前唇距进行卡尔曼滤波处理,获得滤波后的所述当前唇距;
    根据所述滤波后的所述当前唇距和所述历史唇距之间的唇距差值确定所述唇动检测结果。
  8. 如权利要求1所述的唇动检测方法,其特征在于,所述根据所述当前唇距和所述历史唇距之间的唇距差值确定唇动检测结果,包括:
    检测所述第t帧图像中目标人脸上的人脸关键点,获得人脸关键点信息;
    根据所述人脸关键点信息确定所述第t帧图像中的人脸区域;
    根据所述人脸区域在所述第t帧图像中所占的面积比例确定调整权值;
    根据所述调整权值调整所述当前唇距,获得调整后的所述当前唇距;
    根据所述调整后的所述当前唇距和所述历史唇距之间的唇距差值确定所述唇动检测结果。
  9. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至8任一项所述的方法。
  10. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至8任一项所述的方法。
PCT/CN2021/125042 2021-03-29 2021-10-20 唇动检测方法、装置、终端设备及计算机可读存储介质 WO2022205843A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110333133.0A CN112966654B (zh) 2021-03-29 2021-03-29 唇动检测方法、装置、终端设备及计算机可读存储介质
CN202110333133.0 2021-03-29

Publications (1)

Publication Number Publication Date
WO2022205843A1 true WO2022205843A1 (zh) 2022-10-06

Family

ID=76278790

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/125042 WO2022205843A1 (zh) 2021-03-29 2021-10-20 唇动检测方法、装置、终端设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN112966654B (zh)
WO (1) WO2022205843A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112966654B (zh) * 2021-03-29 2023-12-19 深圳市优必选科技股份有限公司 唇动检测方法、装置、终端设备及计算机可读存储介质
CN113822205A (zh) * 2021-09-26 2021-12-21 北京市商汤科技开发有限公司 会议记录生成方法、装置、电子设备以及存储介质
CN117671549A (zh) * 2022-08-17 2024-03-08 马上消费金融股份有限公司 唇动检测方法和装置、存储介质和电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105139503A (zh) * 2015-10-12 2015-12-09 北京航空航天大学 一种唇动口型识别门禁系统及识别方法
CN110750152A (zh) * 2019-09-11 2020-02-04 云知声智能科技股份有限公司 一种基于唇部动作的人机交互方法和系统
CN111259711A (zh) * 2018-12-03 2020-06-09 北京嘀嘀无限科技发展有限公司 一种识别唇动的方法和系统
CN111582195A (zh) * 2020-05-12 2020-08-25 中国矿业大学(北京) 一种汉语唇语单音节识别分类器构建方法
CN112966654A (zh) * 2021-03-29 2021-06-15 深圳市优必选科技股份有限公司 唇动检测方法、装置、终端设备及计算机可读存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5625704A (en) * 1994-11-10 1997-04-29 Ricoh Corporation Speaker recognition using spatiotemporal cues
CN106919891B (zh) * 2015-12-26 2019-08-23 腾讯科技(深圳)有限公司 一种图像处理方法及装置
CN107633204B (zh) * 2017-08-17 2019-01-29 平安科技(深圳)有限公司 人脸遮挡检测方法、装置及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105139503A (zh) * 2015-10-12 2015-12-09 北京航空航天大学 一种唇动口型识别门禁系统及识别方法
CN111259711A (zh) * 2018-12-03 2020-06-09 北京嘀嘀无限科技发展有限公司 一种识别唇动的方法和系统
CN110750152A (zh) * 2019-09-11 2020-02-04 云知声智能科技股份有限公司 一种基于唇部动作的人机交互方法和系统
CN111582195A (zh) * 2020-05-12 2020-08-25 中国矿业大学(北京) 一种汉语唇语单音节识别分类器构建方法
CN112966654A (zh) * 2021-03-29 2021-06-15 深圳市优必选科技股份有限公司 唇动检测方法、装置、终端设备及计算机可读存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
FENG ZHEN-HUA; KITTLER JOSEF; AWAIS MUHAMMAD; HUBER PATRIK; WU XIAO-JUN: "Wing Loss for Robust Facial Landmark Localisation with Convolutional Neural Networks", 2018 IEEE/CVF CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION, IEEE, 18 June 2018 (2018-06-18), pages 2235 - 2245, XP033476189, DOI: 10.1109/CVPR.2018.00238 *

Also Published As

Publication number Publication date
CN112966654B (zh) 2023-12-19
CN112966654A (zh) 2021-06-15

Similar Documents

Publication Publication Date Title
US11423695B2 (en) Face location tracking method, apparatus, and electronic device
WO2022205843A1 (zh) 唇动检测方法、装置、终端设备及计算机可读存储介质
US11164323B2 (en) Method for obtaining image tracking points and device and storage medium thereof
CN107886048B (zh) 目标跟踪方法及系统、存储介质及电子终端
US10628961B2 (en) Object tracking for neural network systems
US20190370551A1 (en) Object detection and tracking delay reduction in video analytics
US10242447B2 (en) Video processing system and method for deformation and occlusion resistant object tracking in video content
US20110311100A1 (en) Method, Apparatus and Computer Program Product for Providing Object Tracking Using Template Switching and Feature Adaptation
US20230334235A1 (en) Detecting occlusion of digital ink
US20210342593A1 (en) Method and apparatus for detecting target in video, computing device, and storage medium
EP3940633B1 (en) Image alignment method and apparatus, electronic device, and storage medium
CN111667504B (zh) 一种人脸追踪方法、装置及设备
WO2014074959A1 (en) Real-time face detection using pixel pairs
US11238309B2 (en) Selecting keypoints in images using descriptor scores
US10354142B2 (en) Method for holographic elements detection in video stream
CN113298852A (zh) 目标跟踪方法、装置、电子设备及计算机可读存储介质
US9317770B2 (en) Method, apparatus and terminal for detecting image stability
WO2021179905A1 (en) Motion blur robust image feature descriptor
TWI736063B (zh) 物件偵測方法以及電子裝置
CN113762027A (zh) 一种异常行为的识别方法、装置、设备及存储介质
CN115210758A (zh) 运动模糊稳健的图像特征匹配
CN112926356B (zh) 一种目标跟踪方法和装置
CN109427067A (zh) 图像处理方法、装置及计算机可读存储介质
CN117745757A (zh) 目标跟踪的方法、装置、终端设备及存储介质
CN112581493A (zh) 静态标志检测方法、装置、智能终端及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21934479

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21934479

Country of ref document: EP

Kind code of ref document: A1