Method and device for obtaining 3D coordinates of facial key points and 3D facial model

By obtaining the coordinates of 2D key points in the monocular image and combining it with the 3D facial model, the problem in the existing technology that it is difficult to obtain the 3D coordinates of the key points of the face at low cost is solved, achieving accurate and accurate detection without installing additional equipment. Convenient 3D coordinate acquisition improves the accuracy and real-time performance of describing the target object's face.

CN111985384BActive Publication Date: 2024-09-24SHENZHEN HORIZON ROBOTICS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010819406.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-14
Publication Date
2024-09-24
Estimated Expiration
2040-08-14

AI Technical Summary

Technical Problem

It is difficult to obtain the 3D coordinates of facial key points of a target object at low cost, conveniently and accurately with existing technology, especially without installing additional equipment.

Method used

By obtaining the coordinates of the 2D key points in the monocular image, and using the preset 3D facial model and configuration parameters of the camera device, the 3D coordinates of the 2D key points in the three-dimensional coordinate system are determined, and the general 3D face is calculated using the model scaling coefficient. The model is adjusted to obtain an accurate 3D face model.

Benefits of technology

It is possible to accurately obtain the 3D coordinates of the target object's facial key points without increasing the cost and space occupation, and improves the accuracy and real-time performance of describing the target object's face.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111985384B
    Figure CN111985384B
Patent Text Reader

Abstract

Disclosed are a method and device for obtaining 3D coordinates of facial key points and a 3D face model, wherein the method for obtaining 3D coordinates of facial key points includes: obtaining at least one 2D key point coordinate located on the face of a target object in an image; wherein the image is a monocular image; determining the first 3D coordinates of the facial key points in the 3D face model of the target object corresponding to each of the at least one 2D key point coordinates to obtain at least one first 3D coordinate; and determining the second 3D coordinates of the at least one 2D key point coordinate in the three-dimensional coordinate system where the camera device is located according to the at least one 2D key point coordinate, the at least one first 3D coordinate and the configuration parameters of the camera device that captures the image. The technical solution provided by the present disclosure is conducive to obtaining the 3D coordinates of the facial key points of the target object in a low-cost, convenient and accurate manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to computer vision technology, and more particularly to a method for acquiring 3D coordinates of facial key points, a device for acquiring 3D coordinates of facial key points, a method for determining a 3D facial model, a device for determining a 3D facial model, a storage medium, and an electronic device. Background Art

[0002] In some computer vision applications, it is often necessary to obtain the 3D coordinates of the target object's facial key points (e.g., eyeball key points, etc.). For example, in a DMS (Driver Monitor System), it is often necessary to determine the driver's line of sight based on the 3D coordinates of the driver's eyeball key points.

[0003] How to obtain the 3D coordinates of the target object's facial key points in a low-cost, convenient and accurate manner is a technical issue worthy of attention. Summary of the invention

[0004] In order to solve the above technical problems, the present disclosure is proposed. The embodiments of the present disclosure provide a method for obtaining 3D coordinates of facial key points, an apparatus for obtaining 3D coordinates of facial key points, a method for determining a 3D facial model, an apparatus for determining a 3D facial model, a storage medium, and an electronic device.

[0005] According to a first aspect of an embodiment of the present disclosure, a method for obtaining 3D coordinates of facial key points is provided, comprising: obtaining coordinates of at least one 2D key point located on the face of a target object in an image; wherein the image is a monocular image; determining first 3D coordinates of facial key points in a 3D facial model of the target object corresponding to each of the at least one 2D key point coordinates to obtain at least one first 3D coordinate; and determining, based on the at least one 2D key point coordinate, the at least one first 3D coordinate and configuration parameters of a camera device that captures the image, second 3D coordinates of the at least one 2D key point coordinate in a three-dimensional coordinate system where the camera device is located.

[0006] According to a second aspect of an embodiment of the present disclosure, a method for determining a 3D face model is provided, comprising: obtaining a pre-set universal 3D face model for multiple target objects; obtaining a model scaling factor of a target object to be processed; scaling the universal 3D face model according to the model scaling factor to obtain the 3D face model of the target object to be processed.

[0007] According to a third aspect of an embodiment of the present disclosure, a device for acquiring 3D coordinates of facial key points is provided, comprising: a 2D coordinate acquisition module, used to acquire the coordinates of at least one 2D key point located on the face of a target object in an image; wherein the image is a monocular image; a model 3D coordinate determination module, used to determine the first 3D coordinates of the facial key points in the 3D face model of the target object corresponding to each of the at least one 2D key point coordinates acquired by the 2D coordinate acquisition module, to obtain at least one first 3D coordinate; a key point 3D coordinate determination module, used to determine the second 3D coordinate of the at least one 2D key point coordinate in the three-dimensional coordinate system where the camera device is located according to the at least one 2D key point coordinate acquired by the 2D coordinate acquisition module, the at least one first 3D coordinate obtained by the model 3D coordinate determination module and the configuration parameters of the camera device that captures the image.

[0008] According to a fourth aspect of an embodiment of the present disclosure, there is provided an apparatus for determining a 3D face model, comprising: a face model acquisition module, used to acquire a pre-set universal 3D face model for multiple target objects; a scaling system acquisition module, used to acquire a model scaling coefficient of a target object to be processed; and a model adjustment module, used to scale and adjust the universal 3D face model acquired by the face model acquisition module according to the model scaling coefficient acquired by the scaling system acquisition module, so as to acquire the 3D face model of the target object to be processed.

[0009] According to a fifth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is used to implement the above method.

[0010] According to the sixth aspect of an embodiment of the present disclosure, an electronic device is provided, which includes: a processor; a memory for storing instructions executable by the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the above method.

[0011] Based on the method and device for obtaining the 3D coordinates of facial key points and the method and device for determining the 3D facial model provided by the above embodiments of the present disclosure, by using the first 3D coordinates of at least one facial key point in the 3D facial model of the target object, the coordinates of at least one 2D key point located on the face of the target object in the monocular image captured by the camera device can be conveniently converted into 3D coordinates in the three-dimensional coordinate system where the camera device is located. By scaling and adjusting the general 3D facial model using the model scaling coefficient of the target object, a 3D facial model that can more accurately describe the facial key points of the target object can be obtained. When the 3D facial model of the target object can more accurately describe the face of the target object, the 2D key point coordinates of the face of the target object in the monocular image finally obtained by the present disclosure with the help of the 3D facial model will have better accuracy in the 3D coordinate system where the camera device is located. It can be seen that the technical solution provided by the present disclosure is conducive to obtaining the 3D coordinates of the facial key points of the target object at a low cost, conveniently and accurately.

