A method and device for extracting three-dimensional primitive data, and storage medium

By using vote counting statistics and local optimization methods in 3D point cloud data, the objective function is established for iterative updating, which solves the problem of identifying multiple geometric primitives in 3D point cloud, improves the recognition accuracy and robustness, and is suitable for Three-dimensional target tracking and attitude estimation in complex scenes.

CN112070005BActive Publication Date: 2024-09-06SHENZHEN HUAHAN WEIYE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010933180.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-08
Publication Date
2024-09-06
Estimated Expiration
2040-09-08

AI Technical Summary

Technical Problem

It is difficult for existing technology to automatically identify various geometric primitives, such as planes, spheres, and cylinders, in three-dimensional point clouds, especially in the presence of background noise and lack of texture, resulting in reduced target recognition and tracking accuracy.

Method used

By acquiring three-dimensional point cloud data, using vote counting statistics and local optimization methods, the objective function is established for iterative updating, and the three-dimensional metadata and resulting geometric information of the target object are extracted, using voxel grid discretization and hash table mapping relationships. Improve feature matching and robustness.

Benefits of technology

It achieves high-precision automatic recognition of three-dimensional elements, improves the processing speed and robustness of the algorithm, reduces the difficulty of the device perceiving the environment, and enhances the accuracy of three-dimensional target tracking and attitude estimation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112070005B
    Figure CN112070005B
Patent Text Reader

Abstract

A method and device for extracting three-dimensional primitive data, and a storage medium, wherein the extraction method includes: obtaining three-dimensional point cloud data of a target object; describing the characteristics of the target object according to the three-dimensional point cloud data, and obtaining the characteristic data and initial geometric information of the target object through voting counting statistics; locally optimizing the characteristic data according to the distance from the characteristic data to the geometric primitive, and obtaining the local optimized data of the target object; establishing an objective function and using the objective function to iteratively update the local optimized data, and obtaining the three-dimensional primitive data and resulting geometric information of the target object. Since artificial scenes often contain a large number of geometric features such as contours, planes, spheres, and cylinders that can well reflect the structural information of the target object, the technical solution of the present application uses these features to express the target object, which can reduce the complexity of algorithms such as three-dimensional target tracking, shape recognition, and posture estimation, while greatly improving the robustness and accuracy of the algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method and device for extracting three-dimensional primitive data, and a storage medium. Background Art

[0002] In recent years, computer vision research has flourished. Researchers have continuously created groundbreaking algorithm theories and designed brand-new product technologies, which have endowed machines with increasingly human-like visual capabilities, bringing about earth-shaking changes in people's lives and work. In particular, the popularity of high-performance video and photography equipment, the rapid increase in computer computing speed, and breakthroughs in algorithm theories with learning capabilities have enabled computer vision to play an important role in various fields such as robotics, security monitoring, industrial production, gaming entertainment, and medical imaging.

[0003] In robot manipulation and target grasping applications, traditional algorithms such as 3D target tracking, target recognition and pose estimation are implemented based on point features. When the image contains a lot of background information and noise, or the target lacks texture information, point feature-based methods will face serious challenges. However, artificial targets in natural scenes contain a large number of geometric features such as lines, surfaces and contours that can well reflect the target structure information. Compared with point features, the geometric primitive information represented by these geometric features is more robust to the target surface texture distribution, lighting, noise, etc., and has a certain robustness to the partial occlusion of the target or the partial invisibility due to lighting, which can effectively improve the target recognition rate, target tracking, target 3D reconstruction and target pose estimation accuracy.

[0004] RGB-D, a high-performance photography device, is one of the representatives of new products and technologies that have emerged in recent years. It can easily obtain color (RGB) and depth (D) information at the same time, breaking through the limitation that ordinary cameras and laser scanners can only collect color or depth information. The emergence and rapid development of such equipment has made it convenient, fast and low-cost to obtain 3D data optically. However, a challenging problem has emerged: how to use computers to automatically analyze and perceive the huge amount of collected 3D data, and automatically detect geometric features from 3D point clouds to identify geometric primitives such as planes, spheres and cylinders is a fundamental problem in computer perception of the world. Summary of the invention

[0005] The main technical problem solved by the present invention is: how to provide a practical, high-precision method for automatically identifying multiple geometric primitives in a three-dimensional point cloud. To solve the above technical problem, the present application provides a method and device for extracting three-dimensional primitive data, and a storage medium.

[0006] According to the first aspect, an embodiment provides a method for extracting three-dimensional primitive data, which includes: acquiring three-dimensional point cloud data of a target object; the three-dimensional point cloud data includes the coordinates of each feature point on the surface of the target object and the corresponding normal vector; describing the target object according to the three-dimensional point cloud data, and obtaining the feature data and initial geometric information of the target object through voting counting statistics; the initial geometric information is used to characterize the geometric primitives of the target object; locally optimizing the feature data according to the distance from the feature data to the geometric primitives to obtain local optimized data of the target object; establishing an objective function for the geometric primitives, and iteratively updating the local optimized data using the objective function to obtain the three-dimensional primitive data and result geometric information of the target object.

[0007] The method of describing the features of the target object according to the three-dimensional point cloud data and obtaining the feature data and initial geometric information of the target object by voting counting statistics includes: discretizing the three-dimensional point cloud data using a voxel grid to obtain discrete data; forming feature point pairs for every two feature points on the target object according to the discrete data, and calculating corresponding feature descriptors; dividing feature point pairs with the same or similar feature descriptors into a group and storing them in the same hash table, calculating the key value of each hash table, and establishing a mapping relationship between the key value and the feature point pairs stored in the hash table; performing voting counting according to the key value of each hash table, obtaining feature point pairs corresponding to key values ​​with different voting scores by counting, and using the coordinates of each feature point in the feature point pair as the feature data of the target object; and determining the initial geometric information of the target object according to the feature point pairs corresponding to the same key value.

[0008] The method of counting votes according to the key values ​​of each hash table, obtaining feature point pairs corresponding to key values ​​with different voting scores, and using the coordinates of each feature point in the feature point pair as feature data of the target object includes: for each feature point pair in the hash table, the feature descriptor of the feature point pair is expressed as follows: The feature descriptor All or part of the parameters in the feature point pair are used to calculate the key value of the hash table; wherein, F1 is the distance between two feature points in the feature point pair, F2 is the angle between the normal vector of one feature point in the feature point pair and the line connecting the two feature points, F3 is the angle between the normal vector of another feature point in the feature point pair and the line connecting the two feature points, and F4 is the angle between the normal vectors of two feature points in the feature point pair; the number of feature point pairs with the same key value is voted and counted to obtain the voting scores of the key values ​​of each hash table, and the coordinates and normal vectors of each feature point in the feature point pair corresponding to the key values ​​with different voting scores are used as the feature data of the target object.

