当前位置:网站首页>[PCL self study: feature9] global aligned spatial distribution (GASD) descriptor (continuously updated)
[PCL self study: feature9] global aligned spatial distribution (GASD) descriptor (continuously updated)
2022-07-05 04:31:00 【Stanford rabbit】
One 、 Global alignment spatial distribution (GASD) Descriptors introduce
This article describes the global alignment spatial distribution ([GASD]) global descriptor , For effective object recognition and pose estimation .
GASD Estimation based on the whole point cloud reference frame representing the object instance , This reference frame is used to align it with the normative coordinate system . then , According to the spatial distribution of its three-dimensional points , Compute descriptors for aligned point clouds . Such a descriptor can also be extended to the color distribution of the entire alignment point cloud . The global alignment transformation of the matching point cloud is used to calculate the pose of the target . For more information, see This paper
【 Theoretical basis :】
Globally aligned spatial distribution (global Aligned Spatial Distribution, abbreviation GASD) Global description method to represent a partial view of a given object 3D Point cloud as input . The first step is to estimate the reference frame of the point cloud ( The coordinate system established by the point cloud itself ), It is used to calculate the transformation of aligning it with the standard coordinate system , Keep the descriptor posture invariant . After alignment , Calculate the shape descriptor of point cloud according to the spatial distribution of three-dimensional points . You can also consider the color distribution of point clouds , Thus, shape and color descriptors with high resolution are obtained . Finally, by matching the query of partial views and training descriptors **( I understand that the query descriptor is the descriptor calculation of the matching point cloud , The training descriptor calculates the descriptor of the object point cloud )** Object recognition . The pose of each recognized object is also calculated by matching query and alignment transformation of training partial views .
For the first step, the reference frame of the point cloud is estimated using principal component analysis (PCA) Method estimation reference frame . Give a group 3D spot ( P i {P_i} Pi), Represents a detail view of an object , among i ∈ { 1 , … , n } i\in\{1,…, n\} i∈{ 1,…,n}, The first step is to calculate their centroids P ‾ {\overline{P}} P, It is the origin of the reference coordinate system . Then from P i {P_i} Pi and P ‾ {\overline{P}} P Calculate the covariance matrix C {C} C As shown below .
then , obtain C {C} C The eigenvalues of the λ j \lambda_j λj And its corresponding eigenvectors . Considering that the eigenvalues are arranged in ascending order , Adopt the eigenvector related to the minimum eigenvalue v 1 {v_1} v1 As a reference coordinate system z Axis . If v 1 {v_1} v1 The included angle with the observation direction is [ − 9 0 ∘ , 9 0 ∘ ] [-90^{\circ}, 90^{\circ}] [−90∘,90∘] Within the scope of , be v 1 {v_1} v1 Take the opposite . This ensures the z The axis always points to the viewer . Reference coordinate system x The axis is the eigenvector associated with the maximum eigenvalue v 3 {v3} v3.y Axis by v 2 {v_2} v2= v 1 {v_1} v1× v 3 {v3} v3 Express ( Cross riding ).
From the reference coordinate system , You can calculate a transformation j matrix [ R ∣ t ] [\boldsymbol{R} | \boldsymbol{t}] [R∣t], Align it with the standard coordinate system . Then all the points in the detail view ( P i ) (P_i) (Pi) after [ R ∣ t ] [\boldsymbol{R} | \boldsymbol{t}] [R∣t] convert , Its definition is as follows :
Once the point cloud aligns the reference frame , A posture invariant global shape descriptor can be calculated . The boundary cube aligned with the point cloud axis centered on the origin is divided into m s × m s × m s m_s \ × m_s \ × m_s ms ×ms ×ms Regular grid . For each grid cell , Calculation with l s b i n s l_s bins lsbins Histogram . If l s = 1 l_s=1 ls=1, So each histogram bin The storage belongs to 3D The number of points of the corresponding cell in the regular grid . If it is l s > 1 l_s>1 ls>1, So for each cell , The histogram of normalized distance between each cell and cloud centroid will be calculated .
The contribution of each sample to the histogram is normalized relative to the total number of points in the cloud . Optionally , Interpolation can be used to assign the value of each sample to adjacent cells , To avoid the boundary effect that may cause sudden changes in the histogram when a sample is transferred from one cell to another . then , The descriptor is obtained by connecting the calculated histogram .
Color information can also be incorporated into descriptors , To increase its identification ability . The color component of the descriptor is m c × m c × m c m_c \ × m_c \ × m_c mc ×mc ×mc Grid Computing , Similar to the mesh used by shape components , But the color histogram of each cell is generated based on the color of its points . The color of point cloud is HSV Represent... In space , The hue value is l c l_c lc Accumulate in the histogram of the container . Similar to shape component calculation , Normalize the points . Besides , You can also interpolate histogram samples . Shape and color components are connected , Generate the final descriptor .
Use the nearest neighbor search method (KDtree) Match query and training descriptor . then , For each matching object instance , Use the alignment transformation obtained from the reference frames of the respective query and training partial views To calculate the rough posture . By transforming the views of query and training parts respectively [ R q ∣ t q ] [\mathbf{R_{q}} | \mathbf{t_{q}}] [Rq∣tq] and [ R t ∣ t t ] [\mathbf{R_{t}} | \mathbf{t_{t}}] [Rt∣tt], Get the rough pose of the object [ R c ∣ t c ] [\mathbf{R_{c}} | \mathbf{t_{c}}] [Rc∣tc].
Then use the iterative closest point (ICP) Algorithm for rough pose [ R c ∣ t c ] [\mathbf{R_{c}} | \mathbf{t_{c}}] [Rc∣tc] Refinement .ICP Relevant contents can be referred to This blog post .
Two 、 Global alignment spatial distribution (GASD) Sample code analysis
The spatial distribution of global alignment is as pcl_features Part of the library is PCL Implemented in . With color information GASD The default value of the parameter is : m s = 6 m_s=6 ms=6( The size is 3 Half of ), l s = 1 l_s=1 ls=1, m c = 4 m_c=4 mc=4( The size is 2 Half of ) and l c = 12 l_c=12 lc=12, No histogram interpolation (INTERP_NONE). This will result in a containing 984 An array of floating-point values . They are stored in pcl::GASDSignature984 Point type . Only shape information GASD The default value of the parameter is : m s m_s ms=8(4 Half the size of ), l s = 1 l_s=1 ls=1 And trilinear histogram interpolation (INTERP_TRILINEAR). This will result in a containing 512 An array of floating-point values , The array can be stored in pcl::GASDSignature512 Point type . You can also use quartilinear histogram interpolation (interp_quadrillinear).
The following code snippet will estimate the input color point cloud GASD shape + Color descriptor .
#include <pcl/point_types.h>
#include <pcl/features/gasd.h>
{
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZRGBA>);
// Here you need to add read PCD Format point cloud or create point cloud related code , I won't repeat
// establish GASD Estimation class , And press the point cloud data into it .
pcl::GASDColorEstimation<pcl::PointXYZRGBA, pcl::GASDSignature984> gasd;
gasd.setInputCloud (cloud);
// Declare a with color information and shape information GASD Descriptor total 984 Lattice floating point numbers represent
pcl::PointCloud<pcl::GASDSignature984> descriptor;
// Start calculating descriptors
gasd.compute (descriptor);
// Get alignment transformation matrix
Eigen::Matrix4f trans = gasd.getTransform (trans);
// Decompress the histogram
for (std::size_t i = 0; i < std::size_t( descriptor[0].descriptorSize ()); ++i)
{
descriptor[0].histogram[i];
}
}
The following code snippet will only estimate the input point cloud GASD Shape descriptor . The only difference is the descriptor statement pcl::GASDSignature984 Change it to pcl::GASDSignature512.
#include <pcl/point_types.h>
#include <pcl/features/gasd.h>
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
// Here you need to add read PCD Format point cloud or create point cloud related code , I won't repeat
// establish GASD Estimation class , And press the point cloud data into it .
pcl::GASDEstimation<pcl::PointXYZ, pcl::GASDSignature512> gasd;
gasd.setInputCloud (cloud);
// Declare a with color information and shape information GASD Descriptor total 512 Lattice floating point numbers represent
pcl::PointCloud<pcl::GASDSignature512> descriptor;
// Start calculating descriptors
gasd.compute (descriptor);
// Get alignment transformation matrix
Eigen::Matrix4f trans = gasd.getTransform (trans);
// Add compressed histogram
for (std::size_t i = 0; i < std::size_t( descriptor[0].descriptorSize ()); ++i)
{
descriptor[0].histogram[i];
}
}
summary : This article briefly introduces GASD Function and principle of , Combined with the official website example code for analysis . thus PCL Of Feature All modules are introduced .
【 About bloggers 】
Stanford rabbit , male , Master of mechanical engineering, Tianjin University . Since graduation, I have been engaged in optical three-dimensional imaging and point cloud processing . Because the three-dimensional processing library used in work is the internal library of the company , Not universally applicable , So I learned to open source by myself PCL Library and its related mathematical knowledge for use . I would like to share the self-study process with you .
Bloggers lack of talent and knowledge , Not yet able to guide , If you have any questions, please leave a message in the comments section for everyone to discuss .
If seniors have job opportunities, you are welcome to send a private letter .
边栏推荐
- 程序员应该怎么学数学
- 【FineBI】使用FineBI制作自定义地图过程
- level18
- Observable time series data downsampling practice in Prometheus
- 蛇形矩阵
- 3 minutes learn to create Google account and email detailed tutorial!
- 如何进行「小步重构」?
- How to force activerecord to reload a class- How do I force ActiveRecord to reload a class?
- 机器学习 --- 神经网络
- How should programmers learn mathematics
猜你喜欢
托管式服务网络:云原生时代的应用体系架构进化
2022-2028 global and Chinese equipment as a Service Market Research Report
Pointer function (basic)
Sword finger offer 04 Search in two-dimensional array
取余操作是一个哈希函数
Discussion on the dimension of confrontation subspace
Advanced length of redis -- deletion strategy, master-slave replication, sentinel mode
Scheduling system of kubernetes cluster
Web开发人员应该养成的10个编程习惯
Rome chain analysis
随机推荐
[popular science] basic knowledge of thermal design: heat dissipation analysis of 5g optical devices
web资源部署后navigator获取不到mediaDevices实例的解决方案(navigator.mediaDevices为undefined)
Construction d'un Cluster redis sous Windows
Convert Boolean to integer value PHP - Convert Boolean to integer value PHP
QT Bluetooth: a class for searching Bluetooth devices -- qbluetooth devicediscoveryagent
User behavior collection platform
2022-2028 global and Chinese equipment as a Service Market Research Report
Mixed compilation of C and CC
【虚幻引擎UE】实现背景模糊下近景旋转操作物体的方法及踩坑记录
Bit operation skills
About the prompt loading after appscan is opened: guilogic, it keeps loading and gets stuck. My personal solution. (it may be the first solution available in the whole network at present)
Machine learning -- neural network
Realize the attention function of the article in the applet
How to force activerecord to reload a class- How do I force ActiveRecord to reload a class?
Sword finger offer 04 Search in two-dimensional array
Uncover the seven quirky brain circuits necessary for technology leaders
Neural network and deep learning Chapter 1: introduction reading questions
函数(易错)
TPG x AIDU | AI leading talent recruitment plan in progress!
Raki's notes on reading paper: soft gazetteers for low resource named entity recognition