[0012] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] By describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present disclosure will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.

[0014] Figure 1 is a schematic diagram of a scenario to which the present disclosure is applicable;

[0015] Figure 2 A flowchart of an embodiment of a method for obtaining 3D coordinates of facial key points disclosed in the present invention;

[0016] Figure 3 A flowchart of an embodiment of determining a second 3D coordinate according to the present disclosure;

[0017] Figure 4 A schematic diagram of an embodiment of a coordinate system of a 3D face model and a camera device disclosed in the present invention;

[0018] Figure 5 A flowchart of an embodiment of a method for determining a 3D face model according to the present disclosure;

[0019] Figure 6 A flowchart of an embodiment of obtaining a model scaling factor of a target object to be processed according to the present disclosure;

[0020] Figure 7 A flowchart of an embodiment of obtaining a first translation vector according to the present disclosure;

[0021] Figure 8 It is a schematic diagram of an embodiment of the present disclosure of obtaining a model scaling factor of a target object to be processed by using a plane graphic;

[0022] Fig. 9A and Fig. 9B It is a schematic diagram of another embodiment of the present disclosure for obtaining a model scaling factor of a target object to be processed by using a plane graphic;

[0023] Fig.10 A schematic diagram of the structure of an embodiment of a device for obtaining 3D coordinates of facial key points disclosed in the present invention;

[0024] Fig.11 A schematic diagram of the structure of an embodiment of the apparatus for determining a 3D face model disclosed in the present invention;

[0025] Fig.12 It is a structural diagram of an electronic device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0026] The exemplary embodiments according to the present disclosure will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described here.

[0027] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.

[0028] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.

[0029] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.

[0030] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.

[0031] In addition, the term "and / or" in this disclosure is only a description of the association relationship of associated objects, indicating that there may be three relationships, such as A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this disclosure generally indicates that the associated objects before and after are in an "or" relationship.

[0032] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0033] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0034] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0035] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.

[0036] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0037] The embodiments of the present disclosure can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems or servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.

[0038] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, target programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment. In a distributed cloud computing environment, tasks can be performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0039] SUMMARY OF THE DISCLOSURE

[0040] In the process of realizing the present disclosure, the inventors found that in applications such as determining the face height of the target object, the orientation of specific points on the face of the target object (such as eyeball key points, etc.), and the distance between specific points on the face of the target object (such as nose tip key points, etc.) and specific objects (such as dashboards in vehicles, etc.), it is often necessary to perceive the 3D coordinates of the key points of the face of the target object. If position sensing devices such as Ultra-sound sensors, ToF (Time-of-Flight) sensors, and structured-light sensors are installed in the space where the target object such as a vehicle is located, then these position sensing devices will not only occupy a certain space (for example, occupying limited vehicle space), but also increase certain costs. If the existing facilities in the space (such as monocular camera devices in vehicles, etc.) can be used to obtain the 3D coordinates of the key points of the face of the target object, the corresponding application can be conveniently realized without installing additional equipment and making full use of the existing facilities in the space.

[0041] Exemplary Overview

[0042] The technical solution for obtaining the 3D coordinates of key points of the face provided by the present disclosure can be applied to a variety of scenarios. For example, the technical solution for obtaining the 3D coordinates of key points of the face provided by the present disclosure can be applied to the application of adjusting the rearview mirror of a vehicle. Figure 1 shown.

[0043] Figure 1 In the embodiment, the vehicle 100 has two rearview mirrors located on the left and right sides of the vehicle, namely, a left rearview mirror (also referred to as a left rearview mirror) and a right rearview mirror (also referred to as a right rearview mirror), and the vehicle 100 is equipped with a DMS. Photos or videos (i.e., monocular images) taken by a monocular camera device 101 in the vehicle 100 can be provided to the DMS in real time.

[0044] When the driver is in the driving position of vehicle 100, if the driver finds that the position of the left rearview mirror or the right rearview mirror of vehicle 100 needs to be adjusted, the driver can turn on the rearview mirror adjustment function in DMS at any time, and let DMS know whether the rearview mirror to be adjusted is the left rearview mirror or the right rearview mirror of vehicle 100 through touch screen-based interaction or voice interaction.

[0045] After the DMS learns about the current rearview mirror to be adjusted, the DMS can prompt the driver to look directly at the current rearview mirror to be adjusted for a certain period of time (such as looking directly at the current rearview mirror to be adjusted for 2 seconds) through voice or text, so as to determine the 3D coordinates of the key points of the driver's eyeballs, and determine the driver's current line of sight direction based on the 3D coordinates of the key points of the driver's eyeballs. After detecting the driver's current line of sight direction, the DMS can determine the target position of the current rearview mirror to be adjusted based on the predetermined rearview angle corresponding to the rearview mirror stored in advance and the current line of sight angle of the driver currently detected. Furthermore, the DMS can generate a corresponding motor control command for the motor corresponding to the current rearview mirror to be adjusted based on the current position of the current rearview mirror to be adjusted and its target position. The motor corresponding to the current rearview mirror to be adjusted, driven by the motor control command, drives the current rearview mirror to be adjusted to rotate in the corresponding direction, thereby moving the current rearview mirror to be adjusted from the current position to the above-mentioned determined target position.

[0046] The DMS can ask the driver by voice or text whether the position of the rearview mirror to be adjusted has been adjusted to the appropriate position. If the DMS receives feedback that the position of the rearview mirror to be adjusted has been adjusted to the appropriate position, the rearview mirror adjustment process can be terminated; if the DMS receives feedback that the position of the rearview mirror to be adjusted has not been adjusted to the appropriate position, the DMS can again determine the 3D coordinates of the driver's eye key points, and further determine the driver's current line of sight direction, and then adjust the rearview mirror.

[0047] Exemplary Methods

[0048] Figure 2 FIG. 1 is a flow chart of an embodiment of a method for obtaining 3D coordinates of facial key points disclosed in the present invention. Figure 2 The method shown includes: S200, S201 and S202. Each step is described below.

[0049] S200: Obtain coordinates of at least one 2D key point located on the face of the target object in the image.

[0050] The image in the present disclosure is a monocular image, that is, the image in the present disclosure may be an image (i.e., a 2D image) captured by a monocular camera device. The monocular image may be a photo taken by a monocular camera device, or a video frame in a video taken by a monocular camera device.