[0009] The determining of the initial geometric information of the target object based on the feature point pairs corresponding to the same key value includes: obtaining the coordinates of the feature points in the feature point pairs corresponding to the same key value, and determining the geometric primitives of the target object through the coordinate distribution; for the geometric primitives of the plane type, the initial geometric information of the target object is expressed by the formula [a, b, c, d][x, y, z, 1] T =0; where a, b, c, d are plane geometric parameters; for a spherical geometric primitive, the initial geometric information of the target object is expressed by the formula (x-x0) 2 +(y-y0) 2 +(z-z0) 2 =R s 2 ; Among them, x0, y0, z0, R s is the spherical geometric parameter; for the cylindrical geometric primitive, the initial geometric information of the target object is expressed as

[0010]

[0011] Among them, t, s, h are the geometric parameters of the cylinder, n x 、n y 、n z are the normal components of the normal vector of the point (x, y, z) on the three coordinate axes.

[0012] The locally optimizing the feature data according to the distance from the feature data to the geometric primitive to obtain the locally optimized data of the target object includes: selecting part of the data from the feature data by non-maximum suppression to obtain candidate information; this step specifically includes: determining the key value when the voting score is the highest, selecting the feature point pair corresponding to the key value from the feature data of the target object, and using the coordinates of the feature points in the selected feature point pair as the candidate information; segmenting the geometric primitive according to the distance from each data point in the candidate information to the geometric primitive, and locally updating the candidate information using the segmentation result to obtain the locally optimized data of the target object.

[0013] The method of segmenting the geometric primitives according to the distance from each data point in the candidate information to the geometric primitives and locally updating the candidate information using the segmentation result to obtain local optimization data of the target object includes: calculating the distance from each data point in the candidate information to the geometric primitives, determining whether the distance is less than or equal to a preset threshold, and if so, confirming that the corresponding data point belongs to the geometric primitive; if not, eliminating the corresponding data point from the candidate information; and using the eliminated candidate information as the local optimization data of the target object.

[0014] The method of establishing an objective function for the geometric primitives, and iteratively updating the local optimization data using the objective function to obtain three-dimensional primitive data and result geometric information of the target object includes: establishing an objective function for the geometric primitives; the objective function includes the geometric information of the geometric primitives and the geometric relationship of the local optimization data; performing iterative calculation of the objective function according to each feature point in the local optimization data until the results of two consecutive calculations are less than a target threshold or the iterative process reaches a preset number of iterations, extracting converged feature points and using them as three-dimensional primitive data of the target object; and determining the result geometric information of the target object according to the three-dimensional primitive data.

[0015] The established objective function is expressed as

[0016]

[0017] Where p is the primitive geometric parameter, r is the data point in the local optimization data, P is the number of data points in the local optimization data, d(p,r) is the distance from the data point to the geometric primitive, and w r is the weight coefficient of d(p,r); for the geometric primitives of the plane type, the distance from the data point to the geometric primitive is expressed as d(p,r)=(ax i +by i +cz i +d) 2 ; Where a, b, c, d are plane geometric parameters, and the subscript i is the serial number of the data point;

[0018] For a cylinder-type geometric primitive, the distance from a data point to the geometric primitive is expressed as Among them, x0,y0,z0,R s is the spherical geometric parameter, and the subscript i is the serial number of the data point; for the cylindrical type geometric primitive, the distance from the data point to the geometric primitive is expressed as d(p,r)=(|T′rT′r·(0,0,1) T |-R c ), where T′ is the transformation matrix when the geometric primitive is transformed into the coordinate system with the center located at the origin of the coordinate system and the main axis coincides with the z-axis of the coordinate system. The superscript T is the transposition operation, and R c is the radius of the cylinder; the iterative calculation of the objective function is the gradient descent method or the least squares method; the weight coefficient w r The calculation of is done using the Huber method or the Tukey method.

[0019] According to the second aspect, an embodiment provides a three-dimensional primitive recognition device, which includes: a sensor, used to collect scene images of a target object to form three-dimensional point cloud data of the target object; a processor, connected to the sensor, and used to obtain three-dimensional primitive data and result geometric information of the target object through the extraction method described in the first aspect above; a controller, connected to the sensor and the processor, and used to control the sensor to collect the scene image of the target object, and to control an actuator to capture the target object according to the three-dimensional primitive data and result geometric information output by the processor.

[0020] According to a third aspect, an embodiment provides a computer-readable storage medium, which includes a program, and the program can be executed by a processor to implement the extraction method described in the first aspect.

[0021] The beneficial effects of this application are:

[0022] According to the above-mentioned embodiment, a method, device and storage medium for extracting three-dimensional primitive data are provided, wherein the extraction method includes: obtaining three-dimensional point cloud data of the target object; describing the features of the target object according to the three-dimensional point cloud data, and obtaining the feature data and initial geometric information of the target object through voting counting statistics; locally optimizing the feature data according to the distance from the feature data to the geometric primitive, and obtaining the local optimized data of the target object; establishing an objective function for the geometric primitive, and using the objective function to iteratively update the local optimized data, and obtaining the three-dimensional primitive data and resulting geometric information of the target object. First, since the feature data and initial geometric information of the target object are obtained through voting counting statistics, the algorithm can speed up the matching process of the feature vector and quickly obtain the feature data and initial geometric primitives of the target object; second, since the feature data is locally optimized to obtain the local optimized data of the target object, the calculation in the global coordinate system is converted into the calculation in the local coordinate system, and the point-based processing method is converted into the multi-dimensional feature-based processing method, which not only improves the processing speed and efficiency of the algorithm, but also improves the anti-occlusion ability and robustness of the algorithm, and can easily meet the extraction operations of three-dimensional primitive data in application scenarios such as visual guidance, autonomous driving, and augmented reality; third, since the local optimized data is iteratively updated using the objective function to obtain the three-dimensional primitive data and results of the target object Geometric information enables the algorithm to adopt a hierarchical optimization strategy, which can improve the accuracy and expression ability of geometric primitive extraction; fourthly, the technical solution of the present application automatically detects geometric features from three-dimensional point cloud data to identify geometric primitives such as planes, spheres, and cylinders, which can reduce the difficulty of the device to perceive the environment, narrow the semantic gap between high-level semantics and underlying visual features, and help the device to analyze and perceive the world like humans and realize intelligent operation; fifthly, since artificial scenes often contain a large number of geometric features such as contours, planes, spheres, and cylinders that can well reflect the structural information of the target object, the technical solution of the present application uses these features to express the target object, which can reduce the complexity of algorithms such as three-dimensional target tracking, shape recognition, and posture estimation, while greatly improving the robustness and accuracy of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 A flowchart of a method for extracting three-dimensional primitive data in this application;

[0024] Figure 2 A flowchart for counting votes based on three-dimensional point cloud data;

[0025] Figure 3 A flowchart for local optimization of feature data;

[0026] Figure 4 A flowchart for iteratively updating local optimization data using an objective function;

[0027] Figure 5 It is a schematic diagram of the principle of discretization using voxel grid;

[0028] Figure 6 Schematic diagram of the principle of calculating feature descriptors using two feature points;

