Two-handed gesture interaction method, device, electronic device and storage medium
By identifying hand information inside the vehicle and using two-hand gestures to control vehicle functions, the problem of noise interference in interactive technology in the cabin environment is solved, and the anti-interference ability and efficiency of interaction are improved.
Patent Information
- Application Number
- CN202411036116.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-07-31
AI Technical Summary
In the vehicle cockpit environment, existing interaction technology is greatly disturbed by noise, has low speech recognition accuracy and speed, and lacks efficient interaction methods with anti-interference capabilities.
By acquiring real-time video inside the vehicle, identifying hand information based on driving speed, determining the hand group and matching pair of left and right hands, and using gestures with both hands to control controllable components, direct operation of vehicle functions is achieved.
It improves the anti-interference ability and efficiency of interaction in the cabin environment, and directly operates the vehicle functions through gesture control with both hands, reducing the impact of the surrounding environment on interaction.
Smart Images

Figure CN118567488B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition technology, and in particular to a two-handed gesture interaction method, device, electronic device and storage medium. Background Art
[0002] At present, the interaction technology in the vehicle cabin is usually achieved through physical buttons or touch screens. However, this interaction method requires finding the exact control position before interaction can be carried out. In addition, although there is a voice control system as a supplement, when there is noise in the cabin, the accuracy and response speed of voice recognition will be significantly reduced. Therefore, there is an urgent need for an interaction method with strong anti-interference ability and convenient interaction. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a two-handed gesture interaction method, device, electronic device and storage medium to improve the anti-interference ability when interacting in a vehicle cabin environment and enable efficient interaction.
[0004] In a first aspect, an embodiment of the present application provides a two-handed gesture interaction method, the method comprising:
[0005] After obtaining a current frame image of the real-time video of the interior of the vehicle cabin, obtaining hand information of each hand in a target area corresponding to the driving speed in the current frame image according to the driving speed of the vehicle;
[0006] Determine a hand group belonging to the same hand in the current frame image and the previous frame image according to the target hand key points of the hand information of each hand in the previous frame image of the current frame image and the target hand key points of the hand information of each hand in the current frame;
[0007] Determine a left and right hand matching pair belonging to the same person in the current frame image according to the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image;
[0008] For each left-hand matching pair, determine the two-hand gesture corresponding to the left-hand matching pair according to the first hand group and the second hand group corresponding to the left-hand matching pair in the current frame image and the previous frame image;
[0009] According to the two-handed gesture, controllable components in the vehicle corresponding to the two-handed gesture are controlled to perform corresponding operations.
[0010] Optionally, a camera device is provided inside the cabin area, and real-time video of the interior is acquired through the camera device.
[0011] Optionally, a camera device is arranged inside the cabin area near the top of the vehicle head.
[0012] Optionally, the interior of the vehicle cabin is provided with camera devices whose number is equal to the number of seats in the vehicle, and each camera device is used to capture the real-time internal video of the corresponding seat area.
[0013] Optionally, acquiring, according to the driving speed of the vehicle, hand information of each hand in a target area corresponding to the driving speed in the current frame image includes:
[0014] When the driving speed of the vehicle is greater than or equal to a preset speed, obtaining hand information of each hand belonging to the co-pilot area and the rear area in the current frame image;
[0015] When the driving speed of the vehicle is less than the preset speed, hand information of each hand in all seat areas in the current frame image is obtained.
[0016] Optionally, acquiring, according to the driving speed of the vehicle, hand information of each hand in a target area corresponding to the driving speed in the current frame image includes:
[0017] Downsampling the current frame image according to a preset resolution to obtain a downsampled image;
[0018] According to the driving speed of the vehicle, hand information of each hand in the target area corresponding to the driving speed in the down-sampled image is obtained.
[0019] Optionally, obtaining hand information of each hand in a target area corresponding to the driving speed in the current frame image includes:
[0020] For each hand in the target area in the current frame image, a hand image of the hand is obtained according to the diagonal coordinates of the hand circumscribed rectangle that can frame the hand;
[0021] Input the hand image of the hand into the hand skeleton point detection model to obtain the hand key points of the hand and the confidence of each hand key point;
[0022] Calculate the arithmetic mean of the confidence of each hand key point included in the hand;
[0023] When the arithmetic mean value corresponding to the hand is greater than a preset confidence level, the hand image of the hand is input into a hand classifier to determine the handedness of the hand;
[0024] The hand information includes: the key points of the hand and the handedness of the hand, and the handedness includes the left hand and the right hand.
[0025] Optionally, determining a hand group belonging to the same hand in the current frame image and the previous frame image according to target hand key points of hand information of each hand in a previous frame image of the current frame image and target hand key points of hand information of each hand in the current frame includes:
[0026] Calculating a first Euclidean distance between a target hand key point of the hand information of each hand in the previous frame image and a target hand key point of the hand information of each hand in the current frame;
[0027] Constructing a first Euclidean distance matrix according to the first Euclidean distance;
[0028] According to the first Euclidean distance matrix, the Hungarian algorithm is used to match each hand in the previous frame image with each hand in the current frame image to determine a hand group belonging to the same hand in the current frame image and the previous frame image.
[0029] Optionally, determining a left and right hand matching pair belonging to the same person in the current frame image according to the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image comprises:
[0030] Calculating the square value of the second Euclidean distance between the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image;
[0031] Constructing a second Euclidean distance matrix according to the square value of the second Euclidean distance;
[0032] According to the second Euclidean distance matrix, the Hungarian algorithm is used to match each hand belonging to the first chirality in the current frame image with each hand belonging to the second chirality in the current frame image to determine a matching pair of left and right hands belonging to the same person in the current frame image.
[0033] Optionally, the method further comprises:
[0034] When the left and right hand matching pairs belonging to the same person in the previous frame image are matched with the hand group of the same hand in the current frame image, the hands in the current frame image corresponding to the left and right hand matching pairs belonging to the same person in the previous frame image are determined as the left and right hand matching pairs belonging to the same person in the current frame image.
[0035] Optionally, the method further comprises:
[0036] For each hand included in the current frame image, when the hand is matched successfully, the hand is marked using the identifier configured for the hand matching the hand in the previous frame image;
[0037] When the hand is not matched successfully, the hand is marked with a target identifier, where the target identifier is different from the identifiers configured for the hands included in the previous frame of image.
[0038] Optionally, when the left and right hand matching pairs belonging to the same person in the previous frame image are both matched with the hand group of the same hand in the current frame image, the hands in the current frame image corresponding to the left and right hand matching pairs belonging to the same person in the previous frame image are determined as the left and right hand matching pairs belonging to the same person in the current frame image, including:
[0039] The identifiers included in the same left and right hand matching pair in the previous frame image are searched for the identifiers configured for each hand included in the current frame image to see whether the identifiers included in the same left and right hand matching pair in the previous frame image exist;
[0040] If so, the hands corresponding to the same identifiers as those included in the left and right hand matching pairs belonging to the same person in the previous frame image are determined as the left and right hand matching pairs belonging to the same person in the current frame image.
[0041] Optionally, for each left-hand matching pair, determining the two-hand gesture corresponding to the left-hand matching pair according to the first hand group and the second hand group corresponding to the left-hand matching pair in the current frame image and the previous frame image includes:
[0042] Calculating a sum of a first moving distance of a target hand key point of each hand included in the first hand group and a second moving distance of a target hand key point of each hand included in the second hand group;
[0043] Calculate the ratio of the sum value to the sampling interval duration of the internal real-time video, and use the ratio as the movement speed of the two-hand gesture corresponding to the left and right hand matching pair;
[0044] When the moving speed is less than or equal to the preset moving speed, the current frame image is input into a two-handed static gesture classification model to determine the two-handed static gesture corresponding to the left and right hand matching pair;
[0045] When the moving speed is greater than the preset moving speed, a preset number of image frames containing the left and right hand matching pairs are input into a two-hand dynamic gesture classification model to determine the two-hand dynamic gesture corresponding to the left and right hand matching pairs.
[0046] Optionally, the controllable components include:
[0047] Car screen, sunroof, car player, car camera, and cabin lights.
[0048] In a second aspect, an embodiment of the present application provides a two-handed gesture interaction device, the device comprising:
[0049] an acquisition unit, after acquiring a current frame image of the real-time video inside the cabin of the vehicle, acquiring, according to the driving speed of the vehicle, hand information of each hand in a target area corresponding to the driving speed in the current frame image;
[0050] A first determining unit, configured to determine a hand group belonging to the same hand in the current frame image and the previous frame image according to target hand key points of hand information of each hand in the previous frame image of the current frame image and target hand key points of hand information of each hand in the current frame;
[0051] A second determining unit is used to determine a left and right hand matching pair belonging to the same person in the current frame image according to the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image;
[0052] a gesture recognition unit, for determining, for each left-hand matching pair, a two-hand gesture corresponding to the left-hand matching pair according to a first hand group and a second hand group corresponding to the left-hand matching pair in the current frame image and the previous frame image;
[0053] A control unit is used to control the controllable components in the vehicle corresponding to the two-handed gesture to perform corresponding operations according to the two-handed gesture.
[0054] Optionally, a camera device is provided inside the cabin area, and real-time video of the interior is acquired through the camera device.
[0055] Optionally, a camera device is arranged inside the cabin area near the top of the vehicle head.
[0056] Optionally, the interior of the vehicle cabin is provided with camera devices whose number is equal to the number of seats in the vehicle, and each camera device is used to capture the real-time internal video of the corresponding seat area.
[0057] Optionally, when the acquisition unit acquires the hand information of each hand in the target area corresponding to the driving speed in the current frame image according to the driving speed of the vehicle, the acquisition unit may include:
[0058] When the driving speed of the vehicle is greater than or equal to a preset speed, obtaining hand information of each hand belonging to the co-pilot area and the rear area in the current frame image;
[0059] When the driving speed of the vehicle is less than the preset speed, hand information of each hand in all seat areas in the current frame image is obtained.
[0060] Optionally, when the acquisition unit is used to acquire, according to the driving speed of the vehicle, the hand information of each hand in the target area corresponding to the driving speed in the current frame image, the acquisition unit comprises:
[0061] Downsampling the current frame image according to a preset resolution to obtain a downsampled image;
[0062] According to the driving speed of the vehicle, hand information of each hand in the target area corresponding to the driving speed in the down-sampled image is obtained.
[0063] Optionally, when the acquisition unit is used to acquire the hand information of each hand in the target area corresponding to the driving speed in the current frame image, it includes:
[0064] For each hand in the target area in the current frame image, a hand image of the hand is obtained according to the diagonal coordinates of the hand circumscribed rectangle that can frame the hand;
[0065] Input the hand image of the hand into the hand skeleton point detection model to obtain the hand key points of the hand and the confidence of each hand key point;
[0066] Calculate the arithmetic mean of the confidence of each hand key point included in the hand;
[0067] When the arithmetic mean value corresponding to the hand is greater than a preset confidence level, the hand image of the hand is input into a hand classifier to determine the handedness of the hand;
[0068] The hand information includes: the key points of the hand and the handedness of the hand, and the handedness includes the left hand and the right hand.
[0069] Optionally, the first determining unit is used to determine the hand group belonging to the same hand in the current frame image and the previous frame image according to the target hand key points of the hand information of each hand in the previous frame image of the current frame image and the target hand key points of the hand information of each hand in the current frame, including:
[0070] Calculating a first Euclidean distance between a target hand key point of the hand information of each hand in the previous frame image and a target hand key point of the hand information of each hand in the current frame;
[0071] Constructing a first Euclidean distance matrix according to the first Euclidean distance;
[0072] According to the first Euclidean distance matrix, the Hungarian algorithm is used to match each hand in the previous frame image with each hand in the current frame image to determine a hand group belonging to the same hand in the current frame image and the previous frame image.
[0073] Optionally, the second determination unit is used to determine the left and right hand matching pairs belonging to the same person in the current frame image according to the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image, including:
[0074] Calculating the square value of the second Euclidean distance between the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image;
[0075] Constructing a second Euclidean distance matrix according to the square value of the second Euclidean distance;
[0076] According to the second Euclidean distance matrix, the Hungarian algorithm is used to match each hand belonging to the first chirality in the current frame image with each hand belonging to the second chirality in the current frame image to determine a matching pair of left and right hands belonging to the same person in the current frame image.
[0077] Optionally, the second determining unit is further configured to:
[0078] When the left and right hand matching pairs belonging to the same person in the previous frame image are matched with the hand group of the same hand in the current frame image, the hands in the current frame image corresponding to the left and right hand matching pairs belonging to the same person in the previous frame image are determined as the left and right hand matching pairs belonging to the same person in the current frame image.
[0079] Optionally, the device further comprises:
[0080] A marking unit is used to mark each hand included in the current frame image using an identifier configured for the hand that matches the hand in the previous frame image when the hand is matched successfully; when the hand is not matched successfully, mark the hand using a target identifier, and the target identifier is different from the identifier configured for each hand included in the previous frame image.
[0081] Optionally, the second determining unit is used to determine the hands in the current frame image corresponding to the left and right hand matching pair belonging to the same person in the previous frame image as the left and right hand matching pair belonging to the same person in the current frame image when the left and right hand matching pair belonging to the same person in the previous frame image both match the hand group of the same hand in the current frame image, including:
[0082] According to the identifiers included in the same left and right hand matching pair in the previous frame image, searching among the identifiers configured for the hands included in the current frame image whether there is the identifier included in the same left and right hand matching pair in the previous frame image;
[0083] If so, the hands corresponding to the same identifiers as those included in the left and right hand matching pair belonging to the same person in the previous frame image in the current frame image are determined as the left and right hand matching pair belonging to the same person in the current frame image.
[0084] Optionally, the second determining unit is used to determine, for each left-hand matching pair, a two-hand gesture corresponding to the left-hand matching pair according to a first hand group and a second hand group corresponding to the left-hand matching pair in the current frame image and the previous frame image, comprising:
[0085] Calculating a sum of a first moving distance of a target hand key point of each hand included in the first hand group and a second moving distance of a target hand key point of each hand included in the second hand group;
[0086] Calculate the ratio of the sum value to the sampling interval duration of the internal real-time video, and use the ratio as the movement speed of the two-hand gesture corresponding to the left and right hand matching pair;
[0087] When the moving speed is less than or equal to the preset moving speed, the current frame image is input into a two-handed static gesture classification model to determine the two-handed static gesture corresponding to the left and right hand matching pair;
[0088] When the moving speed is greater than the preset moving speed, a preset number of image frames containing the left and right hand matching pairs are input into a two-hand dynamic gesture classification model to determine the two-hand dynamic gesture corresponding to the left and right hand matching pairs.
[0089] Optionally, the controllable components include:
[0090] Car screen, sunroof, car player, car camera, and cabin lights.
[0091] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the two-handed gesture interaction method described in any one of the first aspects above.
[0092] In a fourth aspect, an embodiment of the present application provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the two-handed gesture interaction method described in any one of the first aspects above.
[0093] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0094] In the present application, after obtaining the current frame image of the internal real-time video of the cabin part of the vehicle, the hand information of each hand in the target area corresponding to the driving speed in the current frame image is obtained according to the driving speed of the vehicle, and then the hand group belonging to the same hand in the current frame image and the previous frame image is determined according to the hand information, and the left and right hand matching pairs belonging to the same person in the current frame image are determined according to the hand information. Finally, the two-hand gesture of a person can be determined through the first hand group and the second hand group corresponding to the left and right hand matching pairs belonging to the same person, and the controllable components are controlled to perform corresponding operations according to the determined two-hand gestures. In the above method, control is completed through two-hand gestures. This control method is less affected by the surrounding environment, so it is beneficial to improve the anti-interference ability when interacting in the cabin environment. In addition, since the control method of two-hand gestures can directly control the functions on the vehicle, it is beneficial to improve the interaction efficiency.
[0095] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0096] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0097] Figure 1 A schematic diagram of a two-handed gesture interaction method provided in an embodiment of the present application;
[0098] Figure 2 A flowchart of another two-handed gesture interaction method provided in an embodiment of the present application;
[0099] Figure 3 A schematic diagram of key points of a hand provided in an embodiment of the present application;
[0100] Figure 4 A flowchart of another two-handed gesture interaction method provided in an embodiment of the present application;
[0101] Figure 5 A flowchart of another two-handed gesture interaction method provided in an embodiment of the present application;
[0102] Figure 6 A flowchart of another two-handed gesture interaction method provided in an embodiment of the present application;
[0103] Figure 7 A flowchart of another two-handed gesture interaction method provided in an embodiment of the present application;
[0104] Figure 8 A schematic diagram of the structure of a two-handed gesture interaction device provided in an embodiment of the present application;
[0105] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0106] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0107] Figure 1 A flowchart of a two-handed gesture interaction method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method comprises the following steps:
[0108] Step 101: After obtaining a current frame image of the real-time video inside the cabin of a vehicle, obtain hand information of each hand in a target area corresponding to the driving speed in the current frame image according to the driving speed of the vehicle.
[0109] Step 102: determine the hand group belonging to the same hand in the current frame image and the previous frame image based on the target hand key points of the hand information of each hand in the previous frame image of the current frame image and the target hand key points of the hand information of each hand in the current frame.
[0110] Step 103: Determine a matching pair of left and right hands belonging to the same person in the current frame image based on the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image.
[0111] Step 104: for each left-hand matching pair, determine the two-hand gesture corresponding to the left-hand matching pair according to the first hand group and the second hand group corresponding to the left-hand matching pair in the current frame image and the previous frame image.
[0112] Step 105: According to the two-handed gesture, controllable components in the vehicle corresponding to the two-handed gesture are controlled to perform corresponding operations.
[0113] Specifically, the cabin part in the present application refers to the part of the vehicle used to carry users. The cabin part includes the main driver's seat, the co-driver's seat and the rear seats, as well as various control components for controlling the vehicle's driving, such as: steering wheel, brakes, clutch and other components. The cabin part also includes: on-board screen, sunroof, on-board player and cabin lights and other controllable components. The controllable components on the vehicle also include a on-board camera device for shooting the external environment of the vehicle. The video of the external environment shot by the on-board camera device can be displayed on the on-board screen.
[0114] In order to achieve the purpose of controlling the controllable components on the vehicle through two-hand gestures, the internal real-time video of the cabin can be obtained through the camera device. When the current frame of the internal real-time video is obtained, it is necessary to obtain the hand information of each hand in the target area corresponding to the driving speed in the current frame image according to the current driving speed of the vehicle. Since the current frame image includes images of the main driving area, the co-pilot area and the rear area in the cabin, users in these three areas can control the controllable components in the vehicle through two-hand gestures. In order to ensure safe operation during driving, the hand information in the image of the corresponding area can be obtained according to the driving speed, and then at this driving speed, only the users in this area can control the controllable components in the vehicle, and users in other areas cannot perform gesture control.
[0115] Driving speed and target area can include the following situations:
[0116] 1. When the vehicle is in motion or the driving speed is 0, only the hand information of the user in the main driving area is recognized to prevent users in other areas from competing with the user in the main driving area for control of the controllable components in the vehicle;
[0117] 2. Only the hand information of users in the front passenger seat and the rear seat is recognized during driving, so that users in the main driving seat cannot use gesture control during driving. This allows users in the main driving seat to focus on driving the vehicle during driving, thereby ensuring driving safety.
[0118] 3. Only the hand information of the user in the passenger seat is recognized while the vehicle is driving;
[0119] 4. Prioritize the left and right areas of the main driving area, the co-pilot area, and the rear area. When the vehicle is driving or the vehicle speed is 0, if hands are identified in multiple areas in the current frame image, only the hand information corresponding to the area with the highest priority is identified according to the priority level;
[0120] 5. Prioritize the left and right areas of the main driving area, the co-pilot area, and the rear area. When the vehicle is driving or the vehicle speed is 0, if hands are identified in multiple areas in the current frame image, the hand information of each area is identified in order according to the priority, and then control is performed according to the gestures identified in order;
[0121] It should be noted that the relationship between the driving speed and the corresponding target area can be set according to actual needs, which will not be described in detail here.
[0122] For any hand, the hand is continuous in the time dimension, that is, the relative position or hand shape of the same hand will change at different times. In order to determine the continuity of the hand in time, it is necessary to first determine the hand group belonging to the same hand in the current frame image and the previous frame image (that is, the same hand in the current frame image and the previous frame image). Since the hand information of the same hand is the same, the hand group belonging to the same hand in the current frame image and the previous frame image can be determined based on the target hand key points of the hand information of each hand in the previous frame image of the current frame image and the target hand key points of the hand information of each hand in the current frame.
[0123] After determining the same hand in adjacent image frames, it is also necessary to determine the matching pairs of left and right hands belonging to the same person in the current frame image based on the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image, that is, to determine the two hands belonging to the same person.
[0124] After determining the two hands belonging to the same person in the current frame and the hand group belonging to the same hand in the previous and next image frames, the actions made by the left hand of the person in the current frame image and the previous frame image, as well as the actions made by the right hand of the person in the current frame image and the previous frame image can be determined. As time goes by, the current image frame will become the previous frame image at the current moment at the next moment, and then the two-hand gestures made by the person's hands can be determined. After determining the two-hand gestures, the controllable components corresponding to the two-hand gestures can be controlled to perform corresponding operations, for example: when the two-hand gesture is used to control the volume, the car player is controlled to amplify the volume.
[0125] In the above method, control is completed through two-handed gestures. This control method is less affected by the surrounding environment, so it is beneficial to improve the anti-interference ability when interacting in the cabin environment. In addition, since the two-handed gesture control method can directly control the functions on the vehicle, it is beneficial to improve the interaction efficiency.
[0126] It should be noted that, for a hand, if there is no left-hand matching pair of the hand in both the current frame image and the previous frame image, it proves that the corresponding gesture is not a two-hand gesture, and no control operation is performed at this time.
[0127] In a feasible implementation manner, a camera device is provided inside the cabin area, and real-time video of the interior is acquired through the camera device.
[0128] In a feasible implementation, a camera device is provided inside the cabin to obtain real-time video of the interior, wherein the camera device can be provided at the rearview mirror in the cabin, or at the location of the reading lights in the front row of the cabin.
[0129] In a feasible implementation manner, the interior of the vehicle cabin is provided with camera devices whose number is equal to the number of seats in the vehicle, and each of the camera devices is used to capture real-time internal video of the corresponding seat area.
[0130] Specifically, a number of camera devices equal to the number of seats in the vehicle may be arranged inside the vehicle cabin, and a camera device is arranged in front of each seat. The camera device is only used to collect the internal real-time video of the corresponding seat area, so that one internal real-time video can only include one user's gesture, so that gesture recognition is relatively simple. When a corresponding camera device is arranged in front of each seat, it can be determined which camera is started and closed according to the vehicle's driving speed. The specific situations include the following:
[0131] 1. When the vehicle is in motion or the driving speed is 0, only the camera corresponding to the main driving area is turned on to prevent users in other areas from competing with the users in the main driving area for control of the controllable components in the vehicle;
[0132] 2. When the vehicle is driving, only the camera devices in the front passenger seat and the rear seat are turned on, so that the user in the main driving seat cannot use the gesture control function during driving, and the user in the main driving seat can focus on driving the vehicle during driving, so as to ensure the driving safety of the vehicle;
[0133] 3. When the vehicle is in motion, only the camera corresponding to the co-pilot area is turned on;
[0134] 4. Prioritize the camera devices corresponding to the left and right areas of the main driving area, the co-pilot area, and the rear area. When the vehicle is driving or the vehicle speed is 0, the camera devices corresponding to all areas are turned on. When there are hands in the videos captured by the camera devices corresponding to multiple areas, only the hand information in the video captured by the camera device with the highest priority can be identified according to the priority level;
[0135] 5. Prioritize the camera devices corresponding to the left and right areas of the main driving area, co-pilot area and rear area. When the vehicle is driving or the vehicle speed is 0, the camera devices corresponding to all areas are turned on. When there are hands in the videos captured by the camera devices corresponding to multiple areas, the hand information in the videos captured by each camera device can be identified in sequence according to the priority, and then control is performed according to the gestures identified in sequence.
[0136] In a feasible implementation manner, when executing step 101 to obtain hand information of each hand in the target area corresponding to the driving speed in the current frame image according to the driving speed of the vehicle, when the driving speed of the vehicle is greater than or equal to a preset speed, hand information of each hand belonging to the co-pilot area and the rear area in the current frame image is obtained; when the driving speed of the vehicle is less than the preset speed, hand information of each hand in all seat areas in the current frame image is obtained.
[0137] It should be noted that the preset speed can be 0. When the driving speed of the vehicle is greater than 0, the hand information of each hand belonging to the co-pilot area and the rear area in the current frame image is obtained; when the driving speed of the vehicle is equal to 0, the hand information of each hand in all seat areas in the current frame image is obtained. Of course, the actual value of the preset speed can also be set according to actual needs, and no specific limitation is made here.
[0138] In a feasible implementation scheme, in order to reduce the amount of data processing, when executing the step 101 of obtaining, according to the driving speed of the vehicle, the hand information of each hand in the target area corresponding to the driving speed in the current frame image, the current frame image can be downsampled according to a preset resolution to obtain a downsampled image; and then, according to the driving speed of the vehicle, the hand information of each hand in the target area corresponding to the driving speed in the downsampled image can be obtained.
[0139] In one possible embodiment, Figure 2 A flowchart of another two-handed gesture interaction method provided in an embodiment of the present application, when executing the step of obtaining the hand information of each hand in the target area corresponding to the driving speed in the current frame image in step 101, can be implemented by the following steps:
[0140] Step 201: For each hand in the target area of the current frame image, a hand image of the hand is obtained according to the diagonal coordinates of the hand circumscribed rectangle that can frame the hand.
[0141] Step 202: input the hand image of the hand into the hand skeleton point detection model to obtain the hand key points of the hand and the confidence of each hand key point.
[0142] Step 203: Calculate the arithmetic mean of the confidences of the key points of the hand.
[0143] Step 204: when the arithmetic mean value corresponding to the hand is greater than a preset reliability, the hand image of the hand is input into a hand classifier to determine the handedness of the hand; wherein the hand information includes: the hand key points of the hand and the handedness of the hand, and the handedness includes the left hand and the right hand.
[0144] Specifically, when there are multiple hands in the target area of the current frame image, in order to obtain the hand information of each hand (the hand of each hand) (the hand information includes: chirality and hand key points, and chirality includes: left hand and right hand), for each hand, the minimum enclosing rectangle that can frame the hand is used to frame the hand. After obtaining the minimum enclosing rectangle, the horizontal and vertical coordinates of the four corners of the enclosing rectangle in the current frame image can be determined, and then the horizontal and vertical coordinates of the upper left corner and the lower right corner of the enclosing rectangle can be used as the diagonal coordinates of the enclosing rectangle, or the horizontal and vertical coordinates of the upper right corner and the lower left corner can be used as the diagonal coordinates of the enclosing rectangle. After obtaining the diagonal coordinates, the hand images corresponding to each hand can be determined.
[0145] When determining the diagonal coordinates of the circumscribed rectangle, a coordinate system can be constructed with the center of the current frame image as the origin, or a coordinate system can be constructed with one of the four corners of the current frame image as the origin, and then the diagonal coordinates of the circumscribed rectangle are determined based on the pixel coordinates of the diagonal corners of the circumscribed rectangle in the coordinate system.
[0146] After obtaining the hand images of each hand, the hand images of each hand are input into the hand skeleton point detection model to obtain the key points of each hand and the confidence of each key point of the hand. Figure 3 A schematic diagram of a hand key point provided in an embodiment of the present application, such as Figure 3 As shown, a hand includes 21 key points, and these 21 key points are marked using labels 0-20.
[0147] When determining each hand in the target area, it is determined by the hand shape, that is, as long as the object resembles the hand shape, it is possible to be identified as a hand. In order to determine whether each identified hand is a real human hand, the arithmetic mean of the confidence of each hand key point included in the hand can be calculated according to the confidence of the hand key point of each hand. For example: when the hand key point includes 21, for any hand, 21 confidences can be obtained, and the sum of these 21 confidences is calculated, and then the sum is divided by 21, and the result is used as the arithmetic mean of the hand. When the arithmetic mean corresponding to the hand is greater than the preset confidence, it indicates that the hand is a real human hand. At this time, the hand image of the hand can be input into the hand classifier to determine the handedness of the hand. When the arithmetic mean corresponding to the hand is less than the preset confidence, it indicates that the hand is not a real human hand. At this time, the hand can be eliminated.
[0148] It should be noted that the preset confidence can be 0.2, or it can be set to other values according to actual needs, and no specific limitation is made here. The hand skeleton point detection model needs to be trained before use. The RLE Loss (Residual Log-likelihood Estimation Loss) loss function is used during model training. This loss function is used to locate the hand skeleton points and the confidence of each hand skeleton point. The hand classifier also needs to be trained. The loss function used during model training is CrossEntropyLoss (cross entropy loss function). This loss function is used to determine the handedness of the hand, that is, to determine the left and right hands.
[0149] In one possible embodiment, Figure 4 A flowchart of another two-handed gesture interaction method provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, when executing step 102, it can be implemented by the following steps:
[0150] Step 401: Calculate the first Euclidean distance between the target hand key point of the hand information of each hand in the previous frame image and the target hand key point of the hand information of each hand in the current frame.
[0151] Step 402: construct a first Euclidean distance matrix according to the first Euclidean distance.
[0152] Step 403: According to the first Euclidean distance matrix, the Hungarian algorithm is used to match each hand in the previous frame image with each hand in the current frame, and a hand group belonging to the same hand in the current frame image and the previous frame image is determined.
[0153] Specifically, after obtaining the hand information of each hand, the first Euclidean distance between the target hand key point of the hand information of each hand in the previous frame image and the target hand key point of the hand information of each hand in the current frame is calculated. For example: the previous frame image includes 4 hands: hand 1, hand 2, hand 3 and hand 4, and the current frame image includes 3 hands: hand 5, hand 6 and hand 7, then the first Euclidean distance between the target hand key point of hand 1 and the target hand key point of hand 5 is calculated, as well as the first Euclidean distance between the target hand key point of hand 1 and the target hand key point of hand 6, as well as the first Euclidean distance between the target hand key point of hand 1 and the target hand key point of hand 7, and the first Euclidean distance between the target hand key point of hand 2 and the target hand key point of hand 5. The first Euclidean distance is obtained by calculating the first Euclidean distance between the target hand key points of hand 2 and the target hand key points of hand 6, and so on. Twelve first Euclidean distances can be obtained, and then a first Euclidean distance matrix is constructed according to all the first Euclidean distances obtained. Then, the KM (Kuhn-Munkres, Hungarian algorithm) algorithm is used to match each hand in the previous frame image with each hand in the current frame to determine the hand group belonging to the same hand in the current frame image and the previous frame image, that is, the hand group consisting of the two hands belonging to the same hand in the current frame image and the previous frame image can be determined. At the next moment, the current frame image becomes the previous frame image corresponding to the current frame image at the next moment. By analogy, it can be obtained which hand in each image frame in an image frame sequence belongs to the same hand.
[0154] It should be noted that the target hand key point can be a wrist key point, such as Figure 3The hand key point marked as 0 in the figure, of course, other hand key points can also be selected as the target hand key point, such as: the hand key point marked as 1, or the hand key point marked as 3. The specific hand key point selected as the target hand key point can be set according to actual needs and is not specifically limited here.
[0155] In one possible embodiment, Figure 5 A flowchart of another two-handed gesture interaction method provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, when executing step 103, it can be implemented by the following steps:
[0156] Step 501, calculate the square value of the second Euclidean distance between the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image.
[0157] Step 502: construct a second Euclidean distance matrix according to the square value of the second Euclidean distance.
[0158] Step 503: According to the second Euclidean distance matrix, the Hungarian algorithm is used to match each hand of the first hand in the current frame image with each hand of the second hand in the current frame image to determine a left and right hand matching pair belonging to the same person in the current frame image.
[0159] Specifically, when the first chirality is the left hand, the second chirality is the right hand, and when the first chirality is the right hand, the second chirality is the left hand. In order to determine the left and right hands belonging to the same person in the current frame image, when the current frame image includes 3 left hands: left hand 1, left hand 2, and left hand 3, and 3 right hands: right hand 1, right hand 2, and right hand 3, the second Euclidean distance between the target key points of any two hands obtained when each left hand and each right hand are combined in pairs can be calculated. For example, the square value of the second Euclidean distance between the target key point of left hand 1 and the target key point of right hand 1, the square value of the second Euclidean distance between the target key point of left hand 1 and the target key point of right hand 2, and the square value of the second Euclidean distance between the target key point of left hand 1 and the target key point of right hand 2, and the square value of the second Euclidean distance between the target key point of left hand 1 and the target key point of right hand 2, can be calculated. The square value of the second Euclidean distance between the target key point of and the target key point of right hand 3, the square value of the second Euclidean distance between the target key point of left hand 2 and the target key point of right hand 1, and the square value of the second Euclidean distance between the target key point of left hand 2 and the target key point of right hand 2, and so on, can be obtained. Nine square values of the second Euclidean distance are then constructed based on all the square values of the second Euclidean distances obtained. Finally, based on the second Euclidean distance matrix, the Hungarian algorithm is used to match the left and right hands in the current frame image, so as to determine the left and right hands belonging to the same person in the current frame image, that is, the left and right hand matching pair belonging to the same person.
[0160] As time goes by, matching pairs of left and right hands belonging to the same hand in each image frame included in a video can be obtained. After steps 102 and 103, the hands in the current frame image and other frame images contained in the internal real-time video, which hands belong to the same hand, and the left and right hands of the same person in each frame image can be determined. Therefore, the gestures made by the left and right hands of the same person over time can be determined based on the information on the two dimensions determined above, so that the corresponding two-hand gestures can be recognized.
[0161] In a feasible implementation, when the left and right hand matching pairs belonging to the same person in the previous frame image are matched with the hand group of the same hand in the current frame image, the hands in the current frame image corresponding to the left and right hand matching pairs belonging to the same person in the previous frame image are determined as the left and right hand matching pairs belonging to the same person in the current frame image.
[0162] Specifically, for the left and right hand matching pairs that have appeared in the previous frame image, the left and right hand matching pairs belonging to the same person in the current frame image can be determined by inheritance. For example: when the left hand 1 and the right hand 1 in the previous frame image are the first left and right hand matching pairs of the same person, and the left hand 1 and the left hand 2 in the current frame image form a hand group, and the right hand 1 and the right hand 2 in the current frame image form a hand group, then the left hand 2 and the right hand 2 in the current frame image are determined as the left and right hand matching pairs belonging to the same person in the current frame image. For a segment of internal real-time video, the current frame image and the previous frame image of the internal real-time video may be different at different times, but the matched hands of the same person will not change. Therefore, the above method does not need to calculate the left and right hand matching pairs belonging to the same person in the current frame image, but instead determines the left and right hand matching pairs belonging to the same person in the current frame image by inheriting the left and right hand matching pairs belonging to the same person matched in the previous frame image. Only when the left and right hands belonging to the same person appear for the first time in the current frame image, the left and right hands are determined by inheritance. Figure 5 The above method can reduce the amount of calculation and improve the recognition efficiency.
[0163] After determining the two-handed gestures corresponding to a user in image frames corresponding to different times, the two-handed gestures corresponding to different image frames can be combined in chronological order to obtain the two-handed gestures made by the user, thereby completing the corresponding gesture control.
[0164] In a feasible implementation scheme, for each hand included in the current frame image, when the hand is matched successfully, the hand is marked using the identifier configured for the hand that matches the hand in the previous frame image; when the hand is not matched successfully, the hand is marked using a target identifier, and the target identifier is different from the identifier configured for each hand included in the previous frame image.
[0165] Specifically, in order to quickly determine the left and right hand matching pairs belonging to the same person in the current frame image, it is necessary to assign different identifiers to each hand included in the previous frame image. After determining which two hands in the previous frame image belong to the left and right hand matching pairs of the same person, multiple identifier pairs can be determined. Moreover, after determining which two hands in the current frame image and the previous frame image belong to the same hand group, the same hand can be marked with the same identifier, so that the identifier pair corresponding to the current frame image can be determined by the identifier pair corresponding to the previous frame image, thereby quickly completing the matching of the left and right hand matching pairs in the current frame image.
[0166] If the hand is matched successfully, it means that the hand already exists in the previous frame image, so it can be marked by inheritance. If the hand is not matched successfully, it means that the hand appears for the first time in the current frame image and does not appear in the previous frame image. At this time, it is necessary to use an unused identifier to mark the hand.
[0167] In one possible embodiment, Figure 6 A flowchart of another two-handed gesture interaction method provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, when executing the step of determining the hands in the current frame image corresponding to the left and right hand matching pair belonging to the same person in the previous frame image as the left and right hand matching pair belonging to the same person in the current frame image when the left and right hand matching pair belonging to the same person in the previous frame image both match the hand group of the same hand in the current frame image, it can be achieved by the following steps:
[0168] Step 601: Based on the identifiers included in the same left and right hand matching pair in the previous frame image, search among the identifiers configured for each hand included in the current frame image whether there is an identifier included in the same left and right hand matching pair in the previous frame image.
[0169] Step 602: If so, determine the hands corresponding to the same identifiers in the current frame image as the left and right hand matching pairs belonging to the same person in the previous frame image as the left and right hand matching pairs belonging to the same person in the current frame image.
[0170] Specifically, after determining the hand group belonging to the same hand in the current frame image and the previous frame image, each hand in the current frame image can inherit the identification configured for each hand in the previous frame image, and when there is an identification group corresponding to the left and right hand matching pairs in the previous frame image, the hands corresponding to the identification group that is the same as the identification group in the current frame image are determined as the left and right hand matching pairs belonging to the same person. The above method can be used to determine the left and right hand matching pairs belonging to the same person in the current frame image by inheritance, which is beneficial to reduce the amount of calculation.
[0171] In one possible embodiment, Figure 7 A flowchart of another two-handed gesture interaction method provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, when executing step 104, it can be achieved by the following steps:
[0172] Step 701: Calculate the sum of a first moving distance of a target hand key point of each hand included in the first hand group and a second moving distance of a target hand key point of each hand included in the second hand group.
[0173] Step 702: Calculate the ratio of the sum value to the sampling interval duration of the internal real-time video, and use the ratio as the movement speed of the two-hand gesture corresponding to the left and right hand matching pair.
[0174] Step 703: When the moving speed is less than or equal to the preset moving speed, the current frame image is input into a two-handed static gesture classification model to determine the two-handed static gesture corresponding to the left and right hand matching pair.
[0175] Step 704: when the moving speed is greater than the preset moving speed, a preset number of image frames containing the left and right hand matching pairs are input into a two-hand dynamic gesture classification model to determine the two-hand dynamic gesture corresponding to the left and right hand matching pairs.
[0176] Specifically, in order to determine whether a two-handed gesture is a two-handed static gesture or a two-handed dynamic gesture, it can be determined based on the movement speed of the hands of the same person in the previous and next frames. When the movement speed is less than or equal to the preset movement speed, it indicates that the two-handed gesture is a two-handed static gesture, and the image corresponding to the two-handed gesture in the current frame image is input into the two-handed static gesture classification model, so as to identify the specific two-handed static gesture, and then complete the control corresponding to the two-handed static gesture. When the movement speed is greater than the preset speed, it indicates that the two-handed gesture is a two-handed dynamic gesture, and the images corresponding to the two-handed gesture in a preset number of image frames are input into the two-handed dynamic gesture classification model, so as to identify the specific two-handed dynamic gesture, and then complete the control corresponding to the two-handed dynamic gesture. For example: to The image corresponding to the two-hand gesture in the 10 frames of images corresponding to the moment is input into the two-hand dynamic gesture classification model, where: In addition, when determining the hands of the same person, the identification in the above content can be used for determination.
[0177] It should be noted that the specific value of the preset movement speed can be set according to actual needs and is not specifically limited here. The specific two-handed static gesture classification model and two-handed dynamic gesture classification model can be selected according to actual needs and are not specifically limited here.
[0178] In a feasible implementation scheme, the controllable components include: a vehicle-mounted screen, a sunroof, a vehicle-mounted player, a vehicle-mounted camera device, and cabin lights.
[0179] Specifically, the two-hand gestures can be used to adjust the resolution of the car screen, control the game steering wheel displayed on the car screen, control the opening and closing of the sunroof, control the volume of the car player, collect the content currently playing on the car player, control the opening and closing of the car camera, control the shooting timing of the car camera, control the opening and closing of the cabin lights, and cancel the issued gesture commands.
[0180] It should be noted that the specific gesture used to control the specific function can be set according to actual needs and is not specifically limited here.
[0181] Figure 8 A schematic diagram of a two-handed gesture interaction device provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the device comprises:
[0182] The acquisition unit 81, after acquiring the current frame image of the real-time video inside the vehicle cabin, acquires the hand information of each hand in the target area corresponding to the driving speed in the current frame image according to the driving speed of the vehicle;
[0183] A first determining unit 82 is used to determine a hand group belonging to the same hand in the current frame image and the previous frame image according to the target hand key points of the hand information of each hand in the previous frame image of the current frame image and the target hand key points of the hand information of each hand in the current frame;
[0184] A second determining unit 83 is used to determine a left and right hand matching pair belonging to the same person in the current frame image according to the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image;
[0185] The gesture recognition unit 84 is used to determine, for each left-hand matching pair, a two-hand gesture corresponding to the left-hand matching pair according to the first hand group and the second hand group corresponding to the left-hand matching pair in the current frame image and the previous frame image;
[0186] The control unit 85 is used to control the controllable components in the vehicle corresponding to the two-handed gesture to perform corresponding operations according to the two-handed gesture.
[0187] In a feasible implementation manner, a camera device is provided inside the cabin area, and real-time video of the interior is acquired through the camera device.
[0188] In a feasible embodiment, a camera device is arranged inside the cabin area near the top of the vehicle head.
[0189] In a feasible implementation manner, the interior of the vehicle cabin is provided with camera devices whose number is equal to the number of seats in the vehicle, and each of the camera devices is used to capture real-time internal video of the corresponding seat area.
[0190] In a feasible implementation manner, when the acquisition unit warrior acquires the hand information of each hand in the target area corresponding to the driving speed in the current frame image according to the driving speed of the vehicle, it includes:
[0191] When the driving speed of the vehicle is greater than or equal to a preset speed, obtaining hand information of each hand belonging to the co-pilot area and the rear area in the current frame image;
[0192] When the driving speed of the vehicle is less than the preset speed, hand information of each hand in all seat areas in the current frame image is obtained.
[0193] In a feasible implementation manner, when the acquisition unit is used to acquire the hand information of each hand in the target area corresponding to the driving speed in the current frame image according to the driving speed of the vehicle, it includes:
[0194] Downsampling the current frame image according to a preset resolution to obtain a downsampled image;
[0195] According to the driving speed of the vehicle, hand information of each hand in the target area corresponding to the driving speed in the down-sampled image is obtained.
[0196] In a feasible implementation manner, when the acquisition unit is used to acquire the hand information of each hand in the target area corresponding to the driving speed in the current frame image, it includes:
[0197] For each hand in the target area in the current frame image, a hand image of the hand is obtained according to the diagonal coordinates of the hand circumscribed rectangle that can frame the hand;
[0198] Input the hand image of the hand into the hand skeleton point detection model to obtain the hand key points of the hand and the confidence of each hand key point;
[0199] Calculate the arithmetic mean of the confidence of each hand key point included in the hand;
[0200] When the arithmetic mean value corresponding to the hand is greater than a preset confidence level, the hand image of the hand is input into a hand classifier to determine the handedness of the hand;
[0201] The hand information includes: the key points of the hand and the handedness of the hand, and the handedness includes the left hand and the right hand.
[0202] In a feasible implementation manner, the first determining unit is used to determine the hand group belonging to the same hand in the current frame image and the previous frame image according to the target hand key points of the hand information of each hand in the previous frame image of the current frame image and the target hand key points of the hand information of each hand in the current frame, including:
[0203] Calculating a first Euclidean distance between a target hand key point of the hand information of each hand in the previous frame image and a target hand key point of the hand information of each hand in the current frame;
[0204] Constructing a first Euclidean distance matrix according to the first Euclidean distance;
[0205] According to the first Euclidean distance matrix, the Hungarian algorithm is used to match each hand in the previous frame image with each hand in the current frame image to determine a hand group belonging to the same hand in the current frame image and the previous frame image.
[0206] In a feasible implementation manner, the second determination unit is used to determine the left and right hand matching pairs belonging to the same person in the current frame image according to the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image, including:
[0207] Calculating the square value of the second Euclidean distance between the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image;
[0208] Constructing a second Euclidean distance matrix according to the square value of the second Euclidean distance;
[0209] According to the second Euclidean distance matrix, the Hungarian algorithm is used to match each hand belonging to the first chirality in the current frame image with each hand belonging to the second chirality in the current frame image to determine a matching pair of left and right hands belonging to the same person in the current frame image.
[0210] In a feasible implementation manner, the second determining unit is further configured to:
[0211] When the left and right hand matching pairs belonging to the same person in the previous frame image are matched with the hand group of the same hand in the current frame image, the hands in the current frame image corresponding to the left and right hand matching pairs belonging to the same person in the previous frame image are determined as the left and right hand matching pairs belonging to the same person in the current frame image.
[0212] In a feasible embodiment, the device further comprises:
[0213] A marking unit is used to mark each hand included in the current frame image using an identifier configured for the hand that matches the hand in the previous frame image when the hand is matched successfully; when the hand is not matched successfully, mark the hand using a target identifier, and the target identifier is different from the identifier configured for each hand included in the previous frame image.
[0214] In a feasible implementation manner, the second determination unit is used to determine the hands in the current frame image corresponding to the left and right hand matching pair belonging to the same person in the previous frame image as the left and right hand matching pair belonging to the same person in the current frame image when the left and right hand matching pair belonging to the same person in the previous frame image both match the hand group of the same hand in the current frame image, including:
[0215] According to the identifiers included in the same left and right hand matching pair in the previous frame image, searching among the identifiers configured for the hands included in the current frame image whether there is the identifier included in the same left and right hand matching pair in the previous frame image;
[0216] If so, the hands corresponding to the same identifiers as those included in the left and right hand matching pair belonging to the same person in the previous frame image in the current frame image are determined as the left and right hand matching pair belonging to the same person in the current frame image.
[0217] In a feasible implementation manner, the second determination unit is used to determine, for each left-hand matching pair, the two-hand gesture corresponding to the left-hand matching pair according to the first hand group and the second hand group corresponding to the left-hand matching pair in the current frame image and the previous frame image, including:
[0218] Calculating a sum of a first moving distance of a target hand key point of each hand included in the first hand group and a second moving distance of a target hand key point of each hand included in the second hand group;
[0219] Calculate the ratio of the sum value to the sampling interval duration of the internal real-time video, and use the ratio as the movement speed of the two-hand gesture corresponding to the left and right hand matching pair;
[0220] When the moving speed is less than or equal to the preset moving speed, the current frame image is input into a two-handed static gesture classification model to determine the two-handed static gesture corresponding to the left and right hand matching pair;
[0221] When the moving speed is greater than the preset moving speed, a preset number of image frames containing the left and right hand matching pairs are input into a two-hand dynamic gesture classification model to determine the two-hand dynamic gesture corresponding to the left and right hand matching pairs.
[0222] In a feasible embodiment, the controllable component includes:
[0223] Car screen, sunroof, car player, car camera, and cabin lights.
[0224] For the related explanation of the two-handed gesture interaction device, please refer to the related explanation of the two-handed gesture interaction method, which will not be described in detail here.
[0225] Fig. 9 A structural diagram of an electronic device provided in an embodiment of the present application includes: a processor 901, a storage medium 902 and a bus 903, wherein the storage medium 902 stores machine-readable instructions executable by the processor 901. When the electronic device runs a two-handed gesture interaction method as in the embodiment, the processor 901 communicates with the storage medium 902 via the bus 903, and the processor 901 executes the machine-readable instructions to perform the steps as in the embodiment.
[0226] In an embodiment, the storage medium 902 may also execute other machine-readable instructions to execute other methods described in the embodiment. For specific execution method steps and principles, please refer to the description of the embodiment, which will not be repeated here.
[0227] Embodiment 4 of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps shown in the above embodiment are executed.
[0228] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0229] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0230] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0231] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0232] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0233] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A two-handed gesture interaction method, characterized in that: The method comprises: After obtaining a current frame image of the real-time video inside the cabin of the vehicle, obtaining hand information of each hand in a target area inside the cabin corresponding to the driving speed in the current frame image according to the driving speed of the vehicle, wherein the hand information includes: hand key points of the hand and the handedness of the hand, and the handedness includes left hand and right hand; Determine a hand group belonging to the same hand in the current frame image and the previous frame image according to the target hand key points of the hand information of each hand in the previous frame image of the current frame image and the target hand key points of the hand information of each hand in the current frame; Determine a left-right hand matching pair belonging to the same person in the current frame image according to the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image, wherein the left-right hand matching pair belonging to the same person in the current frame image is obtained by matching each hand belonging to the first chirality in the current frame image with each hand belonging to the second chirality in the current frame image using the Hungarian algorithm based on a Euclidean distance matrix constructed between the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image; For each left-hand matching pair, determine the two-hand gesture corresponding to the left-hand matching pair according to the first hand group and the second hand group corresponding to the left-hand matching pair in the current frame image and the previous frame image; According to the two-handed gesture, controllable components in the vehicle corresponding to the two-handed gesture are controlled to perform corresponding operations.
2. The method according to claim 1, characterized in that A camera device is provided inside the cabin portion, and real-time video of the interior is acquired through the camera device.
3. The method according to claim 2, characterized in that A camera device is arranged inside the cabin near the top of the vehicle head.
4. The method according to claim 2, characterized in that The interior of the vehicle cabin is provided with camera devices whose number is equal to the number of seats in the vehicle, and each camera device is used to capture the real-time internal video of the corresponding seat area.
5. The method according to claim 1, characterized in that The step of acquiring, according to the driving speed of the vehicle, hand information of each hand in the target area corresponding to the driving speed in the current frame image comprises: When the driving speed of the vehicle is greater than or equal to a preset speed, obtaining hand information of each hand belonging to the co-pilot area and the rear area in the current frame image; When the driving speed of the vehicle is less than the preset speed, hand information of each hand in all seat areas in the current frame image is obtained.
6. The method according to claim 1, characterized in that The step of acquiring, according to the driving speed of the vehicle, hand information of each hand in the target area corresponding to the driving speed in the current frame image comprises: Downsampling the current frame image according to a preset resolution to obtain a downsampled image; According to the driving speed of the vehicle, hand information of each hand in the target area corresponding to the driving speed in the down-sampled image is obtained.
7. The method according to claim 1, characterized in that Acquiring hand information of each hand in a target area corresponding to the driving speed in the current frame image includes: For each hand in the target area in the current frame image, a hand image of the hand is obtained according to the diagonal coordinates of the hand circumscribed rectangle that can frame the hand; Input the hand image of the hand into the hand skeleton point detection model to obtain the hand key points of the hand and the confidence of each hand key point; Calculate the arithmetic mean of the confidence of each hand key point included in the hand; When the arithmetic mean value corresponding to the hand is greater than a preset confidence level, the hand image of the hand is input into the hand classifier to determine the handedness of the hand.
8. The method according to claim 1, characterized in that The determining, based on the target hand key points of the hand information of each hand in the previous frame image of the current frame image and the target hand key points of the hand information of each hand in the current frame, a hand group belonging to the same hand in the current frame image and the previous frame image, comprises: Calculating a first Euclidean distance between a target hand key point of the hand information of each hand in the previous frame image and a target hand key point of the hand information of each hand in the current frame; Constructing a first Euclidean distance matrix according to the first Euclidean distance; According to the first Euclidean distance matrix, the Hungarian algorithm is used to match each hand in the previous frame image with each hand in the current frame image to determine a hand group belonging to the same hand in the current frame image and the previous frame image.
9. The method according to claim 1, characterized in that Determining a left and right hand matching pair belonging to the same person in the current frame image according to the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image comprises: Calculating the square value of the second Euclidean distance between the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image; Constructing a second Euclidean distance matrix according to the square value of the second Euclidean distance; According to the second Euclidean distance matrix, the Hungarian algorithm is used to match each hand belonging to the first chirality in the current frame image with each hand belonging to the second chirality in the current frame image to determine a matching pair of left and right hands belonging to the same person in the current frame image.
10. The method according to claim 9, characterized in that The method further comprises: When the left and right hand matching pairs belonging to the same person in the previous frame image are matched with the hand group of the same hand in the current frame image, the hands in the current frame image corresponding to the left and right hand matching pairs belonging to the same person in the previous frame image are determined as the left and right hand matching pairs belonging to the same person in the current frame image.
11. The method according to claim 8, characterized in that The method further comprises: For each hand included in the current frame image, when the hand is successfully matched, the hand is marked using the identifier configured for the hand matching the hand in the previous frame image; When the hand is not matched successfully, the hand is marked with a target identifier, where the target identifier is different from the identifiers configured for the hands included in the previous frame of image.
12. The method according to claim 11, characterized in that When the left and right hand matching pairs belonging to the same person in the previous frame image are both matched with the hand group of the same hand in the current frame image, the hands in the current frame image corresponding to the left and right hand matching pairs belonging to the same person in the previous frame image are determined as the left and right hand matching pairs belonging to the same person in the current frame image, including: According to the identifiers included in the same left and right hand matching pair in the previous frame image, searching among the identifiers configured for the hands included in the current frame image whether there is the identifier included in the same left and right hand matching pair in the previous frame image; If so, the hands corresponding to the same identifiers as those included in the left and right hand matching pair belonging to the same person in the previous frame image in the current frame image are determined as the left and right hand matching pair belonging to the same person in the current frame image.
13. The method according to claim 1, characterized in that For each left-hand matching pair, determining the two-hand gesture corresponding to the left-hand matching pair according to the first hand group and the second hand group corresponding to the left-hand matching pair in the current frame image and the previous frame image includes: Calculating a sum of a first moving distance of a target hand key point of each hand included in the first hand group and a second moving distance of a target hand key point of each hand included in the second hand group; Calculate the ratio of the sum value to the sampling interval duration of the internal real-time video, and use the ratio as the movement speed of the two-hand gesture corresponding to the left and right hand matching pair; When the moving speed is less than or equal to the preset moving speed, the current frame image is input into a two-handed static gesture classification model to determine the two-handed static gesture corresponding to the left and right hand matching pair; When the moving speed is greater than the preset moving speed, a preset number of image frames containing the left and right hand matching pairs are input into a two-hand dynamic gesture classification model to determine the two-hand dynamic gesture corresponding to the left and right hand matching pairs.
14. The method according to claim 1, wherein: The controllable components include: Car screen, sunroof, car player, car camera, and cabin lights.
15. A two-handed gesture interaction device, characterized in that: The device comprises: an acquisition unit, after acquiring a current frame image of the real-time video inside the vehicle cabin, acquiring, according to the driving speed of the vehicle, hand information of each hand in a target area inside the vehicle cabin corresponding to the driving speed in the current frame image, wherein the hand information includes: a hand key point of the hand and a hand nature of the hand, wherein the hand nature includes a left hand and a right hand; A first determining unit, configured to determine a hand group belonging to the same hand in the current frame image and the previous frame image according to target hand key points of hand information of each hand in the previous frame image of the current frame image and target hand key points of hand information of each hand in the current frame; A second determination unit is used to determine a left-hand matching pair belonging to the same person in the current frame image according to the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image, wherein the left-hand matching pair belonging to the same person in the current frame image is obtained by matching each hand belonging to the first chirality in the current frame image with each hand belonging to the second chirality in the current frame image using the Hungarian algorithm based on a Euclidean distance matrix constructed between the target hand key points of each hand belonging to the first chirality in the hand information in the current frame image and the target hand key points of each hand belonging to the second chirality in the hand information in the current frame image; a gesture recognition unit, for determining, for each left-hand matching pair, a two-hand gesture corresponding to the left-hand matching pair according to a first hand group and a second hand group corresponding to the left-hand matching pair in the current frame image and the previous frame image; A control unit is used to control the controllable components in the vehicle corresponding to the two-handed gesture to perform corresponding operations according to the two-handed gesture.
16. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the two-handed gesture interaction method according to any one of claims 1 to 14.
17. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by the processor, the machine-executable instructions prompt the processor to implement the two-handed gesture interaction method according to any one of claims 1 to 14.