[0051] The present disclosure can perform facial key point detection processing on a monocular image captured by a camera device (such as using a corresponding neural network to perform facial key point detection processing on a monocular image), thereby obtaining at least one 2D key point coordinate located on the face of the target object in the image. The at least one 2D key point coordinate located on the face of the target object in the present disclosure can also be referred to as the 2D coordinate of at least one facial key point of the target object.

[0052] At least one facial key point in the present disclosure may include: at least one of: a facial key point whose position changes with a facial expression, and a facial key point whose position does not change with a facial expression. In one example, the facial key point whose position changes with a facial expression may include: an eyelid key point, a mouth key point, and a chin key point. In another example, the facial key point whose position does not change with a facial expression may include: an eyeball key point, an inner eye corner key point, an outer eye corner key point, and a nose tip key point.

[0053] The 2D key point coordinates in the present disclosure may refer to the two-dimensional coordinates of the facial key points of the target object in the plane coordinate system of the monocular image. A 2D key point coordinate generally includes: the coordinates of the X-axis and the Y-axis of the plane coordinate system based on the monocular image.

[0054] S201, determining first 3D coordinates of facial key points in a 3D facial model of a target object corresponding to each of the at least one 2D key point coordinates, to obtain at least one first 3D coordinate.

[0055] The 3D face model of the target object in the present disclosure may refer to a 3D face model pre-set for the target object. The present disclosure may adopt the method for determining the 3D face model in the following embodiments to set the 3D face model for the target object. In addition, the present disclosure may also adopt other methods to set the 3D face model for the target object, for example, using a depth camera device to set the 3D face model for the target object. The specific process of using the depth camera device to set the 3D face model for the target object is not described in detail here.

[0056] The 3D face model of the target object in the present disclosure generally includes: a plurality of facial key points, and each facial key point has a 3D coordinate based on the 3D face model coordinate system. The facial key points in the 3D face model can be referred to as 3D face key points. The 3D face model coordinate system can be referred to as the three-dimensional coordinate system in which the 3D face model is located. In an example, the intersection O of the X-axis, Y-axis, and Z-axis in the 3D face model coordinate system can be located at any point in the 3D face model, for example, can be located at the center of gravity of the 3D face model, etc.

[0057] The 3D face model coordinate system and the plane coordinate system of the image in the present disclosure are two completely different coordinate systems, and both the 3D face model coordinate system and the plane coordinate system of the image are local coordinate systems, that is, both are not world coordinate systems.

[0058] Each 2D key point coordinate in the present disclosure usually corresponds to a respective facial key point identifier, and each facial key point in the 3D face model in the present disclosure usually also corresponds to a respective facial key point identifier. The facial key point identifier can be considered as the name of the facial key point. For example, a facial key point identifier indicates that the facial key point is a left inner corner key point, a right inner corner key point, a left outer corner key point, a right outer corner key point, a left eyeball key point, or a right eyeball key point, etc.

[0059] For any acquired 2D key point coordinates, the present disclosure can determine the facial key point in the 3D face model corresponding to the 2D key point coordinates based on the facial key point identifier corresponding to the 2D key point coordinates and the facial key point identifier corresponding to the facial key point in the 3D face model, thereby obtaining the first 3D coordinate corresponding to the 2D key point coordinates. For example, if the facial key point identifier corresponding to a 2D key point coordinate is the same as the facial key point identifier corresponding to a 3D facial key point in the 3D face model, the 3D coordinates of the 3D facial key point can be used as the first 3D coordinates corresponding to the 2D key point coordinates.

[0060] S202: Determine a second 3D coordinate of the at least one 2D key point coordinate in a three-dimensional coordinate system where the camera device is located according to the at least one 2D key point coordinate, the at least one first 3D coordinate, and configuration parameters of the camera device that captures the image.

[0061] The configuration parameters of the camera device in the present disclosure may refer to parameters pre-configured for the camera device. The configuration parameters of the camera device may include: internal parameters of the camera device (referred to as internal parameters), etc. For example, the configuration parameters of the camera device may specifically include: the focal length, optical center position, and distortion parameters (such as radial distortion parameters and tangential distortion parameters) of the camera device, etc.

[0062] The present disclosure can calculate the above-mentioned at least one 2D key point coordinate, the above-mentioned at least one first 3D coordinate and the configuration parameters of the camera device based on a predetermined algorithm, so as to convert the 2D key point coordinate into the three-dimensional coordinate system where the camera device is located. That is to say, the present disclosure can obtain the second 3D coordinate of at least one 2D key point coordinate in the three-dimensional coordinate system where the camera device is located based on the calculation result of the algorithm.

[0063] The three-dimensional coordinate system where the camera device is located in the present disclosure is a local coordinate system, that is, the three-dimensional coordinate system where the camera device is located is not a world coordinate system. The direction of the Z axis in the three-dimensional coordinate system where the camera device is located is usually the direction of the optical axis of the camera device.

[0064] The present disclosure can convert the coordinates of at least one 2D key point located on the face of the target object in the monocular image captured by the camera device into 3D coordinates in the three-dimensional coordinate system where the camera device is located by calculating the first 3D coordinates of at least one facial key point in the 3D facial model of the target object. In the case where the 3D facial model of the target object can more accurately describe the face of the target object, the accuracy of the 2D key point coordinates of the face of the target object in the monocular image finally obtained by the present disclosure with the help of the 3D facial model in the three-dimensional coordinate system where the camera device is located will be better. It can be seen that the technical solution provided by the present disclosure is conducive to obtaining the 3D coordinates of the facial key points of the target object at a low cost, conveniently and accurately.

[0065] In an optional example, the present disclosure determines an example of a second 3D coordinate of at least one 2D key point coordinate in the three-dimensional coordinate system where the camera device is located. Figure 3 and Figure 4 shown.

[0066] Figure 3 In S300, based on at least one 2D key point coordinate, at least one first 3D coordinate and internal parameters of the camera device that captures the image, a preset function is used to obtain a rotation vector and a translation vector of at least one first 3D coordinate relative to the three-dimensional coordinate system where the camera device is located.