[0029] Figure 7 Schematic diagram of the principle of reference coordinate transformation;

[0030] Figure 8 It is a schematic diagram of the principle of representing feature point pairs using a spherical coordinate system;

[0031] Fig. 9 It is a schematic diagram of the principle of representing feature point pairs using a cylindrical coordinate system;

[0032] Fig.10 A schematic diagram of the structure of a three-dimensional primitive extraction device in an embodiment;

[0033] Fig.11 It is a schematic diagram of the structure of the processor and the controller;

[0034] Fig.12 FIG. 4 is a schematic diagram of the structure of a three-dimensional primitive recognition device in another embodiment. DETAILED DESCRIPTION

[0035] The present invention is further described in detail below by specific embodiments in conjunction with the accompanying drawings. Wherein similar elements in different embodiments adopt associated similar element numbers. In the following embodiments, many detailed descriptions are for making the present application better understood. However, those skilled in the art can easily recognize that some features can be omitted in different situations, or can be replaced by other elements, materials, methods. In some cases, some operations related to the present application are not shown or described in the specification, this is to avoid the core part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations according to the description in the specification and the general technical knowledge in the art.

[0036] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.

[0037] The serial numbers of the components in this document, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning. The "connection" and "coupling" mentioned in this application, unless otherwise specified, include direct and indirect connections (couplings).

[0038] At present, there are many commonly used two-dimensional primitive extraction methods. The geometric primitive recognition algorithm in three-dimensional point cloud is mainly realized by borrowing the algorithm idea of ​​geometric primitive recognition in two-dimensional images. These common algorithms include Hough transform, region growing, random sample consensus algorithm (RANSAC, Random Sample Consensus), etc. Among them, Hough transform can quickly and accurately fit straight lines and planes, but cannot simultaneously identify multiple different types of models. At the same time, for three-dimensional point cloud data, the representation dimension of geometric primitives increases, the memory required grows exponentially, and the running speed is slow, which cannot meet the demand of real-time geometric primitive extraction. Among them, the RANSAC algorithm can detect models with more than 50% external points and is the most commonly used robust estimation algorithm, but it needs to verify the global data and the calculation is large. Both Hough transform and RANSAC algorithms need to use greedy search to exhaust all possible models in the data, and then find the internal points of the model according to the distance threshold constraint. This type of method can process a single model more efficiently, but some models will be missed when fitting multiple models, and it is very dependent on the distance threshold, which usually requires manual adjustment of the distance threshold value; in addition, this type of method cannot globally analyze the attribution relationship between the internal points of each model. Among them, the region growing algorithm requires manual selection of some internal points in advance and then expands the growth. It cannot be completely analyzed automatically by the computer, and it is very sensitive to external points and noise, resulting in poor algorithm robustness. The main problems of these methods are: first, they cannot recognize multiple geometric primitives at the same time; second, they have poor anti-interference ability to external points and noise; third, they rely on angles and thresholds to judge the internal points of geometric primitives, resulting in a low degree of automation.

[0039] In the process of face extraction, the existing face extraction algorithms are mainly based on point features. Since point features are sensitive to structural information such as texture, when there is a lack of texture in the scene, there will be few feature points, which is difficult to meet the requirements of the iterative algorithm, thus directly affecting the quality of face detection. Therefore, how to combine high-level image features such as lines and contours with point features for face extraction is a current research hotspot. In addition, in terms of 3D object recognition, since artificial objects in natural scenes are easily deformed by noise and affine transformations, and artificial 3D objects are partially invisible due to occlusion or strong light, it will bring challenges to the robustness of feature-based 3D object recognition algorithms.

[0040] The inventive concept of the technical solution of this application is: according to the understanding of the current three-dimensional target recognition algorithm, the processing based on global feature analysis has the problems of slow speed, large amount of calculation and inability to meet the real-time requirements, and the point-based processing has the problem of poor anti-interference of primitive extraction, so this application converts the calculation of the global coordinate system into the calculation under the local coordinate system, and converts the point-based processing method into the multi-dimensional feature-based processing method, which can not only improve the algorithm processing speed and efficiency, but also improve the algorithm's anti-occlusion ability and robustness, thereby meeting the extraction operation of three-dimensional primitive data in application scenarios such as visual guidance, autonomous driving, and augmented reality. In addition, this application mainly follows the design idea of ​​"feature extraction + noise removal + local optimization + global optimization" to progressively improve the accuracy of the algorithm. In terms of feature design, feature points and corresponding normal vectors are used to form feature point pairs, and feature point pairs are used to represent the local feature information of the target object.

[0041] The technical solution of the present application is described in detail below with reference to the embodiments.

[0042] Embodiment 1

[0043] Please refer to Figure 1 This embodiment discloses a method for extracting three-dimensional primitive data, which includes steps S110-S140, which are described below respectively.

[0044] Step S110, obtaining three-dimensional point cloud data of the target object, wherein the three-dimensional point cloud data includes the coordinates of each feature point on the surface of the target object and the corresponding normal vector.

[0045] It should be noted that the target object in this embodiment can be a product on an industrial assembly line, a mechanical part in an object box, a tool on an operating table, etc. Fig.10 Irregularly shaped mechanical parts in the toolbox. Then, the three-dimensional point cloud data of these target objects can be obtained by contact or non-contact scanning equipment, and the three-dimensional point cloud data can be a part of the appearance shape data of the surface of the target object.

[0046] Step S120, feature description is performed on the target object according to the three-dimensional point cloud data, and feature data and initial geometric information of the target object are obtained by voting counting statistics, wherein the initial geometric information is used to characterize geometric primitives of the target object.

[0047] In this embodiment, any two feature points in the three-dimensional point cloud data can be expressed as (p1, n1) and (p2, n2), where p1 and p2 are the coordinates of the two feature points, and n1 and n2 are the normal vectors corresponding to the coordinates of the two feature points. Then, a feature point pair ((p1, n1), (p2, n2)) can be formed to represent the relationship between the two feature points, so that the local features of the target object can be described.

[0048] For the entire 3D point cloud data, it consists of 3D coordinate points and corresponding normal vectors. If the unit normal vector is located on the unit sphere is a series of three-dimensional coordinate points and their normal vectors. If M is a set of point cloud data, Then, the series of point pairs formed can be expressed as

[0049] P s ={((p1,n1),(p2,n2)),(p1,n1)∈M,(p2,n2)∈M}=M 2 .

[0050] Geometric primitives are basic building blocks used to describe the three-dimensional shape of an object. Several common geometric primitives include lines, planes, circles, ellipses, spheres, and cylinders. For a target object, its outline can be automatically divided into multiple parts, each with a corresponding geometric primitive. This can substantially reduce the amount of data that needs to be processed and provide a symbolic description of the data for the algorithm. The extraction of geometric primitives plays an important role in model-based computer vision. The problem of geometric primitive extraction can often be reduced to an optimization problem, that is, finding the global minimum of the cost function.

