Position estimation method, device, equipment and medium
Through the pose estimation method, the control point prediction model is used to extract multi-scale feature information of the target object and calculate the pose parameters, which solves the problem of inaccurate rotation angle when the smart device obtains the object position, and improves the accuracy of object pose determination.
Patent Information
- Application Number
- CN202010802444.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-11
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-08-11
AI Technical Summary
When a smart device obtains the position of an object through its own sensor, it cannot accurately obtain the rotation angle of the object, resulting in inaccurate interactions with environmental objects.
Using the pose estimation method, by collecting target images and inputting them into the pre-trained control point prediction model, multi-scale feature information is extracted to determine the control point coordinates of the target object, and then the pose parameters are calculated to determine the pose of the object.
It achieves the accurate determination of the relative position and rotation angle of the target object in the camera coordinate system, and improves the accuracy of the interaction between smart devices and environmental objects.
Smart Images

Figure CN112085789B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a method, device, equipment and medium for posture estimation. Background Art
[0002] Smart devices, such as smart robots, usually need to know the location of objects in the environment, so as to interact with objects in the environment based on the location of the objects in the environment. In related technologies, smart devices can usually use sensors installed on themselves, such as laser sensors, to know the location of objects in the environment. Since the sensors can usually only obtain the distance and angle of the object as a whole relative to the smart device, but cannot obtain the rotation angle of the object itself, it is impossible to realize accurate interaction between smart devices and objects in the environment.
[0003] Therefore, in the related art, in order to realize accurate interaction between smart devices and objects in the environment, it is necessary to obtain a more accurate position of the objects in the environment. Summary of the invention
[0004] The embodiments of the present application provide a posture estimation method, apparatus, device and medium, which aim to solve the problem in the related art that the position of an object obtained by a smart device using a sensor installed on the smart device is not accurate enough.
[0005] In a first aspect, an embodiment of the present application provides a posture estimation method, the method comprising:
[0006] Acquiring a target image showing a target object;
[0007] Inputting the target image into a pre-trained control point prediction model for processing to obtain coordinate information of a plurality of control points, wherein the plurality of control points are used to describe the contour of the target object, and the control point prediction model processes the target image by extracting multi-scale feature information from the target image, and determining the coordinate information of the plurality of control points based on the multi-scale feature information, wherein the multi-scale feature information is information extracted based on a plurality of preset resolutions for describing features of the target image;
[0008] Determine the posture parameters of the target object based on the coordinate information of the multiple control points, wherein the posture parameters are used for conversion between a first coordinate system and a second coordinate system, the first coordinate system is a coordinate system with the center of the target object as the origin, and the second coordinate system is a coordinate system of a camera that captures the target image;
[0009] According to the posture parameters, the position and posture of the target object are determined.
[0010] Furthermore, multi-scale feature information is extracted from the target image, including:
[0011] Extract N feature blocks with different resolutions from the target image;
[0012] N feature blocks with different resolutions are converted into N feature blocks with the same resolution to obtain multi-scale feature information, where N is an integer greater than 1.
[0013] Furthermore, N=3, the extracted feature blocks are feature blocks of a first resolution, feature blocks of a second resolution, and feature blocks of a third resolution, respectively, the first resolution is greater than the second resolution, and the second resolution is greater than the third resolution; and
[0014] Convert N feature blocks with different resolutions into N feature blocks with the same resolution, including:
[0015] Downsampling the feature block of the first resolution to obtain a first feature block;
[0016] Perform 1×1 convolution on the feature block of the second resolution to obtain a second feature block;
[0017] Upsampling the feature block of the third resolution to obtain a third feature block;
[0018] The multi-scale feature information includes a first feature block, a second feature block and a third feature block, and the first feature block, the second feature block and the third feature block have the same resolution.
[0019] Further, the multi-scale feature information includes N feature blocks with the same resolution; and
[0020] Determine the coordinate information of multiple control points based on the multi-scale feature information, including:
[0021] Extract the global maximum pooling value of each feature block in N feature blocks with the same resolution;
[0022] According to the global maximum pooling value of each feature block and N feature blocks with the same resolution, the coordinate information of multiple control points is determined.
[0023] Further, N=3, the N feature blocks with the same resolution are respectively a first feature block, a second feature block and a third feature block, the first feature block includes i feature maps, the second feature map includes j feature maps, the third feature map includes k feature maps, and i, j, and k are all integers greater than or equal to 1; and
[0024] Extract the global maximum pooling value of each feature block in N feature blocks with the same resolution, including:
[0025] Obtain the maximum value of each feature map in the i feature maps of the first feature block, and determine the average of the maximum values of the i feature maps as the global maximum pooling value of the first feature block;
[0026] Obtain the maximum value of each feature map in the j feature maps of the second feature block, and determine the average of the maximum values of the j feature maps as the global maximum pooling value of the second feature block;
[0027] The maximum value of each feature map in the k feature maps of the third feature block is obtained, and the average of the maximum values of the k feature maps is determined as the global maximum pooling value of the third feature block.
[0028] Furthermore, according to the global maximum pooling value of each feature block and N feature blocks with the same resolution, the coordinate information of multiple control points is determined, including:
[0029] Performing a linear activation processing operation on a vector composed of global maximum pooling values of each feature block to obtain first result data;
[0030] Performing a full connection operation on the first result data to obtain second result data;
[0031] The coordinate information of multiple control points is obtained according to the features of the target image described by the product of N feature blocks with the same resolution and the second result data.
[0032] Further, according to the features of the target image described by the product of the N feature blocks with the same resolution and the second result data, the coordinate information of the multiple control points is obtained, including:
[0033] Determine the object category and the coordinates of the center point of the target object according to the features of the target image described by the product of the N feature blocks with the same resolution and the second result data;
[0034] The coordinates of multiple control points of the target object are determined according to the object category, the coordinates of the object center point and a preset relative position relationship corresponding to the object category, wherein the relative position relationship is used to describe the positional relationship between the coordinates of each control point of the target object and the coordinates of the object center point.
[0035] Furthermore, the control point prediction model is trained through the following steps:
[0036] Acquire a training sample set, wherein the training samples in the training sample set include sample images and annotated coordinates of control points of objects presented in the sample images;
[0037] A training sample is selected from the training sample set, and the following training steps are performed: a sample image of the selected training sample is input into the initial model to obtain an actual output; the annotated coordinates of the control point of the object presented by the input sample image and the obtained actual output are input into a pre-set loss function to obtain a loss value; in response to the loss value being less than a preset loss threshold, the initial model is used as a control point prediction model for training completion;
[0038] In response to the loss value being greater than or equal to a preset loss threshold, the parameters of the initial model are adjusted to obtain an adjusted initial model, the adjusted initial model is used as the initial model, unselected training samples are selected from the training sample set, and the training step is continued.
[0039] In a second aspect, an embodiment of the present application provides a posture estimation device, the device comprising:
[0040] An image acquisition unit, used for acquiring a target image showing a target object;
[0041] A coordinate prediction unit, used to input the target image into a pre-trained control point prediction model for processing, and obtain coordinate information of multiple control points, wherein the multiple control points are used to describe the contour of the target object, and the control point prediction model processes the target image by extracting multi-scale feature information from the target image, and determining the coordinate information of the multiple control points based on the multi-scale feature information, wherein the multi-scale feature information is information extracted based on multiple preset resolutions for describing the features of the target image;
[0042] A parameter determination unit, used to determine the posture parameters of the target object based on the coordinate information of the multiple control points, wherein the posture parameters are used for conversion between a first coordinate system and a second coordinate system, the first coordinate system is a coordinate system with the center of the target object as the origin, and the second coordinate system is a coordinate system of a camera that captures the target image;
[0043] The posture determination unit is used to determine the posture of the target object according to the posture parameters.
[0044] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned posture estimation method when executing the computer program.
[0045] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the above-mentioned posture estimation method are implemented.
[0046] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes any one of the posture estimation methods in the first aspect.
[0047] Compared with the related art, the embodiment of the present application has the following beneficial effects: the collected target image is input into a pre-trained control point prediction model, and the coordinates of multiple control points of the target object presented by the target image are predicted by the control point prediction model. Then, the posture parameters of the conversion between the coordinate system of the target object and the coordinate system of the camera are determined by predicting the coordinates of the multiple control points, so as to determine the position and posture of the object based on the posture parameters. Since the distribution of each control point satisfies the distribution characteristics in the coordinate system of the target object, the relative position and rotation angle of the target object in the camera coordinate system can be obtained by determining the posture parameters of the conversion between the coordinate system of the target object and the coordinate system of the camera through the coordinates of multiple control points, which helps to achieve a more accurate position and posture of the target object. In addition, since different features can be extracted from the target image based on different resolutions, and rich and accurate features can be extracted from the target image based on multiple resolutions, the control point prediction model uses multi-scale feature information extracted based on multiple preset resolutions to predict the coordinate information of the control point, which can make the predicted coordinate information of the control point more accurate, which helps to further improve the accuracy of the prediction of the position and posture of the target object.
[0048] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 It is a flowchart of a posture estimation method provided in an embodiment of the present application;
[0051] Figure 2 is a schematic diagram of the effect of control points on a target image provided by an embodiment of the present application;
[0052] Figure 3 is a schematic diagram of the relationship between the coordinate system of an object and the coordinate system of a camera provided in an embodiment of the present application;
[0053] Figure 4 is a schematic diagram of a process of extracting multi-scale feature information provided by an embodiment of the present application;
[0054] Figure 5 is a flow chart of a posture estimation method provided by another embodiment of the present application;
[0055] Figure 6 is a flowchart of a posture estimation method provided by another embodiment of the present application;
[0056] Figure 7 is a network structure diagram of a control point prediction model provided by an embodiment of the present application;
[0057] Figure 8 is a structural schematic diagram of a posture estimation device provided in one embodiment of the present application;
[0058] Fig. 9 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0059] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0060] It should be understood that the term "and / or" used in the specification of this application and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. In addition, in the description of the specification of this application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0061] It should also be understood that references to "one embodiment" or "some embodiments" etc. described in the specification of the present application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in the specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0062] The present application provides a pose estimation method, which can extract rich and accurate features from the target image by extracting features from different resolutions, thereby making the predicted coordinate information of the control points more accurate, which helps to improve the accuracy of pose prediction of the target object.
[0063] In order to illustrate the technical solution of the present application, the following embodiments are used for illustration.
[0064] Embodiment 1
[0065] See also Figure 1 , the present application embodiment provides a posture estimation method, comprising:
[0066] Step 101 : acquiring a target image showing a target object.
[0067] The target object may be any object, such as a beverage bottle, a stone, a person, a puppy, etc.
[0068] In this embodiment, the execution subject of the posture estimation method may be an intelligent device, such as an intelligent robot, an unmanned vehicle, etc. The execution subject may collect the target image through a camera installed on the intelligent device.
[0069] Step 102: Input the target image into a pre-trained control point prediction model for processing to obtain coordinate information of multiple control points.
[0070] Among them, multiple control points are used to describe the outline of the target object. Here, the control points are points that describe the outline of the target object, and the number of control points is usually multiple. For example, there can be 4, 8, etc. For example, if the target object is a cuboid, there can be 8 control points, and each control point can be 8 vertices of the cuboid.
[0071] The control point prediction model may be used to analyze the correspondence between a target image and coordinate information of a plurality of control points of a target object presented in the target image.
[0072] The control point prediction model processes the target image by extracting multi-scale feature information from the target image and determining the coordinate information of multiple control points based on the multi-scale feature information, wherein the multi-scale feature information is information extracted based on multiple preset resolutions and used to describe the features of the target image.
[0073] In practical applications, after a convolution layer performs convolution processing on an image, it can usually extract one or more feature maps with the same resolution for describing the features of the image. And the resolution of the feature map extracted by a convolution layer is usually fixed. Therefore, the control point prediction model can use a convolution layer whose output feature map has a resolution of a preset resolution to extract the features of the target image. When there are multiple preset resolutions, for each preset resolution, a convolution layer whose output feature map has a resolution of the preset resolution can be used to extract the features of the target image.
[0074] In practice, when extracting features of a target image based on multiple preset resolutions, the feature maps with different resolutions output by each convolutional layer can be directly used as the above-mentioned multi-scale feature information, or the feature maps with different resolutions output by each convolutional layer can be processed according to preset processing rules and the processed feature maps can be used as the above-mentioned multi-scale feature information.
[0075] Among them, the preset processing rule may be a pre-set rule for processing feature maps with different resolutions. As an example, the preset processing rule may be a rule for converting feature maps with different resolutions into feature maps with the same resolution. It should be noted that if the preset processing rule is a rule for converting feature maps with different resolutions into feature maps with the same resolution, in order to reduce the computing resources consumed for converting the resolution, the resolutions of the feature maps with different resolutions are usually converted to the same resolution as one of the feature maps. For example, if the resolution of the feature map output by the first convolution layer is 40×40, the resolution of the feature map output by the second convolution layer is 20×20, and the resolution of the feature map output by the third convolution layer is 10×10. At this time, the resolutions of all feature maps can be converted to 40×40, the resolutions of all feature maps can be converted to 20×20, or the resolutions of all feature maps can be converted to 10×10.
[0076] In practice, the multiple convolutional layers used to extract features of multiple preset resolutions of the target image in the above-mentioned control point prediction model are generally a convolutional network. Optionally, the above-mentioned convolutional network is an anonymous network (darknet network). When the convolutional network is a darknet network, since the resolution of the feature map output by each convolutional layer is known, the corresponding convolutional layer can be selected based on the preset resolution. For example, if the preset resolution is 52×52, 26×26 and 13×13, the resolution of the feature map output by the 8th convolutional layer of the darknet network is 52×52, the resolution of the feature map output by the 13th convolutional layer of the darknet network is 26×26, and the resolution of the feature map output by the 23rd convolutional layer of the darknet network is 13×13. At this time, the feature maps output by the 8th, 13th and 23rd convolutional layers of the darknet network can be selected.
[0077] It should be pointed out that since the darknet network usually has the advantages of fast speed, low background false detection rate, and strong versatility, using the darknet network to extract the features of the target image can help to achieve faster extraction of feature maps that can accurately describe the features of the target object.
[0078] After extracting the multi-scale feature information of the target image, the control point prediction model can obtain the coordinate information of multiple control points of the target object by inputting the extracted multi-scale feature information into a pooling layer, a linear activation layer, a fully connected layer, etc. There can be one or more pooling layers, one or more linear activation layers, and one or more fully connected layers.
[0079] It is understandable that the control point prediction model can be pre-trained by the smart device, or it can be pre-trained by other devices and then the file corresponding to the control point prediction model can be transplanted to the smart device. In other words, the execution subject of training the control point prediction model and the execution subject of using the control point prediction model to perform control point prediction can be the same or different. For example, when other devices are used to train the initial model, after the other devices finish training the initial model, the model parameters of the initial model are fixed to obtain the file corresponding to the control point prediction model. Then the file is transplanted to the smart device.
[0080] In this embodiment, when obtaining the target image, the execution subject may obtain the coordinate information of multiple control points of the target object by inputting the target image into a pre-trained control point prediction model.
[0081] Figure 2 This is a schematic diagram of the effect of the control points of an object presented in a target image obtained for a target image. Figure 2 As shown, the target image is an image including a beverage bottle B. P1-P8 in the figure are eight control points of the beverage bottle predicted by the above control point prediction model, and P0 is the center point of the beverage bottle B.
[0082] Step 103: determining the posture parameters of the target object based on the coordinate information of the multiple control points.
[0083] The posture parameters are used for the conversion between the first coordinate system and the second coordinate system. The first coordinate system is a coordinate system with the center of the target object as the origin, and the second coordinate system is a coordinate system of a camera that captures the target image.
[0084] Pose parameters usually include a rotation matrix and an offset vector.
[0085] The coordinate system of the target object is usually a coordinate system with the center of the target object as the origin. The coordinate system of the camera is usually a coordinate system with the center of the camera as the origin.
[0086] Figure 3 A schematic diagram showing the relationship between the coordinate system of the object and the coordinate system of the camera. Figure 3As shown, for any point on an object, such as a vertex of a cuboid, if the point takes the center of the object as the origin, the coordinates of the point in the object's coordinate system can be obtained as P object If the point takes the camera center as the origin, the coordinates of the point in the camera's coordinate system can be obtained as P camera The coordinates of the same point are different in different coordinate systems, and the same point in different coordinate systems usually satisfies the following coordinate transformation relationship:
[0087] P camera =R·P object +t
[0088] Among them, R is the rotation matrix from the object's coordinate system to the camera's coordinate system, and t is the offset vector from the object's coordinate system to the camera's coordinate system.
[0089] In this embodiment, after obtaining the coordinates of multiple control points of the target object, the above-mentioned execution entity may use relevant technologies or technologies to be developed in the future to determine the posture parameters of the target object. As an example, the above-mentioned execution entity may first use a laser radar sensor to scan the target object to obtain point cloud data of the target object. Then, determine the points in the point cloud data corresponding to the control points of the target object. Finally, the coordinates of the points corresponding to the control points of the target object in the point cloud data and the coordinates of the control points are substituted into the above-mentioned coordinate transformation relationship, and the posture parameters of the target object can be calculated. It should be pointed out that the above-mentioned point cloud data generally refers to a set of three-dimensional coordinate points in the coordinate system of the camera, and each three-dimensional coordinate point corresponds to a point on the outer surface of the object. The above-mentioned set of three-dimensional coordinate points can generally be used to represent the outer surface shape of an object.
[0090] Step 104, determining the position and posture of the target object according to the posture parameters.
[0091] In this embodiment, after obtaining the posture parameters of the target object, the execution subject can directly substitute the coordinates of each control point into the coordinate transformation relationship to calculate the position and posture of the target object. The position and posture of the target object generally refers to the three-dimensional coordinates and rotation angle of the target object in the coordinate system of the camera.
[0092] In this embodiment, the above-mentioned execution subject can input the collected target image into a pre-trained control point prediction model, and predict the coordinates of multiple control points of the target object presented by the target image through the control point prediction model. Then, the posture parameters of the conversion between the coordinate system of the target object and the coordinate system of the camera are determined by predicting the coordinates of the multiple control points, so as to determine the position and posture of the object based on the posture parameters. Since the distribution of each control point satisfies the distribution characteristics in the coordinate system of the target object, the relative position and rotation angle of the target object in the camera coordinate system can be obtained by determining the posture parameters of the conversion between the coordinate system of the target object and the coordinate system of the camera through the coordinates of multiple control points, which helps to achieve a more accurate position and posture of the target object. In addition, since different features can be extracted from the target image based on different resolutions, and rich and accurate features can be extracted from the target image based on multiple resolutions, the control point prediction model uses multi-scale feature information extracted based on multiple preset resolutions to predict the coordinate information of the control point, which can make the predicted coordinate information of the control point more accurate, which helps to further improve the accuracy of the prediction of the position and posture of the target object.
[0093] In some optional implementations of this embodiment, the extracting multi-scale feature information from the target image includes: extracting N feature blocks with different resolutions from the target image, converting the N feature blocks with different resolutions into N feature blocks with the same resolution to obtain the multi-scale feature information, where N is an integer greater than 1.
[0094] The feature block is usually a collection of multiple feature maps with the same resolution. Here, the multi-scale feature information is N feature blocks with the same resolution obtained by conversion.
[0095] Figure 4 A schematic diagram showing the process of extracting multi-scale feature information is shown. Figure 4 As shown, multiple feature blocks with different resolutions can be extracted from the target image 400, namely, feature block 401A, feature block 402A, and feature block 403A. Afterwards, feature blocks 401A, feature blocks 402A, and feature blocks 403A with different resolutions can be converted to the same resolution to obtain multiple feature blocks with the same resolution, namely, feature blocks 401B, feature blocks 402B, and feature blocks 403B. At this time, the obtained feature blocks 401B, feature blocks 402B, and feature blocks 403B are the above-mentioned multi-scale feature information.
[0096] It should be noted that, in order to facilitate the conversion calculation of resolution, the resolutions of the N feature blocks extracted from the target image are usually integer multiples. As an example, if N=2, two feature blocks can be extracted from the target image, and if the resolution of one of the feature blocks is 10×10, the resolution of the other feature block can be 20×20.
[0097] This implementation method can extract richer features of the target image by extracting feature blocks with different resolutions. After that, the feature blocks with different resolutions are converted into blocks with the same resolution, and the features of the feature blocks with multiple resolutions can be comprehensively analyzed, which helps to extract more accurate features of the target image.
[0098] In some optional implementations of this embodiment, if N=3, the extracted feature blocks are feature blocks of a first resolution, feature blocks of a second resolution, and feature blocks of a third resolution, respectively, the first resolution is greater than the second resolution, and the second resolution is greater than the third resolution. At this time, the above-mentioned conversion of N feature blocks with different resolutions into N feature blocks with the same resolution includes:
[0099] The feature block of the first resolution is downsampled to obtain a first feature block.
[0100] Perform 1×1 convolution on the feature block of the second resolution to obtain a second feature block.
[0101] The feature block at the third resolution is upsampled to obtain a third feature block.
[0102] The multi-scale feature information includes a first feature block, a second feature block and a third feature block, and the first feature block, the second feature block and the third feature block have the same resolution.
[0103] For example, if the first resolution is 52×52, the second resolution is 26×26, and the third resolution is 13×13, the feature block of the first resolution can be downsampled by 2 times to obtain a first feature block with a resolution of 26×26. The feature block of the second resolution is convolved by 1×1 to obtain a second feature block with a resolution of 26×26. The feature block of the third resolution is upsampled by 2 times to obtain a third feature block with a resolution of 26×26.
[0104] In this implementation, by downsampling feature blocks with large resolution, upsampling feature blocks with small resolution, and performing 1×1 convolution on feature blocks with medium resolution, the resolution of each feature block is converted to the same resolution as that of one of the feature blocks, which can reduce the computing resources consumed for converting the resolution. In addition, by using multiple sampling methods to convert feature blocks with different resolutions into feature blocks with the same resolution, the loss of features caused by resolution conversion can be reduced, and the obtained multi-scale feature information can be more accurately described The characteristics of the target image.
[0105] In some optional implementations of this embodiment, if the multi-scale feature information includes N feature blocks with the same resolution, then the above-mentioned determination of the coordinate information of the multiple control points based on the multi-scale feature information includes:
[0106] First, the global maximum pooling value of each feature block in N feature blocks with the same resolution is extracted.
[0107] Among them, the above-mentioned global maximum pooling value is a data value obtained based on the maximum values of multiple feature maps included in the feature block. As an example, the above-mentioned global maximum pooling value can be the maximum of the maximum values of each feature map included in the feature block. For further example, if the feature block includes 2 feature maps. The maximum value in one feature map is 20, and the maximum value in the other feature map is 26. At this time, the above-mentioned global maximum pooling value can be 26. As another example, the above-mentioned global maximum pooling value can also be the second largest of the maximum values of each feature map included in the feature block.
[0108] Then, the coordinate information of multiple control points is determined according to the global maximum pooling value of each feature block and N feature blocks with the same resolution.
[0109] Here, after extracting the global maximum pooling value of each feature block in N feature blocks with the same resolution, N global maximum pooling values can be obtained. As an example, the control point prediction model can obtain the coordinate information of multiple control points of the target object by inputting the N global maximum pooling values and at least one of the N feature blocks into a linear activation layer, a fully connected layer, etc. Among them, there can be one or more linear activation layers, and there can be one or more fully connected layers.
[0110] In this implementation, since the point with the larger corresponding value in the feature map has more obvious features of the target image, by extracting the maximum value of the feature map, the point in the feature map that extracts the significant features of the target image can be obtained, thereby achieving the extraction of the significant features of the target image. This helps to improve the accuracy of predicting the coordinate information of the control point of the target object.
[0111] In some optional implementations of this embodiment, if N=3, the N feature blocks with the same resolution are the first feature block, the second feature block and the third feature block, the first feature block includes i feature maps, the second feature map includes j feature maps, and the third feature map includes k feature maps, and i, j, and k are all integers greater than or equal to 1. At this time, the above-mentioned extraction of the global maximum pooling value of each feature block in the N feature blocks with the same resolution includes:
[0112] First, the maximum value of each feature map in the i feature maps of the first feature block is obtained, and the average of the maximum values of the i feature maps is determined as the global maximum pooling value of the first feature block.
[0113] For example, if the value of i is 2, the first feature block includes two feature maps. If the maximum value in one feature map is 20, and the maximum value in the other feature map is 26, then the global maximum pooling value may be 23, where 23 = (20 + 26) ÷ 2.
[0114] Then, the maximum value of each feature map in the j feature maps of the second feature block is obtained, and the average of the maximum values of the j feature maps is determined as the global maximum pooling value of the second feature block.
[0115] Finally, the maximum value of each feature map in the k feature maps of the third feature block is obtained, and the average of the maximum values of the k feature maps is determined as the global maximum pooling value of the third feature block.
[0116] In this implementation, for each of the N feature blocks with the same resolution, the average of the maximum values of the feature maps included in the feature block is used as the global maximum pooling value of the feature block. This can comprehensively consider the features described by the feature maps in the feature block, help to extract stable and reliable significant features of the target image, and further improve the accuracy of predicting the coordinate information of the control points of the target object.
[0117] In some optional implementations of this embodiment, the coordinate information of multiple control points is determined according to the global maximum pooling value of each feature block and N feature blocks with the same resolution, including:
[0118] First, a linear activation processing operation is performed on a vector composed of the global maximum pooling values of each feature block to obtain first result data.
[0119] Here, for the convenience of description, the vector composed of the global maximum pooling values of each feature block can be recorded as a pooling vector.
[0120] Then, a full connection operation is performed on the first result data to obtain the second result data.
[0121] Here, the pooled vector is usually input into a linear activation layer to implement a linear activation processing operation on the pooled vector to obtain first result data, and the first result data is input into a fully connected layer to implement a fully connected operation on the first result data to obtain second result data.
[0122] In practice, the control point prediction model can obtain the second result data in the following way:
[0123] u=E(x)=σ(Wu δ(W d x))
[0124] Where u is the second result data, x is the pooling vector, E(x) represents the activation function calculation performed on x, and W d is the weight vector of the linear activation layer, W u is the weight vector of the fully connected layer, δ is the leak-relu activation function, and σ is the Sigmoid activation function.
[0125] Finally, the coordinate information of multiple control points is obtained according to the features of the target image described by the product of the N feature blocks with the same resolution and the second result data.
[0126] In practice, the control point prediction model can calculate the product of N feature blocks with the same resolution and the second result data by the following formula:
[0127]
[0128] in, is the product of N feature blocks with the same resolution and the second result data, F scale (x d , u) represents the d and u perform the product operation, x d are N feature blocks with the same resolution, and u is the second result data.
[0129] Here, since each element in the pooling vector can be used to describe a significant feature of the target image, the second result data obtained by sequentially processing the above pooling vector through the linear activation layer and the fully connected layer can also be used to describe the significant features of the target image. Here, multiplying N feature blocks with the same resolution with the second result data can achieve attention to the significant features of the target image based on the features of the target image described by the N feature blocks with the same resolution, thereby further improving the accuracy of the extracted features. It is helpful to further improve the accuracy of predicting the coordinate information of the control point of the target object.
[0130] In some optional implementations of this embodiment, the coordinate information of multiple control points is obtained according to the features of the target image described by the product of the N feature blocks with the same resolution and the second result data, including:
[0131] First, the object category and the coordinates of the object center point of the target object are determined according to the features of the target image described by the product of N feature blocks with the same resolution and the second result data.
[0132] Here, by multiplying N feature blocks with the same resolution with the second result data, a data set describing the features of the object presented in the target image can be obtained. By using the data in the data set for calculation, information such as the area where the target object is located, the outline of the target object, the object category, and the coordinates of the object center point can be obtained.
[0133] Then, the coordinates of a plurality of control points of the target object are determined according to the object category, the coordinates of the center point of the object and a preset relative position relationship corresponding to the object category.
[0134] The relative position relationship is used to describe the position relationship between the coordinates of each control point of the target object and the coordinates of the center point of the object.
[0135] Here, after calculating the object category and the coordinates of the object center point, the control point prediction model can search for the relative position relationship corresponding to the current object category from the pre-stored object category-relative position relationship table. The pre-stored object category-relative position relationship table can be a pre-established corresponding relationship table storing multiple object categories and relative position relationships.
[0136] After finding the relative position relationship corresponding to the current object category, the control point prediction model can directly use the found relative position relationship to calculate the coordinates of the control point. The control point prediction model can also scale the found relative position relationship so that the scaled relative position relationship is adapted to the size of the area where the object is located in the target image, and then use the scaled relative position relationship to calculate the coordinates of the control point.
[0137] In this implementation, since there are usually multiple control points, such as 8. In the stage of training the control point prediction model, if the coordinates of the control points are directly obtained by training, it is easy to cause the model to converge and consume a lot of training time. Therefore, this implementation first obtains the center point of the object through training, and then calculates the coordinates of each control point based on the center point of the object, which can reduce the difficulty of model training while obtaining more accurate coordinates of the control points and save model training time.
[0138] In some optional implementations of this embodiment, the control point prediction model can be trained through the following steps:
[0139] Step 1: Obtain a training sample set, where the training samples in the training sample set include sample images and annotated coordinates of control points of objects presented in the sample images.
[0140] Step 2, selecting training samples from the training sample set, and performing the following training steps: First, inputting the sample image of the selected training sample into the initial model to obtain the actual output. Then, inputting the annotated coordinates of the control points of the object presented by the input sample image and the obtained actual output into a pre-set loss function to obtain a loss value. In response to the loss value being less than a preset loss threshold, the initial model is used as the control point prediction model that has completed the training.
[0141] The above loss function is usually a function used to describe the degree of inconsistency between the actual output and the expected output. The above preset loss threshold can be a pre-set value. In practice, the above preset loss threshold is usually very small, such as 0.01.
[0142] Step three, in response to the loss value being greater than or equal to a preset loss threshold, adjust the parameters of the initial model to obtain an adjusted initial model, use the adjusted initial model as the initial model, select unselected training samples from the training sample set, and continue to execute the training step.
[0143] In this implementation, by training the initial model, a control point prediction model for predicting the coordinates of the control points of the object presented in the target image can be obtained.
[0144] Optionally, the above loss function may include any one or more of the following (1), (2), and (3).
[0145]
[0146] Among them, L pt is the loss value for the control point, m is the number of control points, x i is the calculated horizontal coordinate of the ith control point, is the horizontal coordinate of the pre-marked i-th control point, y i is the calculated ordinate of the i-th control point, is the ordinate of the pre-marked i-th control point.
[0147]
[0148] Among them, L d is the loss value for object classification, M is the total number of categories, q c is the pre-labeled category label, q c The value of q is 0 or 1. c The value of 0 indicates that the object presented in the sample image does not belong to the cth category, c The value of 1 indicates that the object presented in the sample image belongs to the cth category, log() is the logarithmic function, and p cis the probability that the object presented in the sample image belongs to the cth category.
[0149]
[0150] Among them, L conf is the confidence loss value for object classification, n is the number of feature data, l j is the pre-annotated confidence label, l j The value is 0 or 1, l j The value of 0 indicates that the confidence of the jth feature data is 0, j The value of 1 indicates that the confidence of the j-th feature data is 1, σ( ) is the sigmoid function, s j is the calculated confidence of the j-th feature data, and || is the absolute value operator.
[0151] In this implementation, the above loss functions (1), (2), and (3) are respectively used to calculate the loss value of the above control point prediction model from different angles. By using any one or more of the loss functions (1), (2), and (3) as the loss function of the above control point prediction model, the training of the control point prediction model can be completed when the loss value converges (less than or equal to the preset loss threshold). It should be pointed out that if the loss functions (1), (2), and (3) are used as the loss functions of the above control point prediction model at the same time, the trained control point prediction model can be made more stable.
[0152] Embodiment 2
[0153] The present application embodiment provides a method for posture estimation. This embodiment is a further explanation of the first embodiment. For details of the same or similar aspects as the first embodiment, please refer to the relevant description of the first embodiment, which will not be repeated here. Figure 5 , the pose estimation method in this embodiment includes:
[0154] Step 501 : acquiring a target image showing a target object.
[0155] Step 502: Input the target image into a pre-trained control point prediction model for processing to obtain coordinate information of multiple control points.
[0156] Among them, multiple control points are used to describe the contour of the target object, and the control point prediction model processes the target image by extracting multi-scale feature information from the target image and determining the coordinate information of multiple control points based on the multi-scale feature information. The multi-scale feature information is information extracted based on multiple preset resolutions and used to describe the features of the target image.
[0157] Step 503: determining the posture parameters of the target object based on the coordinate information of the multiple control points.
[0158] The posture parameters are used for conversion between a first coordinate system and a second coordinate system. The first coordinate system is a coordinate system with the center of the target object as the origin, and the second coordinate system is a coordinate system of a camera that captures the target image.
[0159] Step 504: determine the position and posture of the target object according to the posture parameters.
[0160] In this embodiment, the specific operations of steps 501-504 are the same as Figure 1 The operations of steps 101 - 104 in the illustrated embodiment are substantially the same and will not be described in detail herein.
[0161] Step 505: Generate and execute instructions for controlling the mechanical claw to grasp the target object according to the position and posture of the target object.
[0162] Among them, the above-mentioned mechanical claw is usually a component that comes with the above-mentioned smart device and is used to grasp objects.
[0163] In this embodiment, the execution subject of the above-mentioned posture estimation method is usually an intelligent robot.
[0164] In this embodiment, after obtaining the position and posture of the object, the execution subject may generate an instruction for controlling the mechanical claw to grasp the target object. In this way, the execution subject may control the mechanical claw to grasp the target object by executing the instruction.
[0165] Here, the execution subject may generate the instruction in a variety of ways. As an example, the execution subject may generate the instruction by combining data used to describe the position and posture of the object. The execution subject may also first encode the data used to describe the position and posture of the object, and then combine the encoded data to generate the instruction.
[0166] In this embodiment, since the accurate position and posture of the target object can be obtained through steps 501-504, a more accurate instruction can be generated according to the obtained accurate position and posture of the target object, thereby achieving accurate grasping of the target object.
[0167] Embodiment 3
[0168] The present application embodiment provides a method for posture estimation. This embodiment is a further explanation of the first embodiment. For details of the same or similar aspects as the first embodiment, please refer to the relevant description of the first embodiment, which will not be repeated here. Figure 6 , the pose estimation method in this embodiment includes:
[0169] Step 601 , capturing a target image showing a target object.
[0170] Step 602: Input the target image into a pre-trained control point prediction model for processing to obtain coordinate information of multiple control points.
[0171] Among them, multiple control points are used to describe the contour of the target object, and the control point prediction model processes the target image by extracting multi-scale feature information from the target image and determining the coordinate information of multiple control points based on the multi-scale feature information. The multi-scale feature information is information extracted based on multiple preset resolutions and used to describe the features of the target image.
[0172] Step 603: determining the posture parameters of the target object based on the coordinate information of the multiple control points.
[0173] The posture parameters are used for conversion between a first coordinate system and a second coordinate system. The first coordinate system is a coordinate system with the center of the target object as the origin, and the second coordinate system is a coordinate system of a camera that captures the target image.
[0174] Step 604, determining the position and posture of the target object according to the posture parameters.
[0175] In this embodiment, the specific operations of steps 601-604 are the same as Figure 1 The operations of steps 101 - 104 in the illustrated embodiment are substantially the same and will not be described in detail herein.
[0176] Step 605: Generate and execute instructions for controlling the driverless vehicle to avoid the target object based on the position and posture of the target object.
[0177] In this embodiment, the execution subject of the above-mentioned posture estimation method is usually an unmanned vehicle.
[0178] In this embodiment, after obtaining the position and posture of the target object, the execution subject may generate an instruction for controlling the driverless vehicle to avoid the target object. In this way, the execution subject may control the driverless vehicle to avoid the target object by executing the instruction.
[0179] Here, the execution subject may generate the instruction in a variety of ways. As an example, the execution subject may generate the instruction by combining data used to describe the position and posture of the target object. The execution subject may also first encode the data used to describe the position and posture of the target object, and then combine the encoded data to generate the instruction.
[0180] In this embodiment, since the accurate position and posture of the target object can be obtained through steps 601-604, more accurate instructions can be generated according to the obtained accurate position and posture of the target object, thereby achieving accurate control of the driving of the unmanned vehicle.
[0181] Embodiment 4
[0182] Figure 7 The network structure diagram of the control point prediction model is shown in Figure 2. Figure 7 As shown, the control point prediction model may process the input target image by the following specific steps:
[0183] In the first step, a convolutional network is used to extract multi-scale feature information from the target image.
[0184] Here, the convolutional network can be a darknet network with 24 convolutional layers. The control point prediction model can extract three feature blocks with different resolutions from the target image by extracting the feature blocks output by the 8th, 13th and 23rd layers of the darknet network. Each feature block includes multiple feature maps. Then, the control point prediction model can convert the three feature blocks with different resolutions into three feature blocks with the same resolution. At this time, the three feature blocks with the same resolution obtained are the above-mentioned multi-scale feature information.
[0185] Among them, the resolution of the feature map output by the 8th convolutional layer of the darknet network is 52×52, the resolution of the feature map output by the 13th convolutional layer is 26×26, and the resolution of the feature map output by the 23rd convolutional layer is 13×13. The resolutions of the feature maps output by the 8th, 13th, and 23rd convolutional layers of the darknet network are multiples. Selecting the feature maps output by the 8th, 13th, and 23rd convolutional layers of the darknet network can reduce the computing resources consumed for resolution conversion. In addition, since the darknet network usually has the advantages of fast speed, low background false detection rate, and strong versatility, using the darknet network to extract the features of the target image helps to achieve faster extraction of feature maps that can accurately describe the features of the target object.
[0186] In the second step, the extracted multi-scale feature information is input into the pooling layer to obtain the global maximum pooling value of each feature block in the multi-scale feature information.
[0187] Here, the above-mentioned global maximum pooling value is a data value obtained based on the maximum values of multiple feature maps included in the feature block.
[0188] Specifically, the average of the maximum values of each feature map included in the feature block can be used as the global maximum pooling value of the feature block. For example, if the value of i is 2, the first feature block includes two feature maps. If the maximum value in one feature map is 20, and the maximum value in the other feature map is 26. At this time, the above global maximum pooling value can be 23, where 23=(20+26)÷2.
[0189] In the third step, the vector composed of the global maximum pooling values of each feature block is input into the linear activation layer to obtain the first result data.
[0190] Here, the activation function of the linear activation layer is the leak-relu function.
[0191] The fourth step is to input the first result data into the fully connected layer to obtain the second result data.
[0192] Here, the activation function of the fully connected layer is the Sigmoid function.
[0193] In the fifth step, the coordinate information of multiple control points is obtained according to the characteristics of the target image described by the product of the multi-scale feature information and the second result data.
[0194] In this embodiment, by extracting feature blocks with different resolutions, it is possible to extract richer features of the target image. Afterwards, by converting feature blocks with different resolutions into blocks with the same resolution, it is possible to perform a comprehensive analysis of the features of feature blocks with multiple resolutions, which is helpful to extract more accurate features of the target image, thereby accurately predicting the coordinate information of the control points of the target object. In addition, since the points with larger corresponding values in the feature map have more obvious features of the extracted target image, the mean of the maximum values of each feature map included in the feature block is used as the global maximum pooling value of the feature block, which can comprehensively consider the features described by each feature map in the feature block, and is helpful to extract stable and reliable significant features of the target image, thereby further improving the accuracy of predicting the coordinate information of the control points of the target object.
[0195] Embodiment 5
[0196] Corresponding to the pose estimation method in the above embodiment, Figure 8 A structural block diagram of a posture estimation device 800 provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0197] Reference Figure 8 , the device comprises:
[0198] An image acquisition unit 801 is used to acquire a target image showing a target object;
[0199] A coordinate prediction unit 802 is used to input the target image into a pre-trained control point prediction model for processing, and obtain coordinate information of multiple control points, wherein the multiple control points are used to describe the contour of the target object, and the control point prediction model processes the target image by extracting multi-scale feature information from the target image, and determining the coordinate information of the multiple control points based on the multi-scale feature information, wherein the multi-scale feature information is information extracted based on multiple preset resolutions for describing the features of the target image;
[0200] A parameter determination unit 803 is used to determine the posture parameters of the target object based on the coordinate information of the multiple control points, wherein the posture parameters are used for conversion between a first coordinate system and a second coordinate system, the first coordinate system is a coordinate system with the center of the target object as the origin, and the second coordinate system is a coordinate system of a camera that captures the target image;
[0201] The posture determination unit 804 is used to determine the posture of the target object according to the posture parameters.
[0202] In one embodiment, extracting multi-scale feature information from a target image includes:
[0203] Extract N feature blocks with different resolutions from the target image;
[0204] N feature blocks with different resolutions are converted into N feature blocks with the same resolution to obtain multi-scale feature information, where N is an integer greater than 1.
[0205] In one embodiment, N=3, the extracted feature blocks are feature blocks of a first resolution, a second resolution, and a third resolution, respectively, the first resolution is greater than the second resolution, and the second resolution is greater than the third resolution; and
[0206] Convert N feature blocks with different resolutions into N feature blocks with the same resolution, including:
[0207] Downsampling the feature block of the first resolution to obtain a first feature block;
[0208] Perform 1×1 convolution on the feature block of the second resolution to obtain a second feature block;
[0209] Upsampling the feature block of the third resolution to obtain a third feature block;
[0210] The multi-scale feature information includes a first feature block, a second feature block and a third feature block, and the first feature block, the second feature block and the third feature block have the same resolution.
[0211] In one embodiment, the multi-scale feature information includes N feature blocks with the same resolution; and
[0212] Determine the coordinate information of multiple control points based on the multi-scale feature information, including:
[0213] Extract the global maximum pooling value of each feature block in N feature blocks with the same resolution;
[0214] According to the global maximum pooling value of each feature block and N feature blocks with the same resolution, the coordinate information of multiple control points is determined.
[0215] In one embodiment, N=3, the N feature blocks with the same resolution are respectively a first feature block, a second feature block and a third feature block, the first feature block includes i feature maps, the second feature map includes j feature maps, the third feature map includes k feature maps, and i, j, and k are all integers greater than or equal to 1; and
[0216] Extract the global maximum pooling value of each feature block in N feature blocks with the same resolution, including:
[0217] Obtain the maximum value of each feature map in the i feature maps of the first feature block, and determine the average of the maximum values of the i feature maps as the global maximum pooling value of the first feature block;
[0218] Obtain the maximum value of each feature map in the j feature maps of the second feature block, and determine the average of the maximum values of the j feature maps as the global maximum pooling value of the second feature block;
[0219] The maximum value of each feature map in the k feature maps of the third feature block is obtained, and the average of the maximum values of the k feature maps is determined as the global maximum pooling value of the third feature block.
[0220] In one embodiment, the coordinate information of multiple control points is determined according to the global maximum pooling value of each feature block and N feature blocks with the same resolution, including:
[0221] Performing a linear activation processing operation on a vector composed of global maximum pooling values of each feature block to obtain first result data;
[0222] Performing a full connection operation on the first result data to obtain second result data;
[0223] The coordinate information of multiple control points is obtained according to the features of the target image described by the product of N feature blocks with the same resolution and the second result data.
[0224] In one embodiment, the coordinate information of multiple control points is obtained according to the features of the target image described by the product of N feature blocks with the same resolution and the second result data, including:
[0225] Determine the object category and the coordinates of the center point of the target object according to the features of the target image described by the product of the N feature blocks with the same resolution and the second result data;
[0226] The coordinates of multiple control points of the target object are determined according to the object category, the coordinates of the object center point and a preset relative position relationship corresponding to the object category, wherein the relative position relationship is used to describe the positional relationship between the coordinates of each control point of the target object and the coordinates of the object center point.
[0227] In one embodiment, the control point prediction model is trained by the following steps:
[0228] Acquire a training sample set, wherein the training samples in the training sample set include sample images and annotated coordinates of control points of objects presented in the sample images;
[0229] A training sample is selected from the training sample set, and the following training steps are performed: a sample image of the selected training sample is input into the initial model to obtain an actual output; the annotated coordinates of the control point of the object presented by the input sample image and the obtained actual output are input into a pre-set loss function to obtain a loss value; in response to the loss value being less than a preset loss threshold, the initial model is used as a control point prediction model for training completion;
[0230] In response to the loss value being greater than or equal to a preset loss threshold, the parameters of the initial model are adjusted to obtain an adjusted initial model, the adjusted initial model is used as the initial model, unselected training samples are selected from the training sample set, and the training step is continued.
[0231] The device provided in this embodiment inputs the collected target image into a pre-trained control point prediction model, and predicts the coordinates of multiple control points of the target object presented in the target image through the control point prediction model. Then, the posture parameters of the conversion between the coordinate system of the target object and the coordinate system of the camera are determined by predicting the coordinates of the multiple control points, so as to determine the position and posture of the object based on the posture parameters. Since the distribution of each control point satisfies the distribution characteristics in the coordinate system of the target object, the relative position and rotation angle of the target object in the camera coordinate system can be obtained by determining the posture parameters of the conversion between the coordinate system of the target object and the coordinate system of the camera through the coordinates of multiple control points, which helps to achieve a more accurate position and posture of the target object. In addition, since different features can be extracted from the target image based on different resolutions, and rich and accurate features can be extracted from the target image based on multiple resolutions, the control point prediction model uses multi-scale feature information extracted based on multiple preset resolutions to predict the coordinate information of the control point, which can make the predicted coordinate information of the control point more accurate, which helps to further improve the accuracy of the prediction of the position and posture of the target object.
[0232] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0233] Embodiment 6
[0234] Fig. 9 FIG. 9 is a schematic diagram of the structure of an electronic device 900 provided in an embodiment of the present application. Fig. 9As shown, the electronic device 900 of this embodiment includes: at least one processor 901 ( Fig. 9 Only one processor is shown in the figure), a memory 902, and a computer program 903 stored in the memory 902 and executable on at least one processor 901, such as a posture estimation program. When the processor 901 executes the computer program 903, the steps in any of the above-mentioned method embodiments are implemented. When the processor 901 executes the computer program 903, the steps in the above-mentioned posture estimation method embodiments are implemented. When the processor 901 executes the computer program 903, the functions of each module / unit in the above-mentioned device embodiments are implemented, such as Figure 8 Functions of units 801 to 804 are shown.
[0235] Exemplarily, the computer program 903 may be divided into one or more modules / units, one or more modules / units are stored in the memory 902, and are executed by the processor 901 to complete the present application. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 903 in the electronic device 900. For example, the computer program 903 may be divided into an image acquisition unit, a coordinate prediction unit, a parameter determination unit, and a posture determination unit. The specific functions of each unit have been described in the above embodiments and will not be repeated here.
[0236] The electronic device 900 may be a computing device such as a server, a desktop computer, a tablet computer, a cloud server, and a mobile terminal. The electronic device 900 may include, but is not limited to, a processor 901 and a memory 902. Those skilled in the art will appreciate that Fig. 9 It is only an example of the electronic device 900 and does not constitute a limitation of the electronic device 900. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0237] The processor 901 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0238] The memory 902 may be an internal storage unit of the electronic device 900, such as a hard disk or memory of the electronic device 900. The memory 902 may also be an external storage device of the electronic device 900, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the electronic device 900. Further, the memory 902 may also include both an internal storage unit of the electronic device 900 and an external storage device. The memory 902 is used to store computer programs and other programs and data required by the electronic device. The memory 902 may also be used to temporarily store data that has been output or is to be output.
[0239] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0240] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0241] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0242] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0243] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0244] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0245] If the integrated module is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.
[0246] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A pose estimation method, wherein: The method comprises: Acquiring a target image showing a target object; Inputting the target image into a pre-trained control point prediction model for processing to obtain coordinate information of a plurality of control points, wherein the plurality of control points are used to describe the contour of the target object, the control point prediction model is used to analyze the correspondence between the target image and the coordinate information of the plurality of control points of the target object presented by the target image, and the processing of the target image by the control point prediction model includes extracting multi-scale feature information from the target image, and determining the coordinate information of the plurality of control points based on the multi-scale feature information, wherein the multi-scale feature information is information extracted based on a plurality of preset resolutions and used to describe the features of the target image; Determining the posture parameters of the target object based on the coordinate information of the multiple control points, wherein the posture parameters are used for conversion between a first coordinate system and a second coordinate system, the first coordinate system is a coordinate system with the center of the target object as the origin, and the second coordinate system is a coordinate system of a camera that captures the target image; Determining the position and posture of the target object according to the posture parameters; The multi-scale feature information includes N feature blocks with the same resolution; and The determining the coordinate information of the plurality of control points based on the multi-scale feature information comprises: Extracting the global maximum pooling value of each feature block in the N feature blocks with the same resolution; wherein the global maximum pooling value is a data value obtained by the maximum value of the feature map included in the feature block; Determining coordinate information of the multiple control points according to the global maximum pooling value of each feature block and the N feature blocks with the same resolution; Wherein, N=3, the N feature blocks with the same resolution are respectively a first feature block, a second feature block and a third feature block, the first feature block includes i feature maps, the second feature block includes j feature maps, the third feature block includes k feature maps, and i, j, and k are all integers greater than or equal to 1; and The extracting the global maximum pooling value of each feature block in the N feature blocks with the same resolution includes: Obtaining the maximum value of each feature map in i feature maps of the first feature block, and determining the average of the maximum values of the i feature maps as the global maximum pooling value of the first feature block; Obtaining the maximum value of each feature map in the j feature maps of the second feature block, and determining the average of the maximum values of the j feature maps as the global maximum pooling value of the second feature block; The maximum value of each feature map in the k feature maps of the third feature block is obtained, and the average of the maximum values of the k feature maps is determined as the global maximum pooling value of the third feature block.
2. The method according to claim 1, wherein: The extracting multi-scale feature information from the target image comprises: Extracting N feature blocks with different resolutions from the target image; The N feature blocks with different resolutions are converted into N feature blocks with the same resolution to obtain the multi-scale feature information, where N is an integer greater than 1.
3. The method according to claim 2, wherein: N=3, the extracted feature blocks are feature blocks of a first resolution, feature blocks of a second resolution, and feature blocks of a third resolution, respectively, the first resolution is greater than the second resolution, and the second resolution is greater than the third resolution; as well as The converting the N feature blocks with different resolutions into N feature blocks with the same resolution includes: Downsampling the feature block of the first resolution to obtain a first feature block; Performing a 1×1 convolution on the feature block of the second resolution to obtain a second feature block; Upsampling the feature block at the third resolution to obtain a third feature block; The multi-scale feature information includes the first feature block, the second feature block and the third feature block, and the first feature block, the second feature block and the third feature block have the same resolution.
4. The method according to claim 1, wherein: The determining, according to the global maximum pooling value of each feature block and the N feature blocks with the same resolution, the coordinate information of the multiple control points includes: Performing a linear activation processing operation on a vector composed of global maximum pooling values of each feature block to obtain first result data; Performing a full connection operation on the first result data to obtain second result data; The coordinate information of the multiple control points is obtained according to the features of the target image described by the product of the N feature blocks with the same resolution and the second result data.
5. The method according to claim 4, wherein: The obtaining the coordinate information of the plurality of control points according to the features of the target image described by the product of the N feature blocks with the same resolution and the second result data comprises: Determine the object category and the coordinates of the object center point of the target object according to the features of the target image described by the product of the N feature blocks with the same resolution and the second result data; The coordinates of multiple control points of the target object are determined according to the object category, the coordinates of the object center point and a pre-set relative position relationship corresponding to the object category, wherein the relative position relationship is used to describe the positional relationship between the coordinates of each control point of the target object and the coordinates of the object center point.
6. The method according to claim 1, wherein: The control point prediction model is trained by the following steps: Acquire a training sample set, wherein the training samples in the training sample set include sample images and annotated coordinates of control points of objects presented in the sample images; Selecting training samples from the training sample set, and performing the following training steps: inputting sample images of the selected training samples into an initial model to obtain actual output; Inputting the annotated coordinates of the control points of the object presented in the input sample image and the obtained actual output into a preset loss function to obtain a loss value; in response to the loss value being less than a preset loss threshold, using the initial model as a trained control point prediction model; In response to the loss value being greater than or equal to a preset loss threshold, the parameters of the initial model are adjusted to obtain an adjusted initial model, the adjusted initial model is used as the initial model, unselected training samples are selected from the training sample set, and the training step is continued.
7. A posture estimation device, wherein: The device comprises: An image acquisition unit, used for acquiring a target image showing a target object; a coordinate prediction unit, configured to input the target image into a pre-trained control point prediction model for processing, and obtain coordinate information of a plurality of control points, wherein the plurality of control points are used to describe the contour of the target object, the control point prediction model is used to analyze the correspondence between the target image and the coordinate information of the plurality of control points of the target object presented by the target image, the processing of the target image by the control point prediction model includes extracting multi-scale feature information from the target image, and determining the coordinate information of the plurality of control points based on the multi-scale feature information, wherein the multi-scale feature information is information extracted based on a plurality of preset resolutions and used to describe the features of the target image; a parameter determination unit, configured to determine the posture parameters of the target object based on the coordinate information of the plurality of control points, wherein the posture parameters are used for conversion between a first coordinate system and a second coordinate system, the first coordinate system being a coordinate system with the center of the target object as the origin, and the second coordinate system being a coordinate system of a camera that captures the target image; A posture determination unit, used to determine the posture of the target object according to the posture parameters; The multi-scale feature information includes N feature blocks with the same resolution; and The determining the coordinate information of the plurality of control points based on the multi-scale feature information comprises: Extracting the global maximum pooling value of each feature block in the N feature blocks with the same resolution; wherein the global maximum pooling value is a data value obtained by the maximum value of the feature map included in the feature block; Determining coordinate information of the multiple control points according to the global maximum pooling value of each feature block and the N feature blocks with the same resolution; Wherein, N=3, the N feature blocks with the same resolution are respectively a first feature block, a second feature block and a third feature block, the first feature block includes i feature maps, the second feature block includes j feature maps, the third feature block includes k feature maps, and i, j, and k are all integers greater than or equal to 1; and The extracting the global maximum pooling value of each feature block in the N feature blocks with the same resolution includes: Obtaining the maximum value of each feature map in i feature maps of the first feature block, and determining the average of the maximum values of the i feature maps as the global maximum pooling value of the first feature block; Obtaining the maximum value of each feature map in the j feature maps of the second feature block, and determining the average of the maximum values of the j feature maps as the global maximum pooling value of the second feature block; The maximum value of each feature map in the k feature maps of the third feature block is obtained, and the average of the maximum values of the k feature maps is determined as the global maximum pooling value of the third feature block.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium storing a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Six-degree-of-freedom attitude estimation method and device and computer readable storage medium
CN110119148A
6D pose estimation method using contour information
CN110322510A
Object attitude estimation method, device and equipment
CN111161349A
Multi-person human body posture estimation method
CN111339903A
Fruit pose calculation method and device, computer equipment and storage medium
CN111445523A