[0067] Optional, assuming that Figure 4 The 3D face model 400 shown includes n (n is an integer greater than 1) facial key points ( Figure 4Only five facial key points are schematically shown in the figure), and these n facial key points are facial key points whose positions do not change with the facial expression, that is, the 3D face model of the present disclosure is a 3D face model formed by facial key points whose positions do not change with the facial expression. The first 3D coordinates of the five facial key points in the 3D face model 400 are 3D coordinates based on the 3D coordinate system 401 of the 3D face model 400. Under the above assumptions, the present disclosure can first obtain the 2D key point coordinates corresponding to each of the n facial key points in the image 402 ( Figure 4 Only 2D key point coordinates of 5 facial key points in image 402 are schematically shown), and these 5 2D key point coordinates are 2D coordinates based on the 2D coordinate system of image 402. In one example, the 2D coordinate system plane of image 402 is parallel to the X'O'Y' plane in the three-dimensional coordinate system 403 of the camera device. The present disclosure can use n 2D key point coordinates, n first 3D coordinates and internal parameters of the camera device, and use a preset function to calculate the rotation vector and translation vector of the n first 3D coordinates relative to the three-dimensional coordinate system where the camera device is located, that is, the rotation vector and translation vector of each 3D coordinate.

[0068] Optionally, the preset function of the present disclosure may be a solvePnP (solve Perspective-n-Points) algorithm. The present disclosure may substitute at least one 2D key point coordinate, at least one first 3D coordinate, and the internal parameters of the camera device that captures the image into the solvePnP algorithm, respectively, and by solving the algorithm, obtain the rotation vector R and translation vector T of at least one first 3D coordinate relative to the three-dimensional coordinate system where the camera device is located. The rotation vector R and translation vector T obtained by the present disclosure may represent the head posture of the target object in the image 402, that is, the rotation vector R and translation vector T may represent the rotation and translation of the head of the target object in the image 402 in the three-dimensional coordinate system of the camera device. The translation vector in the present disclosure may also be referred to as a displacement vector. The algorithm solution process is not described in detail here.

[0069] Optionally, a rotation vector in the present disclosure may include: a rotation component relative to the X' coordinate axis in the three-dimensional coordinate system where the camera device is located, a rotation component relative to the Y' coordinate axis in the three-dimensional coordinate system where the camera device is located, and a rotation component relative to the Z' coordinate axis in the three-dimensional coordinate system where the camera device is located.

[0070] Optionally, a translation vector in the present disclosure may include: a translation component relative to the X' coordinate axis in the three-dimensional coordinate system where the camera device is located, a translation component relative to the Y' coordinate axis in the three-dimensional coordinate system where the camera device is located, and a translation component relative to the Z' coordinate axis in the three-dimensional coordinate system where the camera device is located (i.e., a translation component in the depth direction).

[0071] S301 , determining a second 3D coordinate of at least one 2D key point coordinate in a three-dimensional coordinate system where a camera device is located according to at least one first 3D coordinate, the rotation vector and the translation vector.

[0072] Optionally, for any facial key point in the 3D facial model of the target object, the present disclosure may perform rotation and translation processing on the first 3D coordinate of the facial key point based on the rotation vector and translation vector of the facial key point obtained as described above, and the present disclosure may use the result of the rotation and translation processing as the second 3D coordinate of the 2D key point coordinate corresponding to the facial key point in the three-dimensional coordinate system where the camera device is located.

[0073] The present disclosure uses a preset function to solve the rotation vector and translation vector of each first 3D coordinate, and uses the rotation vector and translation vector to convert the 3D coordinates of the key points of the face in the 3D face model of the target object into the 3D coordinates in the three-dimensional coordinate system where the camera device is located, so that the 3D coordinates of the key points of the face of the target object can be obtained without setting up additional equipment. Since the computing resources occupied by the solving process of the preset functions such as solvePnP are very limited, and the accuracy of the calculation results is relatively good, the present disclosure is conducive to obtaining the 3D coordinates of the key points of the face of the target object at a low cost, conveniently and accurately.

[0074] The 3D face model of the target object used in the above method embodiment can be set using the method for determining a 3D face model provided in the present disclosure, and the process of an embodiment of the method for determining a 3D face model in the present disclosure is as follows: Figure 5 shown.

[0075] Figure 5 In step S500, a pre-set universal 3D face model for multiple target objects is obtained.

[0076] The universal 3D face model in the present disclosure is oriented to multiple target objects, that is, the universal 3D face model is not set for a specific target object, and the universal 3D face model has universal applicability.

[0077] In one example, the present disclosure may first obtain 3D facial models of each of the multiple target objects, and perform fusion processing (such as mean calculation processing, etc.) on the multiple 3D facial models to form a universal 3D facial model. The universal 3D facial model formed in this way may also be called an average 3D facial model. The present disclosure does not limit the method of obtaining the 3D facial models of each of the multiple target objects. For example, the 3D facial models of each of the multiple target objects may be read from a facial model set. The present disclosure does not limit the setting method of the 3D facial models of the multiple target objects obtained in advance. For example, the 3D facial models of the multiple target objects may all be set based on the depth camera device. In addition, the universal 3D facial model in the present disclosure may also be an initialized 3D facial model with default settings.

[0078] It should be noted that the multiple target objects involved in the process of establishing the universal 3D face model do not limit the target objects facing the universal 3D face model. In other words, the target objects facing the universal 3D face model may be unrelated to the multiple target objects involved in the process of establishing the universal 3D face model.

[0079] S501: Obtain a model scaling factor of a target object to be processed.

[0080] The target object to be processed in the present disclosure may refer to a target object for which a 3D face model needs to be set. For example, Figure 2 The target object in the process shown can be used as the target object to be processed in this process. The model scaling factor in the present disclosure may refer to a parameter used to adjust the size of a general 3D face model. Each target object to be processed has its own model scaling factor, and the model scaling factors of any two different target objects to be processed may be the same or different. In an example, the model scaling factor of the target object to be processed in the present disclosure may range from [0.9, 1.1].

[0081] S502: scaling the general 3D face model according to the above model scaling coefficient to obtain a 3D face model of the target object to be processed.

[0082] The present disclosure uses the model scaling coefficient to scale the universal 3D face model, which can be considered as: adjusting the coordinates of each facial key point in the universal 3D face model in the universal 3D face model coordinate system, thereby obtaining a new 3D face model, which is the 3D face model of the target object to be processed. The 3D face model of the target object to be processed usually has the same three-dimensional coordinate system as the universal 3D face model, and both are local coordinate systems.

