Head posture estimation method, device and storage medium

By using binocular cameras and image pyramid technology in head posture estimation to optimize feature point matching and tracking, the problems of low robustness and low accuracy in the existing technology are solved, and efficient tracking and accurate estimation of head posture are achieved.

CN113361400BActive Publication Date: 2024-09-17QINGYUAN HUAAO PHOTOELECTRIC INSTR CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110628375.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-04
Publication Date
2024-09-17
Estimated Expiration
2041-06-04

Smart Images

  • Figure CN113361400B
    Figure CN113361400B
Patent Text Reader

Abstract

The present invention discloses a head posture estimation method, device and storage medium, including: extracting, optimizing and matching feature points of images constituting an image pyramid to determine the position of a second feature point of a current frame and estimating the head posture. The present invention has the beneficial effects of: extracting features from received images and continuously dividing the images to optimize feature points, solving the problem of feature point clustering, tracking head posture at a relatively low cost, and obtaining the angle of head posture deflection relative to a key frame.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of tracking and target posture estimation, and in particular, to a head posture estimation method, device and storage medium. Background Art

[0002] With the rapid development of computer vision, head posture estimation is still one of the research hotspots in the field of computer vision. In short, head posture estimation is to determine the three posture angles of a person's head in three-dimensional space by inputting images or videos, namely roll, pitch, and yaw. It is a close-up of the direction of a person's head at a certain moment. Head posture has very wide applications in face recognition, human-computer interaction, fatigue driving, attention detection, etc. Different head postures can not only infer the intention of the tester, but also get the head direction and then judge whether the tester is focused. Head posture estimation has a very broad development prospect in practical applications.

[0003] At present, head posture estimation can be mainly divided into appearance template method, detector array method, nonlinear regression method, geometric calculation method, flexible template method, tracking method and other methods according to different implementation methods. However, the current head posture estimation methods have problems such as poor robustness, low accuracy and poor real-time performance. Summary of the invention

[0004] In order to solve the deficiencies of the prior art, the present invention provides a head posture estimation method, device and storage medium.

[0005] The present invention proposes a head posture estimation method, comprising: receiving an image with a head, wherein the image is an image taken by a binocular camera; extracting a first feature point by using an image pyramid constructed by each frame of the image as a node; dividing the node into four sub-nodes, and if the number of first feature points in the sub-node is 0, deleting the sub-node; if the number of first feature points in the sub-node is 1, retaining the sub-node; if the number of first feature points in the sub-node is greater than 1, continuing to divide the sub-node into four new sub-nodes until the number of retained sub-nodes is greater than a first preset value or the number of first feature points in the retained sub-nodes is all 1; retaining the first feature point with the highest Harris response value in each sub-node, setting it as a second feature point; matching the second feature point in the same frame, and setting the three-dimensional point of the world coordinate system bound to the second feature point as a map point; obtaining the position of the second feature point in the current frame according to the map point; estimating the head posture according to the key frame of the world coordinate system and the current frame.

[0006] In this technical solution, by extracting features from the received image and continuously dividing the image to optimize feature points, the problem of feature point clustering is solved, and the head posture tracking is achieved at a lower cost to obtain the angle of deflection of the head posture relative to the key frame.

[0007] In the above technical solution, the head deflection angle information of the first frame is received, and the world coordinate system is established with the first frame as a key frame.

[0008] In this technical solution, the world coordinate system is established with the first frame of the image as the key frame, which is conducive to calculating the angles of other frames and to estimating the deflection angle of the head posture.

[0009] In the above technical solution, after receiving the position of the second feature point in the current frame according to the map point, the key frame and the map point are stored.

[0010] In this technical solution, saving key frames is helpful to improve the estimation efficiency of head posture angles.

[0011] In the above technical solution, if the received image has the same scene as the image received last time, the stored key frames and map points are called to relocate and track the head.

[0012] In this technical solution, the head tracking efficiency can be improved by calling the stored key frames to achieve repositioning.

[0013] In the above technical solution, matching the second feature point in the same frame includes: taking a neighborhood S at the second feature point to obtain:

[0014]

[0015]