[0051] Then it can be understood that the characteristic data of the target object is the set of data points that constitute the target object, that is, the set of (p,n); the initial geometric information of the target object is the primitive geometric parameters of the target object, such as plane geometric parameters, spherical geometric parameters or cylindrical geometric parameters.

[0052] Step S130 , locally optimizing the feature data according to the distance from the feature data to the geometric primitive, to obtain locally optimized data of the target object.

[0053] It should be noted that the local optimization processing of feature data is equivalent to the local optimization operation of the algorithm. To achieve this operation, it is possible to determine which data points belong to the geometric primitives and which do not belong to the geometric primitives based on the distance from each data point in the feature data to the geometric primitives. The data points that do not belong to the geometric primitives are then eliminated, and the remaining data points are used as the local optimization data of the target object.

[0054] Step S140, establishing an objective function for geometric primitives, and using the objective function to iteratively update local optimization data to obtain three-dimensional primitive data and result geometric information of the target object.

[0055] It should be noted that the iterative update of local optimization data is equivalent to the global optimization operation of the data. To achieve this operation, the distance from the data point to the geometric primitive can be used to establish the objective function, and the local optimization data can be substituted into the objective function for iterative update, and the converged data points can be selected as the three-dimensional primitive data of the target object. After obtaining the three-dimensional primitive data, it is easy to determine the result geometric information of the target object. Since the result geometric information is a numerical representation of the geometric shape of the object, the surface shape of the target object can be identified through the result geometric information, and even the spatial change posture of the target object can be identified.

[0056] In this embodiment, see Figure 2 The above-mentioned step S120 mainly involves the process of counting votes according to the three-dimensional point cloud data, which may specifically include steps S121-S124, which are described as follows.

[0057] Step S121, discretizing the three-dimensional point cloud data using a voxel grid to obtain discrete data.

[0058] Discrete sampling of voxel grids is a common method in point cloud filtering and is often used as an important measure in point cloud preprocessing. Since there are a large number of data points in 3D point cloud data, including discrete points and dense and sparse points, in order to shorten the calculation time, voxel grids are used for discretization to reduce the number of points in the point cloud. Figure 5 , the voxel grid is discretized to generate a 3D voxel grid of unit size (the voxel grid can be imagined as a collection of tiny three-dimensional cubes in space), and the three-dimensional point cloud data is stored in each voxel (i.e., a three-dimensional cube). Then, in each voxel, the center of gravity of all points in the voxel is used to approximate the other points in the voxel, so that all points in the voxel are finally represented by a center of gravity point, so that the three-dimensional point cloud data is replaced by the center point of these point clouds. After the original three-dimensional point cloud data is downsampled by the voxel grid, although the number of points is greatly reduced, the shape of the point cloud represented by the discrete data does not change, thus ensuring that the extraction accuracy is not reduced at all when extracting three-dimensional geometric primitives.

[0059] Here we will explain the principle of voxel grid discretization in detail through mathematical operations. Assume that the input 3D point cloud data contains the data (x i ,y i ,z i ,u i ,v i ,w i)(i=1,2,…,n), where (x i ,y i ,z i ) is the coordinate point, (u i ,v i ,w i ) is the normal vector corresponding to the point, and n here is the number of points in the 3D point cloud data. Then it is necessary to calculate the maximum and minimum values ​​of the x, y, and z coordinate components, that is, it is necessary to calculate x min 、x max ,y min ,y max , z min 、z max According to the formula

[0060] d x =x max -x min ,d y =y max -y min ,d z =z max -z min ;

[0061] The radius of the outer sphere of all point clouds can be calculated as Set the sampling step size of x, y, and z to δ x , δ y and δ z , thereby realizing the input three-dimensional point cloud data.

[0062] Since the coordinates (x i ,y i ,z i ) is a unit vector, so the maximum possible numbers of x, y, and z after discretization are Therefore, the input coordinate point (x i ,y i ,z i ) After quantization, the same index values ​​are stored in an array, and the mapping relationship of the index values ​​is performed according to the following formula:

[0063]

[0064] Among them, the index value is expressed as index = x cell n y n z +y cell n z +z cell ,symbol Indicates floor operation.

[0065] Here, clustering calculation is performed on the coordinate points with the same index value, and specifically, mean clustering or Gaussian clustering can be used.

[0066] First, when using mean clustering, it is assumed that the number of coordinate points with the same index value is c i , the output after clustering is the total number of coordinate points and normal vector pairs with different indices, then we have

[0067]

[0068] Secondly, when Gaussian clustering is used, it is assumed that the centroids of x, y, and z are expressed as x c ,y c 、z c , calculate the distance from the point to the centroid, calculate the weight according to the distance, and then calculate the weighted sum, so we can get

[0069] Δx=x i -x c ,Δy=y i -y c ,Δz=z i -z c .

[0070] To obtain the distance Weight or α i =1 / d i , all weights and The coordinate output is

[0071]

[0072] Step S122, forming a feature point pair for every two feature points on the target object according to the discrete data, and calculating the corresponding feature descriptor. The feature point pairs with the same or similar feature descriptors are divided into a group and stored in the same hash table, the key value of each hash table is calculated, and a mapping relationship between the key value and the feature point pairs stored in the hash table is established.

[0073] Those skilled in the art will appreciate that for discrete data, for example Figure 6 , we know that two feature points p1 and p2 and their corresponding normal vectors n1 and n2 can be obtained, and the feature point pairs about the feature points (p1,n1) and (p2,n2) can be obtained, and the feature point pairs are expressed as ((p1,n1),(p2,n2)). Then, in Figure 6 The feature descriptor of the feature point pair ((p1,n1),(p2,n2)) can be defined in the rectangular coordinate system shown in the figure

[0074] F(p1,p2)=(||d||,∠(n1,d),∠(n2,d),∠(n1,n2));

[0075] Wherein, d represents the vector from p1 to p2 and satisfies d=p1-p2, ||d|| represents the distance between p1 and p2; ∠(a,b)∈[0,π] represents the angle between two vectors (where a and b represent parameters of the calculation process), for example, ∠(n1,d)∈[0,π] represents the angle between n1 and d, ∠(n2,d)∈[0,π] represents the angle between n2 and d, and ∠(n1,n2)∈[0,π] represents the angle between n1 and n2.

[0076] In this embodiment, the hash table is mainly composed of two parts (key, data), where key is the key value and data is the data, that is, similar data is set to the same key value. The MurHash function can be used to establish the mapping relationship between the feature descriptor F and the key value, which will not be described in detail here.

[0077] It should be noted that for each feature point pair in the hash table, the feature descriptor of the feature point pair can also be expressed as Feature Descriptor All or part of the parameters in are used to calculate the key value of the hash table; among them, F1 is the distance between two feature points in the feature point pair, F2 is the angle between the normal vector of one feature point in the feature point pair and the line connecting the two feature points, F3 is the angle between the normal vector of another feature point in the feature point pair and the line connecting the two feature points, and F4 is the angle between the normal vectors of two feature points in the feature point pair.