[0083] The present disclosure can conveniently obtain a 3D face model that can more accurately describe the facial key points of the target object by scaling the universal 3D face model using the model scaling coefficient of the target object. Since the present disclosure can conveniently obtain a more accurate 3D face model using a monocular camera device without installing additional equipment, the present disclosure finally obtains the 2D key point coordinates of the target object's face in the monocular image with the help of the 3D face model. The accuracy of the 3D coordinates in the three-dimensional coordinate system where the camera device is located will be better, effectively reducing the error of the 3D coordinates (in an actual test, the error of the 3D coordinates obtained using the 3D face model of the present disclosure is half of the error of the 3D coordinates obtained using the universal 3D face model), and has good real-time performance and low implementation cost.

[0084] In an optional example, the present disclosure obtains an example of a model scaling factor of a target object to be processed. Figure 6 shown.

[0085] Figure 6 In step S600, a first translation vector of a key point in a 3D model of a preset target relative to a three-dimensional coordinate system where a camera device is located is obtained.

[0086] Optionally, the preset target in the present disclosure may refer to an object with known external dimensions, and the preset target is generally an object of a regular shape. In one example, the preset target is a cuboid with known length and width, etc. In a more specific example, the preset target may be a mobile phone of a known model, etc.

[0087] Optionally, the camera device in this process is usually a camera device that collects a monocular image of the target object to be processed. Figure 2 The camera devices in the process have the same configuration parameters, and the two camera devices are set in exactly the same position. Figure 2 The camera device in is the same camera device set at the same position.

[0088] Optionally, the 3D model of the preset target in the present disclosure is generally a 3D model pre-set for the preset target. For example, a 3D model pre-set for the preset target using a depth camera device. The key points in the 3D model of the preset target may refer to more important or more special points of the preset target, and the number of key points is generally multiple. For example, the key points in the 3D model of the preset target may be the four vertices of the preset target in the shape of a rectangular parallelepiped, etc.

[0089] Optionally, the present disclosure may utilize a corresponding algorithm (such as solvePnP algorithm, etc.) to obtain a first translation vector. The first translation vector may include: a translation component relative to the X' axis in the three-dimensional coordinate system where the camera device is located, a translation component relative to the Y' axis in the three-dimensional coordinate system where the camera device is located, and a translation component relative to the Z' axis in the three-dimensional coordinate system where the camera device is located (i.e., a depth translation vector, which may also be referred to as a translation component in the depth direction).

[0090] S601: Obtain a second translation vector of a facial key point in a universal 3D facial model relative to a three-dimensional coordinate system where a camera device is located.

[0091] Optionally, the present disclosure may utilize a corresponding algorithm (such as solvePnP algorithm, etc.) to obtain the second translation vector. The second translation vector may include: a translation component relative to the X' axis in the three-dimensional coordinate system where the camera device is located, a translation component relative to the Y' axis in the three-dimensional coordinate system where the camera device is located, and a translation component relative to the Z' axis in the three-dimensional coordinate system where the camera device is located (i.e., a depth translation vector, which may also be referred to as a translation component in the depth direction).

[0092] S602: Determine a model scaling factor of the target object to be processed according to a ratio of a depth translation vector in the first translation vector to a depth translation vector in the second translation vector.

[0093] Optionally, the present disclosure may directly use the ratio of the depth translation vector in the first translation vector to the depth translation vector in the second translation vector as the model scaling factor of the target object to be processed. The present disclosure may also further process the ratio of the depth translation vector in the first translation vector to the depth translation vector in the second translation vector (for example, retaining decimal places or correction processing, etc.), and use the processing result as the model scaling factor of the target object to be processed.

[0094] Since the present disclosure can calculate the first translation vector and the second translation vector through a corresponding algorithm, and the computing resources occupied by calculating the first translation vector and the second translation vector, and the computing resources occupied by calculating the ratio of the depth translation vector in the first translation vector to the depth translation vector in the second translation vector are very limited, the present disclosure can obtain the model scaling coefficient of the target object to be processed while occupying fewer computing resources, which is beneficial to improving the real-time performance of the technical solution for obtaining the 3D coordinates of facial key points and the technical solution for determining the 3D facial model provided by the present disclosure, and reducing the implementation cost.

[0095] In an optional example, the process of an embodiment of the present disclosure for obtaining a first translation vector of a key point in a 3D model of a preset target relative to a three-dimensional coordinate system where a camera device is located is as follows: Figure 7 shown.

[0096] Figure 7 In step S700, the coordinates of at least one 2D key point of a preset target in a monocular image captured by a camera device are obtained.

[0097] Optionally, the monocular image in the present disclosure may be an image (i.e., a 2D image) captured by a monocular camera device. The monocular image may be a photo taken by the monocular camera device, or a video frame in a video taken by the monocular camera device.

[0098] Optionally, the present disclosure may perform key point detection processing on a monocular image captured by a camera device (such as performing key point detection processing on a monocular image using a corresponding neural network), thereby obtaining at least one 2D key point coordinate located on a preset target in the monocular image. The 2D key point coordinate of a preset target in the present disclosure may refer to the two-dimensional coordinate of the key point of the preset target in the plane coordinate system of the monocular image. A 2D key point coordinate generally includes: a coordinate based on the X-axis and a coordinate based on the Y-axis.

[0099] S701 , determining a third 3D coordinate of a key point in a 3D model of a preset target corresponding to each coordinate of at least one 2D key point of a preset target, and obtaining at least one third 3D coordinate.

[0100] Optionally, the 3D model of the preset target in the present disclosure generally includes: a plurality of key points, and each key point has a 3D coordinate based on the 3D model coordinate system. The key points in the 3D model can be referred to as 3D key points. The 3D model coordinate system can be referred to as the three-dimensional coordinate system in which the 3D model is located. In an example, the intersection O of the X-axis, the Y-axis, and the Z-axis in the 3D model coordinate system can be located at any point in the 3D model, for example, at the center of gravity of the 3D model, etc.

[0101] Optionally, the 3D model coordinate system in the present disclosure and the plane coordinate system of the monocular image containing the preset target are two completely different coordinate systems, and the 3D model coordinate system and the plane coordinate system of the monocular image containing the preset target are both local coordinate systems, that is, both coordinate systems are not world coordinate systems.

[0102] Optionally, each 2D key point coordinate of the preset target in the present disclosure usually corresponds to a respective key point identifier, and each key point in the 3D model in the present disclosure usually corresponds to a respective key point identifier. The key point identifier can be considered as the name of the key point. In an example, a key point identifier can indicate that the key point is the upper left vertex, upper right vertex, lower left vertex, or lower right vertex of the preset target.