[0016] Where N is the number of point pairs, τ(S; p, q) means taking a neighborhood block S from the extracted second feature point, randomly taking point pairs p and q in this neighborhood block S, and f N (S) is the feature point descriptor, and i is a positive integer.

[0017] In this technical solution, the information of each second feature point is obtained through the above equation, which is conducive to matching the second feature points, estimating the deflection angle of the head posture, and improving the accuracy of the estimation.

[0018] In the above technical solution, obtaining the position of the second feature point in the current frame based on the map point includes: receiving the postures of the previous two frames respectively; calculating the posture of the current frame according to the posture difference of the previous two frames; projecting the map point in the world coordinate system in the previous frame to the current frame, and searching for a point matching the second feature point of the previous frame within a range with the projection point as the center and a radius of r1 as the second feature point of the current frame, wherein r1 is positively correlated with the second feature point of the map point in the number of layers of the image pyramid.

[0019] In this technical solution, the position of the second feature point of the current frame is determined by the posture difference between the previous two frames, thereby achieving tracking of the head posture, which is conducive to estimating the deflection angle of the head posture and improving the accuracy of the estimation.

[0020] In the above technical solution, the receiving of the postures of the first two frames respectively further includes: optimizing the received postures, and the optimization equation is:

[0021]

[0022] Among them, the pose is {R, t}, and its Lie group is represented by T, T * is the optimized pose, n is the result of all matching, ρ is the robust kernel function, u i is the projection point, π s is the projection equation, P i is a map point, P i =[X i , Y i , Z i ] T ,∑ is the covariance matrix associated with the scale of the second feature point, π s is defined as follows:

[0023]

[0024] Among them, f x , f y is the focal length of the camera, c x , c y is the camera principal point, and b is the camera baseline distance.

[0025] In this technical solution, optimizing the postures of the first two frames is conducive to estimating the deflection angle of the head posture and improving the accuracy of the estimation.

[0026] In the above technical solution, the current frame and the key frame form a local map, the map points of the local map are projected to the current frame, and the points matching the second feature points of the previous frame are searched within a range with the projection point as the center and a radius of r2, wherein r2 is positively correlated with the map points of the local map in the number of layers of the image pyramid.

[0027] In this technical solution, the second feature point of the local map is matched to improve the accuracy of the position of the second feature point of the current frame, which is conducive to estimating the deflection angle of the head posture and improving the accuracy of the estimation.

[0028] The present invention also provides a device, comprising a memory, a processor and a program, wherein the program is stored in the memory, and the processor executes the program to implement the method as described above.

[0029] The present invention also provides a storage medium, wherein the storage medium stores a program, and when the program is executed by a processor, the above-mentioned head posture estimation method is implemented.

[0030] The beneficial effects of the present invention are: by extracting features from received images, continuously dividing images and processing feature points, the phenomenon of feature point clustering is solved, the head posture is tracked at a lower cost, and the angle of deflection of the head posture relative to the key frame is obtained. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A head posture tracking method according to an embodiment of the present invention is shown;

[0032] Figure 2 A model diagram of binocular camera imaging according to an embodiment of the present invention is shown;

[0033] Figure 3 A geometric model diagram of a binocular camera according to an embodiment of the present invention is shown;

[0034] Figure 4 A flow chart of a tracking algorithm according to an embodiment of the present invention is shown;

[0035] Figure 5 A diagram of a uniform speed model matching strategy according to an embodiment of the present invention is shown;

[0036] Figure 6 shows a reprojection error map according to one embodiment of the present invention;

[0037] Figure 7 A diagram showing a camera coordinate system and a head coordinate system according to an embodiment of the present invention is shown;

[0038] Figure 8A matching flowchart of a second feature point according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0039] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0040] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0041] In the related art, head posture refers to the deflection angle of a person's head relative to the frontal face image in three-dimensional space. Head posture estimation is the process of inferring the deflection angle of a person's head from a digital image or video image. The specific deflection angles can be divided into roll angle, yaw angle, and pitch angle. Ideally, the head posture ranges from -90° to 90° in the three coordinate axis directions, but in fact, there is usually a certain range for the head deflection of adults. The head posture deflection range around the X-axis (Pitch) direction is -60.4° to +69.6°, the head posture deflection range around the Y-axis (Yaw) direction is -40.9° to 36.3°, and the head posture deflection range around the Z-axis (Roll) direction is -79.8° to +75.37°.

