A hand segmentation method based on multi-cue fusion

Through the hand segmentation method of multi-cue fusion, combined with YCrCb space skin color segmentation and frame difference method, it solves the problem of poor hand segmentation effect under complex backgrounds, achieves efficient and anti-interference hand segmentation, and reduces costs and network Traffic, suitable for real-time identification.

CN114862894BActive Publication Date: 2024-10-18HARBIN ENG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210306836.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-25
Publication Date
2024-10-18
Estimated Expiration
2042-03-25

AI Technical Summary

Technical Problem

Existing hand segmentation methods have poor segmentation results under complex backgrounds and are easily affected by background interference and lighting changes. Their calculation speed is slow, making it difficult to achieve real-time processing, and the cost is high.

Method used

The hand segmentation method using multi-cue fusion is combined with YCrCb space skin color segmentation, frame difference method, background extraction and watershed algorithm, and the frame difference method is used to extract moving targets, K nearest neighbor background modeling, YCrCb space skin color segmentation, watershed segmentation and flooding. Fill, suppress the adhesion between the hand and the background, and obtain the final hand segmentation area.

Benefits of technology

It achieves efficient hand segmentation in complex backgrounds, has strong anti-interference ability and fast calculation speed, reduces the requirements for image quality, reduces network traffic and equipment costs, and achieves real-time gesture recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114862894B_ABST
    Figure CN114862894B_ABST
Patent Text Reader

Abstract

The purpose of the present invention is to provide a hand segmentation method based on multi-cue fusion to overcome the problem of poor segmentation effect of hand segmentation under complex background conditions. The problems and shortcomings existing in the prior art lead to unsatisfactory segmentation effect of hand segmentation. First of all, the background form of hand segmentation is changeable and is subject to much interference from the movement of other external objects, which causes a certain deviation between the result of hand segmentation and the true segmentation result. The present invention adopts a hand segmentation method based on multi-cue fusion, and calculates the segmentation area by using YCrCb space skin color segmentation, frame difference method, and background extraction. The watershed algorithm is used to suppress the adhesion of the hand and the background when the original YCrCb segmentation result is flooded and filled, and the obtained segmentation area is operated to obtain the final hand segmentation area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a hand segmentation method based on multi-cue fusion, and belongs to the field of computer gesture recognition. Background Art

[0002] Gesture recognition has been increasingly widely used in industrial control, transportation, national defense and security. The real environment is highly complex, uncertain, and has many natural factors (such as background and lighting) that interfere with it. Hand segmentation faces many challenges. There are two main types of existing hand segmentation methods: one is based on the color space features and shape features of the hand. For color, color spaces based on CIELAB, HSV, CIELUV, IHLS, RGB, SKN, YCbCr, etc. are used. For shape, edge detection methods are used to extract contours, and SIFT and HOG descriptors plus machine learning algorithms are also used for segmentation. In addition, there are hand segmentation methods based on pixel color features, texture features, and image neighborhood features, and using random forests as classifiers; one is based on deep learning methods, such as hand segmentation based on semantic segmentation networks U-Net and SegNet, and using multi-task SegNet to perform finger area segmentation and fingertip detection simultaneously. There are also some methods that use depth images or depth images with RGB images as input, which can obtain better accuracy than using only RGB as input. Although the method based on the color space features of the hand is fast to calculate, the accuracy is not high. It is easily affected by the background color. Among the color spaces mentioned above, YCbCr is the color space with the best skin color segmentation effect, but it is still easily affected by the background. The method based on shape features is easily affected by the orientation and angle. The method based on deep learning first requires a large data set for training, and the annotation of the data set is very time-consuming. In addition, the deep learning method is sometimes greatly affected by the lighting. When the lighting is dark, large areas of the hand area that should be segmented will not be segmented. And even if the GPU is used for inference, it is still relatively time-consuming compared to traditional methods. In practical applications, it is impossible to process a large number of gesture recognition requirements that appear at the same time in real time. In addition, the semantic segmentation method has high requirements on the quality of the input image. If the recognition is performed in a cloud-edge collaborative manner, it may cause excessive network traffic. Some methods also use depth cameras as input, resulting in higher costs for completing gesture recognition tasks.

[0003] Purpose of the Invention