[0103] Optionally, for any 2D key point coordinate of a preset target, the present disclosure may determine the key point in the 3D model corresponding to the 2D key point coordinate based on the key point identifier corresponding to the 2D key point coordinate and the key point identifier corresponding to the key point in the 3D model of the preset target, thereby obtaining the third 3D coordinate corresponding to the 2D key point coordinate. For example, if the key point identifier corresponding to a 2D key point coordinate is the same as the key point identifier corresponding to a 3D key point in the 3D model, the 3D coordinate of the 3D key point may be used as the third 3D coordinate corresponding to the 2D key point coordinate.

[0104] S702: Determine a first translation vector of a 3D key point of a preset target relative to a three-dimensional coordinate system where the camera device is located according to at least one 2D key point coordinate of the preset target, at least one third 3D coordinate, and configuration parameters of the camera device.

[0105] Optionally, the present disclosure may calculate the first translation vector of the 3D key point of the preset target relative to the three-dimensional coordinate system where the camera device is located, using a preset function (such as the solvePnP algorithm) based on at least one 2D key point coordinate of the preset target, at least one third 3D coordinate, and the configuration parameters of the camera device. For example, the present disclosure may substitute at least one 2D key point coordinate of the preset target, at least one third 3D coordinate, and the internal parameters of the camera device that captures the monocular image into the solvePnP algorithm, and by solving the algorithm, the first translation vector of at least one third 3D coordinate relative to the three-dimensional coordinate system where the camera device is located may be obtained. The first translation vector may represent the placement form of the preset target in the monocular image, and further, the first translation vector may represent the translation position of the preset target in the monocular image in the three-dimensional coordinate system of the camera device.

[0106] The present disclosure can obtain the first translation vector of the 3D key point of the preset target relative to the three-dimensional coordinate system where the camera device is located by means of a function calculation method by using the third 3D coordinate of at least one key point in the 3D model of the preset target, so that the coordinates of at least one 2D key point of the preset target in the monocular image captured by the camera device can be conveniently converted into 3D coordinates in the three-dimensional coordinate system where the camera device is located by means of the first translation vector. Since the process of obtaining the first translation vector of the present disclosure may not involve additional equipment and the computing resources occupied are very limited, it is conducive to obtaining the 3D coordinates of the preset target in a low-cost, convenient and accurate manner.

[0107] In an optional example, the present disclosure can use a plane graphic to obtain a model scaling factor of a target object to be processed, and the dimensions between multiple specific points on the plane graphic are known. In one example, the plane graphic can be a QR code or a checkerboard. The plane graphic can be a plane graphic (such as a mobile phone 800) displayed on a display screen of an electronic device (such as a smart phone 800). Figure 8 As shown), the plane figure may also be a physical plane figure pre-set on an object, for example, Fig. 9A and Fig. 9B As shown, the plane graphic may be a physical two-dimensional code and a checkerboard, etc., which are pre-set (such as by printing, dyeing, or film-sticking) on ​​the hat 900 or the glasses 901 .

[0108] Optionally, the present disclosure uses a plane graph to obtain an example of a model scaling factor of a target object to be processed. Figure 8 shown.

[0109] Figure 8 In the example, the target object 801 to be processed uses its smart phone 800 to display a checkerboard graphic. For example, the smart phone 800 is used to display a checkerboard photo in its gallery, thereby displaying a checkerboard graphic 802. For another example, the smart phone 800 is used to run an APP (application) and trigger a function in the APP, so that the APP displays a checkerboard graphic 802.

[0110] The target object 801 to be processed may place the smart mobile phone 800 near its head, for example, so that the display screen of the smart mobile phone 800 and its front face are located in the same plane. The present disclosure may adopt a method such as performing checkerboard pattern recognition on an image captured by a camera device (such as a vehicle-mounted monocular camera device) 803 to obtain a checkerboard pattern 802 displayed by a smart mobile phone 800 captured by the camera device 803. At this time, the present disclosure may obtain the screen size of the display screen of the smart mobile phone 800 by exchanging information with the smart mobile phone 800, so that the present disclosure may use the screen size to calculate the real distance between multiple corner points (such as vertices of multiple small black squares) in the checkerboard pattern 802 displayed by it. Afterwards, the present disclosure may calculate the first translation vector of the multiple corner points in the checkerboard pattern 802 relative to the three-dimensional coordinate system where the camera device 803 is located based on the real distance and the distance between the multiple corner points in the checkerboard pattern in the image captured by the camera device 803. Then, the present disclosure may use the ratio of the depth translation vector in the first translation vector to the depth translation vector in the above-mentioned second translation vector to determine the model scaling coefficient of the target object to be processed.

[0111] Optionally, another example of the present disclosure using a plane graph to obtain a model scaling factor of a target object to be processed is as follows: Fig. 9A and Fig. 9B shown.

[0112] Fig. 9A and Fig. 9B In the figure, the target object 902 to be processed has a hat 900 or glasses 901 provided with at least one checkerboard pattern 903. The target object 902 to be processed can wear the hat 900 or the glasses 901. The present disclosure can adopt a method such as performing checkerboard pattern recognition on an image captured by a camera device (such as a vehicle-mounted monocular camera device) to obtain the checkerboard pattern 903 on the hat 900 or the glasses 901 captured by the camera device. Since the present disclosure can know in advance the real distance between multiple corner points (such as vertices of multiple black small squares) in the checkerboard pattern 903, the present disclosure can calculate the first translation vector of the multiple corner points in the checkerboard pattern 903 relative to the three-dimensional coordinate system where the camera device is located based on the real distance and the distance between the multiple corner points in the checkerboard pattern 903 in the image captured by the camera device. Then, the present disclosure can use the ratio of the depth translation vector in the first translation vector to the depth translation vector in the above-mentioned second translation vector to determine the model scaling coefficient of the target object 902 to be processed.

[0113] In an optional example, the present disclosure uses the model scaling factor to scale the general 3D face model as follows: multiplying the first 3D coordinates of each key point in the general 3D face model by the model scaling factor respectively, thereby obtaining the 3D face model of the target object to be processed. Specifically, the present disclosure may use the following formula (1) to represent the 3D face model of the target object to be processed obtained by the present disclosure:

[0114] F i =s×F0 Formula (1)

[0115] In the above formula (1), F i represents the 3D face model of the target object to be processed; s represents the model scaling factor of the target object to be processed; F0 represents a general 3D face model.