[0042] Some embodiments of the present invention are described below with reference to the accompanying drawings. The present invention is further described in detail below.

[0043] like Figure 1 As shown, the present invention provides a head posture estimation method, comprising:

[0044] Receiving an image having a head, wherein the image is an image taken by a binocular camera;

[0045] Extracting a first feature point using an image pyramid constructed by using each frame of the image as a node;

[0046] Split the node into 4 sub-nodes, and if the number of first feature points in the sub-node is 0, delete the sub-node;

[0047] If the number of the first feature points of the child node is 1, retain the child node;

[0048] If the number of first feature points in the subnode is greater than 1, continue to split the subnode into 4 new subnodes until the number of retained subnodes is greater than a first preset value or the number of first feature points in the retained subnodes is all 1;

[0049] The first feature point with the highest Harris response value in each child node is retained and set as the second feature point;

[0050] Match the second feature point in the same frame, and set the 3D point in the world coordinate system bound to the second feature point as the map point;

[0051] Acquire the position of the second feature point in the current frame according to the map point;

[0052] The head posture is estimated based on the key frame of the world coordinate system and the current frame.

[0053] By extracting features from the received images and continuously dividing the images to optimize feature points, the problem of feature point clustering is solved, and the head posture tracking is achieved at a lower cost to obtain the angle of deflection of the head posture relative to the key frame.

[0054] Optionally, the number of levels of the image pyramid is 8.

[0055] The first preset value should be determined according to the actual situation, and the effect can be kept relatively stable when a certain number of feature points are extracted.

[0056] Since the algorithm needs to be initialized, in the world coordinate system, the angle information of the first frame can be set as the frontal face image, and the frontal face image is the first frame. The frontal face image refers to the image of the face facing the left camera. It can be understood that each frame of the image should include the image taken by the left camera and the image taken by the right camera to achieve the subsequent matching of the second feature point and the binding of its corresponding map point.

[0057] Specifically, in one embodiment, the matching process of the second feature point is as follows: Figure 8 shown.

[0058] Construct an image pyramid. The construction of an image pyramid forms a series of images with different resolutions, which is conducive to forming a cognition of the size of the face.

[0059] Limit the extraction area and set the feature point extraction area to the center of the image to reduce the feature point detection range.

[0060] Divide the image into blocks, divide the set extraction area into image grids of uniform size, and extract the first feature point in each image grid. The first feature point is extracted by taking any pixel point a in the child node and setting the pixel value to I a, select a circle with a radius of 3 with point a as the center, and compare the grayscale values ​​of the 16 pixels on the circle with the pixel a respectively. If there are 12 consecutive pixels with a brightness greater than I a +T or less than I a -T, it is considered to be the first feature point. In order to improve efficiency, for each pixel point, add a pre-test operation to detect the brightness of the 1st, 5th, 9th, and 13th pixels on the neighborhood circle. When 3 of these 4 pixels are greater than I at the same time, a +T or less than I a -T may be the first feature point. The value of T should be selected according to the actual situation to extract the first feature point in a suitable extraction range.

[0061] Specifically, this extraction method often brings about a large number of first feature points, and the first feature points often appear clustered due to the small range of grayscale value comparison. Therefore, the image pyramid composed of each frame of the image is divided into 4 sub-nodes as a node, and operations are performed according to the number of first feature points in the sub-nodes: deleting the sub-nodes without first feature points can avoid repeated comparisons of sub-nodes without first feature points and improve efficiency; retaining the sub-nodes with only one first feature point is conducive to using the first feature point to realize the estimation of the head posture of the current frame; sub-nodes with more than one first feature point are divided again until the number of sub-nodes reaches the first threshold, or the number of first feature points in each sub-node is 1. Operations are performed on the clustered first feature points, which can eliminate the clustering phenomenon caused by the extraction method. On the other hand, the first feature point with the highest Harris response value in each sub-node is retained as the second feature point, which is conducive to the subsequent operation of head posture estimation.