[0004] The purpose of the present invention is to provide a hand segmentation method based on multi-cue fusion to overcome the problem of poor segmentation effect of hand segmentation under complex background conditions. The problems and shortcomings existing in the prior art lead to unsatisfactory segmentation effect of hand segmentation. First of all, the background form of hand segmentation is changeable and is subject to much interference from the movement of other external objects, which causes a certain deviation between the result of hand segmentation and the true segmentation result. The present invention adopts a hand segmentation method based on multi-cue fusion, and calculates the segmentation area by using YCrCb space skin color segmentation, frame difference method, and background extraction. The watershed algorithm is used to suppress the adhesion of the hand and the background when the original YCrCb segmentation result is flooded and filled, and the obtained segmentation area is operated to obtain the final hand segmentation area.

[0005] The object of the present invention is achieved in that:

[0006] The present invention proposes a hand segmentation method based on multi-cue fusion, which has the advantages of fast calculation speed, a certain degree of anti-interference to complex backgrounds, and low requirements on image quality. The specific steps are as follows:

[0007] S1: Use the frame difference method to extract pixels whose color difference exceeds a certain threshold to achieve moving target segmentation. Subtract the two frames before and after the dynamic video and convert them into grayscale images. Extract the elements whose grayscale difference exceeds move_thres.

[0008] S2: Use K-nearest neighbor background modeling to extract the background, and subtract the background from the original image to obtain the foreground fgMask.

[0009] S3: Use the YCrCb space skin color segmentation method to segment the hand area, forming the hand skin color area mask skin_mask and the Cr channel image Cr_hand_image. At the same time, the facial skin color interference needs to be considered, and the facial skin color area is removed using the face detection method. First, the image is Gaussian filtered to remove noise and the image color space is converted to the YCrCb space. The threshold Cr_threshold of the YCrCb skin color segmentation needs to be set by yourself, and the Cr value can also be thresholded by the Otsu method for the Cr channel. If the automatic segmentation threshold is less than the threshold Cr_threshold, it is easy to segment the background. At this time, the threshold segmentation is still used to determine. Finally, the face detection method is used to remove the facial skin color part to obtain skin_mask, and the face area is removed from the Cr channel image to obtain Cr_hand_image.

[0010] S4: Generate a mask that contains the complete foreground and the skin color area. Perform an AND operation on Cr_hand_image and skin_mask to segment the skin color area image skin_segment (there may still be an area close to the skin color at this time). If background modeling is used, perform an AND operation on the foreground fgMask and skin_mask to obtain the background difference and the skin color segmentation overlap area, and perform morphological operations to fill the holes of the result to obtain a mask fgYCrHand that contains the complete foreground and the skin color area.

[0011] S5: Use watershed segmentation to generate a white boundary to suppress adhesion with the background during flood filling. First, perform a morphological opening operation on the skin_mask in step S4 to obtain opening, and then use the above mask to perform an expansion operation to obtain a mask sure_bg that is determined as the background area. Perform L2 distance transformation on the image after the opening operation and perform threshold segmentation to obtain a mask sure_fg that is determined as the foreground area. Subtract sure_bg from sure_fg to obtain a boundary area unknown, and the relationship between this area and the contour area is unknown. Then, the eight connected regions in sure_fg are labeled and the pixel values ​​of the region positions corresponding to unknown are set to 0, and the mask is set to markers. Finally, the YCrCb color image and markers are used to obtain the result using the watershed algorithm. Set the positions of the contour pixels corresponding to markers in skin_segment to white to block filling. In addition, if there is a human face skin color area in skin_segment, the boundary of the human face area should also be set to white.

[0012] S6: Get the contour set fg_contours of fgYCrHand in S4 and sort them in reverse order according to the contour area, then select a seed from each contour to flood fill the skin_segment. First, determine whether the contour is in the face area. If not, perform the following operations:

[0013] Select 8 neighboring points near a point in the contour as seeds, and test whether the point is inside the contour. If the above conditions are met, calculate the color center mode_color of skin_segment in the contour (that is, the Cr pixel value corresponding to the mode of the color histogram in the contour). Calculate the new Cr lower limit lowCr=max(mode_color-scale,minCr) and the new Cr channel skin color upper limit upCr=min(maxCr,mode_color+scale), where minCr and maxCr are preset values. If the seed point pixel value is greater than lowCr, subtract the seed point from lowCr as the lower bound of the difference with the seed point pixel value. Similarly, if the seed point pixel value is less than or equal to upCr, subtract upCr from the seed point pixel value as the upper bound of the difference with the seed point pixel value. The upper and lower bounds are used as parameters during flood filling. The filled mask fill_mask is the mask of the foreground and the skin color area.