[0116] In an optional example, another example of scaling the general 3D face model using the model scaling coefficient in the present disclosure may be: multiplying the first 3D coordinates of each key point in the general 3D face model by the model scaling coefficient respectively, and correcting the multiplication result according to a preset residual to obtain the 3D face model of the target object. Specifically, the present disclosure may use the following formula (2) to represent the 3D face model of the target object to be processed obtained by the present disclosure:

[0117]

[0118] In the above formula (2), Fi represents the 3D face model of the target object to be processed; s represents the model scaling factor of the target object to be processed; F0 represents a general 3D face model; Represents the residual of the target object to be processed. The size can be set according to actual experience. It can be a known experience value.

[0119] The present disclosure uses a scaling factor to scale a general 3D face model, and in particular uses a preset residual to correct the 3D face model of the target object, which is beneficial to improving the accuracy of the 3D face model of the target object, thereby improving the accuracy of the 3D coordinates of the facial key points of the target object that are finally obtained.

[0120] Exemplary Devices

[0121] Fig.10 The present invention provides a schematic diagram of the structure of the device for obtaining the 3D coordinates of the key points of the face. The device of this embodiment can be used to implement the corresponding method embodiment of the present invention. Fig.10 The device shown includes: a module 1000 for acquiring 2D coordinates, a module 1001 for determining model 3D coordinates, and a module 1002 for determining key point 3D coordinates.

[0122] The 2D coordinate acquisition module 1000 is used to acquire the coordinates of at least one 2D key point located on the face of the target object in the image, wherein the image is a monocular image.

[0123] The model 3D coordinate determination module 1001 is used to determine the first 3D coordinates of the facial key points in the 3D facial model of the target object corresponding to the at least one 2D key point coordinate obtained by the 2D coordinate acquisition module 1000, and obtain at least one first 3D coordinate.

[0124] The key point 3D coordinate determination module 1002 is used to determine the second 3D coordinate of the at least one 2D key point coordinate in the three-dimensional coordinate system where the camera device is located based on the at least one 2D key point coordinate obtained by the 2D coordinate acquisition module 1000, the at least one first 3D coordinate obtained by the model 3D coordinate determination module 1001, and the configuration parameters of the camera device that captures the image.

[0125] Optionally, the module 1002 for determining the 3D coordinates of the key points can obtain the rotation vector and translation vector of the at least one first 3D coordinate relative to the three-dimensional coordinate system where the camera device is located, using a preset function based on at least one 2D key point coordinate acquired by the module 1000 for acquiring the 2D coordinates, at least one first 3D coordinate acquired by the module 1001 for determining the model 3D coordinates, and internal parameters of the camera device that captures the image; thereafter, the module 1002 for determining the 3D coordinates of the key points can determine the second 3D coordinate of the at least one 2D key point coordinate in the three-dimensional coordinate system where the camera device is located, based on the at least one first 3D coordinate, the rotation vector, and the translation vector.

[0126] Fig.11 FIG. 1 is a schematic diagram of a structure of an embodiment of a device for determining a 3D face model of the present disclosure. The device of this embodiment can be used to implement the corresponding method embodiment of the present disclosure. Fig.11 The device shown includes: a face model acquisition module 1100 , a scaling system acquisition module 1101 , and a model adjustment module 1102 .

[0127] The facial model acquisition module 1100 is used to acquire a preset universal 3D facial model for multiple target objects.

[0128] The scaling system acquisition module 1101 is used to acquire the model scaling factor of the target object to be processed.

[0129] The model adjustment module 1102 is used to scale the general 3D face model obtained by the face model acquisition module 1100 according to the model scaling coefficient obtained by the scaling system acquisition module 1101 to obtain the 3D face model of the target object to be processed.

[0130] Optionally, the module 1101 for obtaining the zoom system may include: a first submodule 11011, a second submodule 11012, and a third submodule 11013. The first submodule 11011 is used to obtain a first translation vector of a key point in a 3D model of a preset target relative to a three-dimensional coordinate system where a camera device is located; wherein the camera device is a camera device for collecting a monocular image of the target object to be processed. The second submodule 11012 is used to obtain a second translation vector of a facial key point in the universal 3D facial model relative to the three-dimensional coordinate system where the camera device is located. The third submodule 11013 is used to determine the model zoom coefficient of the target object to be processed according to the ratio of the depth translation vector in the first translation vector obtained by the first submodule 11011 to the depth translation vector in the second translation vector obtained by the second submodule 11012.

[0131] In one example, the first submodule 11011 of the present disclosure can first obtain at least one 2D key point coordinate of the preset target in the monocular image captured by the camera device; then, the first submodule 11011 determines the third 3D coordinate of the key point in the 3D model of the preset target corresponding to each of the at least one 2D key point coordinates of the preset target, and obtains at least one third 3D coordinate; finally, the first submodule 11011 determines the first translation vector of the key point in the 3D model of the preset target relative to the three-dimensional coordinate system where the camera device is located based on the at least one 2D key point coordinate of the preset target, the at least one third 3D coordinate and the configuration parameters of the camera device.

[0132] Optionally, the model adjustment module 1102 may respectively multiply the first 3D coordinates of each key point in the general 3D face model by the model scaling factor to obtain the 3D face model of the target object.

[0133] Optionally, the model adjustment module 1102 may multiply the first 3D coordinates of each key point in the general 3D face model by the model scaling factor respectively, and correct the multiplication result according to a preset residual to obtain the 3D face model of the target object.

[0134] Exemplary Electronic Devices

[0135] Reference below Fig.12 An electronic device according to an embodiment of the present disclosure is described. Fig.12 1 shows a block diagram of an electronic device according to an embodiment of the present disclosure. Fig.12 As shown, the electronic device 121 includes one or more processors 1211 and a memory 1212 .

[0136] The processor 1211 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 121 to perform desired functions.

[0137] The memory 1212 may include one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory, for example, may include: random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory, for example, may include: read-only memory (ROM), hard disk, and flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 1211 may execute the program instructions to implement the method for obtaining the 3D coordinates of facial key points, the method for determining a 3D facial model, and / or other desired functions of the various embodiments of the present disclosure described above. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.

[0138] In one example, the electronic device 121 may also include: an input device 1213 and an output device 1214, etc., which are interconnected through a bus system and / or other forms of connection mechanisms (not shown). In addition, the input device 1213 may also include, for example, a keyboard, a mouse, etc. The output device 1214 may output various information to the outside. The output device 1214 may include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, etc.