[0078] Step S123 , counting votes according to the key values ​​of each hash table, obtaining feature point pairs corresponding to key values ​​with different voting scores, and using the coordinates of each feature point in the feature point pair as feature data of the target object.

[0079] In a specific embodiment, the process of obtaining the characteristic data of the target object can be described as follows:

[0080] (1) For each feature point pair in the hash table, if Represents the feature descriptor of the feature point pair, and sets the angle and distance sampling step d for it respectively l and d α , then we can get

[0081]

[0082] Then we can use the feature descriptor Calculates the key value of this hash table based on all or part of the parameters.

[0083] Case 1: For a plane, determine whether the calculated feature vectors F2, F3, and F4 are within the feature space range. If they are within the range, discretize the vectors and only use F2, F3, and F4 for voting. At this time, the key value of the hash table can be calculated based on F2, F3, and F4. It should be noted that the feature vector under the plane can be expressed as F = [|d|, π / 2, π / 2, 0]. If the distance error and angle error are taken into account, the value range of the feature descriptor under the plane is

[0084]

[0085] where δ α is the angle error. Then, the discretized vector voting in the plane case can be performed according to formula (1-1).

[0086] Case 2: For a sphere, voting can be performed based on F1 and F4 only, and F2 and F3 can be used to exclude feature point pairs. In this case, the key value of the hash table can be calculated based on F1 and F4. Figure 8 , the feature descriptor under the sphere can be expressed as

[0087] F(p1,p2)=[2rsin(α / 2),(π-α) / 2,(π+α) / 2,α] (1-2)

[0088] If the position error is considered to be δ p , the angle error is δ α , then the range of angle and radius is

[0089]

[0090] Among them, α is the angle between the normal vectors of p1 and p2, such as Figure 8 The angle between the normal vectors n1 and n2 mapped to the same circular surface. Ideally, α is also the angle between the line connecting p1 and p2 to the center of the circle; r represents the radius of the sphere and satisfies

[0091]

[0092] Then, the discretized feature voting in the sphere case can be performed according to formula (1-2).

[0093] Case 3: For a cylinder, since the cylinder is not only affected by the local position coordinates but also by the radius r parameter, in order to reduce the parameter voting dimension, only F2, F3, and F4 need to be used for voting, and then the radius r = F1 / F1 is calculated. M Is it within the given range? If it is within the range, vote. At this time, the key value of the hash table can be calculated based on F2, F3, and F4. It should be noted that see Fig. 9 , the feature descriptor under the cylinder can be expressed as

[0094] F(p1,p2)=[|d|,∠(n1,d),π-∠(n1,d),α] (1-3)

[0095] Where n1 = (1, 0, 0) T , d = (r(1-cosα),rsinα,l) T ; α represents the angle between the normal vectors of p1 and p2, such as Fig. 9 In the example, the normal vectors n1 and n2 are mapped to the same circular surface, and in an ideal case, α is also the angle between p1 and p2 mapped to the same circular surface and the line connecting the center of the circle. Then, the discretized feature voting in the case of a cylinder can be performed according to formula (1-3).

[0096] (2) The number of feature point pairs with the same key value is counted by voting to obtain the voting score of the key value of each hash table. The coordinates and normal vectors of each feature point in the feature point pair corresponding to the key values ​​with different voting scores are used as the feature data of the target object.

[0097] It should be noted that the voting count here can be simply expressed as: if the key value corresponding to any feature point pair is the same as the key value corresponding to other feature point pairs, the index count of the key value is +1; if they are different, the index count of the new key value is +1. Then, the voting score of the key value of each hash table can be obtained based on the voting count result.

[0098] It should be noted that for planes and spheres, after a point is coincident with the normal vector, no matter how it is rotated, its local parameter angle does not affect the shape, so it is not necessary to consider the rotation angle β in the local coordinate system when extracting primitives. However, for cylinders, since the rotation angle will affect its coincidence, it is necessary to consider the local angle parameter. For example, convert point p1 in (p1,n1) to the origin of the coordinate system, calculate the translation vector T and rotation matrix R that coincides with the x-axis in the n1 direction, then point p2 can be transformed according to the same translation vector T and rotation matrix R, and the transformed coordinates are expressed as p′=(p x ,p y ,p z ), the stored rotation angle β = tan -1 (-p z ,p y ). The specific process can be described as:

[0099] A) Establish an intermediate local coordinate system, see Figure 7, take s as the reference point of the intermediate local coordinate system, and calculate the translation vector T and rotation matrix R of the reference point s in the intermediate local coordinate system. For example, transform the reference point s to the origin of the intermediate local coordinate system, transform the direction of the corresponding normal vector n1′ to be consistent with the x-axis direction of the intermediate local coordinate system, and calculate the x-axis angle θ = arccos(n x ) and the equivalent axis angle unit direction vector The translation vector T and rotation matrix R of the reference point s in the intermediate local coordinate system are calculated and expressed as

[0100]

[0101] T=-Rp1=-R(p x ,p y ,p z ) T ;

[0102] Where cθ represents cosθ, sθ represents sinθ, (p x ,p y ,p z ) T Indicates the transpose operation of the reference point s.

[0103] B) According to the translation vector T and the rotation matrix R, a feature point m in the feature point pair is transformed into the reference coordinates so that the positions of the same features in the same coordinate system can coincide through rotation and translation transformation, thereby obtaining T s→l s i =R(β)T m→l m i , T m→l m i =R(β)T m→l s i , the subscript i represents the serial number, so that the reference point and the feature point are formed The corresponding relationship. Among them, for point s r , T s→l is to r Translate to the origin and change s r The normal of the point m is rotated to the x-axis (pointing in the positive direction) in a rigid 3D transformation; r , T m→l is to m r Translate to the origin and change m r The normal of is rotated to the x-axis (pointing in the positive direction) in a rigid 3D transformation; T -1 It means inverse transformation. For the rotation angle β, R x (β) is a rigid 3D transformation about the x-axis by an angle β. Then, given a point s r The local coordinates (mr ,β), from the point m in the coordinate space i to its corresponding point s in the scene space i The mapping can be written as

[0104]

[0105] Step S124 , determining the initial geometric information of the target object according to the feature point pairs corresponding to the same key value.

[0106] In a specific embodiment, the process of obtaining the initial geometric information of the target object is described as follows:

[0107] (1) Obtain the coordinates of the feature points in the feature point pair corresponding to the same key value, and determine the geometric primitives of the target object through the coordinate distribution.

[0108] (2) For the plane type geometric primitives, the initial geometric information of the target object is expressed as

[0109] [a,b,c,d][x,y,z,1] T =0,

[0110] Or ax+by+cz+d=0;

[0111] Among them, a, b, c, and d are plane geometric parameters.

[0112] For the sphere-type geometric primitive, the initial geometric information of the target object is expressed as

