Data processing method and device, electronic equipment and storage medium
By identifying the same hand in consecutive image frames, the problem of gesture detection frame misalignment in the existing technology is solved, and higher gesture recognition accuracy is achieved.
Patent Information
- Application Number
- CN202310891022.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-19
- Publication Date
- 2025-01-21
AI Technical Summary
Existing gesture detection methods cannot recognize the hands of different people in the video stream, resulting in misalignment of the detection frame, which in turn affects the accuracy of gesture recognition.
By obtaining the hand characteristics data in the continuous image frame, the difference between the characteristics of the feature data is used to identify the same hand as the previous frame, so as to determine the hand of the target user and avoid the hand interference of other users.
The accurate recognition of the target user's hand is achieved, the hand interference of other users is reduced, and the accuracy of gesture recognition is improved.
Smart Images

Figure CN119339407A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data processing method, device, electronic device and storage medium. Background Art
[0002] Terminals, such as virtual reality devices, usually have a gesture detection function, which can detect the user's hand movements and provide corresponding feedback. Summary of the invention
[0003] The present disclosure provides a data processing method, device, electronic device and storage medium.
[0004] The present disclosure adopts the following technical solutions.
[0005] In some embodiments, the present disclosure provides a data processing method, including:
[0006] Acquire feature data of a hand in a first image at a first moment, and feature data of a hand in a second image at a second moment;
[0007] Determine the same hand in the second image as that in the first image based on a difference in feature data of each hand in the first image and the second image;
[0008] The second moment is a moment after the first moment, and both the first image and the second image have one or more hands.
[0009] In some embodiments, the present disclosure provides a data processing device, including:
[0010] A feature unit, used to obtain feature data of a hand in a first image at a first moment, and feature data of a hand in a second image at a second moment;
[0011] an identification unit, configured to determine the same hand in the second image as that in the first image based on a difference in feature data of each hand in the first image and the second image;
[0012] The second moment is a moment after the first moment, and both the first image and the second image have one or more hands.
[0013] In some embodiments, the present disclosure provides an electronic device, comprising: at least one memory and at least one processor;
[0014] The memory is used to store program codes, and the processor is used to call the program codes stored in the memory to execute the above method.
[0015] In some embodiments, the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and when the program code is executed by a processor, the processor is prompted to perform the above method.
[0016] The data processing method provided by the embodiment of the present disclosure can recognize the same hand in continuous images, thereby avoiding interference from other users' hands during the gesture recognition process, thereby improving the accuracy of gesture recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.
[0018] Figure 1 It is a flow chart of the data processing method of the embodiment of the present disclosure.
[0019] Figure 2 It is a schematic diagram of the data processing method of an embodiment of the present disclosure.
[0020] Figure 3 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0022] It should be understood that the various steps described in the method embodiments of the present disclosure can be performed in sequence and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0023] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0024] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0025] It should be noted that the modification of “one” mentioned in the present disclosure is illustrative rather than restrictive, and those skilled in the art should understand that it should be understood as “one or more” unless otherwise clearly indicated in the context.
[0026] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0027] The solution provided by the embodiment of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0028] Terminals, such as head-mounted virtual reality devices, usually have gesture detection functions. Common gesture detection methods predict the detection frames of several hands in the current frame based on discrete frame images. Different hands cannot be identified, and no connection is established between the previous and next frames of the video stream. When interference from a third party's hand appears in the captured image, such as the third party's hand crossing the current user's hand, it is easy for the detection frames of the previous frame and the next frame to be misaligned, and the detection frames are in the hands of different people. It can be seen that in common gesture detection methods, the detection frames are misaligned because it is impossible to distinguish the hands of different people in the previous and next video frames, which in turn leads to gesture detection errors.
[0029] like Figure 1 As shown, Figure 1 It is a flowchart of the data processing method of the embodiment of the present disclosure, which includes the following steps.
[0030] S11, acquiring feature data of a hand in a first image at a first moment, and feature data of a hand in a second image at a second moment.
[0031] S12. Determine the hands in the second image that are the same as those in the first image based on the feature data of each hand in the first image and the second image.
[0032] In some embodiments, the data processing method in the present disclosure can be used in a terminal, and the terminal can be a mobile phone, a computer, or an extended display device, etc. The extended reality device can be, for example, a virtual reality device, an augmented reality device, or a mixed reality device. The extended reality device can be a head-mounted extended reality device. The method proposed in the present disclosure can be specifically used for gesture detection, and the first image and the second image can be gesture images in a continuous video stream captured by the camera of the terminal. Among them, the second moment is a moment after the first moment, and the first moment and the second moment can be the shooting moments of the first image and the second image. There are one or more hands in the first image and the second image. More specifically, the first image can be an image with only the left hand of the target user (for example, the current user currently using the terminal), an image with only the right hand, or an image with both the left hand and the right hand, without the hands of other users, because gesture detection is to detect the movement of the hand of the target user, therefore, the first image is first used as a comparison reference, which only has the hand of the target user. The second image may be an image after the first image, which may be an image frame adjacent to the first image in the video stream, and may have hands of other users other than the target user's hand, and the hands of other users may interfere with gesture detection. Therefore, in some embodiments, in the method disclosed herein, the same hand as in the first image is determined from the second image, that is, the same hand of the target user is determined, and then the data processing method is repeatedly executed to determine the same hand of the target user in each frame of the collected video stream, so that the gesture of the target user is accurately determined by continuously identifying the same hand belonging to the target user in the video stream, thereby making a correct response to the gesture of the target user. In order to determine the same hand in the second image as in the first image, it is necessary to extract the feature data of each hand in the first image and the second image, and use the feature data as the basis for comparison. The feature data of the same hand of the same person in the first image and the second image must be relatively similar, so by comparing the difference or similarity of the feature data of the hands in the first image and the second image, it can be determined whether each hand in the second image is the same hand of the same person as the hand in the first image.
[0033] The following example illustrates that in this embodiment, the execution end of the data processing method is a virtual reality device as an example. The virtual reality device has a camera that can capture the gestures of a target user wearing and using the virtual reality device. Gesture detection can be: using a neural network algorithm to infer a given color image or grayscale image to predict the center point position, width and height dimensions, all hand categories and confidence of the minimum enclosing rectangle of the gesture in the image pixel coordinate system, that is, it is usually necessary to detect the left and right hand categories and the center point position. After the virtual reality device turns on the camera, it captures a video stream from a first perspective and captures a first image. The first image is an image of the left and right hands of the target user. The virtual reality device identifies feature data 1 of the left hand of the target user in the first image, and feature data 2 of the right hand. Then, the next frame in the video stream captured by the camera is extracted as the second image. The second image may have other hands besides the left and right hands of the target user. For example, the hands of other users may be captured in the second image. If a common gesture recognition method is used, the detection frame will be misaligned (the detection frame is the frame where the detected hand is located) due to the presence of the hands of other users in the second image, and the hand of the target user cannot be accurately recognized. In this embodiment, the feature data of each hand in the second image will be extracted, and then compared with the feature data 1 and the feature data 2 respectively, so as to determine the left and right hands of the target user in the second image, and the left and right hands of the target user in the second image can be marked with hand identifiers. The hand identifier can be an ID number of the hand, which is unique, and different hand identifiers of different people are different. The above method is repeated for all adjacent image frames in the video stream, and then the image of the target user's hand in each image frame of the video stream can be obtained based on the hand identifier of the target user, and then the gesture of the target user's hand can be determined, and then the gesture of the target user can be responded to, thereby avoiding interference of a third party's hand in gesture recognition.
[0034] In some embodiments of the present disclosure, feature data of a hand in a first image at a first moment and feature data of a hand in a second image at a second moment are obtained, including: obtaining the feature data of the hand in the first image and the feature data of the hand in the second image through an encoder, the input of the encoder including: a hand image, and the output of the encoder including: feature data.
[0035] In some embodiments, an encoder is pre-set to obtain feature data of the hand from the first image and the second image, which facilitates the operation of obtaining feature data in batches and improves efficiency.
[0036] In some embodiments of the present disclosure, obtaining the feature data of the hand in the first image and the feature data of the hand in the second image through an encoder includes: obtaining the coordinate information of the hand from the first image and the second image, cutting out the hand image from the first image and the second image according to the coordinate information and adjusting it to a first preset size, inputting the hand image of the first preset size into the encoder, thereby determining the feature data of the hand in the first image and the second image. Wherein, the input of the encoder includes: the hand image of the first preset size, and the output of the encoder includes: the feature data; the first preset size is smaller than the size of the first image and the second image.
[0037] In some embodiments, the encoder may be pre-trained before step S11. The encoder is used to extract feature data of the image from an image of a first preset size. Specifically, the first preset size may be 64×64 pixels.
[0038] In some embodiments of the present disclosure, obtaining the coordinate information of the hand from the first image and the second image includes: inputting the first image and the second image into an image processing model to obtain the coordinate information of the hand in the first image and the second image; wherein the input of the image processing model includes: an image with a hand, the output of the image processing model includes: the coordinate information of the hand, or the output of the image processing model includes: the coordinate information of the hand, and at least one of the confidence, left and right type and coordinate size loss function of the hand.
[0039] In some embodiments, the image processing model may be pre-trained before step S11. The image processing model is used to determine information such as the coordinate information of the hand from the image, and may include a backbone network and a detection head network for hand detection. Specifically, the image processing model may be a neural network model. The input of the image processing model includes: an image with a hand, and the output of the image processing model includes: the coordinate information of the hand, or the output of the image processing model includes: the coordinate information of the hand, and at least one of the confidence, left and right type, and coordinate size loss function of the hand; when training the image processing model, several images of human hands are used, and the coordinate information, confidence, left and right hand categories, and coordinate size loss function of the human hand are pre-marked, and then the parameters of the image processing model are adjusted so that the difference between the above information obtained after processing by the image processing model and the pre-marked information is less than a certain threshold value.
[0040] When determining the feature data of the hands in the first image and the second image, the first image and the second image are respectively input into the image processing module, and the coordinate information of the hands is obtained from the first image and the second image through the image processing model. The hand images are cut out from the first image and the second image according to the coordinate information and adjusted to a first preset size, and the hand images of the first preset size are input into the encoder, thereby determining the feature data of the hands in the first image and the second image.
[0041] In some embodiments of the present disclosure, the encoder is pre-trained using the following steps, including: inputting a preset hand image into the encoder to obtain feature data of the preset hand image, wherein the preset hand image has a pre-bound hand identifier and a timestamp, and the hand identifier can be used to determine whether different preset hand images belong to the same person; adjusting the parameters of the encoder so that the loss function between the feature data of the preset hand images belonging to the same person and close in time meets preset requirements.
[0042] In some embodiments, the encoder needs to be trained before executing step S11 so that the encoder can recognize whether the hands belong to the same person or different people. Therefore, preset hand images of a first preset size of hands of different people are input into the encoder. The preset hand images can be images of the first preset size. Each preset hand image can have a hand, and the hand corresponds to a unique hand identifier and is marked with a timestamp. The timestamp can be a mark of the shooting time. These preset hand images can be images in a pre-collected video stream. Inputting the preset hand images into the encoder will obtain corresponding feature data. If the two preset hand images are hand images of the same person and the time is close (for example, the time difference is less than the time threshold), the loss function between the feature data of the corresponding two preset hand images will need to meet the preset requirements. The parameters of the encoder can be adjusted so that the loss function meets the preset requirements. For example, the preset requirements can be that the loss function (SmoothL1Loss) between the feature data of the hands of different people should be as large as possible, while the loss function between the feature data of the hands of the same person in the previous and next frames in the video stream should be as small as possible, or a distance threshold can be set, and the loss function between the feature data of the hands of different people is greater than the distance threshold, and the loss function between the feature data of the hands of the same person in the previous and next frames in the video stream should be less than the distance threshold. In this way, it is possible to determine whether it is the hand of the same person through the feature data of the hand. The loss function here can be the use of homogeneous and heterogeneous (L homogeneity +L hetergeneity) jointly supervised. The feature data here can be a latent vector feature, such as a 1×256 dimensional latent vector feature. The loss function is a function that describes the loss. When the loss function between the feature data is large, it indicates that the difference between the two is large. When the loss function between the feature data is small, it indicates that the difference between the two is small. The difference in feature data corresponding to hand images of different people is large, while the difference in feature data corresponding to hand images of the same person and close in time is small.
[0043] In some embodiments of the present disclosure, the pre-trained encoder further includes: inputting the feature data of the preset hand image into a decoder to obtain a hand restoration image output by the decoder, wherein the input of the decoder includes: the feature data, and the output of the decoder includes: a hand restoration image, which may be an image of a first preset size; determining whether the loss function between the preset hand image and the hand restoration image is less than a first threshold; if not less than the first threshold, adjusting the parameters of the encoder to make it less than the first threshold.
[0044] In some embodiments, a decoder is provided, which includes deconvolution and upsampling operators. The decoder may be a latent vector decoder, which is used to restore the feature data into an image of a first preset size, for example, to restore the 1×256-dimensional latent vector feature into a grayscale image with a resolution of 64×64, which is used to ensure that the feature data encodes the full information of the image, which can be obtained through the decoder's loss function L reconstruction To supervise the difference between the restored hand image and the preset hand image, the encoder parameters are adjusted to make it as small as possible to ensure that the feature data encodes the full information of the image.
[0045] In some embodiments of the present disclosure, each hand in the first image is marked with a different hand identifier; after determining the hands in the second image that are the same as those in the first image, it also includes: marking the hand identifiers of the hands in the second image that are the same as those in the first image, wherein the hand identifiers of the same hands in the first image and the second image are the same, and the hand identifiers of different hands are different.
[0046] In some embodiments, the hand identifier can be represented as a HandID. Different hands of different users have different HandIDs. Each hand in the first image has its own corresponding HandID. Then, if the hand in the second image is the same as that in the first image, the same hand in the second image should have the same HandID. Therefore, the same HandID is marked for the hand in the second image. By repeatedly performing this operation, the HandID of each hand in each image frame in the entire video stream can be determined. In some embodiments, the hand identifier in the first image is the HandID of the left and right hands of the target user. Therefore, the images of the left and right hands of the target user in the video stream can be determined, thereby determining the gesture of the target user to avoid interference from the hands of other users.
[0047] In some embodiments of the present disclosure, based on the difference between the feature data of each hand in the first image and the second image, the hand in the second image that is the same as that in the first image is determined. In some embodiments, the difference in feature data of the same hand may be less than a preset difference threshold, and the difference in feature data of hands of different users may be not less than the difference threshold. The loss function between the feature data of each hand may be used as the difference between the feature data.
[0048] In some embodiments, the first image and the second image are two temporally consecutive images in a video.
[0049] In some embodiments, the feature data of the hand in the second image that is the same as that in the first image is used to perform difference calculation with the feature data of the hand in the third image at the next moment; because the time difference between the first image and the third image is larger than the time difference between the second image and the third image, each time the same hand (the hand of the target user) in the next frame of the image is determined, the feature data of the same hand that has been determined in the previous frame is used as the comparison basis, thereby ensuring the accuracy of the comparison.
[0050] The following is combined with Figure 2 A specific embodiment is proposed. In this embodiment, the data processing method includes three stages, including: a first training stage of the network framework, a second training stage of the network framework and an inference stage of the network framework.
[0051] In the first training stage of the network framework, the hand detection backbone network and the detection head network are trained using the gesture target detection training set. The input is several large images of the gesture target detection training set (larger than the first preset size of the small image below), and the output is the position coordinate information (x, y, w, h) of several human hands in the large image, as well as the confidence L of the hand. conf , Category L cls and the coordinate size loss function Lxywh .
[0052] After obtaining the position coordinate information (x, y, w, h), the hand image is extracted from the large image, and the hand image size is adjusted to a small image of 64×64 pixels (a first preset size) as the input of the latent vector encoder. The output of the latent vector encoder is a 1×256-dimensional latent vector feature (feature data), which will be used as the input of the latent vector decoder.
[0053] In the second training stage of the network framework, the gesture ID training set is used to train the latent vector encoder. The gesture ID training set contains small pictures of different people's hands. Each picture has a unique HandID (hand identification) and timestamp information. The loss function between the latent vector features encoded by the small pictures of different people's hands input into the latent vector encoder should be as large as possible, and the loss function between the latent vector features encoded by the small pictures of the hands of the same person in the previous and next frames of the video should be as small as possible. The loss function here uses L homogeneity +L hetergeneity Joint supervision.
[0054] The latent vector decoder is composed of deconvolution and upsampling operators. Its function is to restore the 1×256 dimensional latent vector features into a small grayscale image with a resolution of 64×64, ensuring that the latent vector features encode the full information of the image. The latent vector decoder is used to supervise the loss function between the 64×64 small image and the reconstructed grayscale image to be as small as possible.
[0055] During the inference phase of the network framework (i.e. when determining the same hand in the second image as the first image), the latent vector decoder needs to be removed and only the latent vector encoder is retained.
[0056] At time T-1, the latent vector data of the left and right hands of the target user from the first perspective (i.e., the feature data of the hands in the first image) are cached. At time T, it is found that several left and right hands appear in the second image. After the second image is cut out, the latent vector features are obtained using the encoder and compared with the latent vector features of the left and right hands from the first perspective at time T-1. If the distance between the two (e.g., the size of the loss function between the two) is less than the threshold, it means that they are the same hand of the same person. At this time, the HandID of the hand in the first image corresponding to the hand in the second image is retained, and the latent vector features of the left and right hands of the target user are updated with the latent vector features of the second image for comparison with the hands in the next frame of the image. The hands that are different from those in the first image are the hands of a third party.
[0057] The method proposed in the disclosed embodiment can stably identify the HandID of the first-person hand (the hand of the target user), and greatly reduce the interference of other third-person hands. The codec only acts on the small image after the cutout (the image of the first preset scale), and the network will not increase too much calculation and parameter quantity. When determining whether the second image has the same hand as the first image, only the encoder is used without the decoder, which is convenient for the deployment of the model.
[0058] In some embodiments of the present disclosure, a control device for a terminal is provided, including:
[0059] A feature unit, used to obtain feature data of a hand in a first image at a first moment, and feature data of a hand in a second image at a second moment;
[0060] a recognition unit, configured to determine the same hand in the second image as that in the first image based on feature data of each hand in the first image and the second image;
[0061] The second moment is a moment after the first moment, and both the first image and the second image have one or more hands.
[0062] In some embodiments, obtaining feature data of the hand in a first image at a first moment and feature data of the hand in a second image at a second moment includes: obtaining feature data of the hand in the first image and feature data of the hand in the second image through an encoder, the input of the encoder includes: a hand image, and the output of the encoder includes: feature data.
[0063] In some embodiments, feature data of the hand in the first image and feature data of the hand in the second image are obtained through an encoder, including: obtaining coordinate information of the hand from the first image and the second image, cutting out hand images from the first image and the second image according to the coordinate information and adjusting them to a first preset size, and inputting the hand image of the first preset size into the encoder, thereby determining the feature data of the hand in the first image and the second image.
[0064] The input of the encoder includes: a hand image of a first preset size, and the output of the encoder includes: feature data; the first preset size is smaller than the size of the first image and the second image.
[0065] In some embodiments, obtaining hand coordinate information from the first image and the second image includes:
[0066] Inputting the first image and the second image into an image processing model to obtain coordinate information of the hand in the first image and the second image;
[0067] Among them, the input of the image processing model includes: an image with a hand, the output of the image processing model includes: coordinate information of the hand, or the output of the image processing model includes: coordinate information of the hand, and at least one of the hand confidence, left and right type and coordinate size loss function.
[0068] In some embodiments, the encoder is pre-trained using the following steps, including:
[0069] Inputting a preset hand image into the encoder to obtain feature data of the preset hand image, wherein the preset hand image has a pre-bound hand identifier and a timestamp;
[0070] The parameters of the encoder are adjusted so that the loss function between the feature data of the preset hand images belonging to the same person and close in time meets the preset requirements.
[0071] In some embodiments, the step of pre-training the encoder further includes:
[0072] Inputting the feature data of the preset hand image into a decoder, thereby obtaining a hand restoration image output by the decoder, wherein the input of the decoder includes: the feature data, and the output of the decoder includes: a hand restoration image;
[0073] Determining whether a loss function between the preset hand image and the restored hand image is less than a first threshold;
[0074] If it is not less than the first threshold, the parameters of the encoder are adjusted to make it less than the first threshold.
[0075] In some embodiments, each hand in the first image is marked with a different hand identifier;
[0076] The recognition unit is also used to: after determining the hand in the second image that is the same as that in the first image, mark the hand identifier of the hand in the second image that is the same as that in the first image, wherein the hand identifiers of the same hands in the first image and the second image are the same, and the hand identifiers of different hands are different.
[0077] In some embodiments, at least one of the following is satisfied:
[0078] Determine the same hand in the second image as that in the first image based on a difference in feature data of each hand in the first image and the second image;
[0079] The first image is an image of the left hand and / or right hand of the target user at a first viewing angle;
[0080] The feature data includes latent vector features;
[0081] The first image and the second image are two temporally consecutive images in the video;
[0082] The execution end of the data processing method is an extended reality device.
[0083] For the embodiments of the device, since they basically correspond to the method embodiments, the relevant parts refer to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the modules described as separation modules may or may not be separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present embodiment. Those of ordinary skill in the art can understand and implement without paying creative work.
[0084] The method and device of the present disclosure are described above based on the embodiments and application examples. In addition, the present disclosure also provides an electronic device and a computer-readable storage medium, which are described below.
[0085] Reference below Figure 3 , which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 800 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in the figure is only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present disclosure.
[0086] The electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0087] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although the electronic device 800 with various devices is shown in the figure, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.
[0088] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0089] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0090] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0091] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0092] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method of the present disclosure.
[0093] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0094] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0095] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0096] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0097] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0098] According to one or more embodiments of the present disclosure, a data processing method is provided, including:
[0099] Acquire feature data of a hand in a first image at a first moment, and feature data of a hand in a second image at a second moment;
[0100] Determine the same hand in the second image as that in the first image based on feature data of each hand in the first image and the second image;
[0101] The second moment is a moment after the first moment, and both the first image and the second image have one or more hands.
[0102] According to one or more embodiments of the present disclosure, a data processing method is provided, wherein the method of acquiring feature data of a hand in a first image at a first moment and feature data of a hand in a second image at a second moment comprises: acquiring the feature data of the hand in the first image and the feature data of the hand in the second image through an encoder, wherein the input of the encoder comprises: a hand image, and the output of the encoder comprises: feature data.
[0103] According to one or more embodiments of the present disclosure, a data processing method is provided, which obtains feature data of a hand in the first image and feature data of a hand in the second image through an encoder, including: obtaining coordinate information of the hand from the first image and the second image, cutting out a hand image from the first image and the second image according to the coordinate information and adjusting it to a first preset size, and inputting the hand image of the first preset size into the encoder, thereby determining the feature data of the hand in the first image and the second image.
[0104] The input of the encoder includes: a hand image of a first preset size, and the output of the encoder includes: feature data; the first preset size is smaller than the size of the first image and the second image.
[0105] According to one or more embodiments of the present disclosure, a data processing method is provided, which obtains hand coordinate information from the first image and the second image, including:
[0106] Inputting the first image and the second image into an image processing model to obtain coordinate information of the hand in the first image and the second image;
[0107] Among them, the input of the image processing model includes: an image with a hand, the output of the image processing model includes: coordinate information of the hand, or the output of the image processing model includes: coordinate information of the hand, and at least one of the hand confidence, left and right type and coordinate size loss function.
[0108] According to one or more embodiments of the present disclosure, a data processing method is provided, wherein the encoder is pre-trained using the following steps, including:
[0109] Inputting a preset hand image into the encoder to obtain feature data of the preset hand image, wherein the preset hand image has a pre-bound hand identifier and a timestamp;
[0110] The parameters of the encoder are adjusted so that the loss function between the feature data of the preset hand images belonging to the same person and close in time meets the preset requirements.
[0111] According to one or more embodiments of the present disclosure, a data processing method is provided, wherein the step of pre-training the encoder further includes:
[0112] Inputting the feature data of the preset hand image into a decoder, thereby obtaining a hand restoration image output by the decoder, wherein the input of the decoder includes: the feature data, and the output of the decoder includes: a hand restoration image;
[0113] Determining whether a loss function between the preset hand image and the restored hand image is less than a first threshold;
[0114] If it is not less than the first threshold, the parameters of the encoder are adjusted to make it less than the first threshold.
[0115] According to one or more embodiments of the present disclosure, a data processing method is provided, wherein each hand in the first image is marked with a different hand identifier;
[0116] After determining the hand in the second image that is the same as that in the first image, it also includes: marking the hand identifier of the hand in the second image that is the same as that in the first image, wherein the hand identifiers of the same hands in the first image and the second image are the same, and the hand identifiers of different hands are different.
[0117] According to one or more embodiments of the present disclosure, a data processing method is provided, which satisfies at least one of the following conditions:
[0118] Determine the same hand in the second image as that in the first image based on a difference in feature data of each hand in the first image and the second image;
[0119] The first image is an image of the left hand and / or right hand of the target user at a first viewing angle;
[0120] The feature data includes latent vector features;
[0121] The first image and the second image are two temporally consecutive images in the video;
[0122] The execution end of the data processing method is an extended reality device.
[0123] According to one or more embodiments of the present disclosure, there is provided a data processing device, including:
[0124] A feature unit, used to obtain feature data of a hand in a first image at a first moment, and feature data of a hand in a second image at a second moment;
[0125] a recognition unit, configured to determine the same hand in the second image as that in the first image based on feature data of each hand in the first image and the second image;
[0126] The second moment is a moment after the first moment, and both the first image and the second image have one or more hands.
[0127] According to one or more embodiments of the present disclosure, there is provided an electronic device, including: at least one memory and at least one processor;
[0128] The at least one memory is used to store program codes, and the at least one processor is used to call the program codes stored in the at least one memory to execute any one of the above methods.
[0129] According to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium is used to store program code, and when the program code is executed by a processor, the processor is prompted to execute the above method.
[0130] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0131] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0132] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A data processing method, characterized in that: include: Acquire feature data of a hand in a first image at a first moment, and feature data of a hand in a second image at a second moment; Determine the same hand in the second image as that in the first image based on feature data of each hand in the first image and the second image; The second moment is a moment after the first moment, and both the first image and the second image have one or more hands.
2. The method according to claim 1, characterized in that The acquiring the feature data of the hand in the first image at the first moment and the feature data of the hand in the second image at the second moment includes: The feature data of the hand in the first image and the feature data of the hand in the second image are acquired through an encoder, wherein the input of the encoder includes: a hand image, and the output of the encoder includes: feature data.
3. The method according to claim 2, characterized in that Acquiring feature data of the hand in the first image and feature data of the hand in the second image through an encoder includes: Acquire the coordinate information of the hand from the first image and the second image, cut out the hand image from the first image and the second image according to the coordinate information and adjust it to a first preset size, input the hand image of the first preset size into the encoder, so as to determine the feature data of the hand in the first image and the second image; The input of the encoder includes: a hand image of a first preset size; the first preset size is smaller than the size of the first image and the second image.
4. The method according to claim 3, characterized in that Acquiring hand coordinate information from the first image and the second image includes: Inputting the first image and the second image into an image processing model to obtain coordinate information of the hand in the first image and the second image; Among them, the input of the image processing model includes: an image with a hand, the output of the image processing model includes: coordinate information of the hand, or the output of the image processing model includes: coordinate information of the hand, and at least one of the hand confidence, left and right type and coordinate size loss function.
5. The method according to claim 2, characterized in that: The encoder is pre-trained using the following steps, including: Inputting a preset hand image into the encoder to obtain feature data of the preset hand image, wherein the preset hand image has a pre-bound hand identifier and a timestamp; The parameters of the encoder are adjusted so that the loss function between the feature data of the preset hand images belonging to the same person and close in time meets the preset requirements.
6. The method according to claim 5, characterized in that The step of pre-training the encoder further includes: Inputting the feature data of the preset hand image into a decoder, thereby obtaining a hand restoration image output by the decoder, wherein the input of the decoder includes: the feature data, and the output of the decoder includes: a hand restoration image; Determining whether a loss function between the preset hand image and the restored hand image is less than a first threshold; If it is not less than the first threshold, the parameters of the encoder are adjusted to make it less than the first threshold.
7. The method according to claim 1, characterized in that Each hand in the first image is marked with a different hand identifier; After determining the hand in the second image that is the same as that in the first image, it also includes: marking the hand identifier of the hand in the second image that is the same as that in the first image, wherein the hand identifiers of the same hands in the first image and the second image are the same, and the hand identifiers of different hands are different.
8. The method according to claim 1, characterized in that Satisfy at least one of the following: Determine the same hand in the second image as that in the first image based on a difference in feature data of each hand in the first image and the second image; The first image is an image of the left hand and / or right hand of the target user at a first viewing angle; The feature data includes latent vector features; The first image and the second image are two temporally consecutive images in the video; The execution end of the data processing method is an extended reality device.
9. A data processing device, characterized in that: include: A feature unit, used to obtain feature data of a hand in a first image at a first moment, and feature data of a hand in a second image at a second moment; a recognition unit, configured to determine the same hand in the second image as that in the first image based on feature data of each hand in the first image and the second image; The second moment is a moment after the first moment, and both the first image and the second image have one or more hands.
10. An electronic device comprising: at least one memory and at least one processor; The at least one memory is used to store program code, and the at least one processor is used to call the program code stored in the at least one memory to execute the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, the computer-readable storage medium being used to store program code, wherein when the program code is executed by a processor, the processor is prompted to execute the method according to any one of claims 1 to 8.