[0139] Of course, to simplify, Fig.12 Only some of the components related to the present disclosure in the electronic device 121 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application scenarios, the electronic device 121 may also include any other appropriate components.

[0140] Exemplary computer program products and computer-readable storage media

[0141] In addition to the above-mentioned method and device, the embodiments of the present disclosure may also be a computer program product, which includes computer program instructions, and when the computer program instructions are executed by a processor, the processor executes the steps in the method for obtaining 3D coordinates of facial key points or the method for determining a 3D facial model according to various embodiments of the present disclosure described in the above-mentioned “Exemplary Method” section of this specification.

[0142] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0143] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the processor executes the steps in the method for obtaining 3D coordinates of facial key points or the method for determining a 3D facial model according to various embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.

[0144] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive enumeration) of readable storage media can include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0145] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. must be possessed by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, rather than limitation, and the above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.

[0146] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0147] The block diagrams of the devices, apparatuses, equipment, and systems involved in the present disclosure are intended only as illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems may be connected, arranged, and configured in any manner. Words such as "include," "comprise," "have," and the like are open words, meaning "including but not limited to," and may be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and may be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and may be used interchangeably therewith.

[0148] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.

[0149] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.

[0150] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects, etc., will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

[0151] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

Claims

1. A method for obtaining 3D coordinates of facial key points, comprising: Acquire the coordinates of at least one 2D key point located on the face of the target object in the image; wherein the image is a monocular image; Determine first 3D coordinates of facial key points in the 3D facial model of the target object corresponding to the at least one 2D key point coordinate, and obtain at least one first 3D coordinate, wherein the first 3D coordinate is a 3D coordinate based on a 3D facial model coordinate system, wherein the 3D facial model coordinate system is a local coordinate system where the 3D facial model is located, and the 3D facial model of the target object is obtained by scaling a general 3D facial model using a model scaling factor of the target object; According to the at least one 2D key point coordinate, the at least one first 3D coordinate and the configuration parameters of the camera device that captures the image, the second 3D coordinate of the at least one 2D key point coordinate in the three-dimensional coordinate system where the camera device is located is determined, and the three-dimensional coordinate system where the camera device is located is a local coordinate system.

2. The method according to claim 1, wherein: The determining, according to the at least one 2D key point coordinate, the at least one first 3D coordinate and the 2D configuration parameter, a second 3D coordinate of the at least one 2D key point coordinate in the three-dimensional coordinate system where the camera device is located comprises: According to the at least one 2D key point coordinate, the at least one first 3D coordinate and the internal parameters of the camera device that captures the image, using a preset function, obtain a rotation vector and a translation vector of the at least one first 3D coordinate relative to the three-dimensional coordinate system where the camera device is located; Determine a second 3D coordinate of the at least one 2D key point coordinate in the three-dimensional coordinate system where the camera device is located according to the at least one first 3D coordinate, the rotation vector and the translation vector.

3. The method according to claim 1, characterized in that Also includes: Obtaining a pre-set universal 3D face model for multiple target objects; Obtaining a model scaling factor of the target object; The universal 3D face model is scaled according to the model scaling factor to obtain the 3D face model of the target object.

4. The method according to claim 3, wherein: The obtaining of the model scaling factor of the target object comprises: Obtaining a first translation vector of a key point in a 3D model of a preset target relative to a three-dimensional coordinate system where the camera device is located; Obtaining a second translation vector of a facial key point in the universal 3D facial model relative to a three-dimensional coordinate system where the camera device is located; A model scaling factor of the target object is determined according to a ratio of a depth translation vector in the first translation vector to a depth translation vector in the second translation vector.

5. The method according to claim 4, wherein: The step of obtaining a first translation vector of a key point in the 3D model of the preset target relative to the three-dimensional coordinate system where the camera device is located includes: Acquire at least one 2D key point coordinate of the preset target in the monocular image captured by the camera device; Determine a third 3D coordinate of a key point in the 3D model of the preset target corresponding to each of the at least one 2D key point coordinates of the preset target, to obtain at least one third 3D coordinate; According to the at least one 2D key point coordinate of the preset target, the at least one third 3D coordinate and the configuration parameters of the camera device, a first translation vector of the key point in the 3D model of the preset target relative to the three-dimensional coordinate system where the camera device is located is determined.

6. The method according to any one of claims 3 to 5, wherein: The step of scaling the general 3D face model according to the model scaling coefficient to obtain the 3D face model of the target object includes: multiplying the first 3D coordinates of each key point in the general 3D face model by the model scaling factor to obtain the 3D face model of the target object; or The first 3D coordinates of each key point in the universal 3D facial model are respectively multiplied by the model scaling coefficient, and the multiplication result is corrected according to a preset residual to obtain the 3D facial model of the target object.

7. A device for obtaining 3D coordinates of facial key points, comprising: A 2D coordinate acquisition module is used to acquire the coordinates of at least one 2D key point located on the face of the target object in the image; wherein the image is a monocular image; a module for determining a model 3D coordinate, used to determine a first 3D coordinate of a facial key point in the 3D facial model of the target object corresponding to each of the at least one 2D key point coordinates acquired by the module for acquiring 2D coordinates, and obtain at least one first 3D coordinate, wherein the first 3D coordinate is a 3D coordinate based on a 3D facial model coordinate system, wherein the 3D facial model coordinate system is a local coordinate system where the 3D facial model is located, and the 3D facial model of the target object is obtained by scaling a general 3D facial model using a model scaling factor of the target object; A module for determining 3D coordinates of key points is used to determine the second 3D coordinate of at least one 2D key point coordinate in the three-dimensional coordinate system where the camera device is located, based on at least one 2D key point coordinate acquired by the module for acquiring 2D coordinates, at least one first 3D coordinate acquired by the module for determining 3D coordinates of the model, and the configuration parameters of the camera device that captures the image. The three-dimensional coordinate system where the camera device is located is a local coordinate system.

8. The device according to claim 7, characterized in that Also includes: A face model acquisition module is used to acquire a pre-set universal 3D face model for multiple target objects; An acquisition scaling system module is used to acquire a model scaling factor of the target object; The model adjustment module is used to scale the universal 3D face model obtained by the face model acquisition module according to the model scaling coefficient obtained by the scaling system acquisition module to obtain the 3D face model of the target object.

9. A computer-readable storage medium storing a computer program, wherein the computer program is used to execute the method according to any one of claims 1 to 6.

10. An electronic device, comprising: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the method according to any one of claims 1 to 6.