[0113] (x-x0) 2 +(y-y0) 2 +(z-z0) 2 =R 2 ;

[0114] Among them, x0, y0, z0, and R are the geometric parameters of the ball.

[0115] For the cylindrical geometric primitive, the initial geometric information of the target object is expressed as

[0116]

[0117] Among them, t, s, n, h are the geometric parameters of the cylinder, n x 、n y 、n z are the normal components of the normal vector of the point (x, y, z) on the three coordinate axes.

[0118] Those skilled in the art can understand that, since the feature data and initial geometric information of the target object are obtained by voting counting statistics, the algorithm can speed up the matching process of feature vectors and quickly obtain the feature data and initial geometric primitives of the target object.

[0119] In this embodiment, see Figure 3 The above-mentioned step S130 mainly involves the process of counting votes according to the three-dimensional point cloud data, which may specifically include steps S131-S132, which are described as follows.

[0120] Step S131, select part of the data from the feature data by non-maximum suppression to obtain candidate information. In a specific embodiment, first determine the key value with the highest voting score, select the feature point pair corresponding to the key value from the feature data of the target object, and use the coordinates of the feature points in the selected feature point pair as candidate information.

[0121] It should be noted that non-maximum suppression (NMS) is to suppress elements that are not maximum values. Here, non-maximum suppression is used to determine the key value when voting for the highest score.

[0122] Step S132, segmenting the geometric primitives according to the distances from each data point in the candidate information to the geometric primitives, and locally updating the candidate information using the segmentation results to obtain locally optimized data of the target object.

[0123] In a specific embodiment, the distance from each data point in the candidate information to the geometric primitive can be calculated to determine whether the distance is less than or equal to a preset threshold; if so, it is confirmed that the corresponding data point belongs to the geometric primitive; if not, the corresponding data point is removed from the candidate information. It can be understood that the candidate information after removal can be used as local optimization data of the target object.

[0124] Case 1: If the geometric primitive of the target object is a plane, the distance from each data point in the candidate information to the geometric primitive is expressed as d(p,r)=(ax i +by i +cz i +d) 2 , where p is the plane geometry parameter, r is the data point, and subscript i is the serial number of the data point.

[0125] Case 2: If the geometric primitive of the target object is a sphere, the distance from each data point in the candidate information to the geometric primitive is expressed as Where p is the geometric parameter of the sphere, r is the data point, subscript i is the serial number of the data point, (x0, y0, z0) is the coordinate of the center of the sphere, R s is the radius of the sphere.

[0126] Case 3: If the geometric primitive of the target object is a cylinder, the distance from each data point in the candidate information to the geometric primitive is expressed as d(p,r) = (|T′rT′r·(0,0,1) T |-R c ), where p is the cylinder geometry parameter, r is the data point, T′ is the transformation matrix when the geometric primitive is transformed into the coordinate system with the center at the origin of the coordinate system and the main axis coincident with the z-axis of the coordinate system, the superscript T is the transposition operation, R c is the radius of the cylinder.

[0127] Those skilled in the art will understand that, since the feature data is locally optimized to obtain the local optimized data of the target object, the calculation in the global coordinate system is transformed into the calculation in the local coordinate system, and the point-based processing method is transformed into a multi-dimensional feature-based processing method. This not only improves the processing speed and efficiency of the algorithm, but also improves the algorithm's anti-occlusion capability and robustness, and can easily meet the extraction operations of three-dimensional primitive data in application scenarios such as visual guidance, autonomous driving, and augmented reality.

[0128] In this embodiment, see Figure 4 The above-mentioned step S140 mainly involves the process of counting votes according to the three-dimensional point cloud data, which may specifically include steps S141-S143, which are described as follows.

[0129] Step S141: Establishing an objective function for geometric primitives, wherein the objective function includes geometric information of the geometric primitives and geometric relations of local optimization data.

[0130] In a specific embodiment, the established objective function is expressed as follows:

[0131]

[0132] Where p is the primitive geometric parameter, r is the data point in the local optimization data, P is the number of data points in the local optimization data, d(p,r) is the distance from the data point to the geometric primitive, and w r is the weight coefficient of d(p,r).

[0133] Case 1: For a plane-type geometric primitive, the distance from a data point to the geometric primitive is expressed as

[0134] d(p,r)=(ax i +by i +cz i +d) 2 ;

[0135] Among them, a, b, c, d are plane geometric parameters, and the subscript i is the serial number of the data point. In addition, the weight coefficient w at this timer It can be expressed as

[0136]

[0137] At this time, if formula (2-1) is expressed as a vector, E(p) = e T e, then the gradient can be expressed as Using the Jacobian matrix When , the iterative calculation can be expressed as

[0138]

[0139] Case 2: For a sphere-type geometric primitive, the distance from the data point to the geometric primitive is expressed as

[0140]

[0141] Among them, x0,y0,z0,R s is the geometric parameter of the ball. At this time, the Taylor formula can also be used to expand formula (2-1) to transform the nonlinear problem into a linear problem. The calculation result iteration can be used The parameter A k Expressed as

[0142]

[0143]

[0144] in, k is the sequence number corresponding to the number of iterations.

[0145] Case 3: For a cylindrical geometric primitive, the distance from the data point to the geometric primitive is expressed as

[0146] d(p,r)=(|T′rT′r·(0,0,1) T |-R c );

[0147] Where T′ is the transformation matrix when the geometric primitive is transformed into the coordinate system with the center at the origin of the coordinate system and the main axis coincident with the z-axis of the coordinate system. The superscript T is the transposition operation, and R c is the radius of the cylinder. To represent the transformation matrix T′, we can use the equivalent axis-angle method to represent it, so that δ=(δ r ,δ tx ,δ ty ,δ rx ,δ ry ), the iteratively updated expression can be expressed as

[0148]

[0149] In this embodiment, the iterative calculation of the objective function E(p) can adopt the gradient descent method or the least squares method; and the weight coefficient w r The calculation of can adopt Huber method (loss minimization learning method) or Tukey method (multiple comparison method). Since the principles of various methods belong to the prior art, the specific methods and application processes are not described in detail and limited here.

[0150] Step S142, performing iterative calculation of the objective function according to each feature point in the local optimization data until the results of two calculations are less than the target threshold or the iterative process reaches a preset number of iterations, extracting the converged feature points and using them as the three-dimensional primitive data of the target object.

[0151] Step S143, determining the result geometric information of the target object according to the three-dimensional primitive data. Specifically, the coordinates of each feature point in the three-dimensional primitive data are obtained, and the result geometric primitive of the target object is determined by the coordinate distribution; the result geometric information of the target object is determined according to the type of the result geometric primitive (plane, sphere, cylinder, etc.). It can be understood that the result geometric information represents the real primitive type of the target object, and the shape or posture of the target object can be recognized based on it.

[0152] Those skilled in the art will appreciate that since the objective function is used to iteratively update local optimization data to obtain the three-dimensional primitive data and resulting geometric information of the target object, the algorithm adopts a hierarchical optimization strategy, which can improve the accuracy and expression ability of geometric primitive extraction.