[0014] S7: Segmentation result fusion. The image obtained by the frame difference method in step S1 and the skin_mask in step S4 are ANDed within the fill_mask generated in step S6 to obtain the final hand segmentation area.

[0015] Compared with the prior art, the present invention has the following beneficial effects:

[0016] The present invention overcomes the shortcomings of a single method for segmenting hands and has a certain degree of anti-interference against complex backgrounds. In addition, the calculation speed is faster than that of the deep learning method, saving time. Gesture recognition can be performed in real time using cloud services. Compared with the semantic segmentation method in the deep learning method, it does not require high-quality images and can be combined with video compression transmission standards such as H264, H265, etc. to reduce network traffic. There is no need to use more advanced deep image equipment, which reduces the cost of gesture recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 forming a flow chart for skin color area mask;

[0018] Figure 2 Generate a flow chart for a mask containing complete foreground and skin-colored areas;

[0019] Figure 3 This is a flow chart for watershed segmentation;

[0020] Figure 4 Fill in the flow chart for flooding. DETAILED DESCRIPTION

[0021] The following is further described in detail with reference to the accompanying drawings:

[0022] The present invention proposes a hand segmentation method based on multi-cue fusion, and the specific steps are as follows:

[0023] S1: Use the frame difference method to extract pixels whose color difference exceeds a certain threshold to achieve moving target segmentation. Subtract the two frames before and after the dynamic video and convert them into grayscale images. Extract the elements whose grayscale difference exceeds move_thres.

[0024] S2: Use K-nearest neighbor background modeling to extract the background, and subtract the background from the original image to obtain the foreground fgMask.

[0025] S3: Use the YCrCb space skin color segmentation method to segment the hand area, forming the hand skin color area mask skin_mask and the Cr channel image Cr_hand_image. At the same time, the facial skin color interference needs to be considered, and the facial skin color area is removed using the face detection method. First, the image is Gaussian filtered to remove noise and the image color space is converted to the YCrCb space. The threshold Cr_threshold of the YCrCb skin color segmentation needs to be set by yourself, and the Cr value can also be thresholded by the Otsu method for the Cr channel. If the automatic segmentation threshold is less than the threshold Cr_threshold, it is easy to segment the background. At this time, the threshold segmentation is still used to determine. Finally, the face detection method is used to remove the facial skin color part to obtain skin_mask, and the face area is removed from the Cr channel image to obtain Cr_hand_image.

[0026] S4: Generate a mask that contains the complete foreground and the skin color area. Perform an AND operation on Cr_hand_image and skin_mask to segment the skin color area image skin_segment (there may still be an area close to the skin color at this time). If background modeling is used, perform an AND operation on the foreground fgMask and skin_mask to obtain the background difference and the skin color segmentation overlap area, and perform morphological operations to fill the holes of the result to obtain a mask fgYCrHand that contains the complete foreground and the skin color area.

[0027] S5: Use watershed segmentation to generate a white boundary to suppress adhesion with the background during flood filling. First, perform a morphological opening operation on the skin_mask in step S4 to obtain opening, and then use the above mask to perform an expansion operation to obtain a mask sure_bg that is determined as the background area. Perform L2 distance transformation on the image after the opening operation and perform threshold segmentation to obtain a mask sure_fg that is determined as the foreground area. Subtract sure_bg from sure_fg to obtain a boundary area unknown, and the relationship between this area and the contour area is unknown. Then, the eight connected regions in sure_fg are labeled and the pixel values ​​of the region positions corresponding to unknown are set to 0, and the mask is set to markers. Finally, the YCrCb color image and markers are used to obtain the result using the watershed algorithm. Set the positions of the contour pixels corresponding to markers in skin_segment to white to block filling. In addition, if there is a human face skin color area in skin_segment, the boundary of the human face area should also be set to white.

[0028] S6: Get the contour set fg_contours of fgYCrHand in S4 and sort them in reverse order according to the contour area, then select a seed from each contour to flood fill the skin_segment. First, determine whether the contour is in the face area. If not, perform the following operations:

[0029] Select 8 neighboring points near a point in the contour as seeds, and test whether the point is inside the contour. If the above conditions are met, calculate the color center mode_color of skin_segment in the contour (that is, the Cr pixel value corresponding to the mode of the color histogram in the contour). Calculate the new Cr lower limit lowCr=max(mode_color-scale,minCr) and the new Cr channel skin color upper limit upCr=min(maxCr,mode_color+scale), where minCr and maxCr are preset values. If the seed point pixel value is greater than lowCr, subtract the seed point from lowCr as the lower bound of the difference with the seed point pixel value. Similarly, if the seed point pixel value is less than or equal to upCr, subtract upCr from the seed point pixel value as the upper bound of the difference with the seed point pixel value. The upper and lower bounds are used as parameters during flood filling. The filled mask fill_mask is the mask of the foreground and the skin color area. S7: Fusion of segmentation results. The image obtained by the frame difference method in step S1 and the skin_mask in step S4 are ANDed within the fill_mask generated in step S6 to obtain the final hand segmentation area.

[0030] The algorithm of the present invention is implemented using Python language and OpenCV framework with Numpy software package, and face detection uses OpenCV pre-trained face detection model based on deep learning. In step S1, move_thres takes a value of 5. In step S2, the K value is taken as 500. In step S3, the face and the skin color area directly connected to the face, such as ears, neck, etc., need to be removed by expanding the positioning frame. The positioning frame is expanded by 20% of the width of the positioning frame in the horizontal direction as a margin, 30% of the height of the positioning frame in the vertical direction as a margin, and 60% of the height of the positioning frame is expanded downward as a margin. The Gaussian filter kernel size is 5x5, Cr_threshold needs to be adjusted according to the actual application scenario, and the empirical value of Cr_threshold is between [125,138]. In step S4, the morphological operation of the background difference and the skin color segmentation overlap area adopts a closing operation with a kernel size of 20x20. In step S5, the opening operation of the hand skin color mask skin_mask uses a kernel size of 3x3 and the number of iterations is 2. The kernel size of the expansion operation is the same, and the number of iterations is 3. Determine the threshold segmentation of sure_fg using a given threshold for segmentation, and the threshold uses 0.5 times the maximum pixel value of the distance transform. When labeling connected areas in OpenCV, the background label is 0, so it is necessary to add 1 to all pixel values ​​of markers and then set the corresponding unknown areas to 0. In step S6, when judging whether the contour is located in the face area, it is necessary to take into account areas connected to the face such as the neck. The judgment method is similar to the method of expanding the positioning box in step S2. When OpenCV performs flood filling, the length and width of the mask to be filled must be set to the length and width of the image plus 2 pixels respectively. In actual implementation, it is not necessary to traverse every contour, because the area of ​​the contour behind is much smaller than the area of ​​the contour in front, and it is highly likely that it will not be a hand. At most, only 10 contours need to be traversed.

Claims