[0062] Harris response value refers to the response value obtained by using the Harris Corner Detection algorithm. Its size can be used to evaluate whether a pixel is the first feature point. Harris Corner Detector is an algorithm widely used in computer vision. It is mainly used to find feature points representing corners from images.

[0063] If the image is rotated, the descriptor information of the second feature point will change. The second feature point can be optimized by calculating the main direction of the feature point using the grayscale centroid method to achieve rotation invariance of the second feature point.

[0064] For the optimized second feature point, the matching rate of the second feature point can be improved by obtaining the descriptor information of the second feature point. BRIEF descriptor (full name: Binary Robust Independent Elementary Features, a binary coded descriptor).

[0065]

[0066]

[0067] The BRIEF descriptor is calculated for each point, where N is the number of point pairs, and the value of N can be one of 128, 256, and 512. τ(S; p, q) refers to taking a neighborhood block S from the extracted second feature point, and randomly selecting point pairs p and q in this neighborhood block S, f N (S) is a feature point descriptor, and i is a positive integer. Obtaining the second feature point of the descriptor information is conducive to completing the matching of the second feature point.

[0068] like Figure 2 As shown in the figure, O1 and O2 are the aperture centers of the left and right cameras, and P is a point in three-dimensional space. Since the photos acquired by the binocular camera are images of the same object from two perspectives, the matching method for the second feature point after calculating the BRIEF descriptor is as follows: According to the epipolar constraint principle, the second feature point P2 matching the second feature point P1 on the left image I1 must be on the epipolar line in the right image I2. After epipolar line correction, point P2 only needs to be searched in the x-axis direction of I2.

[0069] For the second feature point in the left camera, search bands of different sizes are set in the right camera according to the image scale to obtain candidate feature points. The candidate feature points are matched with BRIEF descriptors, and then SAD matching (Sum of absolute differences, an image matching algorithm. The basic idea is the sum of the absolute values ​​of the differences. This algorithm is often used for image block matching. The absolute values ​​of the differences between the corresponding values ​​of each pixel are summed to evaluate the similarity of the two image blocks.) is used for similarity comparison. The mismatched points that do not meet the requirements are eliminated, and then sub-pixel precision matching is achieved through parabola fitting to obtain accurate matching results.

[0070] For the matched points, the map points can be bound through the binocular matching relationship, such as Figure 3 As shown, for a point P in three-dimensional space, the imaging point of the left camera and the right camera is P L and P R , where u L and u R is the pixel coordinate of point P on the u axis on different imaging planes, f is the focal length, O L and O R are the aperture centers of the left and right cameras respectively. According to the principle of similar triangles, we can get:

[0071]

[0072] Arrange, get

[0073]

[0074] Where d = u L -u R The above binding method can realize the binding of the three-dimensional point in the world coordinate system and the second feature point that has been matched. The bound three-dimensional point becomes a map point, which can be used to determine the position of the second feature point bound to the map point in the current frame.

[0075] In one embodiment, the process of determining the position of the second feature point bound to the map point in the current frame is as follows: Figure 4 Each process is described below.

[0076] In the map initialization phase, after completing the matching of the second feature point, set the depth value of the 3D point to z, the binocular camera baseline to b, and bind the 3D point with a depth value of 0<z<10*b to the second feature point to become a map point with the observation information, descriptor information, and observation direction information of the second feature point. The first frame that is successfully initialized is used as the key frame and the temporary reference key frame for subsequent tracking to establish the initial world coordinate system.

[0077] Tracking matching phase, such as Figure 5 As shown, to obtain the position of the second feature point in the current frame, the poses of the previous two frames are received respectively; the pose of the current frame is calculated according to the pose difference of the previous two frames; the map point in the previous frame in the world coordinate system is projected into the current frame, and within the range of the projection point as the center and the radius r1, a point matching the second feature point of the previous frame is searched as the second feature point of the current frame, wherein r1 is positively correlated with the number of layers of the second feature point of the map point in the image pyramid. Specifically, the feature points on the same node can be matched based on the DBoW2 algorithm (full name Bags of binary words 2, which is an improved method based on Bags of binary words), and the corresponding map points are bound to the matched feature points to obtain a 3D-2D matching relationship, and the initial pose of the current frame is set according to the pose difference between the previous two frames and the uniform motion assumption. For the map point of the previous frame, it is projected into the current frame, and the matching point is searched within the radius r1 to obtain the best matching result.

