An image recognition method, apparatus and electronic device
By analyzing images inside the vehicle cabin and utilizing the correlation between elbows, wrists, and key gesture points, a theoretical detection box is generated, solving the problem of inaccurate hand positioning inside the vehicle cabin, achieving more accurate gesture recognition, and improving the user experience.
Patent Information
- Application Number
- CN202211626965.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-16
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2042-12-16
AI Technical Summary
Due to the influence of the vehicle cabin environment, the user's palm positioning and recognition rate is low, resulting in inaccurate gesture recognition.
By acquiring target images from image acquisition devices, analyzing gestures and key points of the human body, and utilizing the correlation between elbows, wrists, and key points of gestures, a theoretical detection box is generated, and similarity analysis is performed to determine the position of the palm.
It improves the accuracy of palm positioning and recognition, ensures the accuracy of gesture recognition, and enhances the user experience.
Smart Images

Figure CN118212647B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image recognition technology, and in particular to an image recognition method, apparatus and electronic device. Background Technology
[0002] With the development of technology, vehicles are equipped with more and more electronic devices. Among them, some electronic devices can be controlled by gestures to perform corresponding functions, such as switching songs or adjusting the volume.
[0003] However, due to the influence of the vehicle's cabin environment, the user's palm is often not recognized, resulting in a low palm positioning and recognition rate. Summary of the Invention
[0004] To address the aforementioned technical problems, this disclosure provides an image recognition method, apparatus, and electronic device.
[0005] The technical solution disclosed herein is as follows:
[0006] In a first aspect, this disclosure provides an image recognition method, comprising: acquiring a target image acquired by an image acquisition device; wherein the target image includes images of preset parts of a human body; analyzing the target image to obtain a first actual detection box corresponding to a gesture in the target image, and gesture key points corresponding to the gesture; performing human body detection on the target image to obtain human body key points corresponding to the human body; wherein the human body key points include at least elbow key points and wrist key points; obtaining a theoretical detection box corresponding to the gesture based on the correlation between the elbow key points, wrist key points, and gesture key points; performing similarity analysis on the first actual detection box and the theoretical detection box to obtain an analysis result; determining a target detection box when the analysis result shows that the first actual detection box and the theoretical detection box correspond to the same palm; wherein the target detection box includes any one of the first actual detection box and the theoretical detection box; and using the position information corresponding to the target detection box as the palm position corresponding to the gesture.
[0007] In some possible implementation examples, the target image is analyzed to obtain a first actual detection box corresponding to the gesture in the target image, and gesture key points corresponding to the gesture, including: performing gesture detection on the target image to determine the gesture image corresponding to the gesture in the target image; performing contour detection on the gesture image to determine the first actual detection box; and performing gesture key point detection on the image corresponding to the gesture in the first actual detection box to determine the gesture key points corresponding to the gesture.
[0008] In some feasible examples, human detection is performed on the target image to obtain human key points corresponding to the human body, including: performing human detection on the target image to determine a second actual detection box corresponding to the human body in the target image; and performing human key point detection on the image corresponding to the human body in the second actual detection box to determine the human key points corresponding to the human body.
[0009] In some executable examples, a theoretical detection box corresponding to a gesture is obtained based on the relationship between the elbow keypoint, the wrist keypoint, and the gesture keypoint. This includes: when the gesture is located on the line connecting the elbow keypoint and the wrist keypoint, performing calculations on the gesture keypoint to determine the center keypoint corresponding to the gesture keypoint; and when the distance between the center keypoint and the wrist keypoint is less than or equal to a distance threshold, generating a theoretical detection box corresponding to the gesture based on the gesture keypoint.
[0010] In some exemplifiable examples, the image recognition method provided in this disclosure further includes: generating a prompt message when the distance between the center key point and the wrist key point is greater than a distance threshold; wherein the prompt message is used to instruct the palm to move into the acquisition range of the image acquisition device.
[0011] In some feasible embodiments, a similarity analysis is performed on the first actual detection box and the theoretical detection box to obtain the analysis result, including: determining the cross-union ratio (CUP) between the first actual detection box and the theoretical detection box based on the first actual detection box and the theoretical detection box; obtaining the analysis result based on the comparison result of the CUP and a preset threshold; and determining the target detection box when the analysis result shows that the first actual detection box and the theoretical detection box correspond to the same hand, including: when the comparison result of the CUP and the preset threshold shows that the CUP is greater than or equal to the preset threshold, the analysis result shows that the first actual detection box and the theoretical detection box correspond to the same hand, and the target detection box is determined.
[0012] In some exemplifiable examples, the image recognition method provided by this disclosure further includes: when the comparison result of the cross-union ratio and the preset threshold is that the cross-union ratio is less than the preset threshold, the analysis result is that the first actual detection box and the theoretical detection box are not the same hand, and a prompt message is generated.
[0013] Secondly, this disclosure provides an image recognition device, comprising: an acquisition unit for acquiring a target image acquired by an image acquisition device; wherein the target image includes an image of a preset part of a human body; a processing unit for analyzing the target image acquired by the acquisition unit to obtain a first actual detection box corresponding to a gesture in the target image, and gesture key points corresponding to the gesture; the processing unit is further configured to perform human body detection on the target image acquired by the acquisition unit to obtain human body key points corresponding to the human body; wherein the human body key points include at least elbow key points and wrist key points; the processing unit is further configured to obtain a theoretical detection box corresponding to the gesture based on the correlation between the elbow key points, wrist key points, and gesture key points; the processing unit is further configured to perform similarity analysis on the first actual detection box and the theoretical detection box to obtain an analysis result; the processing unit is further configured to determine a target detection box when the analysis result shows that the first actual detection box and the theoretical detection box correspond to the same palm; wherein the target detection box includes any one of the first actual detection box and the theoretical detection box; the processing unit is further configured to use the position information corresponding to the target detection box as the palm position corresponding to the gesture.
[0014] In some possible embodiments, the processing unit is specifically used to perform gesture detection on the target image acquired by the acquisition unit and determine the gesture image corresponding to the gesture in the target image; the processing unit is specifically used to perform contour detection on the gesture image and determine a first actual detection box; the processing unit is specifically used to perform gesture key point detection on the image corresponding to the gesture in the first actual detection box and determine the gesture key points corresponding to the gesture.
[0015] In some possible implementation examples, the processing unit is specifically used to perform human detection on the target image acquired by the acquisition unit and determine the second actual detection box corresponding to the human body in the target image; the processing unit is specifically used to perform human key point detection on the image corresponding to the human body in the second actual detection box and determine the human key points corresponding to the human body.
[0016] In some exemplifiable examples, the processing unit is specifically used to perform calculations on the gesture key points when the gesture is located on the line connecting the elbow key point and the wrist key point, and to determine the center key point corresponding to the gesture key point; the processing unit is specifically used to generate a theoretical detection box corresponding to the gesture based on the gesture key points when the distance between the center key point and the wrist key point is less than or equal to a distance threshold.
[0017] In some possible embodiments, the processing unit is further configured to generate a prompt message when the distance between the center key point and the wrist key point is greater than a distance threshold; wherein the prompt message is used to instruct the palm to be moved into the acquisition range of the image acquisition device.
[0018] In some possible implementation examples, the processing unit is specifically used to determine the cross-union ratio (CUP) between the first actual detection box and the theoretical detection box based on the first actual detection box and the theoretical detection box; the processing unit is specifically used to obtain an analysis result based on the comparison result of the CUP and a preset threshold; the processing unit is specifically used to determine the target detection box when the comparison result of the CUP and the preset threshold is that the CUP is greater than or equal to the preset threshold, and the analysis result is that the first actual detection box and the theoretical detection box correspond to the same palm.
[0019] In some possible implementation examples, the processing unit is also configured to generate a prompt message when the cross-union ratio is less than a preset threshold.
[0020] Thirdly, this disclosure provides an electronic device, including: a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to cause the electronic device to implement the image recognition method provided in the first aspect above when executing the computer program.
[0021] Fourthly, this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a computing device, causes the computing device to implement the image recognition method provided in the first aspect above.
[0022] Fifthly, this disclosure provides a computer program product that, when run on a computer, causes the computer to perform an image recognition method as designed in the first aspect.
[0023] In a sixth aspect, this disclosure provides a vehicle including an image recognition device as provided in the second aspect, or an electronic device as provided in the third aspect.
[0024] It should be noted that the aforementioned computer instructions may be stored, in whole or in part, on the first computer-readable storage medium. The first computer-readable storage medium may be packaged together with the processor of the image recognition device, or it may be packaged separately from the processor of the image recognition device; this disclosure does not impose any limitations on this.
[0025] The descriptions of the second, third, fourth, fifth, and sixth aspects in this disclosure can be referenced to the detailed description of the first aspect; and the beneficial effects of the descriptions of the second, third, fourth, fifth, and sixth aspects can be referenced to the analysis of the beneficial effects of the first aspect, which will not be repeated here.
[0026] In this disclosure, the names of the aforementioned image recognition devices do not limit the devices or functional modules themselves. In actual implementation, these devices or functional modules may appear under other names. As long as the functions of each device or functional module are similar to those of this disclosure, they fall within the scope of the claims of this disclosure and their equivalents.
[0027] These or other aspects of this disclosure will become more readily apparent in the following description.
[0028] The technical solution provided in this disclosure has the following advantages compared with the prior art:
[0029] By analyzing or processing the target image acquired by the image acquisition device, the first actual detection box corresponding to the gesture, the gesture key points corresponding to the gesture, and the human body key points corresponding to the human body can be obtained. Then, by analyzing the correlation between the elbow key point, wrist key point, and gesture key point among the human body key points, the theoretical detection box corresponding to the gesture can be obtained. For example, by connecting the elbow and wrist key points and their positional relationship with the gesture key points, the location of the palm can be inferred. Finally, by performing similarity analysis on the first actual detection box and the theoretical detection box, it can be determined whether the first actual detection box and the theoretical detection box correspond to the same palm. When the analysis results show that the first actual detection box and the theoretical detection box both correspond to the same palm, the position information corresponding to either the first actual detection box or the theoretical detection box can be used as the palm position corresponding to the gesture. This allows for a more accurate determination of the palm position. Since the palm position can be identified more accurately, it can be tracked based on the palm position, thereby improving the recognition of the user's gestures and ensuring a better user experience. This solves the problem of low palm positioning and recognition rates, which often occurs due to the influence of the vehicle's cabin environment and the inability to recognize the user's palm. Attached Figure Description
[0030] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0031] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is one of the flowcharts illustrating the image recognition method provided in this embodiment of the disclosure;
[0033] Figure 2 This is a second schematic flowchart of the image recognition method provided in the embodiments of this disclosure;
[0034] Figure 3 The third schematic flowchart of the image recognition method provided in this embodiment of the disclosure;
[0035] Figure 4 The fourth schematic flowchart of the image recognition method provided in the embodiments of this disclosure;
[0036] Figure 5 Fifth schematic flowchart of the image recognition method provided in the embodiments of this disclosure;
[0037] Figure 6 Sixth schematic flowchart of the image recognition method provided in the embodiments of this disclosure;
[0038] Figure 7 This is a schematic diagram of the structure of the image recognition device provided in the embodiments of this disclosure;
[0039] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure;
[0040] Figure 9 This is a schematic diagram of the structure of a computer program product for an image recognition method provided in an embodiment of this disclosure. Detailed Implementation
[0041] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0042] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0043] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0044] In this embodiment of the disclosure, RMPE refers to Regional Multi-Person Pose Estimation, which is a top-down pose estimation method.
[0045] The target images involved in this application may be data authorized by the user or fully authorized by all parties.
[0046] It should be noted that when a vehicle executes the image recognition method provided in this embodiment, the executing entity is the vehicle's processor. For example, when the vehicle is a car, the executing entity for the image recognition method provided in this embodiment is the car's processor.
[0047] For example, taking a car as an example, the image recognition method provided in this disclosure will be described. Figure 1 As shown, the image recognition method includes the following S11-S17:
[0048] S11. Acquire the target image captured by the image acquisition device. The target image includes images of preset parts of the human body.
[0049] In some examples, one or more image acquisition devices are installed inside the car cabin to capture images of the cabin, such as cameras. When a passenger is sitting in the car cabin, the camera can capture a target image of the user inside the cabin. To promptly recognize the user's gestures, the image recognition method provided in this disclosure acquires a target image through a camera, then analyzes the target image to obtain a first actual detection box corresponding to the gesture in the target image, as well as the gesture key points corresponding to the gesture. Simultaneously, human body detection is performed on the target image to obtain human body key points; these human body key points include at least elbow key points and wrist key points. Then, based on the correlation between the elbow key points, wrist key points, and gesture key points, a theoretical detection box corresponding to the gesture is obtained. Finally, the first actual detection box and the theoretical detection box are analyzed to obtain the palm position corresponding to the gesture. In this way, the palm can be tracked based on its position, thereby improving the recognition of the user's gestures and ensuring a better user experience.
[0050] S12. Analyze the target image to obtain the first actual detection box corresponding to the gesture in the target image, as well as the gesture key points corresponding to the gesture.
[0051] In some examples, in order to better identify key gesture points or key human body points, the target image needs to be preprocessed before analysis or processing, such as one or more of image distortion correction, noise reduction, and stretching.
[0052] In some examples, to obtain the first actual detection box and gesture key points, gesture detection can be performed on the preprocessed target image. For example, a gesture detection algorithm can be used to detect gestures in the target image to obtain the first actual detection box corresponding to the gesture in the target image. Then, gesture key point detection is performed on the image corresponding to the gesture in the first actual detection box. For example, a gesture key point detection algorithm can be used to detect gesture key points in the image corresponding to the gesture in the first actual detection box to determine the gesture key points corresponding to the gesture.
[0053] Alternatively, the target image can be input into the first detection model to obtain the first actual detection box corresponding to the gesture in the target image, as well as the gesture keypoints corresponding to the gesture. The training process of the first detection model is as follows:
[0054] Obtain training sample data and its labeling results. The training sample data includes historical target images, and the labeling results include the actual detection bounding boxes and gesture keypoints corresponding to each historical target image.
[0055] The training sample data is input into the neural network model for training, and the prediction results of the neural network model on the training sample data are obtained.
[0056] If the predicted results differ from the training results, adjust the network parameters of the neural network model. Iterate the training repeatedly until the training conditions are met, at which point the first detection model is obtained. These training conditions include the neural network model being trained an equal number of times (e.g., 200 times), or the number of times the predicted results are consecutively the same as the training results being greater than or equal to a preset value (e.g., 5 times).
[0057] S13. Perform human detection on the target image to obtain the corresponding human body key points. Among them, the human body key points include at least the elbow key points and the wrist key points.
[0058] In some examples, to obtain human keypoints, human detection can be performed on the target image. For instance, a human detection algorithm can be used to detect humans in the target image and determine the second actual detection box corresponding to the human body in the target image. Then, a human keypoint detection algorithm can be used to detect human keypoints in the image corresponding to the human body within the second actual detection box to determine the corresponding human keypoints.
[0059] Alternatively, the target image can be input into a second detection model to obtain the human body key points corresponding to the human body in the target image.
[0060] The training process for the second detection model is as follows:
[0061] Acquire training sample data and training supervision data. Both training sample data and training supervision data include historical target images, and the actual detection bounding boxes and gesture keypoints corresponding to each historical target image.
[0062] The neural network model is trained based on the training sample data to obtain the pre-trained neural network model.
[0063] The pre-trained neural network model is trained under supervised training data until it converges, thus obtaining the second detection model.
[0064] S14. Based on the relationship between the elbow key point, wrist key point and gesture key point, obtain the theoretical detection box corresponding to the gesture.
[0065] In some examples, the relationship between the elbow and wrist keypoints and the corresponding gestures can be determined by connecting these keypoints. For instance, the position of the palm can be deduced from the line connecting the elbow and wrist keypoints. Then, when the gesture corresponding to a keypoint lies on this line, it indicates that the hand is located at that keypoint. Next, a theoretical bounding box is obtained based on the keypoints. For example, the theoretical bounding box can be obtained from the closed shape formed by the keypoints, or the smallest inscribed rectangle of the outermost keypoint can be used as the theoretical bounding box.
[0066] S15. Perform similarity analysis on the first actual detection box and the theoretical detection box to obtain the analysis results.
[0067] S16. If the analysis results show that the first actual detection box and the theoretical detection box correspond to the same hand, determine the target detection box. The target detection box includes either the first actual detection box or the theoretical detection box.
[0068] In some examples, when performing similarity analysis on the first actual detection box and the theoretical detection box, the Intersection-over-Union (IOU) ratio can be calculated. For example, the IOU is equal to the first area divided by the second area. The first area is the area of the overlapping region between the first actual and theoretical detection boxes, and the second area is the difference between the sum of the areas of the first actual and theoretical detection boxes and the first area. The analysis result is obtained based on the relationship between the IOU and a preset threshold. For example, if the IOU is greater than or equal to the preset threshold, the analysis result indicates that the image in the theoretical detection box and the image in the first actual detection box represent the same hand. If the IOU is less than the preset threshold, the analysis result indicates that the image in the theoretical detection box and the image in the first actual detection box do not represent the same hand. In this case, a prompt message needs to be generated to instruct the user to move their hand within the image acquisition range of the image acquisition device.
[0069] S17. Use the position information corresponding to the target detection box as the palm position corresponding to the gesture.
[0070] In some examples, the average position information of each vertex in the object detection bounding box can be used as the hand position corresponding to the gesture. Alternatively, the position information of any point within the object detection bounding box can be used as the hand position corresponding to the gesture.
[0071] As described above, the image recognition method provided in this embodiment infers the position of the palm by connecting the elbow key point and the wrist key point with the positional relationship of the gesture corresponding to the gesture key point. Then, by analyzing the first actual detection box and the theoretical detection box, the palm position corresponding to the gesture is obtained. For example, if the intersection-union ratio (IUU) of the first actual detection box and the theoretical detection box is greater than or equal to a preset threshold, it indicates that the image in the first actual detection box and the image in the theoretical detection box represent the same palm. This allows for a more accurate determination of the palm position. Because the palm position can be more accurately identified, it can be tracked, thereby improving the recognition of user gestures and ensuring a better user experience.
[0072] In some feasible examples, combining Figure 1 ,like Figure 2 As shown, the above S12 can be specifically implemented through the following S120-S122.
[0073] S120. Perform gesture detection on the target image to determine the gesture image corresponding to the gesture in the target image.
[0074] S121. Perform contour detection on the gesture image to determine the first actual detection box.
[0075] In some examples, gesture detection algorithms can be used to detect gestures in the target image. For instance, image segmentation can be performed on the target image to determine the foreground and background. Then, image recognition algorithms (such as the Hungarian algorithm or depth-first search) can be used to recognize the foreground image and identify the hand image within it. Based on the hand image, the first actual detection box corresponding to the gesture in the target image is determined. For example, the smallest inscribed rectangle of the outermost hand image can be used as the first actual detection box, or the closed shape formed by the hand images can be used as the first actual detection box.
[0076] S122. Perform gesture key point detection on the image corresponding to the gesture in the first actual detection box to determine the gesture key points corresponding to the gesture.
[0077] In some examples, a gesture keypoint detection algorithm can be used to detect gesture keypoints in the image corresponding to the gesture in the first actual detection box, thereby determining the gesture keypoints corresponding to the gesture. For example, gesture keypoint detection algorithms include either the Scale Invariant Feature Transform (SIFT) algorithm or the heatmap method.
[0078] In some feasible examples, combining Figure 1 ,like Figure 3 As shown, the above S13 can be implemented by the following S130 and S131.
[0079] S130. Perform human detection on the target image and determine the second actual detection box corresponding to the human body in the target image.
[0080] In some examples, human detection algorithms can be used to detect humans in the target image, such as image segmentation to determine the foreground and background. Then, image recognition algorithms (such as breadth-first search, Prim's algorithm, etc.) are used to identify the human figures within the foreground. Finally, based on the human figures, a second bounding box is determined for each human in the target image. This can be achieved by using the smallest inscribed rectangle of the outermost human figure or by using a closed shape composed of human figures as the second bounding box.
[0081] S131. Perform human body key point detection on the image corresponding to the human body in the second actual detection frame, and determine the human body key points corresponding to the human body.
[0082] In some examples, human keypoint detection algorithms can be used to detect human keypoints in the image corresponding to the human body in the second actual detection box, thereby determining the corresponding human keypoints. For example, human keypoint detection algorithms include either the Content Forward Network (CNN) algorithm or the RMPE algorithm.
[0083] In some feasible examples, combining Figure 1 ,like Figure 4 As shown, the above S14 can be implemented by the following S140 and S141.
[0084] S140. When the gesture is located on the line connecting the elbow key point and the wrist key point, perform calculations on the gesture key points to determine the center key point corresponding to the gesture key points.
[0085] In some examples, the central keypoint is equal to the average of the positional information of all gesture keypoints in the target image, or the cluster center obtained by clustering the gesture keypoints is used as the central keypoint.
[0086] S141. When the distance between the center key point and the wrist key point is less than or equal to the distance threshold, generate the theoretical detection box corresponding to the gesture based on the gesture key point.
[0087] In some examples, when the distance between the center keypoint and the wrist keypoint is less than or equal to a distance threshold, it indicates that the image in the theoretical detection box and the image in the first actual detection box are the same hand.
[0088] In some feasible examples, combining Figure 1 ,like Figure 4 As shown, the image recognition method provided in this embodiment of the present disclosure further includes S142.
[0089] S142. If the distance between the center key point and the wrist key point is greater than a distance threshold, a prompt message is generated. The prompt message instructs the user to move their hand within the image acquisition range of the image acquisition device.
[0090] In some examples, when the distance between the center key point and the wrist key point is greater than the distance threshold, it indicates that the image in the theoretical detection box and the image in the first actual detection box are not the same hand. Since the image in the theoretical detection box and the image in the first actual detection box are not the same hand, there is no need to generate a theoretical detection box. Instead, the user is prompted to move the hand to the acquisition range of the image acquisition device and re-acquire the target image.
[0091] In some feasible examples, combining Figure 1 ,like Figure 5As shown, S15 can be implemented by S150 and S151, and S16 can be implemented by S160.
[0092] S150. Determine the crossover ratio between the first actual detection frame and the theoretical detection frame based on the first actual detection frame and the theoretical detection frame.
[0093] S151. Based on the comparison results of the crossover ratio and the preset threshold, the analysis results are obtained.
[0094] S160. When the comparison result between the cross-union ratio and the preset threshold is that the cross-union ratio is greater than or equal to the preset threshold, the analysis result is that the first actual detection box and the theoretical detection box correspond to the same palm, and the target detection box is determined.
[0095] In some feasible examples, combining Figure 5 ,like Figure 6 As shown, the image recognition method provided in this embodiment of the present disclosure further includes S18.
[0096] S18. When the comparison result between the cross-union ratio and the preset threshold is that the cross-union ratio is less than the preset threshold, the analysis result is that the first actual detection box and the theoretical detection box are not the same hand, and a prompt message is generated.
[0097] In some examples, when the intersection-union ratio is less than a preset threshold, it indicates that the image in the theoretical detection box and the image in the first actual detection box are not the same hand. Since the image in the theoretical detection box and the image in the first actual detection box are not the same hand, it is not necessary to obtain the hand position corresponding to the gesture. Instead, the user should be prompted to move the hand to the acquisition range of the image acquisition device and re-acquire the target image.
[0098] The foregoing primarily describes the solutions provided by the embodiments of the present invention from a methodological perspective. To achieve the aforementioned functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the present invention can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0099] In this embodiment of the invention, the image recognition device can be divided into functional modules according to the above method example. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware or as software functional modules. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division; in actual implementation, there may be other division methods.
[0100] like Figure 7 As shown, an embodiment of the present invention provides a schematic diagram of the structure of an image recognition device 10. The image recognition device 10 includes an acquisition unit 101 and a processing unit 102.
[0101] The acquisition unit 101 is used to acquire a target image acquired by an image acquisition device; wherein the target image includes images of preset parts of the human body; the processing unit 102 is used to analyze the target image acquired by the acquisition unit 101 to obtain a first actual detection box corresponding to the gesture in the target image, and a gesture key point corresponding to the gesture; the processing unit 102 is also used to perform human body detection on the target image acquired by the acquisition unit 101 to obtain human body key points corresponding to the human body; wherein the human body key points include at least elbow key points and wrist key points; the processing unit 102 is also used to obtain a theoretical detection box corresponding to the gesture based on the correlation between the elbow key points, wrist key points and gesture key points; the processing unit 102 is also used to perform similarity analysis on the first actual detection box and the theoretical detection box to obtain analysis results. The processing unit 102 is also used to determine a target detection box when the analysis result shows that the first actual detection box and the theoretical detection box correspond to the same palm; wherein the target detection box includes any one of the first actual detection box and the theoretical detection box; the processing unit 102 is also used to use the position information corresponding to the target detection box as the palm position corresponding to the gesture.
[0102] In some possible embodiments, the processing unit 102 is specifically used to perform gesture detection on the target image acquired by the acquisition unit 101 and determine the gesture image corresponding to the gesture in the target image; the processing unit 102 is specifically used to perform contour detection on the gesture image and determine a first actual detection box; the processing unit 102 is specifically used to perform gesture key point detection on the image corresponding to the gesture in the first actual detection box and determine the gesture key points corresponding to the gesture.
[0103] In some possible embodiments, the processing unit 102 is specifically used to perform human body detection on the target image acquired by the acquisition unit 101 and determine the second actual detection box corresponding to the human body in the target image; the processing unit 102 is specifically used to perform human body key point detection on the image corresponding to the human body in the second actual detection box and determine the human body key points corresponding to the human body.
[0104] In some possible implementation examples, the processing unit 102 is specifically used to perform calculations on the gesture key points when the gesture is located on the line connecting the elbow key point and the wrist key point, and determine the center key point corresponding to the gesture key point; the processing unit 102 is specifically used to generate a theoretical detection box corresponding to the gesture based on the gesture key points when the distance between the center key point and the wrist key point is less than or equal to a distance threshold.
[0105] In some possible embodiments, the processing unit 102 is further configured to generate a prompt message when the distance between the center key point and the wrist key point is greater than a distance threshold; wherein the prompt message is used to instruct the palm to be moved into the acquisition range of the image acquisition device.
[0106] In some possible embodiments, processing unit 102 is specifically used to determine the cross-union ratio (CUP) between the first actual detection box and the theoretical detection box based on the first actual detection box and the theoretical detection box; processing unit 102 is specifically used to obtain an analysis result based on the comparison result of the CUP and a preset threshold. Specifically, when the comparison result of the CUP and the preset threshold is that the CUP is greater than or equal to the preset threshold, the analysis result is that the first actual detection box and the theoretical detection box correspond to the same hand, thus determining the target detection box.
[0107] In some possible implementation examples, the processing unit 102 is further configured to, when the comparison result between the cross-union ratio and the preset threshold is that the cross-union ratio is less than the preset threshold, then the analysis result is that the first actual detection box and the theoretical detection box are not the same hand, and generate a prompt message.
[0108] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and their functions will not be repeated here.
[0109] Of course, the image recognition device 10 provided in this embodiment of the invention includes, but is not limited to, the modules described above. For example, the image recognition device 10 may also include a storage unit 103. The storage unit 103 may be used to store the program code of the image recognition device 10, and may also be used to store data generated by the image recognition device 10 during operation, such as data in write requests.
[0110] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention, such as... Figure 8 As shown, the electronic device may include at least one processor 51, a memory 52, a communication interface 53, and a communication bus 54.
[0111] The following is combined with Figure 8 A detailed introduction to each component of the electronic device:
[0112] The processor 51 is the control center of the electronic device. It can be a single processor or a collective term for multiple processing elements. For example, the processor 51 can be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, such as one or more DSPs, or one or more field-programmable gate arrays (FPGAs).
[0113] In a specific implementation, as one example, processor 51 may include one or more CPUs, for example... Figure 8 CPU0 and CPU1 are shown in the diagram. Furthermore, as one embodiment, the electronic device may include multiple processors, such as... Figure 8 The processors 51 and 55 are shown. Each of these processors can be a single-core processor or a multi-core processor. A processor here can refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).
[0114] The memory 52 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or it may be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto. The memory 52 may exist independently and be connected to the processor 51 via a communication bus 54. The memory 52 may also be integrated with the processor 51.
[0115] In a specific implementation, memory 52 is used to store data from this invention and the software program for executing this invention. Processor 51 can perform various functions of the air conditioner by running or executing the software program stored in memory 52 and by calling the data stored in memory 52.
[0116] Communication interface 53, using any transceiver-like device, is used to communicate with other devices or communication networks, such as Radio Access Network (RAN), Wireless Local Area Networks (WLAN), terminals, and the cloud. Communication interface 53 may include an acquisition unit to implement acquisition functions.
[0117] The communication bus 54 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0118] As an example, combined Figure 7 The functions implemented by the acquisition unit 101 in the image recognition device 10 are the same as those of the image recognition device 10. Figure 8 The communication interface 53 has the same function, and the processing unit 102 implements the same function. Figure 8 The processor 51 in the memory unit has the same function as the memory unit 103. Figure 8 The memory 52 in it has the same function.
[0119] Another embodiment of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a computing device, causes the computing device to implement the method shown in the above-described method embodiment.
[0120] In some embodiments, the disclosed method may be implemented as computer program instructions encoded in a machine-readable format on a computer-readable storage medium or on other non-transitory media or articles of art.
[0121] Figure 9 A conceptual partial view of a computer program product provided in an embodiment of the present invention is shown schematically. The computer program product includes a computer program for executing computer processes on a computing device.
[0122] In one embodiment, a computer program product is provided using a signal bearer medium 410. The signal bearer medium 410 may include one or more program instructions that, when executed by one or more processors, can provide the above-mentioned... Figure 1 The described function or part of the function. Therefore, for example, refer to... Figure 1 In the embodiment shown, one or more features of S11-S17 can be provided by one or more instructions associated with the signal carrying medium 410. Furthermore, Figure 9 The program instructions in the document also describe example instructions.
[0123] In some examples, the signal carrying medium 410 may include a computer-readable medium 411, such as, but not limited to, a hard disk drive, a compact disc (CD), a digital video disc (DVD), a digital magnetic tape, a memory, a read-only memory (ROM), or a random access memory (RAM), etc.
[0124] In some implementations, the signal carrying medium 410 may include a computer recordable medium 412, such as, but not limited to, a memory, a read / write (R / W) CD, a R / W DVD, and so on.
[0125] In some implementations, the signal carrying medium 410 may include a communication medium 413, such as, but not limited to, digital and / or analog communication media (e.g., fiber optic cables, waveguides, wired communication links, wireless communication links, etc.).
[0126] The signal-bearing medium 410 can be transmitted by a wireless communication medium 413 (e.g., a wireless communication medium conforming to the IEEE 802.41 standard or other transmission protocols). One or more program instructions can be, for example, computer-executable instructions or logical implementation instructions.
[0127] In some examples, such as targeting Figure 7 The described image recognition device can be configured to provide various operations, functions, or actions in response to one or more program instructions in a computer-readable medium 411, a computer-recordable medium 412, and / or a communication medium 413.
[0128] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0129] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0130] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0131] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0132] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0133] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An image recognition method, characterized in that, include: Acquire a target image captured by an image acquisition device; wherein the target image includes an image of a preset part of the human body; The target image is analyzed to obtain the first actual detection box corresponding to the gesture in the target image, and the gesture key points corresponding to the gesture; Human body detection is performed on the target image to obtain the human body key points corresponding to the human body; wherein, the human body key points include at least elbow key points and wrist key points; Based on the correlation among the elbow key point, the wrist key point and the gesture key point, the theoretical detection box corresponding to the gesture is obtained. A similarity analysis is performed on the first actual detection box and the theoretical detection box to obtain the analysis results; If the analysis result shows that the first actual detection box and the theoretical detection box correspond to the same hand, a target detection box is determined; wherein, the target detection box includes either the first actual detection box or the theoretical detection box. The position information corresponding to the target detection box is used as the palm position corresponding to the gesture; The theoretical detection box corresponding to the gesture is obtained based on the correlation between the elbow key point, the wrist key point, and the gesture key point, including: When the gesture is located on the line connecting the elbow key point and the wrist key point, the gesture key point is calculated to determine the center key point corresponding to the gesture key point; If the distance between the center key point and the wrist key point is less than or equal to a distance threshold, a theoretical detection box corresponding to the gesture is generated based on the gesture key point.
2. The image recognition method according to claim 1, characterized in that, The step of analyzing the target image to obtain the first actual detection box corresponding to the gesture in the target image, and the gesture key points corresponding to the gesture, includes: Perform gesture detection on the target image to determine the gesture image corresponding to the gesture in the target image; Perform contour detection on the gesture image to determine the first actual detection box; Gesture key point detection is performed on the image corresponding to the gesture in the first actual detection frame to determine the gesture key points corresponding to the gesture.
3. The image recognition method according to claim 1, characterized in that, The step of performing human detection on the target image to obtain the human body key points corresponding to the human body includes: Human detection is performed on the target image to determine the second actual detection box corresponding to the human body in the target image; Human key points are detected in the image corresponding to the human body in the second actual detection frame to determine the human key points corresponding to the human body.
4. The image recognition method according to claim 1, characterized in that, The method further includes: If the distance between the center key point and the wrist key point is greater than the distance threshold, a prompt message is generated; wherein the prompt message is used to instruct the palm to be moved into the acquisition range of the image acquisition device.
5. The image recognition method according to claim 1, characterized in that, The similarity analysis of the first actual detection box and the theoretical detection box to obtain the analysis results includes: Based on the first actual detection frame and the theoretical detection frame, determine the intersection-union ratio between the first actual detection frame and the theoretical detection frame; Based on the comparison results between the crossover ratio and the preset threshold, the analysis results are obtained; When the analysis result shows that the first actual detection box and the theoretical detection box correspond to the same hand, determining the target detection box includes: When the comparison result between the cross-union ratio and the preset threshold is that the cross-union ratio is greater than or equal to the preset threshold, the analysis result is that the first actual detection box and the theoretical detection box correspond to the same palm, and the target detection box is determined.
6. The image recognition method according to claim 5, characterized in that, The method further includes: If the comparison result between the cross-union ratio and the preset threshold is that the cross-union ratio is less than the preset threshold, then the analysis result is that the first actual detection box and the theoretical detection box are not the same hand, and a prompt message is generated.
7. An image recognition device, characterized in that, include: An acquisition unit is used to acquire a target image captured by an image acquisition device; wherein the target image includes an image of a preset part of the human body; The processing unit is used to analyze the target image acquired by the acquisition unit to obtain a first actual detection box corresponding to the gesture in the target image, and gesture key points corresponding to the gesture; The processing unit is further configured to perform human body detection on the target image acquired by the acquisition unit to obtain human body key points corresponding to the human body; wherein, the human body key points include at least elbow key points and wrist key points. The processing unit is further configured to perform calculations on the gesture key points when the gesture is located on the line connecting the elbow key point and the wrist key point, and determine the center key point corresponding to the gesture key point. If the distance between the center key point and the wrist key point is less than or equal to a distance threshold, a theoretical detection box corresponding to the gesture is generated based on the gesture key point. The processing unit is further configured to perform similarity analysis on the first actual detection box and the theoretical detection box to obtain analysis results; The processing unit is further configured to determine a target detection box when the analysis result shows that the first actual detection box and the theoretical detection box correspond to the same palm; wherein the target detection box includes either the first actual detection box or the theoretical detection box; The processing unit is further configured to use the position information corresponding to the target detection box as the palm position corresponding to the gesture.
8. An electronic device, characterized in that, include: A memory and a processor, the memory being used to store a computer program; the processor being used to cause the electronic device to implement the image recognition method according to any one of claims 1-6 when executing the computer program.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a computing device, causes the computing device to implement the image recognition method according to any one of claims 1-6.
10. A vehicle, characterized in that, This includes the image recognition device as described in claim 7, or the electronic device as described in claim 8.
Citation Information
Patent Citations
Hand detection method and device
CN111222379A
Equipment control method and device, electronic equipment and storage medium
CN112987933A
