Embodiments of the present disclosure relate to the field of data processing, and more specifically, to a data processing method and apparatus.
Human body modeling is widely applied in the computer graphics and computer vision fields, such as movie special effects, three dimensional (3D) games, virtual reality, and man-machine interaction.
In a current human body modeling system, strong noise or a hole in a human body point cloud is introduced into a reconstructed human body model, resulting in relatively low accuracy of the human body model. Currently, no effective method is available for resolving the foregoing problem.
Embodiments of the present disclosure provide a data processing method and apparatus, to effectively improve model accuracy.
A first aspect provides a data processing method, where the method includes obtaining a first reconstruction model of a target object. The method also includes dividing the first reconstruction model into M local blocks, where different local blocks of the M local blocks of the first reconstruction model are corresponding to different parts of the target object, the different parts are represented by different part names, and M is a positive integer greater than 1. Additionally, the method includes obtaining N target object sample alignment models, where a posture parameter corresponding to a posture of each target object sample alignment model is the same as a posture parameter corresponding to a posture of the first reconstruction model, and each target object sample alignment model includes M local blocks, where the ith local block of each target object sample alignment model and the ith local block of the first reconstruction model are corresponding to a part that is of the target object and is represented by a same part name, the ith local block of each target object sample alignment model is aligned with the ith local block of the first reconstruction model, N is a positive integer, and i is 1, . . . , or M. The method also includes approximating the N target object sample alignment models to the first reconstruction model, to determine a second reconstruction model that is of the target object and includes M local blocks, where the ith local block of the second reconstruction model is determined according to the ith local block of each target object sample alignment model, and i is 1, . . . , or M.
With reference to the first aspect, in a first possible implementation of the first aspect, the approximating the N target object sample alignment models to the first reconstruction model, to determine a second reconstruction model that is of the target object and includes M local blocks includes: obtaining the second reconstruction model according to the following formula:
K
i
=B
i
c
i+μi (i=1, . . . , M),
where Ki is the ith local block of the M local blocks of the second reconstruction model, Bi is a basis including the ith local blocks of the N target object sample alignment models, μi is an average value of vertex coordinates of the ith local blocks of the N target object sample alignment models, and ci is a coefficient vector of Bi, where a formula for obtaining ci includes:
where C=(c1T, c2T, . . . , cMT)T, Vi is the ith local block of the first reconstruction model, Γ is a set of adjacent local blocks of the M local blocks of each target object sample alignment model, (i, j)∈Γ represents that the jth local block of each target object sample alignment model is a local block adjacent to the ith local block of each target object sample alignment model, Bj is a basis including the jth local blocks of the target object sample alignment models, Bij is used to represent a boundary vertex at a junction of the ith local block and the jth local block of each target object sample alignment model, Bij is a subset of Bi, μi is an average value of Bij, Bji is used to represent a boundary vertex at a junction of the jth local block and the ith local block of each target object sample alignment model, Bij is a subset of Bi, μij is an average value of Bji, β is a weight, λ is a weight, ∥ ∥1 is an L1 norm, and ∥ ∥2 is an L2 norm.
With reference to the first aspect or the first possible implementation of the first aspect, in a second possible implementation of the first aspect, adjacent local blocks of the M local blocks of the first reconstruction model have a common boundary vertex at a junction.
With reference to the first aspect, or the first or the second possible implementation of the first aspect, in a third possible implementation of the first aspect, the obtaining a first reconstruction model of a target object includes: obtaining target object point cloud data of the target object; obtaining a template model of the target object, where the template model is a model describing standard target object point cloud data of the target object in a preset standard posture; determining a point correspondence between the target object point cloud data and the template model; estimating, based on a skeleton-driven deformation technology and the point correspondence, a posture change parameter of the target object point cloud data relative to the template model; and deforming, by using the posture change parameter of the target object point cloud data relative to the template model, the template model into the first reconstruction model with a same posture as the target object point cloud data.
With reference to the first aspect, or the first or the second possible implementation of the first aspect, in a fourth possible implementation of the first aspect, the obtaining a first reconstruction model of a target object includes: obtaining target object point cloud data of the target object; obtaining a template model of the target object, where the template model is a model describing standard target object point cloud data of the target object in a preset standard posture; determining a point correspondence between the target object point cloud data and the template model; estimating, based on a skeleton-driven deformation technology and the point correspondence, a posture change parameter of the target object point cloud data relative to the template model; deforming, by using the posture change parameter of the target object point cloud data relative to the template model, the template model into a skeleton deformation model with a same posture as the target object point cloud data, so that the skeleton deformation model is aligned with the target object point cloud data; and deforming, based on a mesh deformation technology, the skeleton deformation model, to obtain the first reconstruction model, so that the first reconstruction model matches a shape of the target object point cloud data.
With reference to any one of the first aspect or the first to the fourth possible implementations of the first aspect, in a fifth possible implementation of the first aspect, the obtaining N target object sample alignment models includes: obtaining N target object sample models from a preset target object database; deforming, based on the skeleton-driven deformation technology and according to the posture parameter of the first reconstruction model, the N target object sample models into N target object sample skeleton deformation models corresponding to the same posture parameter as the first reconstruction model; dividing each target object sample skeleton deformation model into M local blocks, where the ith local block of each target object sample skeleton deformation model and the ith local block of the first reconstruction model are corresponding to a part that is of the target object and is represented by a same part name; and performing at least one change of rotation, translation, or scaling on the ith local block of each target object sample skeleton deformation model, to obtain the N target object sample alignment models, where after the at least one change of rotation, translation, or scaling, the ith local block of each target object sample alignment model is aligned with the ith local block of the first reconstruction model, and i is 1, 2, . . . , or M.
With reference to any one of the first aspect or the first to the fifth possible implementations of the first aspect, in a sixth possible implementation of the first aspect, the method further includes: performing smooth optimization processing on the second reconstruction model.
A second aspect provides a data processing apparatus, where the apparatus includes: a first obtaining module, configured to obtain a first reconstruction model of a target object; a division module, configured to divide the first reconstruction model obtained by the obtaining module into M local blocks, where different local blocks of the M local blocks of the first reconstruction model are corresponding to different parts of the target object, the different pails are represented by different part names, and M is a positive integer greater than 1; a second obtaining module, configured to obtain N target object sample alignment models, where a posture parameter corresponding to a posture of each target object sample alignment model is the same as a posture parameter corresponding to a posture of the first reconstruction model obtained by the first obtaining module, and each target object sample alignment model includes M local blocks, where the ith local block of each target object sample alignment model and the ith local block of the first reconstruction model are corresponding to a part that is of the target object and is represented by a same part name, the ith local block of each target object sample alignment model is aligned with the ith local block of the first reconstruction model, N is a positive integer, and i is 1, . . . , or M; and a determining module, configured to approximate the N target object sample alignment models obtained by the second obtaining module to the first reconstruction model obtained by the first obtaining module, to determine a second reconstruction model that is of the target object and includes M local blocks, where the ith local block of the second reconstruction model is determined according to the ith local block of each target object sample alignment model, and i is 1, . . . , or M.
With reference to the second aspect, in a first possible implementation of the second aspect, the determining module is specifically configured to: obtain the second reconstruction model according to the following formula:
K
i
=B
i
c
i+μi (i=1, . . . , M),
where Ki is the ith local block of the M local blocks of the second reconstruction model, Bi is a basis including the ith local blocks of the N target object sample alignment models, is an average value of vertex coordinates of the ith local blocks of the N target object sample alignment models, and ci is a coefficient vector of Bi, where a formula for obtaining ci includes:
where C=(c1T, c2T, . . . , cMT, Vi is the ith local block of the first reconstruction model, Γ is a set of adjacent local blocks of the M local blocks of each target object sample alignment model, (i, j)∈Γ represents that the jth local block of each target object sample alignment model is a local block adjacent to the ith local block of each target object sample alignment model, Bj is a basis including the jth local blocks of the target object sample alignment models, Bij is used to represent a boundary vertex at a junction of the ith local block and the jth local block of each target object sample alignment model, Bij is a subset of Bi, μij is an average value of Bij, Bji is used to represent a boundary vertex at a junction of the jth local block and the ith local block of each target object sample alignment model, Bij is a subset of Bi, μij is an average value of Bji, β is a weight, λ is a weight, ∥ ∥1 is an L1 norm, and ∥ ∥2 is an L2 norm.
With reference to the second aspect or the first possible implementation of the second aspect, in a second possible implementation of the second aspect, adjacent local blocks of the M local blocks of the first reconstruction model obtained by the first obtaining module have a common boundary vertex at a junction.
With reference to the second aspect, or the first or the second possible implementation of the second aspect, in a third possible implementation of the second aspect, the first obtaining module includes: a first obtaining unit, configured to obtain target object point cloud data of the target object; a second obtaining unit, configured to obtain a template model of the target object, where the template model is a model describing standard target object point cloud data of the target object in a preset standard posture; a determining unit, configured to determine a point correspondence between the target object point cloud data obtained by the first obtaining unit and the template model obtained by the second obtaining unit; an estimation unit, configured to estimate, based on a skeleton-driven deformation technology and the point correspondence determined by the determining unit, a posture change parameter of the target object point cloud data that is relative to the template model determined by the second obtaining unit and that is determined by the first obtaining unit; and a first deformation unit, configured to deform, by using the posture change parameter that is of the target object point cloud data relative to the template model and that is estimated by the estimation unit, the template model into the first reconstruction model with a same posture as the target object point cloud data.
With reference to the second aspect, or the first or the second possible implementation of the second aspect, in a fourth possible implementation of the second aspect, the first obtaining module includes: a first obtaining unit, configured to obtain target object point cloud data of the target object; a second obtaining unit, configured to obtain a template model of the target object, where the template model is a model describing standard target object point cloud data of the target object in a preset standard posture; a determining unit, configured to determine a point correspondence between the target object point cloud data obtained by the first obtaining unit and the template model obtained by the second obtaining unit; an estimation unit, configured to estimate, based on a skeleton-driven deformation technology and the point correspondence determined by the determining unit, a posture change parameter of the target object point cloud data that is relative to the template model determined by the second obtaining unit and that is determined by the first obtaining unit; a second deformation unit, configured to deform, by using the posture change parameter that is of the target object point cloud data relative to the template model and that is estimated by the estimation unit, the template model into a skeleton deformation model with a same posture as the target object point cloud data, so that the skeleton deformation model is aligned with the target object point cloud data; and a third deformation unit, configured to deform, based on a mesh deformation technology, the skeleton deformation model obtained by the second deformation unit, to obtain the first reconstruction model, so that the first reconstruction model matches a shape of the target object point cloud data.
With reference to any one of the second aspect or the first to the fourth possible implementations of the second aspect, in a fifth possible implementation of the second aspect, the second obtaining module includes: a third obtaining unit, configured to obtain N target object sample models from a preset target object database; a fourth deformation unit, configured to deform, based on the skeleton-driven deformation technology and according to the posture parameter of the first reconstruction model, the N target object sample models obtained by the third obtaining unit into N target object sample skeleton deformation models corresponding to the same posture parameter as the first reconstruction model; a division unit, configured to divide each target object sample skeleton deformation model obtained by the fourth deformation unit into M local blocks, where the ith local block of each target object sample skeleton deformation model and the ith local block of the first reconstruction model are corresponding to a part that is of the target object and is represented by a same part name; and a fourth obtaining unit, configured to perform at least one change of rotation, translation, or scaling on the ith local block that is of each target object sample skeleton deformation model and that is obtained by the division unit, to obtain the N target object sample alignment models, where after the at least one change of rotation, translation, or scaling, the ith local block of each target object sample alignment model is aligned with the ith local block of the first reconstruction model, and i is 1, 2, . . . , or M.
With reference to any one of the second aspect or the first to the fifth possible implementations of the second aspect, in a sixth possible implementation of the second aspect, the apparatus further includes: an optimization module, configured to perform smooth optimization processing on the second reconstruction model.
Based on the foregoing technical solutions, according to the data processing method and apparatus in the embodiments of the present disclosure, a first reconstruction model of a target object is divided into M local blocks, and N target object sample alignment models are approximated to the first reconstruction model, to determine a second reconstruction model that is of the target object and includes M local blocks, where the ith local block of the second reconstruction model is determined according to the ith local block of each target object sample alignment model. With the method in the embodiments of the present disclosure, model accuracy can be effectively improved.
To describe the technical solutions in the embodiments of the present disclosure more clearly, the following briefly describes the accompanying drawings required for describing the embodiments. Apparently, the accompanying drawings in the following description show merely some embodiments of the present disclosure, and a person of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative efforts.
The following clearly describes the technical solutions in the embodiments of the present disclosure with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are some but not all of the embodiments of the present disclosure. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.
An embodiment of the present disclosure provides a data processing method, which is specifically a method for determining a reconstruction model of a target object. The target object may be a human body, or may be an animal or another dynamic object.
In the following, for the ease of understanding and description, the target object being a human body is used as an example for illustration purposes instead of limitation.
To help understand a data processing solution provided in the embodiment of the present disclosure, the following concept is explained first.
Kinect RGB-D™ cameras.
In most human body modeling systems, a series of cameras or a three-dimensional scanning technology (for example, a laser camera and a structured-light camera) are used to collect depth image data. However, the application of these modeling systems is limited by expensive devices and complex cumbersome user interaction interfaces. The Kinect RGB-D™ cameras released by Microsoft™ are at low prices and easy to operate, and therefore have been widely applied in the human body modeling systems.
In the data processing method provided in this embodiment of the present disclosure, a Kinect RGB-D™ camera is used to collect depth image data of a human body, so as to obtain human body point cloud data of the human body. For example, one or more Kinect RGB-D™ cameras are fixed near the human body to simultaneously capture a depth image data sequence of the human body. A human body model (which is corresponding to a second reconstruction model in a flowchart shown in
Optionally, in this embodiment of the present disclosure, one or more Kinect RGB-D™ cameras are used to collect the human body depth image data.
For the ease of understanding and description, the following describes a human body modeling process of the current frame.
S110. Obtain a first reconstruction model of a target object.
Specifically, the first reconstruction model may be a model that is reconstructed based on the human body point cloud data and that is used to describe human body point cloud data of a human body. The human body point cloud data is a data point extracted from depth image data of the human body. In the following S111, a process of extracting the human body point cloud data is described. The first reconstruction model is specifically a model determined after a human body sample model in a preset human body database is aligned with the human body point cloud data of the human body. Alignment herein means that the first reconstruction model has a point alignment relationship with the human body point cloud data. Specifically, each vertex included in the first reconstruction model is corresponding to a point in the human body point cloud data of the human body, and two points of each pair of corresponding points are nearest adjacent points.
Because the human body point cloud data is data collected based on the depth image data of the human body captured by a camera, the human body point cloud data generally includes strong noise, and the first reconstruction model obtained based on the human body point cloud data also includes noise, resulting in relatively low model precision. The first reconstruction model needs to be further processed, so as to improve the model precision.
S120. Divide the first reconstruction model into M local blocks, where different local blocks of the M local blocks of the first reconstruction model are corresponding to different parts of the target object, the different parts are represented by different part names, and M is a positive integer greater than 1.
Specifically, for example, the first reconstruction model is a human body model shown in
S130. Obtain N target object sample alignment models, where a posture parameter corresponding to a posture of each target object sample alignment model is the same as a posture parameter corresponding to a posture of the first reconstruction model, and each target object sample alignment model includes M local blocks, where the ith local block of each target object sample alignment model and the ith local block of the first reconstruction model are corresponding to a part that is of the target object and is represented by a same part name, the ith local block of each target object sample alignment model is aligned with the ith local block of the first reconstruction model, N is a positive integer, and i is 1, . . . , or M, where i being 1, . . . , and M means that assigned values of i are sequentially 1, . . . , and M.
Specifically, for example, the target object is the human body. The target object sample alignment model is a human body sample alignment model, which specifically is a model resulting from performing some processing on a standard human body sample model in the preset human body database. For example, the human body sample model undergoes a posture change, so that a posture parameter corresponding to the human body sample model resulting from the posture change (that is, the human body sample alignment model) is the same as that corresponding to the first reconstruction model of the human body, that is, the human body sample model resulting from the posture change and the first reconstruction model have a same posture. For example, if a posture of the first reconstruction model of the human body is squatting, the human body sample alignment model also has the squatting posture. This helps to ensure a constraint on boundary consistency in a subsequent model reconstruction process.
That the ith local block of each human body sample alignment model and the ith local block of the first reconstruction model are corresponding to a part represented by a same part name, of the human body means: If the first reconstruction model of the human body is divided into 16 local blocks, as shown in
As for that the ith local block of each human body sample alignment model is aligned with the ith local block of the first reconstruction model, the alignment is: No rigid transformation is needed between the ith local block of each human body sample alignment model and the ith local block of the first reconstruction model to implement alignment between each other, that is, the ith local block of each human body sample alignment model and the ith local block of the first reconstruction model are in a same coordinate system.
S140. Approximate the N target object sample alignment models to the first reconstruction model, to determine a second reconstruction model that is of the target object and includes M local blocks, where the ith local block of the second reconstruction model is determined according to the ith local block of each target object sample alignment model, and i is 1, . . . , or M, where i being 1, . . . , and M means that assigned values of i are sequentially 1, . . . , and M.
Specifically, for example, the target object is the human body. The ith local block of the second reconstruction model is determined according to a linear combination of the ith local block of each human body sample alignment model, and the linear combination of the ith local block of each human body sample alignment model is determined in a process of approximating the N human body sample alignment models to the first reconstruction model. Details are provided in the following with reference to formulas (3) to (6).
Therefore, according to the data processing method in this embodiment of the present disclosure, a first reconstruction model of a human body is divided into M local blocks, and N human body sample alignment models are approximated to the first reconstruction model, to determine a second reconstruction model including M local blocks, of the human body, where the ith local block of the second reconstruction model is determined according to the ith local block of each human body sample alignment model. With the method in this embodiment of the present disclosure, model accuracy can be effectively improved.
According to the method in this embodiment of the present disclosure, the second reconstruction model of the human body is determined based on a combination of the N human body sample alignment models, and the combination of the N human body sample alignment models is determined by means of approximating the N human body sample alignment models to the first reconstruction model. The second reconstruction model obtained in this way both restores the first reconstruction model of the human body in a relatively close similarity and keeps smoothness and accuracy of the human body sample model, so as to eliminate noise that may be included in the first reconstruction model, to a relatively great extent. Therefore, with the data processing method in this embodiment of the present disclosure, the model accuracy can be effectively improved.
It should be understood that a single human body part has smaller posture change space than the entire human body. In this embodiment of the present disclosure, the ith local block of the second reconstruction model is determined according to the ith local block of each human body sample alignment model. In this embodiment of the present disclosure, the second reconstruction model approximating to the first reconstruction model to a relatively great extent can be obtained based on a relatively small-scale human body sample database. Therefore, the data processing method in this embodiment of the present disclosure can effectively improve the model accuracy, and can reduce requirements on a quantity of models and posture changes in a human body sample database, and therefore is to be applied more widely in future.
Optionally, in this embodiment of the present disclosure, the obtaining a first reconstruction model of a target object in S110 includes the following steps.
S111. Obtain target object point cloud data of the target object.
For example, the target object is the human body, and specifically, two steps of collecting a depth image of the human body and extracting human body point cloud data are included.
1. Collect the depth image of the human body.
In the following, two RGB-D cameras are used as an example for illustration purposes instead of limitation.
The two RGB-D cameras are fixed in front of and behind the to-be-photographed human body, respectively, so that the two cameras can photograph the entire human body. For example, the cameras in front and behind each are about 2.5 m to 3 m away from the human body. This is not limited in this embodiment of the present disclosure.
The two cameras may be set to collect data synchronously. Specifically, intrinsic parameters of the RGB-D cameras and extrinsic parameters between the two RGB-D cameras may be estimated according to a standard procedure, so that the two cameras collect data at a same time. After the camera calibration, two depth images collected by the two cameras at a same time point may be aligned in a same coordinate system.
In a process of depth image collection, the photographed human body may have different postures.
After a period of consecutive photographing, the two cameras collect two depth image synchronization sequences of dynamic human body changes.
It should be understood that, alternatively, three RGB-D cameras may be used to collect the depth image data. For example, two cameras capture the upper and lower parts of the human body, and the other camera captures the middle part in an opposite direction. Perspectives of all the Kinect™ cameras do not overlap, so as to avoid mutual infrared interference and a data loss.
2. Extract the human body point cloud data.
A. Detect the ground by using a plane detection method, and delete a ground part from the depth image.
B. Define a three-dimensional bounding box that can enclose the entire human body, and delete another part from the depth image except the three-dimensional bounding box.
C. Delete a remaining point of the ground by using a statistical method.
D. Determine a pixel range of the human body in the current frame by using an extraction result of human body point cloud data of a previous frame as prior knowledge, and delete an unnecessary point, to obtain the final human body point cloud data of the current frame.
It should be understood that in a process of extracting the human body point cloud data of the first frame, step D is omitted.
S112. Obtain a template model of the target object, where the template model is a model describing standard target object point cloud data of the target object in a preset standard posture.
For example, the target object is the human body. The preset standard posture is a standard standing posture of the human body, and specifically, the preset standard standing posture of the human body is a standard standing posture specified in the human body database.
First, standard human body point cloud data of the human body in the preset standard standing posture of the human body is obtained. Then, any human body sample model in the human body database is aligned with the standard human body point cloud data of the human body. A model resulting from performing the alignment step on the human body sample model is the template model of the human body. Each vertex of the template model is corresponding to a point in the standard human body point cloud data, and two points of each pair of corresponding points are nearest adjacent points.
That is, the template model is a deformed model obtained by aligning the human body sample model in the human body database with the standard human body point cloud data of the human body. The obtaining the template model mainly includes the following two steps.
Step one. Establish a correspondence between sparse points.
The standard human body point cloud data of the human body in the preset standard standing posture of the human body is obtained. It is assumed that a sample model A in the human body database is used as a base model of the template model.
The sample model A and the standard human body point cloud data of the human body are downsampled. For example, the sample model A is initially aligned with the standard human body point cloud data by using an alignment method provided in the literature “Point Set Registration: Coherent Point Drift. Andriy Myronenko, etc. PAMI 2010.” Specifically, for example, the standard human body point cloud data or the sample model A undergoes at least one change of translation, rotation, or scaling, so that finally, there are as many data points as possible in the standard human body point cloud data aligning with a vertex of the sample model A, and the data points and the vertex overlap as much as possible.
Corresponding points between the initially aligned sample model A and the standard human body point cloud data are determined according to the initially aligned sample model A and the standard human body point cloud data. For example, for the vertex ai of the sample model A resulting from the alignment with the standard human body point cloud data, a nearest point is found in an entire human body point cloud based on three-dimensional distances and is used as a corresponding point pi of the vertex ai of the standard human body point cloud data.
Based on these correspondences between sparse points, for example, (a1, p1), the sample model A is initially aligned with the standard human body point cloud data. Specifically, the sample model A undergoes at least one change of translation, rotation, or scaling, so that the sample model A is initially aligned with the standard human body point cloud data. For the ease of understanding and description, the sample model A deformed by means of the foregoing initial alignment is referred to as a sample model A′.
Step two. Establish a correspondence between dense points.
Dense corresponding points are determined between the sample model A′ and the standard human body point cloud data according to the sample model A′ and the standard human body point cloud data by using a method for finding a corresponding nearest adjacent point. Based on the dense corresponding points, the sample model A′ is further aligned with the standard human body point cloud data. Specifically, the sample model A′ undergoes at least one change of translation, rotation, or scaling, so that the sample model A′ is further aligned with the standard human body point cloud data.
A deformed model resulting from performing the foregoing second alignment on the sample model A′ is determined as the template model of the human body. That is, the template model more accurately describes the standard human body point cloud data of the human body in the standard standing posture.
It should be understood that when the corresponding points are determined by using the nearest neighbor method, if normal vectors of two points form an angle less than 90 degrees and are less than 0.1 m apart, the corresponding point found by using the nearest neighbor method is proper. Using a determining condition for the angle between the normal vectors is to avoid incorrect match between a point on a front surface and a point on the back surface.
It should be understood that by using the foregoing two steps of establishing correspondences between points, the template model that has a point correspondence with the standard human body point cloud data in the standard standing posture is obtained.
It should be understood that the foregoing process of determining the template model may be considered as: a process of continuously deforming the sample model A in the human body database toward the standard human body point cloud data in the standard standing posture, so as to align the deformed sample module A with the standard human body point cloud data as much as possible, and finally generate a human body model matching the human body point cloud in the standard standing posture, that is, the template model.
S113. Determine a point correspondence between the target object point cloud data and the template model.
Specifically, the point correspondence between the human body point cloud data and the template model may be determined by using an alignment method provided in the literature “Point Set Registration: Coherent Point Drift. Andriy Myronenko, etc. PAMI 2010.” For example, a corresponding point of a vertex a2 of the template model in the human body point cloud data is p2, and the pair of corresponding points (a2, p2) are nearest adjacent points.
For example, the point correspondence between the template model and the human body point cloud data of the current frame may alternatively be established by referring to the first reconstruction model of the previous frame.
It should be understood that, alternatively, another alignment method may be used to determine the point correspondence between the human body point cloud data and the template model. This is not limited in this embodiment of the present disclosure.
S114. Estimate, based on a skeleton-driven deformation technology and the point correspondence, a posture change parameter of the target object point cloud data relative to the template model.
S115. Deform, by using the posture change parameter of the target object point cloud data relative to the template model, the template model into the first reconstruction model with a same posture as the target object point cloud data.
Specifically, the skeleton-driven technology uses a skeletal motion model to represent a movement of the human body, and implements smooth human body deformation based on almost rigid movement characteristics of each small part of the human body and by using skinning weight and linear blend skinning technologies. The skeletal motion model includes a mesh human body model and a human body skeleton embedded in the model. The human body skeleton includes some joints and bones. A connection between joints is orderly and may be represented by using a tree structure. A rotation axis is defined for each joint, and a bone connecting to the joint may arbitrarily rotate around the rotation axis of the joint. A movement of the bone is affected by movements of all joints in an entire chain (Kinematic Chain) from a root joint to the joint connected to the bone. A movement of each vertex of the template model may be expressed by using a linear combination of rigid movements of all the bones of the human body skeleton. A correlation between the movement of each vertex of the template model and the movement of each bone of the human body skeleton is represented by using a skinning weight. For a specific method, refer to an existing method in “Baran, etc., Automatic rigging and animation of 3d characters. SIGGRAPH 2007, page 72.”
Specifically,
Optionally, in this embodiment of the present disclosure, the posture change parameter of the target object point cloud data relative to the template model and the first reconstruction model with the same posture as the target object point cloud data are estimated according to the following formulas:
where qi(χ) is the ith vertex of the first reconstruction model, qi′ is the ith vertex of the template model, R is a total quantity of bones included in the skeleton model using the skeleton-driven technology, wig is a movement weight of a bone g for the ith vertex of the template model, jg is a quantity of joints in the skeleton model that affect a movement of the bone g, φg(j) is an index of the jthjoint in the skeleton model that affects the bone g, exp(θφ
It should be understood that in this embodiment of the present disclosure, the posture change parameter of the human body point cloud data relative to the template model is corresponding to the skeleton posture vector χ=(θ0{circumflex over (ξ)}, θ1, . . . , θn) in the formulas (1) and (2).
Specifically, multiple optimization iterations, for example, eight optimization iterations, are performed based on the formulas (1) and (2), so that the first reconstruction model resulting from deforming the template model has a better alignment relationship with the human body point cloud data of the current frame. Optionally, a Levenberg-Marquardt algorithm may be used to perform optimization iterations.
More specifically, in the multiple optimization iterations, a skeleton posture χt−1 of the previous frame and corresponding points between the first reconstruction model of the previous frame and the human body point cloud data of the current frame may be used as an initial iterative condition, so as to finally obtain a skeleton posture χ′ of the current frame.
To sum up, the posture change parameter of the human body point cloud data relative to the template model, that is, the skeleton posture vector χ in the formulas (1) and (2), may be estimated by means of the multiple iterations based on the formulas (1) and (2). Then, the skeleton posture vector χ is substituted into the formula (1), coordinates (corresponding to qi(χ) in the formula (1)) of each vertex of the first reconstruction model may be obtained through calculation, and the first reconstruction model is obtained.
It should be understood that a posture parameter of the first reconstruction model may be determined by using the posture change parameter (corresponding to the skeleton posture vector χ=(θ0{circumflex over (ξ)}, θ1, . . . , θn) in the formulas (1) and (2)) that is of the human body point cloud data relative to the template model and that is estimated in S114. Specifically, the posture change parameter (corresponding to the skeleton posture vector χ=(θ0{circumflex over (ξ)}, θ1, . . . , θn) in the formulas (1) and (2)) is determined as the posture parameter of the first reconstruction model. That is, the posture parameter of the first reconstruction model describes a posture change of the first reconstruction model relative to the template model.
To better reflect deformation of human body details, for example, local deformation and detail deformation of a limb, detail deformation may be further implemented based on the skeleton-driven deformation, so that the resulting first reconstruction model is truer to the actual human body.
Optionally, in this embodiment of the present disclosure, the obtaining a first reconstruction model of a target object in S110 includes the following steps.
S111. Obtain target object point cloud data of the target object.
A specific process is the same as the above, and for brevity, details are not repeated herein.
S112. Obtain a template model of the target object, where the template model is a model describing standard target object point cloud data of the target object in a preset standard posture.
A specific process is the same as the above, and for brevity, details are not repeated herein.
S113. Determine a point correspondence between the target object point cloud data and the template model.
A specific process is the same as the above, and for brevity, details are not repeated herein.
S114. Estimate, based on a skeleton-driven deformation technology and the point correspondence, a posture change parameter of the target object point cloud data relative to the template model.
S115A. Deform, by using the posture change parameter of the target object point cloud data relative to the template model, the template model into a skeleton deformation model with a same posture as the target object point cloud data, so that the skeleton deformation model is aligned with the target object point cloud data.
Specifically, the posture change parameter (corresponding to the skeleton posture vector χ=(θ0{circumflex over (ξ)}, θ1, . . . , θn) in the formulas (1) and (2)) of the human body point cloud data relative to the template model is estimated by means of the multiple iterations based on the formulas (1) and (2). qi(χ) in the formula (1) is considered as the ith vertex of the skeleton deformation model.
Then, the skeleton posture vector χ is substituted into the formula (1), the coordinates (corresponding to qi(χ) in the formula (1)) of each vertex of the first reconstruction model may be obtained through calculation, coordinates (corresponding to qi(χ) in the formula (1)) of each vertex of the skeleton deformation model is obtained, and the skeleton deformation model is obtained.
S115B. Deform, based on a mesh deformation technology, the skeleton deformation model, to obtain the first reconstruction model, so that the first reconstruction model matches a shape of the target object point cloud data.
Specifically, an affine transformation Xi is assigned to each vertex of the skeleton deformation model, the affine transformation Xi is used to transform each vertex of the skeleton deformation model to a corresponding point of the vertex of the human body point cloud. Transformations of all the vertexes are integrated, to obtain a 4n*3 matrix. An energy function for the deformation is as follows:
where X is a matrix including the transformation of each vertex, D is a matrix including coordinates of each vertex before the deformation, U is a coordinate matrix of a corresponding point in the human body point cloud, W is a weight matrix including a weight value of each corresponding point, ε is a set of all sides of the skeleton deformation model, i, j are indexes of two vertexes of a side (a connection between any two adjacent vertexes of the skeleton deformation model is referred to as a side) of the skeleton deformation model, and α is a smoothness term weight.
The first term in the formula (3) is a data term, representing that a distance between the vertex of the skeleton deformation model resulting from the deformation and the corresponding point in the human body point cloud data is as short as possible. The second term in the formula (3) is a smoothness term, representing that transformations of two vertexes of a side need to be similar, to make overall deformation smooth.
In the foregoing detail deformation process, the smoothness term weight is initially set to a large value, and as a quantity of iteration times gradually decreases, this manner helps to reduce impact of strong noise in input data on deformation as much as possible.
Specifically, the energy function in the formula (3) is solved by using a least squares method.
In this embodiment of the present disclosure, the first reconstruction model of the current frame results from sequentially performing skeleton-driven deformation and detail deformation on the template model of the human body, so as to better reflect deformation of human body details, for example, local deformation and detail deformation of a limb, and to make the resulting first reconstruction model truer to the actual human body.
In this embodiment of the present disclosure, alternatively, existing point alignment and deformation methods may be used, for example, the first reconstruction model of the human body point cloud data is obtained by using existing skeleton alignment, coarse alignment, and fine alignment. Alternatively, the first reconstruction model of the previous frame is aligned with the human body point cloud data of the current frame based on the skeleton-driven deformation method, and then, detail deformation is implemented by using Laplacian deformation, to obtain the first reconstruction model of the current frame.
In S120, the first reconstruction model is divided into the M local blocks, where the different local blocks of the M local blocks of the first reconstruction model are corresponding to the different parts of the target object, the different parts are represented by the different part names, and M is a positive integer greater than 1.
Specifically, for example, as shown in
Optionally, in this embodiment of the present disclosure, adjacent local blocks of the M local blocks of the first reconstruction model have a common boundary vertex at a junction.
Specifically, it is assumed that the first reconstruction model is the human body model shown in
The first reconstruction model is divided into the M local blocks, and the adjacent local blocks have the common boundary vertex at the junction. This helps to keep boundary consistency in a subsequent local block reconstruction step, so as to further improve model accuracy.
In S130, the N target object sample alignment models are obtained, where the posture parameter corresponding to the posture of each target object sample alignment model is the same as the posture parameter corresponding to the posture of the first reconstruction model, and each target object sample alignment model includes M local blocks, where the ith local block of each target object sample alignment model and the ith local block of the first reconstruction model are corresponding to a part that is of the target object and is represented by a same part name, the ith local block of each target object sample alignment model is aligned with the ith local block of the first reconstruction model, N is a positive integer, and i is 1, . . . , or M, where i being 1, . . . , and M means that assigned values of i are sequentially 1, . . . , and M.
The human body sample alignment model may be preset by a system, or may be obtained after a related processing operation is performed in real time on the standard human body sample model in the human body database. Details are provided in the following.
Optionally, in this embodiment of the present disclosure, the obtaining N human body sample alignment models in S130 includes the following steps.
S131. Obtain N target object sample models from a preset target object database.
Specifically, the human body standard database in this embodiment of the present disclosure may include 190 (that is, N is equal to 190) human body models in the standard standing posture, and each human body model includes 9999 vertexes and 19994 triangular facets.
S132. Deform, based on the skeleton-driven deformation technology and according to the posture parameter of the first reconstruction model, the N target object sample models into N target object sample skeleton deformation models corresponding to the same posture parameter as the first reconstruction model.
Specifically, the N human body sample models are deformed into the N human body sample skeleton deformation models by using a posture change parameter (corresponding to the skeleton posture χ determined based on the formulas (1) and (2)) that is of the current frame and that is determined in the skeleton-driven deformation process. The human body sample skeleton deformation model has a same posture as the first reconstruction model (or the human body point cloud data).
S133. Divide each target object sample skeleton deformation model into M local blocks, where the ith local block of each target object sample skeleton deformation model and the ith local block of the first reconstruction model are corresponding to a part that is of the target object and is represented by a same part name.
Specifically, the N human body sample skeleton deformation models resulting from the posture change each are divided into the M local blocks, and adjacent local blocks of the M local blocks have a common boundary vertex at a junction.
S134. Perform at least one change of rotation, translation, or scaling on the ith local block of each target object sample skeleton deformation model, to obtain the N target object sample alignment models, where after the at least one change of rotation, translation, or scaling, the ith local block of each target object sample alignment model is aligned with the ith local block of the first reconstruction model, and i is 1, 2, . . . , or M.
Specifically, by using an existing Procrustes analysis method (for example, “D. G. Kendall, ‘A survey of the statistical theory of shape,’ Statistical Science, vol. 4, no. 2, pp. 87-99, 1989.”), a parameter about rigid transformation from the ith local block of the M local blocks of each human body sample skeleton deformation model of the N human body sample skeleton deformation models to the ith local block of the first reconstruction model is estimated; according to the rigid transformation parameter, the ith local block of each human body sample skeleton deformation model is aligned with the ith local block of the first reconstruction model by performing the at least one change of rotation, translation, or scaling on the ith local block of each human body sample skeleton deformation model of the N human body sample skeleton deformation models, to obtain the N human body sample alignment models. The step S134 may be also referred to as a local block alignment step.
It should be understood that the N human body sample alignment models obtained according to the local block alignment step of S134 eliminates rigid transformation between the human body sample alignment models and the first reconstruction model to a relatively great extent. Therefore, in S140, the human body sample alignment models can well express the first reconstruction model.
In S140, the N target object sample alignment models are approximated to the first reconstruction model, to determine the second reconstruction model including the M local blocks, of the target object, where the ith local block of the second reconstruction model is determined according to the ith local block of each target object sample alignment model, and i is 1, . . . , or M. A specific process is as follows: obtaining the second reconstruction model according to the following formula:
K
i
=B
i
c
i+μi (i=1, . . . M) (4),
where Ki is the ith local block of the M local blocks of the second reconstruction model, Bi is a basis including the ith local blocks of the N target object sample alignment models, is an average value of vertex coordinates of the ith local blocks of the N target object sample alignment models, and ci is a coefficient vector of Bi, where a formula for obtaining ci includes:
where C=(ciT, c2T, . . . , cMT)T, Vi is the ith local block of the first reconstruction model, Γ is a set of adjacent local blocks of the M local blocks of each target object sample alignment model, (i, j)∈Γ represents that the jth local block of each target object sample alignment model is a local block adjacent to the ith local block of each target object sample alignment model, Bj is a basis including the jth local blocks of the target object sample alignment models, Bij is used to represent a boundary vertex at a junction of the ith local block and the jth local block of each target object sample alignment model, Bij is a subset of Bi, μij is an average value of Bij, Bji is used to represent a boundary vertex at a junction of the jth local block and the ith local block of each target object sample alignment model, Bji is a subset of Bj, μji is an average value of Bji, β is a weight, λ is a weight, ∥ ∥1 is an L1 norm, and ∥ ∥2 is an L2 norm.
It can be learned from the above that the first term in the formula (5) represents that linear expression of each local block of each human body sample alignment model is similar to a corresponding local block of the first reconstruction model. That is, an approximation degree of the linear combination of the ith local block of each human body sample alignment model to the ith local block of the first reconstruction model meets a preset condition. Specifically, the preset condition may be determined according to an indicator for a model accuracy requirement.
It should be understood that a single human body part has smaller posture change space than the entire human body. Therefore, more accurate linear expression of each local block in the first reconstruction model can be implemented by using a relatively small-scale human body sample database, so that this embodiment of the present disclosure can reduce requirements on a quantity of human body models and posture changes in a human body sample database, and therefore is to be applied more widely in future.
The second term in the formula (5) is a boundary constraint, representing that expression results of the common boundary vertex of the two adjacent local blocks are similar in the two local blocks.
Specifically, if the ith and the jth local blocks of the M local blocks included in a human body sample skeleton deformation model model 1 are adjacent local blocks, that is, the ith and the jth local blocks have common boundary vertexes G at the junction. That is, the common boundary vertexes G have same coordinates (or a position expression parameter) in both the ith and the jth local blocks. According to the local block alignment step of S134, that is, after the at least one change of rotation, translation, or scaling, each local block of the human body sample skeleton deformation model model 1 is aligned with the corresponding local block of the first reconstruction model, a model resulting from the local block alignment step is referred to as a human body sample alignment model model 2. In the human body sample alignment model model 2, the ith and the jth local blocks of the M local blocks included in the model 2 may be disconnected from each other, for example, break apart from each other, because of the at least one change of rotation, translation, or scaling. Therefore, the previous common boundary vertexes G are boundary vertexes G1 in the ith local block and boundary vertexes G2 in the jth local block, and coordinates (or a position expression parameter) of the boundary vertexes G1 in the ith local block are different from coordinates (or a position expression parameter) of the boundary vertexes G1 in the jth local block, and similarly, coordinates (or a position expression parameter) of the boundary vertexes G2 in the ith local block are different from coordinates (or a position expression parameter) of the boundary vertexes G2 in the jth local block. This is unhelpful for the boundary consistency in the local block reconstruction process.
The second term in the formula (5) is to resolve the foregoing problem. The second term in the formula (5) is the boundary constraint, representing that the expression results of the common boundary vertex of the two adjacent local blocks are similar in the two adjacent local blocks. That is, the expression results of the common boundary vertex of the two adjacent local blocks in the two adjacent local blocks should meet a preset condition, and the preset condition may be specifically determined according to a specific model accuracy requirement.
The constraint represented by the second term in the formula (5) effectively resolves the boundary inconsistency problem in the local block alignment process.
It can be further learned from the formula (5) that the coefficient vector ci of Bi is greater than 0 (that is, each element of the coefficient vector ci is positive), that is, meeting a coefficient positive constraint condition, so as to improve robustness to strong noise.
In this embodiment of the present disclosure, with reference to the formula (4) and the formula (5), the first reconstruction model and the second reconstruction model are determined according to the linear expression of the M local blocks. This can effectively improve the model accuracy and can also reduce requirements on a quantity of models and model postures in a human body sample database. Therefore, the data processing method is to be applied more widely in future.
In addition to determining the coefficient vector ci of Bi according to the formula (5), the coefficient vector ci of Bi may be determined according to the formula (6).
Similar to the formula (5), the first term in the formula (6) represents that linear expression of each local block of each human body sample alignment model is similar to a corresponding local block of the first reconstruction model. The second term is a boundary constraint, representing that expression results of the common boundary vertex of the two adjacent local blocks are similar in the two local blocks. The coefficient vector ci of Bi is greater than 0, that is, meeting a coefficient positive constraint condition. Different from the formula (5), the formula (6) further includes the third term. The third term represents a sparse coefficient constraint condition in linear expression (that is, there are as many elements of the coefficient vector ci as possible that are equal to 0). It should be understood that a positive coefficient constraint and the sparse coefficient constraint can improve robustness to strong noise.
This part is about a local block-based global reconstruction algorithm based on a basic idea of sparse coding. A sparse coding problem may be expressed by using the following formula:
The formula (5) may be solved by using an L1-minimization method.
Generally, extracted human body point cloud data includes noise, and therefore, the corresponding first reconstruction model also includes noise. According to the local block-based human body modeling method in this embodiment of the present disclosure, by using the linear expression, the boundary consistency condition, the positive coefficient constraint condition, and the sparse coefficient constraint condition of the local block, the noise introduced into the human body model can be effectively reduced, and the model accuracy is relatively high.
Therefore, according to the data processing method in this embodiment of the present disclosure, a first reconstruction model of a human body is divided into M local blocks, and N human body sample alignment models are approximated to the first reconstruction model, to determine a second reconstruction model including M local blocks, of the human body, where the ith local block of the second reconstruction model is determined according to the ith local block of each human body sample alignment model. With the method in this embodiment of the present disclosure, model accuracy can be effectively improved.
Optionally, in this embodiment of the present disclosure, block division policies of all the models may be based on a same policy. For example, according to the same block division policy, the first reconstruction model is divided into the M local blocks and the target object sample alignment model is divided into the M local blocks.
Optionally, in this embodiment of the present disclosure, in S120, the first reconstruction model is divided into the M local blocks according to the block division policy, where M may be alternatively equal to 1, and the process of obtaining the second reconstruction model may be: expressing the first reconstruction model by using a linear combination of each of the N human body sample alignment models in entire human body space, and when an approximation degree of the linear combinations of the N human body sample alignment models to the first reconstruction model meets a present condition, determining the corresponding linear combinations of the N human body sample alignment models as a reconstructed model of the first reconstruction model. The foregoing linear combination expression can also improve the reconstructed model accuracy to some extent.
Optionally, in this embodiment of the present disclosure, the method further includes: S150. Perform smooth optimization processing on the second reconstruction model.
Specifically, for example, smooth optimization processing is further performed on the second reconstruction model obtained in S140 by using a surface optimization algorithm provided in the literature “Kangkan Wang, etc. A Two-Stage Framework for 3D Face Reconstruction from RGBD Images. PAMI 2014. Volume: 36, Issue: 8, Pages 1493-1504.”
A specific step is as follows.
An affine transformation may be determined by three vertexes of each triangular facet and a point in the direction perpendicular to the triangular facet of the second reconstruction model before and after deformation. Coordinates of the fourth point may be calculated by using the following formula according to the three vertexes:
V
4
=V
1+(V2−V1)×(V3−V1)/√{square root over (|(V2−V1)×(V3−V1)|)} (8),
where V1, V2, V3 are the three vertexes of the triangular facet.
The affine transformation of the triangular facet may be written as:
Tv
i
+d={tilde over (v)}
i
i∈1, . . . 4 (9),
where {tilde over (v)}i, i∈1, . . . 3 are deformed points; and after the deformation, the following formula may be obtained:
T={tilde over (Q)}
Q
−1 (10),
The foregoing formula indicates that the affine transformation of the triangular facet may be linearly represented by coordinates of deformed vertexes.
An energy function for surface optimization is:
where |T| is a quantity of triangular facets of the template model, adj(i) is a set of triangular facets adjacent to an ith triangular facet, and ci is a vertex of the second reconstruction model corresponding to an ith vertex of the template model. The first term is a smoothness term, representing that a transformation difference between adjacent triangular facets needs to be minimized. The second term is a data term, representing that coordinates of a deformed vertex of the template model need to be aligned with coordinates of a corresponding point in the second reconstruction model. The energy function is a least squares problem and may be solved by using a standard method.
Therefore, according to the data processing method in this embodiment of the present disclosure, a first reconstruction model of a human body is divided into M local blocks, and N human body sample alignment models are approximated to the first reconstruction model, to determine a second reconstruction model including M local blocks, of the human body, where the ith local block of the second reconstruction model is determined according to the ith local block of each human body sample alignment model. With the method in this embodiment of the present disclosure, model accuracy can be effectively improved.
It should be understood that the foregoing description is about the second reconstruction model of the human body point cloud of the current frame. After the processing in S110 to S150 is performed on human body point cloud data in an entire time period, and the second reconstruction models resulting from smooth processing in the entire time period are obtained, temporal filtering processing may be further performed on the second reconstruction models in the entire time period.
Optionally, in this embodiment of the present disclosure, the method 100 further includes.
S160. Perform filtering optimization processing on the second reconstruction models in an entire time period, to obtain an optimized global model for all frames.
Specifically, after human body models of all the frames are reconstructed, that is, after smooth processing is performed on the second reconstruction models of all the frames, filtering processing is performed on the second reconstruction models resulting from smooth processing in the entire time period, to obtain the optimized global model for all the frames. The foregoing process may be also referred to as temporal filtering processing. Currently, there are many temporal filtering algorithms, and a Hodrick-Prescott filtering algorithm may be used.
It should be understood that performing filtering optimization processing in the entire time period can effectively eliminate jitter that may exist in the entire time period.
It should be understood that in this embodiment of the present disclosure, the description is based on the assumption that the human body is articulated.
Human body three-dimensional modeling has profound research significance and wide commercial applications. RGB-D cameras are easy to operate and cost less. A dynamic human body reconstruction algorithm may be applied to augmented reality display in a video conference system, to collect and transmit a to-be-displayed dynamic human body three-dimensional model in real time. In the present disclosure, in the local block-based global modeling algorithm, a three-dimensional posture of the human body is represented by the lower-dimensional sparse coding solution, and the local block-based global modeling algorithm may be applied to code transmission of the three-dimensional human body, that is, the human body model library containing a huge amount of information is preconfigured at a receive end, and a transmit end needs to transmit only the sparse coding solution.
As shown in
Depth images of two postures shown in
It can be learned from
A test sequence includes a total of 321 frames, and a dynamic human body model sequence is obtained.
It can be learned from
Therefore, according to the data processing method in this embodiment of the present disclosure, using a local block-based global human body reconstruction method can more accurately reconstruct dynamic three-dimensional models of a human body when strong noise or a hole exists in an input depth image. In addition, in a modeling processing, only one human body database including a small quantity of samples, of a standard posture is needed to reconstruct human body models for various human body shapes and postures. The modeling process is simpler, and the data processing method is to be used more widely in future.
It should be understood that in this embodiment of the present disclosure, more Kinect RGB-D™ cameras used to collect human body depth data indicate that the finally obtained second reconstruction model is more accurate. However, in this embodiment of the present disclosure, a quantity of Kinect RGB-D™ cameras is not strictly limited. For example, in this embodiment of the present disclosure, one Kinect RGB-D™ camera is used to collect depth image data, or a more accurate human body model may be obtained by using the local block-based method. That is, in the data processing method in this embodiment of the present disclosure, the quantity of Kinect RGB-D™ cameras is not strictly limited, and therefore, costs of a modeling process are relatively low, and there is relatively wide application.
Therefore, according to the data processing method in this embodiment of the present disclosure, a first reconstruction model of a human body is divided into M local blocks, and N human body sample alignment models are approximated to the first reconstruction model, to determine a second reconstruction model including M local blocks, of the human body, where the ith local block of the second reconstruction model is determined according to the ith local block of each human body sample alignment model. With the method in this embodiment of the present disclosure, model accuracy can be effectively improved. In addition, in this embodiment of the present disclosure, the second reconstruction model approximating to the first reconstruction model to a relatively great extent can be obtained based on a relatively small-scale human body sample database. Therefore, the data processing method in this embodiment of the present disclosure can also reduce requirements on a quantity of models and posture changes in a human body sample database, and therefore is to be applied more widely in future. The data processing method in this embodiment of the present disclosure may be further applied to modeling of another dynamic object in the computer graphics and vision fields.
In the above, the local block-based model reconstruction method in this embodiment of the present disclosure is described by using an example in which the target object is a human body. It should be understood that the target object may be alternatively an animal or another dynamic object. A person in the art may obviously make any equivalent modification or change according to the human body-based modeling example provided in the above, to obtain a modeling solution for the animal or the dynamic object. This modification or change also falls within the scope of this embodiment of the present disclosure.
Based on the foregoing technical solution, according to the data processing method in this embodiment of the present disclosure, a first reconstruction model of a target object is divided into M local blocks, and N target object sample alignment models are approximated to the first reconstruction model, to determine a second reconstruction model that is of the target object and includes M local blocks, where the ith local block of the second reconstruction model is determined according to the ith local block of each target object sample alignment model. With the method in this embodiment of the present disclosure, model accuracy can be effectively improved.
In the above, the data processing method in this embodiment of the present disclosure is described with reference to
The first obtaining module 210 is configured to obtain a first reconstruction model of a target object.
Specifically, the first reconstruction model may be a model that is reconstructed based on the human body point cloud data and that is used to describe human body point cloud data of a human body. The first reconstruction model is specifically a model determined after a human body sample model in a preset human body database is aligned with the human body point cloud data of the human body. Alignment herein means that the first reconstruction model has a point alignment relationship with the human body point cloud data. Specifically, each vertex included in the first reconstruction model is corresponding to a point in the human body point cloud data of the human body, and two points of each pair of corresponding points are nearest adjacent points.
Because the human body point cloud data is data collected based on the depth image data of the human body captured by a camera, the human body point cloud data generally includes strong noise, and the first reconstruction model obtained based on the human body point cloud data also includes noise, resulting in relatively low model precision. The first reconstruction model needs to be further processed, so as to improve the model precision.
The division module 220 is configured to divide the first reconstruction model obtained by the obtaining module into M local blocks, where different local blocks of the M local blocks of the first reconstruction model are corresponding to different parts of the target object, the different parts are represented by different part names, and M is a positive integer greater than 1.
Specifically, for example, the first reconstruction model is a human body model shown in
The second obtaining module 230 is configured to obtain N target object sample alignment models, where a posture parameter corresponding to a posture of each target object sample alignment model is the same as a posture parameter corresponding to a posture of the first reconstruction model obtained by the first obtaining module, and each target object sample alignment model includes M local blocks, where the ith local block of each target object sample alignment model and the ith local block of the first reconstruction model are corresponding to a part that is of the target object and is represented by a same part name, the ith local block of each target object sample alignment model is aligned with the ith local block of the first reconstruction model, N is a positive integer, and i is 1, . . . , or M, where i being 1, . . . , and M means that assigned values of i are sequentially 1, . . . , and M.
Specifically, the human body sample alignment model is model resulting from performing some processing on a standard human body sample model in the preset human body database. For example, the human body sample model undergoes a posture change, so that a posture parameter corresponding to the human body sample model resulting from the posture change (that is, the human body sample alignment model) is the same as that corresponding to the first reconstruction model of the human body, that is, the human body sample model resulting from the posture change and the first reconstruction model have a same posture. For example, if a posture of the first reconstruction model of the human body is squatting, the human body sample alignment model also has the squatting posture. This helps to ensure a constraint on boundary consistency in a subsequent model reconstruction process.
That the ith local block of each human body sample alignment model and the ith local block of the first reconstruction model are corresponding to a part represented by a same part name, of the human body means: If the first reconstruction model of the human body is divided into 16 local blocks, as shown in
As for that the ith local block of each human body sample alignment model is aligned with the ith local block of the first reconstruction model, the alignment is: No rigid transformation is needed between the ith local block of each human body sample alignment model and the ith local block of the first reconstruction model to implement alignment between each other, that is, the ith local block of each human body sample alignment model and the ith local block of the first reconstruction model are in a same coordinate system.
The determining module 240 is configured to approximate the N target object sample alignment models obtained by the second obtaining module to the first reconstruction model obtained by the first obtaining module, to determine a second reconstruction model that is of the target object and includes M local blocks, where the ith local block of the second reconstruction model is determined according to the ith local block of each target object sample alignment model, and i is 1, . . . , or M, where i being 1, . . . , and M means that assigned values of i are sequentially 1, . . . , and M.
Specifically, for example, the ith local block of the second reconstruction model is determined according to a linear combination of the ith local block of each human body sample alignment model, and the linear combination of the ith local block of each human body sample alignment model is determined in a process of approximating the N human body sample alignment models to the first reconstruction model.
Therefore, according to the data processing apparatus in this embodiment of the present disclosure, a first reconstruction model of a human body is divided into M local blocks, and N human body sample alignment models are approximated to the first reconstruction model, to determine a second reconstruction model including M local blocks, of the human body, where the ith local block of the second reconstruction model is determined according to the ith local block of each human body sample alignment model. With the method in this embodiment of the present disclosure, model accuracy can be effectively improved.
Optionally, in this embodiment of the present disclosure, adjacent local blocks of the M local blocks of the first reconstruction model obtained by the first obtaining module have a common boundary vertex at a junction.
Specifically, if the ith local block (for example, a right palm) and the jth local block (for example, a right forearm) of the M local blocks are adjacent local blocks, a circle of boundary vertexes at the junction (for example, a right wrist) of the right palm and the right forearm are vertexes belonging to both the ith local block (the right palm) and the jth local block (the right forearm). That is, the ith local block (the right palm) and the jth local block (the right forearm) have the common boundary vertexes (that is, vertexes in the right wrist) at the junction.
The division module 220 divides the first reconstruction model into the M local blocks according to a block division policy, and the adjacent local blocks have the common boundary vertex at the junction. This helps to keep consistency in the boundary in a subsequent local block reconstruction step, so as to further improve model accuracy.
Optionally, in this embodiment of the present disclosure, the determining module is specifically configured to: obtain the second reconstruction model according to the following formula:
K
i
=B
i
c
i+μi (i=1, . . . , M) (4),
where Ki is the ith local block of the M local blocks of the second reconstruction model, Bi is a basis including the ith local blocks of the N target object sample alignment models, μi is an average value of vertex coordinates of the ith local blocks of the N target object sample alignment models, and ci is a coefficient vector of Bi, where a formula for obtaining ci includes:
where C=(c1T, c2T, . . . , cMT)T, Vi is the ith local block of the first reconstruction model, Γ is a set of adjacent local blocks of the M local blocks of each target object sample alignment model, (i, j)∈Γ represents that the jth local block of each target object sample alignment model is a local block adjacent to the ith local block of each target object sample alignment model, Bj is a basis including the jth local blocks of the target object sample alignment models, Bij is used to represent a boundary vertex at a junction of the ith local block and the jth local block of each target object sample alignment model, Bij is a subset of Bi, μij is an average value of Bij, Bji is used to represent a boundary vertex at a junction of the j th local block and the ith local block of each target object sample alignment model, Bji is a subset of Bj, μji is an average value of Bji, β is a weight, λ is a weight, ∥ ∥1 is an L1 norm, and ∥ ∥2 is an L2 norm.
It can be learned from the above that the first term in the formula (5) represents that linear expression of each local block of each human body sample alignment model is similar to a corresponding local block of the first reconstruction model. That is, an approximation degree of the linear combination of the ith local block of each human body sample alignment model to the ith local block of the first reconstruction model meets a preset condition. Specifically, the preset condition may be determined according to an indicator for a model accuracy requirement.
It should be understood that a single human body part has smaller posture change space than the entire human body. Therefore, more accurate linear expression of each local block in the first reconstruction model can be implemented by using a relatively small-scale human body sample database, so that this embodiment of the present disclosure can reduce requirements on a quantity of human body models and posture changes in a human body sample database, and therefore is to be applied more widely in future.
The second term in the formula (5) is a boundary constraint, representing that expression results of the common boundary vertex of the two adjacent local blocks are similar in the two local blocks.
Specifically, if the ith and the jth local blocks of the M local blocks included in a human body sample skeleton deformation model model 1 are adjacent local blocks, that is, the ith and the jth local blocks have common boundary vertexes G at the junction. That is, the common boundary vertexes G have same coordinates (or a position expression parameter) in both the ith and the jth local blocks. According to the local block alignment step of S134, that is, after the at least one change of rotation, translation, or scaling, each local block of the human body sample skeleton deformation model model 1 is aligned with the corresponding local block of the first reconstruction model, a model resulting from the local block alignment step is referred to as a human body sample alignment model model 2. In the human body sample alignment model model 2, the ith and the jth local blocks of the M local blocks included in the model 2 may be disconnected from each other, for example, break apart from each other, because of the at least one change of rotation, translation, or scaling. Therefore, the previous common boundary vertexes G are boundary vertexes G1 in the ith local block and boundary vertexes G2 in the jth local block, and coordinates (or a position expression parameter) of the boundary vertexes G1 in the ith local block are different from coordinates (or a position expression parameter) of the boundary vertexes G1 in the jth local block, and similarly, coordinates (or a position expression parameter) of the boundary vertexes G2 in the ith local block are different from coordinates (or a position expression parameter) of the boundary vertexes G2 in the jth local block. This is unhelpful for the boundary consistency in the local block reconstruction process.
The second term in the formula (5) is to resolve the foregoing problem. The second term in the formula (5) is the boundary constraint, representing that the expression results of the common boundary vertex of the two adjacent local blocks are similar in the two adjacent local blocks. That is, the expression results of the common boundary vertex of the two adjacent local blocks in the two adjacent local blocks should meet a preset condition, and the preset condition may be specifically determined according to a specific model accuracy requirement.
The constraint represented by the second term in the formula (5) effectively resolves the boundary inconsistency problem in the local block alignment process.
It can be further learned from the formula (5) that the coefficient vector ci of Bi is greater than 0 (that is, each element of the coefficient vector ci is positive), that is, meeting a coefficient positive constraint condition, so as to improve robustness to strong noise.
In this embodiment of the present disclosure, with reference to the formula (4) and the formula (5), the first reconstruction model and the second reconstruction model are determined according to the linear expression of the M local blocks. This can effectively improve the model accuracy and can also reduce requirements on a quantity of models and model postures in a human body sample database. Therefore, the data processing apparatus is to be applied more widely in future.
In addition to determining the coefficient vector ci of Bi according to the formula (5), the coefficient vector ci of Bi may be determined according to the formula (6).
Similar to the formula (5), the first term in the formula (6) represents that linear expression of each local block of each human body sample alignment model is similar to a corresponding local block of the first reconstruction model. The second term is a boundary constraint, representing that expression results of the common boundary vertex of the two adjacent local blocks are similar in the two local blocks. The coefficient vector ci of Bi is greater than 0, that is, meeting a coefficient positive constraint condition. Different from the formula (5), the formula (6) further includes the third term. The third term represents a sparse coefficient constraint condition in linear expression (that is, there are as many elements of the coefficient vector ci as possible that are equal to 0). It should be understood that a positive coefficient constraint and the sparse coefficient constraint can improve robustness to strong noise.
This part is about a local block-based global reconstruction algorithm based on a basic idea of sparse coding. A sparse coding problem may be expressed by using the following formula:
The formula (5) may be solved by using an L1-minimization method.
Generally, extracted human body point cloud data includes noise, and therefore, the corresponding first reconstruction model also includes noise. According to the local block-based human body modeling method in this embodiment of the present disclosure, by using the linear expression, the boundary consistency condition, the positive coefficient constraint condition, and the sparse coefficient constraint condition of the local block, the noise introduced into the human body model can be effectively reduced, and the model accuracy is relatively high.
Optionally, in this embodiment of the present disclosure, the first obtaining module 210 includes a first obtaining unit 211, a second obtaining unit 212, a determining unit 213, an estimation unit 214, and a first deformation unit 215.
The first obtaining unit 211 is configured to obtain target object point cloud data of the target object.
Specifically, two steps of collecting a depth image of the human body and extracting human body point cloud data are included.
1. Collect the depth image of the human body; 2. Extract the human body point cloud data. The specific steps are the same as foregoing related description in the method, and for brevity, details are not repeated herein.
The second obtaining unit 212 is configured to obtain a template model of the target object, where the template model is a model describing standard target object point cloud data of the target object in a preset standard posture.
Specifically, the preset standard standing posture of the human body is a standard standing posture specified in the human body database. First, standard human body point cloud data of the human body in the preset standard standing posture of the human body is obtained. Then, any human body sample model in the human body database is aligned with the standard human body point cloud data of the human body. A model resulting from performing the alignment is the template model of the human body. Each vertex of the template model is corresponding to a point in the standard human body point cloud data, and two points of each pair of corresponding points are nearest adjacent points.
That is, the template model is a deformed model obtained by aligning the human body sample model in the human body database with the standard human body point cloud data of the human body. The obtaining the template model mainly includes the following two steps.
Step one. Establish a correspondence between sparse points.
A sample model A in the human body database is determined as a basis of deformation into the template model.
The sample model A and the standard human body point cloud data of the human body in the standard standing posture are downsampled. For example, the sample model A is initially aligned with the standard human body point cloud data by using an alignment method provided in the literature “Point Set Registration: Coherent Point Drift. Andriy Myronenko, etc. PAMI 2010.” Specifically, for example, the standard human body point cloud data or the sample model A undergoes at least one change of translation, rotation, or scaling, so that finally, there are as many data points as possible in the standard human body point cloud data aligning with a vertex of the sample model A, and the data points and the vertex overlap as much as possible.
Corresponding points between the initially aligned sample model A and the standard human body point cloud data are determined according to the initially aligned sample model A and the standard human body point cloud data. For example, for the vertex ai of the sample model A resulting from the alignment with the standard human body point cloud data, a nearest point is found in an entire human body point cloud based on three-dimensional distances and is used as a corresponding point pi of the vertex ai of the standard human body point cloud data.
Based on these correspondences between sparse points, for example, (a1, p1), the sample model A is initially aligned with the standard human body point cloud data. Specifically, the sample model A undergoes at least one change of translation, rotation, or scaling, so that the sample model A is initially aligned with the standard human body point cloud data. For the ease of understanding and description, the sample model A deformed by means of the foregoing initial alignment is referred to as a sample model A′.
Step two. Establish a correspondence between dense points.
Dense corresponding points are determined between the sample model A′ and the standard human body point cloud data according to the sample model A′ and the standard human body point cloud data by using a method for finding a corresponding nearest adjacent point. Based on the dense corresponding points, the sample model A′ is further aligned with the standard human body point cloud data. Specifically, the sample model A′ undergoes at least one change of translation, rotation, or scaling, so that the sample model A′ is further aligned with the standard human body point cloud data.
A deformed model resulting from performing the foregoing second alignment on the sample model A′ is determined as the template model of the human body. That is, the template model more accurately describes the standard human body point cloud data of the human body in the standard standing posture.
It should be understood that when the corresponding points are determined by using the nearest neighbor method, if normal vectors of two points form an angle less than 90 degrees and are less than 0.1 m apart, the corresponding point found by using the nearest neighbor method is proper. Using a determining condition for the angle between the normal vectors is to avoid incorrect match between a point on a front surface and a point on a back surface.
It should be understood that by using the foregoing two steps of establishing correspondences between points, the template model that has a point correspondence with the standard human body point cloud data in the standard standing posture is obtained.
The determining unit 213 is configured to determine a point correspondence between the target object point cloud data obtained by the first obtaining unit and the template model obtained by the second obtaining unit.
Specifically, the point correspondence between the human body point cloud data and the template model may be determined by using an alignment method provided in the literature “Point Set Registration: Coherent Point Drift. Andriy Myronenko, etc. PAMI 2010.” For example, a corresponding point of a vertex a2 of the template model in the human body point cloud data is p2, and the pair of corresponding points (a2, p2) are nearest adjacent points.
For example, the point correspondence between the template model and the human body point cloud data of the current frame may alternatively be established by referring to the first reconstruction model of the previous frame.
It should be understood that, alternatively, another alignment method may be used to determine the point correspondence between the human body point cloud data and the template model. This is not limited in this embodiment of the present disclosure.
The estimation unit 214 is configured to estimate, based on a skeleton-driven deformation technology and the point correspondence determined by the determining unit, a posture change parameter of the target object point cloud data that is relative to the template model determined by the second obtaining unit and that is determined by the first obtaining unit.
The first deformation unit 215 deforms, by using the posture change parameter that is of the target object point cloud data relative to the template model and that is estimated by the estimation unit, the template model into the first reconstruction model with a same posture as the target object point cloud data.
Specifically, the skeleton-driven technology uses a skeletal motion model to represent a movement of the human body, and implements smooth human body deformation based on almost rigid movement characteristics of each small part of the human body and by using skinning weight and linear blend skinning technologies. The skeletal motion model includes a mesh human body model and a human body skeleton embedded in the model. The human body skeleton includes some joints and bones. A connection between joints is orderly and may be represented by using a tree structure. A rotation axis is defined for each joint, and a bone connecting to the joint may arbitrarily rotate around the rotation axis of the joint. A movement of the bone is affected by movements of all joints in an entire chain (Kinematic Chain) from a root joint to the joint connected to the bone. A movement of each vertex of the template model may be expressed by using a linear combination of rigid movements of all the bones of the human body skeleton. A correlation between the movement of each vertex of the template model and the movement of each bone of the human body skeleton is represented by using a skinning weight. For a specific method, refer to an existing method in “Baran, etc., Automatic rigging and animation of 3d characters. SIGGRAPH 2007, page 72.”
Specifically,
Optionally, in this embodiment of the present disclosure, the posture change parameter of the target object point cloud data that is relative to the template model determined by the second obtaining unit and that is determined by the first obtaining unit and the first reconstruction model with the same posture as the target object point cloud data are determined according to the following formulas:
where qi(χ) is the ith vertex of the first reconstruction model, qi is the ith vertex of the template model, R is a total quantity of bones included in the skeleton model using the skeleton-driven technology, wig is a movement weight of a bone g for the ith vertex of the template model, jg is a quantity of joints in the skeleton model that affect a movement of the bone g, φg(j) is an index of the jth joint in the skeleton model that affects the bone g, exp(θφ
It should be understood that in this embodiment of the present disclosure, the posture change parameter of the human body point cloud data relative to the template model is corresponding to the skeleton posture vector χ=(θ0{circumflex over (ξ)}, θ1, . . . , θn) in the formulas (1) and (2).
Specifically, multiple optimization iterations, for example, eight optimization iterations, are performed based on the formulas (1) and (2), so that the first reconstruction model resulting from deforming the template model has a better alignment relationship with the human body point cloud data of the current frame. Optionally, a Levenberg-Marquardt algorithm may be used to perform optimization iterations.
More specifically, in the multiple optimization iterations, a skeleton posture χt−1 of the previous frame and corresponding points between the first reconstruction model of the previous frame and the human body point cloud data of the current frame may be used as an initial iterative condition, so as to finally obtain a skeleton posture χt of the current frame.
To sum up, the posture change parameter of the human body point cloud data relative to the template model, that is, the skeleton posture vector χ in the formulas (1) and (2), may be estimated by means of the multiple iterations based on the formulas (1) and (2). Then, the skeleton posture vector χ is substituted into the formula (1), coordinates (corresponding to qi(χ) in the formula (1)) of each vertex of the first reconstruction model may be obtained through calculation, and the first reconstruction model is obtained.
It should be understood that a posture parameter of the first reconstruction model may be determined by using the posture change parameter (corresponding to the skeleton posture vector χ=(θ0{circumflex over (ξ)}, θ1, . . . , θn) in the formulas (1) and (2)) that is of the human body point cloud data relative to the template model and that is estimated in S114. Specifically, the posture change parameter (corresponding to the skeleton posture vector χ=(θ0{circumflex over (ξ)}, θ1, . . . , θn) in the formulas (1) and (2)) is determined as the posture parameter of the first reconstruction model. That is, the posture parameter of the first reconstruction model describes a posture change of the first reconstruction model relative to the template model.
To better reflect deformation of human body details, for example, local deformation and detail deformation of a limb, detail deformation may be further implemented based on the skeleton-driven deformation, so that the resulting first reconstruction model is truer to the actual human body.
Optionally, in this embodiment of the present disclosure, the first obtaining module 210 includes: a first obtaining unit 211, configured to obtain target object point cloud data of the target object; a second obtaining unit 212, configured to obtain a template model of the target object, where the template model is a model describing standard target object point cloud data of the target object in a preset standard posture; a determining unit 213, configured to determine a point correspondence between the target object point cloud data obtained by the first obtaining unit and the template model obtained by the second obtaining unit; an estimation unit 214, configured to estimate, based on a skeleton-driven deformation technology and the point correspondence determined by the determining unit, a posture change parameter of the target object point cloud data that is relative to the template model determined by the second obtaining unit and that is determined by the first obtaining unit; where for specific description about the first obtaining unit 211, the second obtaining unit 212, the determining unit 213, and the estimation unit 214, refer to the above, and for brevity, details are not repeated herein; a second deformation unit 215A, configured to deform, by using the posture change parameter that is of the target object point cloud data relative to the template model and that is estimated by the estimation unit, the template model into a skeleton deformation model with a same posture as the target object point cloud data, so that the skeleton deformation model is aligned with the target object point cloud data; and a third deformation unit 215B, configured to deform, based on a mesh deformation technology, the skeleton deformation model obtained by the second deformation unit, to obtain the first reconstruction model, so that the first reconstruction model matches a shape of the target object point cloud data.
Specifically, an affine transformation X, is assigned to each vertex of the skeleton deformation model, the affine transformation X, is used to transform each vertex of the skeleton deformation model to a corresponding point of the vertex of the human body point cloud. Transformations of all the vertexes are integrated, to obtain a 4n*3 matrix. An energy function for the deformation is as follows:
where X is a matrix including the transformation of each vertex, D is a matrix including coordinates of each vertex before the deformation, U is a coordinate matrix of a corresponding point in the human body point cloud, W is a weight matrix including a weight value of each corresponding point, ε is a set of all sides of the skeleton deformation model, i, j are indexes of two vertexes of a side (a connection between any two adjacent vertexes of the skeleton deformation model is referred to as a side) of the skeleton deformation model, and α is a smoothness term weight.
The first term in the formula (3) is a data term, representing that a distance between the vertex of the skeleton deformation model resulting from the deformation and the corresponding point in the human body point cloud data is as short as possible. The second term in the formula (3) is a smoothness term, representing that transformations of two vertexes of a side need to be similar, to make overall deformation smooth.
In the foregoing detail deformation process, the smoothness term weight is initially set to a large value, and as a quantity of iteration times gradually decreases, this manner helps to reduce impact of strong noise in input data on deformation as much as possible.
Specifically, the energy function in the formula (3) is solved by using a least squares method.
In this embodiment of the present disclosure, the first reconstruction model of the current frame results from sequentially performing skeleton-driven deformation and detail deformation on the template model of the human body, so as to better reflect deformation of human body details, for example, local deformation and detail deformation of a limb, and to make the resulting first reconstruction model truer to the actual human body.
In this embodiment of the present disclosure, alternatively, existing point alignment and deformation methods may be used, for example, the first reconstruction model of the human body point cloud data is obtained by using existing skeleton alignment, coarse alignment, and fine alignment. Alternatively, the first reconstruction model of the previous frame is aligned with the human body point cloud data of the current frame based on the skeleton-driven deformation method, and then, detail deformation is implemented by using Laplacian deformation, to obtain the first reconstruction model of the current frame.
Optionally, in this embodiment of the present disclosure, the second obtaining module 230 includes a third obtaining unit 231, a fourth deformation unit 232, a division unit 233, and a fourth obtaining unit 234.
The third obtaining unit 231 is configured to obtain N target object sample models from a preset target object database.
Specifically, the human body standard database in this embodiment of the present disclosure may include 190 human body models in the standard standing posture. That is, the second obtaining module obtains 190 (that is, N is equal to 190) human body models in the standard standing posture from the human body standard database.
The fourth deformation unit 232 is configured to deform, based on the skeleton-driven deformation technology and according to the posture parameter of the first reconstruction model, the N target object sample models obtained by the third obtaining unit into N target object sample skeleton deformation models corresponding to the same posture parameter as the first reconstruction model.
Specifically, the N human body sample models are deformed into the N human body sample skeleton deformation models by using a posture change parameter (corresponding to the skeleton posture x determined based on the formulas (1) and (2)) that is of the current frame and that is determined in the skeleton-driven deformation process. The human body sample skeleton deformation model has a same posture as the first reconstruction model (or the human body point cloud data).
The division unit 233 is configured to divide each target object sample skeleton deformation model obtained by the fourth deformation unit into M local blocks, where the ith local block of each target object sample skeleton deformation model and the ith local block of the first reconstruction model are corresponding to a part that is of the target object and is represented by a same part name.
Specifically, the N human body sample skeleton deformation models resulting from the posture change each are divided into the M local blocks, and adjacent local blocks of the M local blocks have a common boundary vertex at a junction.
The fourth obtaining unit 234 is configured to perform at least one change of rotation, translation, or scaling on the ith local block that is of each target object sample skeleton deformation model and that is obtained by the division unit, to obtain the N target object sample alignment models, where after the at least one change of rotation, translation, or scaling, the ith local block of each target object sample alignment model is aligned with the ith local block of the first reconstruction model, and i is 1, 2, . . . , or M.
Specifically, by using an existing Procrustes analysis method (for example, “D. G. Kendall, ‘A survey of the statistical theory of shape,’ Statistical Science, vol. 4, no. 2, pp. 87-99, 1989.”), a parameter about rigid transformation from the ith local block of the M local blocks of each human body sample skeleton deformation model of the N human body sample skeleton deformation models to the ith local block of the first reconstruction model is estimated; according to the rigid transformation parameter, the ith local block of each human body sample skeleton deformation model is aligned with the ith local block of the first reconstruction model by performing the at least one change of rotation, translation, or scaling on the ith local block of each human body sample skeleton deformation model of the N human body sample skeleton deformation models, to obtain the N human body sample alignment models. The step S134 may be also referred to as a local block alignment step.
It should be understood that the N human body sample alignment models obtained according to the local block alignment step of S134 eliminates rigid transformation between the human body sample alignment models and the first reconstruction model to a relatively great extent. Therefore, in S140, the human body sample alignment models can well express the first reconstruction model.
Optionally, in this embodiment of the present disclosure, the apparatus further includes: an optimization module 250, configured to perform smooth optimization processing on the second reconstruction model.
Specifically, for example, the optimization module 250 is configured to perform smooth optimization processing on the second reconstruction model obtained in S140 by using a surface optimization algorithm provided in the literature “Kangkan Wang, etc. A Two-Stage Framework for 3D Face Reconstruction from RGBD Images. PAMI 2014. Volume: 36, Issue: 8, Pages 1493-1504.”
It should be understood that the foregoing description is about the second reconstruction model of the human body point cloud of the current frame. After the processing by the first obtaining module 210, the division module 220, the second obtaining module 230, the determining module 240, and the optimization module 250 is performed on human body point cloud data in an entire time period, and second reconstruction models resulting from smooth processing in the entire time period are obtained, temporal filtering processing may be further performed on the second reconstruction models in the entire time period.
Optionally, in this embodiment of the present disclosure, the apparatus 200 further includes: a global optimization module 260, configured to perform filtering optimization processing on the second reconstruction models in the entire time period, to obtain an optimized global model for all frames.
Specifically, after the optimization module 250 performs smooth processing on the second reconstruction models of all the frames, the global optimization module 260 is configured to perform filtering processing on the second reconstruction models resulting from smooth processing in the entire time period, to obtain the optimized global model for all the frames. The foregoing process may be also referred to as temporal filtering processing. Currently, there are many temporal filtering algorithms, and the global optimization module 260 may use a Hodrick-Prescott filtering algorithm.
It should be understood that performing filtering optimization processing in the entire time period can effectively eliminate jitter that may exist in the entire time period.
Therefore, according to the data processing apparatus in this embodiment of the present disclosure, a first reconstruction model of a human body is divided into M local blocks, and N human body sample alignment models are approximated to the first reconstruction model, to determine a second reconstruction model including M local blocks, of the human body, where the ith local block of the second reconstruction model is determined according to the ith local block of each human body sample alignment model. With the apparatus in this embodiment of the present disclosure, model accuracy can be effectively improved.
It should be understood that the foregoing and another operation and/or function of each module of the data processing apparatus 200 in this embodiment of the present disclosure is to implement a corresponding process of each method in
In the above, with reference to
Based on the foregoing technical solution, according to the data processing apparatus in this embodiment of the present disclosure, a first reconstruction model of a target object is divided into M local blocks, and N target object sample alignment models are approximated to the first reconstruction model, to determine a second reconstruction model that is of the target object and includes M local blocks, where the ith local block of the second reconstruction model is determined according to the ith local block of each target object sample alignment model. With the apparatus in this embodiment of the present disclosure, model accuracy can be effectively improved.
As shown in
Therefore, according to the data processing apparatus in this embodiment of the present disclosure, a first reconstruction model of a human body is divided into M local blocks, and N human body sample alignment models are approximated to the first reconstruction model, to determine a second reconstruction model including M local blocks, of the human body, where the ith local block of the second reconstruction model is determined according to the ith local block of each human body sample alignment model. With the apparatus in this embodiment of the present disclosure, model accuracy can be effectively improved.
Optionally, in an embodiment, adjacent local blocks of the M local blocks of the first reconstruction model have a common boundary vertex at a junction.
Optionally, in an embodiment, the processor 310 is specifically configured to obtain the second reconstruction model according to the following formula:
K
i
=B
i
c
i+μi (i=1, . . . , M),
where Ki is the ith local block of the M local blocks of the second reconstruction model, Bi is a basis including the ith local blocks of the N target object sample alignment models, μi is an average value of vertex coordinates of the ith local blocks of the N target object sample alignment models, and ci is a coefficient vector of Bi, where a formula for obtaining ci includes:
where C=(c1T, c2T, . . . , cMT)T, Vi is the ith local block of the first reconstruction model, Γ is a set of adjacent local blocks of the M local blocks of each target object sample alignment model, (i, j)∈Γ represents that the jth local block of each target object sample alignment model is a local block adjacent to the ith local block of each target object sample alignment model, Bj is a basis including the jth local blocks of the target object sample alignment models, Bij is used to represent a boundary vertex at a junction of the ith local block and the jth local block of each target object sample alignment model, Bij is a subset of Bi, μij is an average value of Bij, Bji is used to represent a boundary vertex at a junction of the jth local block and the ith local block of each target object sample alignment model, Bji is a subset of Bj, μji is an average value of Bji, β is a weight, λ is a weight, ∥ ∥1 is an L1 norm, and ∥ ∥2 is an L2 norm.
Optionally, in an embodiment, the processor 310 is specifically configured to: obtain target object point cloud data of the target object; obtain a template model of the target object, where the template model is a model describing standard target object point cloud data of the target object in a preset standard posture; determine a point correspondence between the target object point cloud data and the template model; estimate, based on a skeleton-driven deformation technology and the point correspondence, a posture change parameter of the target object point cloud data relative to the template model; and deform, by using the posture change parameter of the target object point cloud data relative to the template model, the template model into the first reconstruction model with a same posture as the target object point cloud data.
Optionally, in an embodiment, the processor 310 is specifically configured to: obtain target object point cloud data of the target object; obtain a template model of the target object, where the template model is a model describing standard target object point cloud data of the target object in a preset standard posture; determine a point correspondence between the target object point cloud data and the template model; estimate, based on a skeleton-driven deformation technology and the point correspondence, a posture change parameter of the target object point cloud data relative to the template model; deform, by using the posture change parameter of the target object point cloud data relative to the template model, the template model into a skeleton deformation model with a same posture as the target object point cloud data, so that the skeleton deformation model is aligned with the target object point cloud data; and deform, based on a mesh deformation technology, the skeleton deformation model, to obtain the first reconstruction model, so that the first reconstruction model matches a shape of the target object point cloud data.
Optionally, in an embodiment, the processor 310 is specifically configured to: obtain N target object sample models from a preset target object database; deform, based on the skeleton-driven deformation technology and according to the posture parameter of the first reconstruction model, the N target object sample models into N target object sample skeleton deformation models corresponding to the same posture parameter as the first reconstruction model; divide each target object sample skeleton deformation model into M local blocks, where the ith local block of each target object sample skeleton deformation model and the ith local block of the first reconstruction model are corresponding to a part that is of the target object and is represented by a same part name; and perform at least one change of rotation, translation, or scaling on the ith local block of each target object sample skeleton deformation model, to obtain the N target object sample alignment models, where after the at least one change of rotation, translation, or scaling, the ith local block of each target object sample alignment model is aligned with the ith local block of the first reconstruction model, and i is 1, 2, . . . , or M.
Optionally, in an embodiment, the processor 310 is further configured to perform smooth optimization processing on the second reconstruction model.
It should be understood that the foregoing description is about the second reconstruction model of a human body point cloud of a current frame. After obtaining the second reconstruction models in an entire time period, optionally, in an embodiment, the processor 310 is further configured to perform filtering optimization processing on the second reconstruction models in the entire time period, to obtain a global optimization model for all frames.
It should be understood that in this embodiment of the present disclosure, the processor 310 may be a central processing unit (CPU), or the processor 310 may be another general purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or another programmable logic device, discrete gate or transistor logic device, discrete hardware component, or the like. The general purpose processor may be a microprocessor. Alternatively, the processor may be any conventional processor or the like.
The memory 320 may include a read-only memory and a random access memory, and provides an instruction and data for the processor 310. A part of the memory 320 may further include a nonvolatile random access memory. For example, the memory 320 may further store information about a device type.
The bus system 330 may further include a power bus, a control bus, a status signal bus, or the like, in addition to a data bus. However, for clear description, various types of buses in the figure are marked as the bus system 330.
During an implementation process, each step in the foregoing methods may be completed by using a hardware integrated logic circuit in the processor 310 or an instruction in form of software. The steps of the methods disclosed with reference to the embodiments of the present disclosure may be directly executed and completed by a hardware processor, or may be executed and completed by using a combination of hardware in the processor and software modules. A software module may be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, or another mature storage medium in the art. The storage medium is located in the memory 320. The processor 310 reads the information in the memory 320 and completes the steps of the foregoing methods in combination with hardware of the processor 310. Details are not described herein again for avoiding repetition.
Therefore, according to the data processing apparatus in this embodiment of the present disclosure, a first reconstruction model of a human body is divided into M local blocks, and N human body sample alignment models are approximated to the first reconstruction model, to determine a second reconstruction model including M local blocks, of the human body, where the ith local block of the second reconstruction model is determined according to the ith local block of each human body sample alignment model. With the apparatus in this embodiment of the present disclosure, model accuracy can be effectively improved.
It should be understood that the apparatus 300 in this embodiment of the present disclosure may be corresponding to the data processing apparatus 200 in the embodiment of the present disclosure, and the foregoing and another operation and/or function of each module of the apparatus 300 is to implement a corresponding process of each method in
Based on the foregoing technical solution, according to the data processing apparatus in this embodiment of the present disclosure, a first reconstruction model of a target object is divided into M local blocks, and N target object sample alignment models are approximated to the first reconstruction model, to determine a second reconstruction model that is of the target object and includes M local blocks, where the ith local block of the second reconstruction model is determined according to the ith local block of each target object sample alignment model. With the method in this embodiment of the present disclosure, model accuracy can be effectively improved.
It should be understood that the ith, the first, the second, the third, the fourth, and various numbers in this application are used for differentiation only for ease of description, instead of limiting the scope of the embodiments of the present disclosure. For example, the ith local block is only a name of a local block, but not to limit the scope of the embodiments of the present disclosure.
The term “and/or” in this specification describes only an association relationship for describing associated objects and represents that three relationships may exist. For example, A and/or B may represent the following three cases: Only A exists, both A and B exist, and only B exists. In addition, the character “/” in this specification generally indicates an “or” relationship between the associated objects.
It should be understood that sequence numbers of the foregoing processes do not mean execution sequences in various embodiments of the present disclosure. The execution sequences of the processes should be determined according to functions and internal logic of the processes, and should not be construed as any limitation on the implementation processes of the embodiments of the present disclosure.
A person of ordinary skill in the art may be aware that, the units and algorithm steps in the examples described with reference to the embodiments disclosed in this specification may be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed by hardware or software depends on particular applications and design constraint conditions of the technical solutions. A person skilled in the art may use different methods to implement the described functions for each particular application, but it should not be considered that the implementation goes beyond the scope of the present disclosure.
It may be clearly understood by a person skilled in the art that, for the purpose of convenient and brief description, for a detailed working process of the foregoing system, apparatus, and unit, reference may be made to a corresponding process in the foregoing method embodiments, and details are not described.
In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the described apparatus embodiment is merely an example. For example, the unit division is merely logical function division and may be other division in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces, indirect couplings or communication connections between the apparatuses or units, or electrical connections, mechanical connections, or connections in other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit.
When the functions are implemented in the form of a software functional unit and sold or used as an independent product, the functions may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of the present disclosure essentially, or the part contributing to the prior art, or some of the technical solutions may be implemented in a form of a software product. The software product is stored in a storage medium, and includes several instructions for instructing a computer device (which may be a personal computer, a server, or a network device) to perform all or some of the steps of the methods described in the embodiments of the present disclosure. The foregoing storage medium includes: any medium that can store program code, such as a universal serial bus (USB) flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc.
The foregoing descriptions are merely specific implementations of the present disclosure, but are not intended to limit the protection scope of the present disclosure. Any variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in the present disclosure shall fall within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.
Number | Date | Country | Kind |
---|---|---|---|
201510059955.9 | Feb 2015 | CN | national |
This application is a continuation of International Application No. PCT/CN2015/084335, filed on Jul. 17, 2015, which claims priority to Chinese Patent Application No. 201510059955.9 filed on Feb. 4, 2015, the disclosures of the aforementioned applications are hereby incorporated by reference in their entireties.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2015/084335 | Jul 2015 | US |
Child | 15667917 | US |