1. A hand segmentation method based on multi-cue fusion, It is characterized in that The specific steps are as follows: S1: Use the frame difference method to extract pixels whose color difference exceeds a certain threshold to achieve moving target segmentation; subtract the two frames before and after the dynamic video and convert them into a grayscale image; extract the elements whose grayscale difference exceeds move_thres; S2: Use K nearest neighbor background modeling to extract the background, and subtract the background from the original image to obtain the foreground fgMask; S3: Use the YCrCb space skin color segmentation method to segment the hand area, forming the hand skin color area mask skin_mask, Cr channel image Cr_hand_image, and at the same time, it is necessary to consider the facial skin color interference, and use the face detection method to remove the facial skin color area; first, the image is Gaussian filtered to remove noise and the image color space is converted to YCrCb space; the YCrCb skin color segmentation threshold Cr_threshold needs to be set by yourself, where the Cr value is threshold segmented on the Cr channel by Otsu's method; if the automatic segmentation threshold is less than the threshold Cr_threshold, it is easy to segment the background, and at this time, the threshold segmentation is still used to determine; finally, the face detection method is used to remove the facial skin color part to obtain skin_mask, and the Cr channel image is removed from the face area to obtain Cr_hand_image; S4: Generate a mask containing the complete foreground and the skin color area; perform an AND operation on Cr_hand_image and skin_mask to segment the skin color area image skin_segment. If background modeling is used, perform an AND operation on the foreground fgMask and skin_mask to obtain the background difference and the skin color segmentation overlap area, and perform a morphological operation to fill the holes of the result to obtain a mask fgYCrHand containing the complete foreground and the skin color area; S5: Use watershed segmentation to generate a white boundary to suppress adhesion with the background during flood filling; first, perform morphological opening operation on the skin_mask in step S4 to obtain opening, and then use the above mask to perform dilation operation to obtain the mask sure_bg determined as the background area; perform L2 distance transformation on the image after the opening operation and perform threshold segmentation to obtain the mask sure_fg determined as the foreground area; subtract sure_bg from sure_fg to obtain the boundary area unknown, and the relationship between this area and the contour area is unknown; then label the eight connected areas in sure_fg and set the pixel values ​​of the area positions corresponding to unknown to 0, and set the mask to markers; finally, use the watershed algorithm to obtain the result of the YCrCb color image and markers; set the positions corresponding to the contour pixels in the skin_segment to white to block the filling; in addition, if there is a human face skin color area in the skin_segment, the human face area boundary should also be set to white; S6: Get the contour set fg_contours of fgYCrHand in S4 and sort them in reverse order according to the contour area, then select a seed in each contour to flood fill the skin_segment; first determine whether the contour is in the face area, if not, perform the following operations: Select 8 neighboring points near a point in the contour as seeds, and test whether the point is inside the contour; if the above conditions are met, calculate the color center mode_color of skin_segment in the contour, that is, the Cr pixel value corresponding to the mode of the color histogram in the contour; calculate the new Cr lower limit lowCr=max(mode_color-scale,minCr) and the new Cr channel skin color upper limit upCr=min(maxCr,mode_color+scale), where minCr and maxCr are preset values; if the seed point pixel value is greater than lowCr, subtract the seed point from lowCr as the lower bound of the difference with the seed point pixel value; similarly, if the seed point pixel value is less than or equal to upCr, subtract upCr from the seed point pixel value as the upper bound of the difference with the seed point pixel value; the upper and lower bounds are used as parameters in flood filling; the filled mask fill_mask is the mask of the foreground and the skin color area; S7: Segmentation result fusion; The image obtained by the frame difference method in step S1 and the skin_mask in step S4 are ANDed within the fill_mask generated in step S6 to obtain the final hand segmentation area.

2. According to the hand segmentation method based on multi-cue fusion according to claim 1, It is characterized in that In step S1, the value of move_thres is 5.

3. The hand segmentation method based on multi-cue fusion according to claim 1, It is characterized in that In step S2, the K value is taken as 500.

4. The hand segmentation method based on multi-cue fusion according to claim 1, It is characterized in that In step S3, the face and the skin color area directly connected to the face need to be removed by expanding the positioning frame. The positioning frame is expanded horizontally by 20% of its width as a margin, vertically by 30% of its height as a margin, and downward by 60% of its height as a margin. The Gaussian filter kernel size is 5x5, and Cr_threshold needs to be adjusted according to the actual application scenario. The empirical value of Cr_threshold is between [125,138].

5. The hand segmentation method based on multi-cue fusion according to claim 1, It is characterized in that In step S4, the morphological operation on the overlapping area of ​​the background difference and the skin color segmentation adopts a closing operation with a kernel size of 20x20.

6. The hand segmentation method based on multi-cue fusion according to claim 1, It is characterized in that In step S5, the opening operation of the hand skin mask skin_mask uses a kernel size of 3x3 and 2 iterations. The expansion operation has the same kernel size and 3 iterations. The threshold segmentation of sure_fg is determined using a given threshold. The threshold is 0.5 times the maximum pixel value of the distance transform. When labeling the connected areas in OpenCV, the background label is 0, so it is necessary to add 1 to all pixel values ​​of markers and set the corresponding unknown areas to 0.

7. The hand segmentation method based on multi-cue fusion according to claim 1, It is characterized in that In step S6, when judging whether the contour is located in the face area, the area where the neck and the face are connected should be taken into account. The judgment method is the same as the method of expanding the positioning frame in step S2. When OpenCV performs flood filling, the length and width of the mask to be filled are set to the length and width of the image plus 2 pixels respectively, and traverse 10 contours.

Citation Information

Patent Citations

  • Hand area segmentation method deeply integrating significance detection and prior knowledge

    CN106529432A

  • Moving target background segmentation method based on improved Vibe+ algorithm

    CN110992381A