[0153] Embodiment 2

[0154] Please refer to Fig.10 In this embodiment, a three-dimensional primitive recognition device is disclosed, which mainly includes a sensor 21, a processor 22 and a controller 23, which are described below respectively.

[0155] The sensor 21 is used to collect scene images of the target object to form three-dimensional point cloud data of the target object. The sensor 21 here can be some visual sensors with image acquisition functions, such as camera equipment and laser scanning equipment. The target object here can be products on an industrial assembly line, mechanical parts in an object box, tools on an operating table, etc., without specific limitation.

[0156] The processor 22 is connected to the sensor. The processor 22 is used to obtain the three-dimensional primitive data and result geometric information of the target object through the extraction method disclosed in the first embodiment. For the extraction method used by the processor 22, refer to steps S110-S140 in the first embodiment.

[0157] The controller 23 is connected to the sensor 21 and the processor 22. The controller 23 is used to control the sensor 21 to collect scene images of the target object, for example, the image collection time, collection interval, collection position and other parameters of the sensor 21 can be set. In addition, the controller 23 is also used to control an actuator to capture the target object according to the three-dimensional primitive data and result geometric information output by the processor 22. Fig.10 In the embodiment, the controller 23 can output a motion instruction to the actuator 24 according to the result geometric information output by the processor 22, so that the actuator grabs the target object 25 in the tool box.

[0158] In this embodiment, the actuator 24 is a gripper or suction cup with a mechanical arm; the actuator 24 is used to receive the control instruction issued by the controller 23 and perform a grabbing or sucking operation on the target object within the range of motion of the mechanical arm. If the target object is determined to be a cylinder by the result geometric primitive of the target object, the actuator 24 performs a grabbing operation on the cylinder; if the target object is determined to be a plane or a sphere by the result geometric primitive of the target object, the actuator 24 performs a sucking operation on the plane or the sphere. It can be understood that the actuator 24 can enhance the acquisition effect of the target object by using an adaptive operation mode.

[0159] In this embodiment, the technical solution automatically detects geometric features from three-dimensional point cloud data to identify geometric primitives such as planes, spheres, and cylinders, which can reduce the difficulty of the device to perceive the environment, narrow the semantic gap between high-level semantics and low-level visual features, and help the device analyze and perceive the world like a human, and achieve intelligent operation. In addition, since artificial scenes often contain a large number of geometric features such as contours, planes, spheres, and cylinders that can well reflect the structural information of the target object, the technical solution in this embodiment uses these features to express the target object, which can reduce the complexity of algorithms such as three-dimensional target tracking, shape recognition, and posture estimation, while greatly improving the robustness and accuracy of the algorithm.

[0160] In one specific implementation, see Fig.11 The processor 22 may include a data extraction module 221 and an identification and positioning module 222 .

[0161] Among them, the data extraction module 221 is used to obtain the three-dimensional point cloud data of the target object; the target object is characterized according to the three-dimensional point cloud data, and the characteristic data and initial geometric information of the target object are obtained by voting counting statistics, and the initial geometric information is used to characterize the geometric primitives of the target object; the characteristic data is locally optimized according to the distance from the characteristic data to the geometric primitives to obtain the local optimized data of the target object; the objective function for the geometric primitives is established, and the local optimized data is iteratively updated using the objective function to obtain the three-dimensional primitive data and the result geometric information of the target object. The recognition and positioning module 222 is connected to the data extraction module 221, and is used to estimate the three-dimensional posture of the target object using the three-dimensional primitive data and the result geometric information of the target object to obtain the posture information of the target object.

[0162] In one specific embodiment, see Fig.10 and 11 The controller 23 includes an optimization module 231 and a control module 232 .

[0163] The optimization module 231 is connected to the identification and positioning module 222 in the processor 22, and is used to plan the motion route and the grasping / sucking position of the actuator 24 according to the position information of the target object relative to the sensor 21. The control module 232 is connected to the optimization module 231, and is used to output control instructions, on the one hand, to control the actuator 24 to grasp / suck the target object according to the planned motion route and grasping position, and on the other hand, the control module 232 also outputs control instructions to control the sensor 21 to collect the image of the target object.

[0164] Those skilled in the art will understand that the three-dimensional primitive recognition device disclosed in this embodiment enables the controller to control the motion mechanism to accurately grasp / absorb the target object according to the posture information output by the processor, while ensuring the execution efficiency and effectively improving the accuracy of grasping / absorbence, thereby enhancing the practical performance of the device during application.

[0165] Embodiment 3

[0166] Please refer to Fig.12 This embodiment discloses a three-dimensional primitive recognition device, which may include a memory 31 and a processor 32, which are described below respectively.

[0167] The memory 31 is used to store programs. Specifically, the memory 31 can be regarded as a computer-readable storage medium, and the program stored therein can be the software code of the extraction method disclosed in the first embodiment.

[0168] The processor 32 is connected to the memory 31 , and the processor 32 is used to implement the extraction method disclosed in the first embodiment by executing the program stored in the memory 31 .

[0169] In a specific embodiment, the functions implemented by the processor 32 can be summarized as follows: obtaining three-dimensional point cloud data of the target object, the three-dimensional point cloud data including the coordinates of each feature point on the surface of the target object and the corresponding normal vector; describing the features of the target object according to the three-dimensional point cloud data, and obtaining the feature data and initial geometric information of the target object through voting counting statistics, the initial geometric information is used to characterize the geometric primitives of the target object; locally optimizing the feature data according to the distance from the feature data to the geometric primitives to obtain local optimized data of the target object; establishing an objective function for the geometric primitives, and using the objective function to iteratively update the local optimized data to obtain the three-dimensional primitive data and resulting geometric information of the target object.

[0170] Those skilled in the art will appreciate that all or part of the functions of the various methods in the above-mentioned embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, and the storage medium can include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to implement the above-mentioned functions. For example, the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above-mentioned functions can be implemented. In addition, when all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can also be stored in a storage medium such as a server, another computer, disk, optical disk, flash disk or mobile hard disk, and can be downloaded or copied and saved in the memory of the local device, or the system of the local device is updated, and when the program in the memory is executed by the processor, all or part of the functions in the above-mentioned embodiments can be implemented.

[0171] The above specific examples are used to illustrate the present invention, which are only used to help understand the present invention and are not used to limit the present invention. For those skilled in the art to which the present invention belongs, some simple deductions, modifications or substitutions can be made according to the idea of ​​the present invention.

Claims

1. A method for extracting three-dimensional primitive data, It is characterized in that include: Obtain three-dimensional point cloud data of the target object; The three-dimensional point cloud data includes coordinates of each feature point on the surface of the target object and a corresponding normal vector; Describing the characteristics of the target object according to the three-dimensional point cloud data, and obtaining the characteristic data and initial geometric information of the target object through voting counting statistics; The initial geometric information is used to characterize the geometric primitives of the target object; Locally optimizing the feature data according to the distance from the feature data to the geometric primitive to obtain local optimized data of the target object; An objective function for the geometric primitive is established, and the local optimization data is iteratively updated using the objective function to obtain three-dimensional primitive data and result geometric information of the target object.

