Gesture recognition method based on depth camera and feature fusion and electronic equipment
Through the gesture recognition method of depth camera and feature fusion, the problem that traditional technology is difficult to segment target gestures in complex backgrounds is solved, and high-precision gesture recognition is achieved under multi-scale and multi-angle angles.
Patent Information
- Application Number
- CN202410930409.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-11-01
Smart Images

Figure CN118887733A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of gesture recognition technology, and in particular to a gesture recognition method and electronic device based on a depth camera and feature fusion. Background Art
[0002] Traditional human-computer interaction technology based on gesture recognition has difficulty in segmenting the target gesture in complex backgrounds. Common methods for segmenting target gestures include threshold-based segmentation methods and skin color-based segmentation methods. The threshold-based segmentation method cannot achieve good segmentation results in complex backgrounds, and the skin color-based segmentation method is prone to confusion when there are other skin-like parts in the background, resulting in low accuracy of existing gesture recognition, and often problems such as misrecognition or insensitive recognition. Summary of the invention
[0003] In view of this, the present application provides a gesture recognition method and electronic device with good accuracy combining depth camera and feature fusion.
[0004] In a first aspect, an embodiment of the present application provides a gesture recognition method based on a depth camera and feature fusion, and the gesture recognition method based on a depth camera and feature fusion includes:
[0005] Collecting a depth image set, the depth image set includes a plurality of depth images, each depth image includes a gesture image and a non-gesture image, and the depth image set is obtained by shooting one or more interactive gestures under different shooting conditions by a depth camera;
[0006] Performing gesture segmentation on each depth image to obtain a gesture image sample set, wherein the gesture image sample set includes a plurality of gesture images of one or more interactive gestures;
[0007] Extracting features of each gesture image using at least two feature extraction algorithms to obtain two feature vectors of different lengths corresponding to each gesture image;
[0008] The two feature vectors of different lengths of each gesture image are fused to obtain a fused feature vector set, wherein the fused feature vector set includes a fused feature vector corresponding to each gesture image;
[0009] Inputting the fused feature vector set into an initial model for training to obtain the gesture recognition model;
[0010] The depth image is input into a gesture recognition model to perform gesture recognition.
[0011] In a second aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:
[0012] A depth camera, used to collect a depth image, wherein the depth image includes a gesture image;
[0013] A gesture recognition module is loaded with a gesture recognition model, and the gesture recognition module performs gesture recognition on the depth image according to a gesture recognition method based on a depth camera and feature fusion.
[0014] The above-mentioned gesture recognition method and electronic device based on depth camera and feature fusion. By selecting a depth camera, gesture segmentation is performed on the depth image to ensure that the target gesture can be well segmented in a complex background. The problem that the human-computer interaction technology based on gesture recognition is difficult to segment the target gesture in a complex background is solved. The features of the gesture image are extracted using a feature extraction algorithm, fused and trained to obtain a gesture recognition model. The depth image is then input into the gesture recognition model for static gesture recognition, which improves the accuracy of gesture recognition at multiple scales and angles. The problem that the traditional gesture classification method extracts a single feature or is difficult to accurately express gesture information at multiple scales and angles, resulting in low gesture recognition accuracy is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0016] Figure 1 A schematic flow chart of a gesture recognition method based on a depth camera and feature fusion provided in an embodiment of the present application.
[0017] Figure 2 This is a schematic diagram of the depth camera imaging principle provided in an embodiment of the present application.
[0018] Figure 3 Schematic diagram of various interactive gestures provided in the embodiments of the present application
[0019] Figure 4 This is a depth example diagram of a standard gesture provided in an embodiment of the present application.
[0020] Figure 5 An example diagram of depth of gesture tilt provided in an embodiment of the present application.
[0021] Figure 6 An example of depth at multiple angles provided for an embodiment of the present application.
[0022] Figure 7 A multi-scale depth example diagram provided in an embodiment of the present application.
[0023] Figure 8A flowchart of sub-steps of step S300 provided in an embodiment of the present application.
[0024] Fig. 9 The depth histogram provided in the embodiment of the present application has not been preprocessed.
[0025] Fig.10 Provided in the embodiments of this application Fig. 9 Corresponding depth map.
[0026] Fig.11 A depth histogram after depth threshold segmentation provided in an embodiment of the present application.
[0027] Fig.12 This is an original image of the first gesture provided in this embodiment of the present application.
[0028] Fig.13 This is a depth threshold segmentation result diagram of the first gesture provided in an embodiment of the present application.
[0029] Fig.14 This is a binary image of the first gesture provided in an embodiment of the present application.
[0030] Fig.15 This is the original image of the second gesture provided in this embodiment of the application.
[0031] Fig.16 This is a depth threshold segmentation result diagram of the second gesture provided in an embodiment of the present application.
[0032] Fig.17 This is a binarized image of the second gesture provided in this embodiment of the present application.
[0033] Fig.18 Six types of gesture depth maps are provided in the embodiments of the present application.
[0034] Fig.19 Six types of gesture binarization images are provided in the embodiments of the present application.
[0035] Fig. 20 Six gesture profiles are provided for the embodiments of the present application.
[0036] Fig.21 A schematic diagram of convex hull detection provided in an embodiment of the present application.
[0037] Fig. 22 A schematic diagram of fingertip detection provided in an embodiment of the present application.
[0038] Fig.23 Schematic diagram of two types of image features provided in an embodiment of the present application.
[0039] Fig.24 A diagram of the SVM classification and recognition process provided in an embodiment of the present application.
[0040] Fig.25 Schematic diagram of an electronic device provided in an embodiment of the present application
[0041] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0043] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar planning objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate. In other words, the described embodiments are implemented according to an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any of their variations may also include other content. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to only those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0044] It should be noted that the descriptions involving "first", "second", etc. in this application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0045] Please see Figure 1 , Figure 1 A flowchart of a gesture recognition method based on a depth camera and feature fusion is provided in an embodiment of the present application. The gesture recognition method based on a depth camera and feature fusion includes the following steps S100-S600.
[0046] Step S100, collecting a depth image set, the depth image set includes a plurality of depth images, each of which includes a gesture image and a non-gesture image, and the depth image set is obtained by shooting one or more interactive gestures under different shooting conditions by a depth camera. Furthermore, the non-gesture image includes images of other parts of the human body other than the hands and background images. Images of other parts of the human body other than the hands include the face, torso, etc. The background image refers to the scene image where the human body is located, such as trees, lawns, sky, etc.
[0047] A depth image is also called a distance image, which refers to an image that uses the distance (depth) from the image collector to each point in the scene as a pixel value. In this embodiment, the depth image is acquired by a depth sensor, for example, a TOF (Time of Flight, TOF) camera or a DTOF (Direct Time of Flight, DTOF) camera. Since TOF cameras and DTP cameras are not sensitive to changes in lighting conditions, and the depth image represents the depth value of the object, it is easy to separate the foreground and background. Using depth information for gesture segmentation can reduce the impact of lighting and complex backgrounds.
[0048] Please refer to Figure 2 , Figure 2 The imaging principle diagram of the depth camera 11 provided in the embodiment of the present application. The depth camera 11 includes a frequency driver 110, a laser transmitter 120, a laser receiver 130, and a counter 140. The driver 110 is used to drive the laser transmitter to emit pulsed light. The laser receiver 120 includes one or more avalanche diodes. The pulsed light is reflected back by the target 200 and received by the laser receiver 130, and then the distance of the target is measured by calculating the flight time of the light signal through the counter 140. The depth image is a single-channel image, and each pixel value represents the distance from the object to the camera plane, usually in millimeters. Compared with color images, it is easy to distinguish the foreground and background, and has obvious advantages in gesture segmentation. At the same time, because the TOF depth camera has its own light source, it has a strong resistance to changes in ambient light. These advantages make up for the shortcomings of color images. Therefore, this application selects depth images as the basis for the gesture recognition research of this application.
[0049] Please refer to Figure 3 , Figure 3 A schematic diagram of multiple interactive gestures provided in an embodiment of the present application. In this embodiment, six gestures are used as examples. Among them, the six gestures are static gestures H1-H6, that is, the human hand presents one of the above six gestures and is photographed while remaining unchanged. It can be understood that each gesture represents an interactive instruction, and different gestures represent different interactive instructions.
[0050] Please refer to Figure 4-7 , which illustrates a schematic diagram of a depth camera shooting one or more interactive gestures under different shooting conditions. In this embodiment, the depth camera shoots the above six gestures H1-H6 under four shooting conditions as an example. The four shooting conditions are: standard gesture, tilted gesture, multi-angle gesture, and multi-scale gesture. A complex shooting scene is set under each shooting condition. For example, each shooting condition captures the face and torso of a person, and different environments can also be set. Among them, the standard gesture is the benchmark for other gestures. Figure 4 As shown in , these are images of six gestures captured under standard gesture shooting conditions. Specifically, the standard gestures are captured parallel to the vertical plane where the camera is located and the gesture postures are the same as the commonly used standard gestures. Figure 5 As described above, it is taken under shooting conditions with a certain angle relative to the standard gesture, that is, it is taken under shooting conditions with the gesture tilted, specifically: when the tilted gesture is collected, there is a 30° tilt with the vertical plane where the camera is located. Figure 6 As shown in the figure, six gestures are placed at different angles for shooting, that is, shooting under multi-angle shooting conditions, specifically: when collecting multi-angle gestures, four angles including standard gestures are used as the basis for collection, and the standard gesture is set at 0°, among which gestures H1, H2, and H6 are collected at -45°, -30°, 0°, and 30°, and gestures H3, H4, and H5 are collected at -30°, 0°, 30°, and 60°. Figure 7 As shown, 6 gestures are placed at different scales and shot, that is, shot under multi-scale shooting conditions. Specifically, when collecting multi-scale gestures, three different scales of 350mm, 450mm, and 600mm at a distance from the vertical plane of the camera are selected for collection.
[0051] This embodiment uses six gestures to shoot under different shooting conditions, so that the gesture image is consistent with the complex background existing in the actual human-computer interaction process and the multiple postures of the gesture, providing a good data set for subsequent data processing, thereby providing effectiveness. Specifically, the collection of complex background gestures provides good material for verifying the advantages of gesture segmentation based on depth images over gesture segmentation based on skin color in the gesture segmentation stage. The collection of tilted gestures takes into account that the hand area and the camera plane may be tilted in actual human-computer interaction. Due to the characteristics of the depth image, it may affect the segmentation result. The collection of multi-angle and multi-scale gestures is to provide a good data set in the gesture classification and recognition stage and to verify the effectiveness of the present invention.
[0052] Step S200, gesture segmentation is performed on each depth image to obtain a gesture image sample set, wherein the gesture image sample set includes a plurality of gesture images of one or more interactive gestures. The purpose of gesture segmentation is to effectively segment the hand area from the original depth image, thereby segmenting image data containing only gestures, while eliminating useless information, thereby providing a good foundation for subsequent gesture recognition. This embodiment uses depth information to perform gesture segmentation. For details on how to segment gestures, please refer to the detailed description below.
[0053] Step S300, using at least two feature extraction algorithms to extract features of each gesture image to obtain two feature vectors of different lengths corresponding to each gesture image. Among them, at least two feature extraction algorithms include an invariant moment extraction algorithm and a multi-feature extraction algorithm, and the multi-feature extraction algorithm includes an algorithm for extracting fingertip points, convex hull defects and circularity features. Specifically, the depth image is first further processed after gesture segmentation, and the obtained binary image is subjected to morphological processing, i.e., dilation and erosion. After morphological processing, the noise points in the binary image of the gesture can be eliminated, the edges of the gesture can be smoothed, and the image can be made fuller and more complete, providing better processing effects for subsequent hand contour extraction. In the embodiment of the present application, the Canny algorithm is used to extract edge contour information. After extraction, the depth image, binary image, and edge contour map of the gesture image are respectively as shown. Fig.18 , Fig.19 , Fig. 20 These images contain a large number of features and parameters representing gestures, and gesture features can be extracted based on them.
[0054] In this embodiment, the feature vector obtained by the invariant moment extraction algorithm is the first feature vector. Moment is a concept in probability and statistics, and is a digital feature of a random variable. Hu used the nonlinear combination of moments to derive a set of moment invariants with scale invariance, translation invariance, and rotation invariance.
[0055] In the continuous case, let the image function be f(x,y), and its p+q order geometric moment (origin moment) is defined as:
[0056]
[0057] The p+q order center distance is defined as:
[0058]
[0059] For a discrete digital image, summation is used instead of integral operation. This application obtains the gesture contour matrix based on canny edge extraction to determine the contour function f(x, y) of the gesture, where x and y represent the rows and columns of the matrix, and the corresponding f(x, y) represents the specific pixel value in the matrix. Therefore, the geometric matrix m of the discrete digital image is pq becomes:
[0060]
[0061] Where M, N represent the size of the image, p, q = 0, 1, 2... The values of p and q determine the order of the corresponding moment. When p and q are zero, the zero-order moment m 00 It is the sum of gray levels in the two-dimensional image f(x,y). The p+q order center distance is:
[0062]
[0063] In order to offset the effect of scale change on the central moment, the zero-order central moment μ is used 00 Normalize the center distances of each order to obtain the normalized center moment:
[0064] in
[0065] Therefore, the present invention adopts Hu moment for feature extraction, and the 7 invariant moments M1 to M7 are as follows:
[0066] M1=η 20 +η 02
[0067] M2=(η 20 -η 02 ) 2 +4η 11 2
[0068] M3=(η 20 -3η 12 ) 2 +(3η 21 -η 02 ) 2
[0069] M4=(η 30 +η 12 ) 2 +(η 21 +η 03 ) 2
[0070] M5=(η 30 -3η 12 )(η 30+n 12 )[(or 30 +n 12 ) 2 -3(h 21 +n 03 ) 2 ]
[0071] +(3rd 21 -3rd 03 )(or 21 +n 03 )[3(h 30 +n 12 ) 2 -(or 21 +n 03 ) 2 ]
[0072] M6=(η 20 -or 02 )[(or 30 +n 12 ) 2 -(or 21 +n 03 ) 2 ]+4th 11 (or 30 +n 12 )(or 21 +n 03 )
[0073] M7=(3rd 21 -or 03 )(or 30 +n 21 )[(or 30 +n 12 ) 2 -3(h 21 +n 03 ) 2 ]
[0074] -(or 30 -3rd 12 )(or 21 +n 03 )[3(h 30 +n 12 ) 2 -(or 21 +n 03 ) 2 ]
[0075] In this embodiment, the feature vector obtained by the multi-feature extraction algorithm is the second feature vector. The multi-feature extraction algorithm includes algorithms for extracting fingertip points, convex hull defects and circularity features. Among them, the fingertip point feature can describe the gesture intuitively and accurately, and is the most commonly used gesture feature. The change of gesture is mainly achieved through fingers, so the fingertip point number is one of the most obvious features of gesture, and is not affected by scale and angle transformation. However, the finger feature is too simple and can only describe the local information of the gesture. The convex hull defect is an important characteristic for describing the plane shape, which is easy to extract, and the convex defect point has rotation invariance, but the convex hull defect feature is also too simple and can only describe the local information of the gesture. Circularity is used to describe the complexity of the boundary of an object. It is a very important concept in image processing and is used for feature extraction and description. At the same time, circularity can express the global information of the gesture to a certain extent. Since the fingertip point, convex hull defect, and circularity features are too simple to describe the gesture alone, and the fingertip point and convex hull defect can only express the local features of the gesture, the circularity can describe the global features of the gesture to a certain extent. At the same time, these three features can well describe the details of the gesture and have good scale invariance and rotation invariance. Therefore, these three features are combined into a model that can better describe the contour features of the gesture, as shown below:
[0076] y=f(n,m,L)
[0077] Where n is the number of fingertip points, m is the number of convex hull defects, and L is the circularity.
[0078] The calculation of the fingertip point count and the convex hull defect number n and m is mainly achieved through sorting and scanning. The fingertip point count n and the convex hull defect number m can be well calculated through the convex hull fingertip detection algorithm. The steps are as follows:
[0079] (1) Traverse each point on the contour, find the two extreme points A and B by coordinate judgment, and divide the upper convex hull and the lower convex hull by the line between the two points, as follows: Fig.21 shown.
[0080] (2) To eliminate interference points, repeat the steps for the upper convex hull and the lower convex hull until no endpoints that can divide the upper and lower convex hulls can be found. At this time, all the endpoints obtained are the convex hull vertices.
[0081] (3) After the convex hull of the hand contour is calculated, the closed area formed is the convex hull defect, so the convex hull defect m can be obtained.
[0082] (4) The convex vertices of the convex hull are all fingertip approximation points. Because the convex hull defect depth between two fingertips is larger than the other convex hull defect depths, the convex hull defect depth L is used, as Fig. 22 As shown. Therefore, the number of fingertip points n can be obtained.
[0083] The circularity L is used to describe the complexity of the object boundary, and its calculation formula is:
[0084]
[0085] Where S is the area of the target image, C is the perimeter of the target image, and when L is 1, the shape is a circle; the smaller L is, the more irregular the shape is, and the greater the difference from the circle is. When the image scale changes, both the area and the perimeter will change, so the circularity also has a certain scale invariance.
[0086] It can be seen that the dimension of the first eigenvector is different from the dimension of the second eigenvector. The dimension of the first eigenvector is less than the dimension of the second eigenvector.
[0087] Step S400: fusing two feature vectors of different lengths for each gesture image to obtain a fused feature vector set, wherein the fused feature vector set includes a fused feature vector corresponding to each gesture image.
[0088] Specifically, the first eigenvector and the second eigenvector are first normalized. Since the physical meaning of the Hu feature and the hand multi-feature are different, the value range is greatly different, which easily causes the data discreteness to increase. It is necessary to normalize each feature component of the two types of features so that the results are mapped to [0, 1]. The embodiment of the present application selects deviation normalization for normalization. The specific steps are as follows:
[0089] Assume that feature extraction obtains a k-dimensional feature vector N = [n1, n2, ... n k ], there are M image samples, then the feature vector of the i-th image sample N = [n i1 ,n i2 ,…n ik ], for each column vector N = [n j1 ,n j2 ,…n jm ], calculate the minimum minj and maximum maxj, and get the normalized n ij =(n ij -minj) / (maxj-minj).
[0090] The normalized feature vectors are then serially fused. The method of serial fusion is as follows: let the Hu feature vector extracted from the image feature be α, and the hand multi-feature be β. The two features are serially fused to obtain the final classification feature M = (α, β).
[0091] If the dimension of the extracted Hu feature vector is n, then α=[h1,h2…,h n ], the multi-features of the hand are m-dimensional, then β=[l1,l2…,l m], the above method can obtain the m+n dimensional fusion feature M=[h1,h2…h n ,l1,l2…l m ], which is the final classification feature.
[0092] In this embodiment, Hu and hand multi-feature parameters and dimensions are as follows: Fig.23 As shown, the 7-dimensional Hu features of the image and the 3-dimensional hand multi-features are serially fused according to the above method to obtain a 10-dimensional fused feature vector M.
[0093] Step S500, input the fused feature vector set into the initial model for training to obtain the gesture recognition model. The initial model is an SVM model. The SVM classifier is based on the principle of structural risk minimization. For small sample classification problems, SVM has obvious advantages. The embodiment of the present application uses the libsvm toolkit for SVM classification. The classification and recognition process of libSvm is shown in the figure below. Fig.24 As shown, the specific steps for using the libsvm toolkit for static gesture recognition are as follows:
[0094] (1) A depth gesture image is obtained through a depth camera, and the depth gesture image is preprocessed 20. The depth gesture image obtained after gesture segmentation through a depth threshold is subjected to feature extraction, and Hu features 31 and hand multi-features 32 of the depth image are extracted respectively. Feature fusion is then performed 40, and a feature vector formed by a serial fusion method is imported as a data set.
[0095] (2) The dataset is randomly divided into 10 training samples and 50 test samples in a ratio of 3:1, with the ratio of each gesture being the same.
[0096] (3) Based on the above analysis, the RBF kernel function is selected, and the optimal parameters of the kernel parameter g and the penalty coefficient c required by this application are found through the cross-validation function meshgrid and the function libsvmtrain in libsvm.
[0097] (4) Using the SVM classifier 60, the SVM model is created and trained through the libsvmtrain function, and prediction and classification are performed through the libsvmpredict function.
[0098] Step S600, input the depth image into the gesture recognition model for gesture recognition. The steps of the gesture recognition model construction method have been specifically described above. The collected depth image is input into the constructed gesture recognition model for static gesture recognition, so as to recognize the target gesture in a complex background and improve the recognition rate of static gesture recognition.
[0099] The above-mentioned gesture recognition method based on depth camera and feature fusion uses the depth camera to collect depth images, which can easily distinguish the foreground and background, and has strong resistance to ambient light changes. Gesture segmentation based on depth threshold can eliminate invalid information under complex backgrounds and achieve good segmentation effects. The Canny operator is used to meet the three major standards of edge extraction evaluation, namely accuracy, high positioning, and single response, and the feature fusion method of serial fusion is used to reduce the amount of subsequent work calculations and improve the efficiency of system classification and recognition.
[0100] Please refer to Figure 8. Figure 8 The flowchart of step S200 sub-steps provided in the embodiment of the present application. Performing gesture segmentation on each depth image to obtain a gesture image sample set specifically includes the following steps S201-S205:
[0101] Step S201, find the minimum depth value of each depth image. First, through the depth histogram, the frequency and aggregation of different depth values in the image can be intuitively seen. Histogram is the basis of many spatial domain processing technologies. The depth image is composed of pixels with different depth values. The horizontal axis of the histogram obtained by drawing the depth image is composed of different depth values, and the vertical axis represents the number of pixels where the depth value appears.
[0102] Please refer to Figures 8 to 9 , Fig. 9 The depth histogram provided in the embodiment of the present application has not been preprocessed. Fig.10 Provided for the embodiments of this application Fig. 9 The corresponding depth map. By analyzing the depth image, it is found that the pixel values in the depth map mainly include the hand target area, the body trunk area and the background environment area. Among them, the hand target area is the area to be extracted in this embodiment, the body trunk area is the interference area to be eliminated, and the background environment area is the background area. The pixel value in the depth image is the maximum value of 65535. At the same time, the histogram of the depth image will have multiple troughs, resulting in more than two threshold segmentation problems, which is difficult to achieve in actual image segmentation, so the depth image needs to be further processed.
[0103] Step S203, construct a segmentation formula based on the minimum depth value and the empirical value. First, search for the minimum pixel value of the image, that is, the minimum depth value, set to min. Considering that the hand area is tilted with the camera plane, in order to fully obtain the hand contour, after multiple experiments, the empirical value x is obtained, and the pixel values greater than min+x are set to 65535. The segmentation formula is:
[0104]
[0105] Among them, f(x, y) is the pixel value of a pixel, that is, the depth value. When the pixel value of a pixel is within the range of (min+x, 65535), the pixel value of the pixel is set to 65535; when the pixel value of a pixel is not within the range of (min+x, 65535), the pixel value of the pixel remains unchanged.
[0106] The images containing human faces and complex skin-colored backgrounds are as follows: Fig.12 and Fig.15 shown.
[0107] Step S205, segmenting each depth image according to the segmentation formula to obtain a gesture image corresponding to each depth image. That is, taking the depth value 65535 as the segmentation reference, the image is segmented to obtain a gesture image.
[0108] Please refer to Fig.11 , Fig.11 The depth histogram after depth threshold segmentation provided in the embodiment of the present application. By analyzing the processed histogram, it can be seen that the depth image histogram trough after depth threshold segmentation is reduced, which can effectively remove the background and other parts of the body, especially the face. The processed results obtained after depth threshold segmentation are as follows Fig.13 and Fig.16 As shown, through Fig.13 and Fig.16 It can be seen that compared with skin color segmentation based on YcbCr color space, depth threshold segmentation can effectively remove the background and other parts of the body, especially skin-like parts such as the face.
[0109] Step S207, binarize the segmented gesture image to obtain the gesture image sample set. Fig.14 and Fig.17 As shown, through Fig.14 and Fig.17 It can be seen that the gesture segmentation based on the depth threshold can well segment the target gesture. Therefore, it can be concluded that the gesture segmentation based on the depth threshold can effectively segment the target gesture in a complex background and is not affected by the skin color scene. The next step of gesture recognition research can be carried out.
[0110] In some feasible embodiments, step S207 may be omitted.
[0111] Please refer to Fig.25 , Fig.25 Schematic diagram of an electronic device provided in an embodiment of the present application. An electronic device 1 is provided in an embodiment of the present application, and the electronic device 1 includes:
[0112] The depth camera 11 is used to collect depth images, which include gesture images. The imaging principle of the depth camera 11 is to first use a modulated light signal of a pulse or continuous wave to be reflected by the target and then captured by a pixel array composed of photodiodes, and then calculate the flight time of the light signal to measure the distance of the target. The depth image is a single-channel image, and each pixel value represents the distance from the object to the camera plane, usually in millimeters. Compared with color images, it is easy to distinguish the foreground and background, and has obvious advantages in gesture segmentation. At the same time, because the TOF depth camera has its own light source, it has a strong resistance to changes in ambient light. These advantages make up for the shortcomings of color images.
[0113] The gesture recognition module 12 is loaded with a gesture recognition model 121. The gesture recognition module 12 performs gesture recognition on the depth image according to a gesture recognition method based on a depth camera and feature fusion. The acquired depth image is input into the constructed gesture recognition model 121 for static gesture recognition, so as to recognize the target gesture in a complex background and improve the recognition rate of static gesture recognition.
[0114] The above-mentioned gesture recognition method and electronic device based on depth camera and feature fusion. By selecting a depth camera, gesture segmentation is performed on the depth image to ensure that the target gesture can be well segmented in a complex background. The problem that the human-computer interaction technology based on gesture recognition is difficult to segment the target gesture in a complex background is solved. The features of the gesture image are extracted using a feature extraction algorithm, fused and trained to obtain a gesture recognition model. The depth image is then input into the gesture recognition model for static gesture recognition, which improves the accuracy of gesture recognition at multiple scales and angles. The problem that the traditional gesture classification method extracts a single feature or is difficult to accurately express gesture information at multiple scales and angles, resulting in low gesture recognition accuracy is solved.
[0115] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
[0116] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0117] The above examples are only preferred embodiments of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application still fall within the scope covered by the present application.
Claims
1. A gesture recognition method based on depth camera and feature fusion, It is characterized in that The gesture recognition method based on depth camera and feature fusion includes: Collecting a depth image set, the depth image set includes a plurality of depth images, each depth image includes a gesture image and a non-gesture image, and the depth image set is obtained by shooting one or more interactive gestures under different shooting conditions by a depth camera; Performing gesture segmentation on each depth image to obtain a gesture image sample set, wherein the gesture image sample set includes a plurality of gesture images of one or more interactive gestures; Extracting features of each gesture image using at least two feature extraction algorithms to obtain two feature vectors of different lengths corresponding to each gesture image; The two feature vectors of different lengths of each gesture image are fused to obtain a fused feature vector set, wherein the fused feature vector set includes a fused feature vector corresponding to each gesture image; Inputting the fused feature vector set into an initial model for training to obtain the gesture recognition model; The depth image is input into a gesture recognition model for gesture recognition.
2. The gesture recognition method based on depth camera and feature fusion as claimed in claim 1, It is characterized in that The initial model is a SVM model.
3. The gesture recognition method based on depth camera and feature fusion as claimed in claim 1, It is characterized in that The gesture image sample set obtained by performing gesture segmentation on each depth image specifically includes: Find the minimum depth value of each depth image; Constructing a segmentation formula based on the minimum depth value and the empirical value; and Each of the depth images is segmented according to the segmentation formula to obtain the gesture image sample set.
4. The gesture recognition method based on depth camera and feature fusion as claimed in claim 3, It is characterized in that The segmentation formula is: Among them, min is the minimum depth value of each depth image, and x is the empirical value.
5. The gesture recognition method based on depth camera and feature fusion as claimed in claim 1, It is characterized in that The at least two feature extraction algorithms include an invariant moment extraction algorithm and a multi-feature extraction algorithm, wherein the multi-feature extraction algorithm includes an algorithm for extracting fingertip points, convex hull defects, and circularity features.
6. The gesture recognition method based on depth camera and feature fusion as claimed in claim 5, It is characterized in that The feature vector obtained by the invariant moment extraction algorithm is a first feature vector; the feature vector obtained by the multi-feature extraction algorithm is a second feature vector, and the dimension of the first feature vector is different from the dimension of the second feature vector.
7. The gesture recognition method based on depth camera and feature fusion as claimed in claim 6, It is characterized in that The dimension of the first feature vector is less than the dimension of the second feature vector.
8. The gesture recognition method based on depth camera and feature fusion as claimed in claim 6, It is characterized in that The fused feature vector set obtained by fusing two feature vectors of different lengths for each gesture image is as follows: The first feature vector and the second feature vector are concatenated and fused.
9. The gesture recognition method based on depth camera and feature fusion as claimed in claim 8, It is characterized in that Before the first feature vector and the second feature vector are serially connected and fused, feature normalization processing is performed on the first feature vector and the second feature vector.
10. An electronic device, It is characterized in that The electronic device comprises: A depth camera, used to collect a depth image, wherein the depth image includes a gesture image; A gesture recognition module is loaded with a gesture recognition model, and the gesture recognition module performs gesture recognition on the depth image according to the gesture recognition method based on a depth camera and feature fusion according to any one of claims 1 to 9.