[0078] like Figure 6As shown in the figure, for the matching relationship obtained by projection, BA (full name Bundle Adjustment, an optimization model whose purpose is to minimize the reprojection error) can be used to construct the constraint of minimizing the reprojection error, and the LM algorithm (full name Levenberg-Marquarelt, an algorithm for iteratively finding the extreme value of a function, the LM algorithm combines the characteristics of the two algorithms of Newton's method for finding the extreme value and the gradient method for finding the extreme value.) Iteratively optimizes the posture, where the reprojection error is shown in the figure. In the initial value, the map point P obtained by matching the second feature point p1, its projection point There is a certain distance e between the actual p2, so multiple points are considered to optimize the camera posture to minimize the overall error of all points. Let the map point be Pi = [X i , Y i , Z i ] T , the projection point is u i , the projection equation is π s , the camera's position is {R, t}, its Lie group is represented by T, n is the result of all matching, then the optimization equation can be obtained:

[0079]

[0080] Among them, i takes values ​​within the range of the number of map points, T * is the optimized camera pose, ρ is the robust kernel function used to suppress projection points with large errors, and ∑ is the covariance matrix related to the feature point scale. π s is defined as follows:

[0081]

[0082] Among them, f x is the focal length of the camera in the X direction, f y is the focal length of the same camera in the Y direction; c x is the principal point of the camera in the X direction, c y is the principal point in the Y direction of the same camera; b is the baseline distance between the two cameras.

[0083] In the local map tracking stage, in order to improve the pose accuracy, after the first BA optimization, the local map points are projected to the current frame to obtain more 3D-2D matching relationships, and BA optimization poses are performed again. Among them, the local map consists of key frames that have a co-view relationship with the current frame. The following conditions must be met to project the local map points to the current frame:

[0084] a) Calculate the projection position of the map point and abandon it if it exceeds the image boundary;

[0085] b) Calculate the cosine value of the angle between the current observation line of sight and the average observation direction of the map point. If it is less than cos60°, give up;

[0086] c) Calculate the distance d from the map point to the camera optical center, if Then give up, where d min is the lower limit of the distance to the point, d max is the upper limit of the distance to the point.

[0087] If there are candidate matching feature points, the 3D point is matched with the unmatched feature points to obtain a 3D-2D matching relationship.

[0088] In the key frame decision stage, since the tracking process is a continuous process, when the interval between the key frame and the current frame is too large, it is necessary to consider replacing the key frame. The conditions are as follows:

[0089] a) More than 30 frames have passed since the last relocation

[0090] b) The time since the last key frame was generated is more than 30 frames.

[0091] c) The map points on the current frame tracking are less than 0.4×the map points on the reference key frame tracking or the map points on the current frame tracking are less than 0.4×the total number of close points in the current frame.

[0092] d) The number of points tracked in the current frame is not less than 15.

[0093] The number of frames in a) and b) should be the same, and the number of frames here is only an example. You can select other numbers of frames according to the actual situation. Since the frame in which relocation is successful is the key frame, the setting of the number of frames is related to the time interval of key frames. Too small a time interval will affect the efficiency. The reference key frame is a representative frame selected from the key frames that is closely related to the current frame. In this way, when the uniform speed model tracking is lost, the reference key frame will be considered for tracking first, and relocation will only be performed when all other conditions fail. The number of close points is that the points with depth values ​​less than a certain threshold in the current frame are considered to be close points.

[0094] At the same time, if the number of key frames exceeds the set threshold, a redundant key frame is judged. If more than 90% of the map points of a key frame can be observed simultaneously by more than 3 key frames in a row, it is a redundant key frame and the key frame will be removed to ensure that the operating efficiency will not be affected by the accumulation of time.