2. The extraction method according to claim 1, It is characterized in that The feature description of the target object according to the three-dimensional point cloud data and obtaining the feature data and initial geometric information of the target object by voting counting statistics include: Using voxel grids to discretize the three-dimensional point cloud data to obtain discrete data; According to the discrete data, feature point pairs are formed for every two feature points on the target object, and corresponding feature descriptors are calculated; feature point pairs with the same or similar feature descriptors are divided into a group and stored in the same hash table, a key value of each hash table is calculated, and a mapping relationship between the key value and the feature point pairs stored in the hash table is established; Voting is counted according to the key values ​​of each hash table, and feature point pairs corresponding to key values ​​with different voting scores are obtained by counting, and the coordinates of each feature point in the feature point pair are used as feature data of the target object; The initial geometric information of the target object is determined based on the feature point pairs corresponding to the same key value.

3. The extraction method according to claim 2, It is characterized in that The step of counting votes according to the key values ​​of each hash table, obtaining feature point pairs corresponding to key values ​​with different voting scores, and using the coordinates of each feature point in the feature point pair as feature data of the target object includes: For each feature point pair in the hash table, the feature descriptor of the feature point pair is expressed as , the feature descriptor All or part of the parameters in are used to calculate the key value of the hash table; among them, F 1 is the distance between two feature points in a feature point pair, F 2 is the angle between the normal vector of a feature point in a feature point pair and the line connecting the two feature points. F 3 is the angle between the normal vector of another feature point in the feature point pair and the line connecting the two feature points. F 4 is the angle between the normal vectors of the two feature points in the feature point pair; The number of feature point pairs with the same key value is voted and counted to obtain the voting score of the key value of each hash table, and the coordinates and normal vectors of each feature point in the feature point pair corresponding to the key values ​​with different voting scores are used as the feature data of the target object.

4. The extraction method according to claim 3, It is characterized in that The determining of the initial geometric information of the target object based on the feature point pairs corresponding to the same key value includes: Obtaining coordinates of feature points in a feature point pair corresponding to the same key value, and determining geometric primitives of the target object through coordinate distribution; For the plane type geometric primitive, the initial geometric information of the target object is expressed as [ a , b , c , d ][ x , y , z ,1] T =0; where a , b , c , d is the plane geometric parameter; For a sphere-type geometric primitive, the initial geometric information of the target object is expressed as follows: x - x 0 ) 2 +( y - y 0 ) 2 +( z - z 0 ) 2 = R 2 ;in, x 0 , y 0 , z 0 , R are the geometric parameters of the ball; For a cylindrical geometric primitive, the initial geometric information of the target object is expressed as x ( t , s )= x ( t )+ n x s ; y ( t , s )= y ( t )+ n y s ; z ( t , s )= z ( t )+ n z s ; 0≤ t ≤2 π ,0≤ s ≤ h ; in, t , s , h are the geometric parameters of the cylinder, n x , n y , n z For point ( x , y , z )’s normal vector on the three coordinate axes.

5. The extraction method according to claim 3, It is characterized in that The locally optimizing the feature data according to the distance from the feature data to the geometric primitive to obtain the locally optimized data of the target object includes: Selecting part of the data from the feature data by non-maximum suppression to obtain candidate information; this step specifically includes: determining the key value when the voting score is the highest, selecting the feature point pair corresponding to the key value from the feature data of the target object, and using the coordinates of the feature points in the selected feature point pair as the candidate information; The geometric primitives are segmented according to the distances from each data point in the candidate information to the geometric primitives, and the candidate information is locally updated using the segmentation results to obtain local optimized data of the target object.

6. The extraction method according to claim 5, It is characterized in that The step of segmenting the geometric primitives according to the distances between each data point in the candidate information and the geometric primitives, and locally updating the candidate information using the segmentation results to obtain the local optimized data of the target object includes: Calculate the distance from each data point in the candidate information to the geometric primitive, and determine whether the distance is less than or equal to a preset threshold. If so, confirm that the corresponding data point belongs to the geometric primitive; if not, remove the corresponding data point from the candidate information; The candidate information after elimination is used as local optimization data of the target object.

7. The extraction method according to any one of claims 1 to 6, It is characterized in that The step of establishing an objective function for the geometric primitives and iteratively updating the local optimization data using the objective function to obtain the three-dimensional primitive data and result geometric information of the target object includes: Establishing an objective function for the geometric primitive; the objective function includes geometric information of the geometric primitive and a geometric relationship between the local optimization data; Iterative calculation of the objective function is performed according to each feature point in the local optimization data until the results of two consecutive calculations are less than a target threshold or the iterative process reaches a preset number of iterations, and converged feature points are extracted as three-dimensional primitive data of the target object; The result geometric information of the target object is determined according to the three-dimensional primitive data.

8. The extraction method according to claim 7, It is characterized in that The established objective function is expressed as ; in, p are primitive geometric parameters, r is a data point in the local optimization data, P The number of data points for the local optimization data, d ( p , r ) is the distance from the data point to the geometric primitive, w r for d ( p , r )’s weight coefficient; For a plane-type geometric primitive, the distance from a data point to the geometric primitive is expressed as d ( p , r )=( ax i + by i + cz i + d ) 2 ;in, a , b , c , d is the plane geometric parameter, subscript i is the serial number of the data point; For a cylinder-type geometric primitive, the distance from a data point to the geometric primitive is expressed as ;in, x 0 , y 0 , z 0 , R s is the spherical geometric parameter, subscript i is the serial number of the data point; For a cylinder-type geometric primitive, the distance from a data point to the geometric primitive is expressed as, d ( p , r )=(| T'r - T'r (0,0,1) T |- R c ),in, T' Transform the geometric primitive into a coordinate system with the center at the origin of the coordinate system, the principal axis and the coordinate system z The transformation matrix when the axes coincide, superscript T is the transpose operation, R c is the radius of the cylinder; The iterative calculation of the objective function is a gradient descent method or a least squares method; the weight coefficient w r The calculation of is done using the Huber method or the Tukey method.

9. A three-dimensional primitive recognition device, It is characterized in that include: A sensor, used to collect a scene image of a target object to form three-dimensional point cloud data of the target object; A processor, connected to the sensor, and configured to obtain three-dimensional primitive data and result geometric information of the target object by the extraction method according to any one of claims 1 to 8; A controller is connected to the sensor and the processor, and is used to control the sensor to collect the scene image of the target object, and to control an actuator to capture the target object according to the three-dimensional primitive data and result geometric information output by the processor.

10. A computer-readable storage medium, It is characterized in that The invention comprises a program which can be executed by a processor to implement the extraction method according to any one of claims 1 to 8.