[0095] For tracking loss, the key frame with the highest similarity to the current frame is searched in the local key frame for relocation, and DBoW2 is used to accelerate the matching. The EPNP algorithm (full name: Efficient Perspective-n-Point, which is a non-iterative PnP algorithm for solving the camera pose) calculates the initial pose and optimizes it by minimizing the reprojection error through BA. Then, the unmatched map points in the key frame are projected to the current frame for BA pose optimization again.

[0096] After normal tracking is completed, the map is saved, including the keyframes and the matching information and binding information of each second feature point in the keyframes. If these stored information are loaded next time when running in the same scene, the initialization step can be skipped to directly achieve repositioning and continue tracking the posture. As long as the binocular camera does not move, after tracking and locating the same head, the head is tracked again, and the two trackings are considered to belong to the same scene. When running the algorithm in the same scene, the feature points will be re-extracted from the head of the person, and then matched with the stored keyframes. If enough points are matched, the repositioning is successful, so that subsequent tracking and head posture estimation can be performed.

[0097] By estimating the head posture according to the key frame of the world coordinate system and the current frame, the head posture angle can be estimated. Among them, the rotation matrix and Euler angle are used to estimate the head posture. The rotation matrix describes: the rotation of a rigid body in three-dimensional space can be regarded as a movement with three degrees of freedom, that is, rotation around three axes respectively. The angles of these three rotations are Euler angles. The rotation that is always based on the original coordinate system can be called static Euler angles.

[0098] Define a coordinate system, where the rotation around the Z axis corresponds to the Roll angle, denoted as α, the rotation around the Y axis corresponds to the Yaw angle, denoted as β, and the rotation around the X axis corresponds to the Pitch angle, denoted as γ. For the three rotations around the fixed axis, they are defined as follows:

[0099]

[0100]

[0101]

[0102] The rotation matrix is ​​defined as follows:

[0103]

[0104] From the conversion relationship between the rotation matrix and the static Euler angle, it can be concluded that R(α, β, γ) = R z (α)R y (β)Rx (γ), then:

[0105]

[0106] Where c represents cosine and s represents sin, the calculation formulas for the α, β, and γ angles are as follows:

[0107] α=atan2(R 21 , R 11 )

[0108]

[0109] γ=atan2(R 32 , R 33 )

[0110] Depend on Figure 7 It can be seen that the initial world coordinate system is established with the image of the face facing the left camera. For the head coordinate system, α should be taken as -α, β should be taken as -β, and γ should remain unchanged. The translation between the camera and the head model is ignored, so that the head posture, namely the roll angle, yaw angle, and pitch angle, can be obtained.

[0111] In order to quantitatively evaluate the accuracy of head posture estimation, the evaluation indicators mean absolute error (MAE) and standard deviation (Standard Deviation) are used to test roll [-15°, 15°], pitch [-15°, 15°], yaw [-15°, 15°], and the average of multiple test results is taken. Among them, the mean absolute error is the average of the absolute error, which can better reflect the actual error of the predicted value from the true value. The formula for calculating the mean absolute error is as follows:

[0112]

[0113]

[0114]

[0115] Where α′, β′, γ′ are measured values, and α, β, γ are true values.

[0116] The standard deviation (SD), denoted as σ, is used as one of the evaluation criteria of the head posture estimation algorithm. The standard deviation is used to measure the degree of dispersion of a set of data from the mean. Since the invention uses a continuous video image sequence, the standard deviation can indicate the data stability during continuous tracking. The calculation formula of the standard deviation is as follows:

[0117]

[0118]

[0119]

[0120] In the formula, α′, β′, γ′ are measured values, u α ,u β ,u γ is the average value.

[0121] In one of the embodiments, a binocular ZED camera is used for data collection. The depth range of the ZED camera is 0.3-25m, and the distance from the camera to the head model is about 45cm. First, the internal and external parameter matrix of the binocular camera is obtained, and the internal and external parameters are calculated. Then, the ZED camera is used to record the head model video with a frame rate of 15fps and an image size of 1280×720. Since the instrument can only adjust the rotation within a range of 15°, the data collected in this experiment are all between [-15°, 15°]. The pitch angle, yaw angle, and roll angle are collected in video respectively, and then the video is converted into a 640×360 image as the algorithm input. Since the algorithm needs to be initialized, the angle information of the first frame can be set as the front face image, and the front face image is used as the first frame.

[0122] The present invention also provides a device, comprising a memory, a processor and a program, wherein the program is stored in the memory, and the processor executes the program to implement the method as described above.

[0123] The present invention also provides a storage medium, wherein the storage medium stores a program, and when the program is executed by a processor, the above-mentioned head posture estimation method is implemented.

Claims

1. A head posture estimation method, characterized in that: include: Receiving an image having a head, wherein the image is an image taken by a binocular camera; Extracting a first feature point using an image pyramid constructed by using each frame of the image as a node; Split the node into 4 sub-nodes, and if the number of first feature points in the sub-node is 0, delete the sub-node; If the number of the first feature points of the child node is 1, retain the child node; If the number of first feature points in the subnode is greater than 1, continue to split the subnode into 4 new subnodes until the number of retained subnodes is greater than the first preset value or the number of first feature points in the retained subnodes is 1, and retain the first feature point with the highest Harris response value in each subnode as the second feature point; Match the second feature point in the same frame, and set the 3D point in the world coordinate system bound to the second feature point as the map point; Acquire the position of the second feature point in the current frame according to the map point; The head posture is estimated based on the key frame of the world coordinate system and the current frame.

2. The head posture estimation method according to claim 1, characterized in that: The head deflection angle information of the first frame is received, and the world coordinate system is established with the first frame as a key frame.

3. The head posture estimation method according to claim 1, characterized in that: After receiving the position of the second feature point in the current frame according to the map point, the key frame and the map point are stored.

4. The head posture estimation method according to claim 3, characterized in that: If the scene of the received image is the same as that of the image received last time, the stored key frames and map points are called to reposition and track the head.

5. The head posture estimation method according to claim 1, characterized in that: The matching of the second feature point in the same frame includes: taking a neighborhood S of the second feature point to obtain: Where N is the number of point pairs, τ(S; p, q) means taking a neighborhood block S from the extracted second feature point, randomly taking point pairs p and q in this neighborhood block S, and f N (S) is the feature point descriptor, and i is a positive integer.

6. The head posture estimation method according to claim 5, characterized in that: The acquiring the position of the second feature point in the current frame according to the map point includes: Receive the poses of the first two frames respectively; Calculating the pose of the current frame according to the pose difference between the first two frames; The map point in the world coordinate system in the previous frame is projected into the current frame, and within a range with the projection point as the center and a radius of r1, a point matching the second feature point of the previous frame is searched as the second feature point of the current frame, wherein r1 is positively correlated with the number of layers of the second feature point of the map point in the image pyramid.

7. The head posture estimation method according to claim 6, characterized in that: The receiving of the postures of the first two frames respectively also includes: optimizing the received postures, and the optimization equation is: Among them, the pose is {R, t}, and its Lie group is represented by T, T * is the optimized pose, n is the result of all matching, ρ is the robust kernel function, u i is the projection point, π s is the projection equation, P i is a map point, P i =[X i , Y i , Z i ] T ,∑ is the covariance matrix associated with the scale of the second feature point, π s is defined as follows: Among them, f x , f y is the focal length of the camera, c x , c y is the camera principal point, and b is the camera baseline distance.

8. The head posture estimation method according to claim 6, characterized in that: The receiving, according to the map point, the position of the second feature point in the current frame comprises: The current frame and the key frame form a local map, the map points of the local map are projected to the current frame, and a point matching the second feature point of the previous frame is searched within a range of a circle with a radius of r2 and a projection point as the center, wherein r2 is positively correlated with the number of layers of the map points of the local map in the image pyramid.

9. A device, characterized in that: The method comprises a memory, a processor and a program, wherein the program is stored in the memory, and the processor executes the program to implement the method according to any one of claims 1 to 8.

10. A storage medium, characterized in that: The storage medium stores a program, and when the program is executed by the processor, the above-mentioned head posture estimation method is implemented.