【注释说明】pcl库中OBB和AABB包围盒头文件pcl/features/moment_of_inertia_estimation.h,中文翻译注释说明,欢迎补充

  • 前景提要
  • 翻译注释

前景提要

近期学习了下OBB和AABB包围盒在pcl点云中的使用,想要弄清楚OBB的原理,打开头文件翻译注释了,特此记录。

翻译注释

前面这些英文是版权声明,没必要看

/** Software License Agreement (BSD License)**  Point Cloud Library (PCL) - www.pointclouds.org**  All rights reserved.**  Redistribution and use in source and binary forms, with or without*  modification, are permitted provided that the following conditions*  are met:**   * Redistributions of source code must retain the above copyright*     notice, this list of conditions and the following disclaimer.*   * Redistributions in binary form must reproduce the above*     copyright notice, this list of conditions and the following*     disclaimer in the documentation and/or other materials provided*     with the distribution.*   * Neither the name of Willow Garage, Inc. nor the names of its*     contributors may be used to endorse or promote products derived*     from this software without specific prior written permission.**  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS*  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS*  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,*  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,*  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER*  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN*  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE*  POSSIBILITY OF SUCH DAMAGE.** Author : Sergey Ushakov* Email  : sergey.s.ushakov@mail.ru**/#ifndef PCL_MOMENT_OF_INERTIA_ESIMATION_H_
#define PCL_MOMENT_OF_INERTIA_ESIMATION_H_#include <vector>
#include <math.h>
#include <pcl/features/feature.h>
#include <pcl/PointIndices.h>namespace pcl
{/** \brief* Implements the method for extracting features based on moment of inertia. It also* calculates AABB, OBB and eccentricity of the projected cloud.实现了基于惯性矩的特征提取方法。它还可以计算出投影云的AABB、OBB和离心率。*/template <typename PointT>class PCL_EXPORTS MomentOfInertiaEstimation : public pcl::PCLBase <PointT>{public:using PCLBase <PointT>::input_;using PCLBase <PointT>::indices_;using PCLBase <PointT>::fake_indices_;using PCLBase <PointT>::use_indices_;using PCLBase <PointT>::initCompute;using PCLBase <PointT>::deinitCompute;typedef typename pcl::PCLBase <PointT>::PointCloudConstPtr PointCloudConstPtr;typedef typename pcl::PCLBase <PointT>::PointIndicesConstPtr PointIndicesConstPtr;public:/** \brief Provide a pointer to the input datasetbrief提供指向输入数据集的指针* \param[in] cloud the const boost shared pointer to a PointCloud messageparam[in] cloud指向PointCloud消息的const boost共享指针*/virtual voidsetInputCloud (const PointCloudConstPtr& cloud);/** \brief Provide a pointer to the vector of indices that represents the input data.提供一个指向表示输入数据的索引向量的指针。* \param[in] indices a pointer to the vector of indices that represents the input data.param[in] indices一个指针,指向表示输入数据的索引向量。*/virtual voidsetIndices (const IndicesPtr& indices);/** \brief Provide a pointer to the vector of indices that represents the input data.提供一个指向表示输入数据的索引向量的指针。* \param[in] indices a pointer to the vector of indices that represents the input data.param[in] indices一个指针,指向表示输入数据的索引向量。*/virtual voidsetIndices (const IndicesConstPtr& indices);/** \brief Provide a pointer to the vector of indices that represents the input data.提供一个指向表示输入数据的索引向量的指针。* \param[in] indices a pointer to the vector of indices that represents the input data.param[in] indices一个指针,指向表示输入数据的索引向量。*/virtual voidsetIndices (const PointIndicesConstPtr& indices);/** \brief Set the indices for the points laying within an interest region of * the point cloud.* \note you shouldn't call this method on unorganized point clouds!* \param[in] row_start the offset on rows* \param[in] col_start the offset on columns* \param[in] nb_rows the number of rows to be considered row_start included* \param[in] nb_cols the number of columns to be considered col_start included/** \brief设置点云中感兴趣区域内的点的索引。注意,你不应该在没有组织的点云上调用这个方法!* \param[in] row_start行偏移量* \param[in] col_start列的偏移量* \param[in] nb_rows被认为包含row_start的行数* \param[in] nb_cols被认为包含col_start的列数*/virtual voidsetIndices (size_t row_start, size_t col_start, size_t nb_rows, size_t nb_cols);/** \brief Constructor that sets default values for member variables. *//** \brief为成员变量设置默认值的构造函数。*/MomentOfInertiaEstimation ();/** \brief Virtual destructor which frees the memory. *//** \brief释放内存的虚析构函数。*/virtual~MomentOfInertiaEstimation ();/** \brief This method allows to set the angle step. It is used for the rotation* of the axis which is used for moment of inertia/eccentricity calculation.* \param[in] step angle step
此方法允许设置角度步长。用于轴的转动,用于计算转动惯量/偏心量。
param[in] step角度步长*/voidsetAngleStep (const float step);/** \brief Returns the angle step. */
/** \brief返回角度步骤。*/floatgetAngleStep () const;/** \brief This method allows to set the normalize_ flag. If set to false, then* point_mass_ will be used to scale the moment of inertia values. Otherwise,* point_mass_ will be set to 1 / number_of_points. Default value is true.* \param[in] need_to_normalize desired value该方法允许设置normalize_标志。如果设置为false,则point_mass_将用于缩放惯性矩值。否则,point_mass_将被设置为1 / number_of_points。默认值为true。
need_to_normalize期望值*/voidsetNormalizePointMassFlag (bool need_to_normalize);/** \brief Returns the normalize_ flag. */
/** \brief返回normalize_标志。*/boolgetNormalizePointMassFlag () const;/** \brief This method allows to set point mass that will be used for* moment of inertia calculation. It is needed to scale moment of inertia values.* default value is 0.0001.* \param[in] point_mass point mass这种方法允许设置点质量,用于计算惯性矩。需要对惯性矩值进行缩放。
默认值为0.0001。
参数[in] point_mass点质量*/voidsetPointMass (const float point_mass);/** \brief Returns the mass of point. */
/** \brief返回点的质量。*/floatgetPointMass () const;/** \brief This method launches the computation of all features. After execution* it sets is_valid_ flag to true and each feature can be accessed with the* corresponding get method.
/** \brief该方法启动所有特性的计算。在执行之后,它将is_valid_标志设置为true,并且每个特性都可以通过
*对应的get方法。*/voidcompute ();/** \brief This method gives access to the computed axis aligned bounding box. It returns true* if the current values (eccentricity, moment of inertia etc) are valid and false otherwise.* \param[out] min_point min point of the AABB* \param[out] max_point max point of the AABB这个方法提供了对计算出的轴对齐边界框的访问。如果当前值(离心率,转动惯量等)有效则返回true,否则返回false。
* \param[out] min_point AABB的最小点
* \param[out] max_point AABB的最大点*/boolgetAABB (PointT& min_point, PointT& max_point) const;/** \brief This method gives access to the computed oriented bounding box. It returns true* if the current values (eccentricity, moment of inertia etc) are valid and false otherwise.* Note that in order to get the OBB, each vertex of the given AABB (specified with min_point and max_point)* must be rotated with the given rotational matrix (rotation transform) and then positioned.* Also pay attention to the fact that this is not the minimal possible bounding box. This is the bounding box* which is oriented in accordance with the eigen vectors.* \param[out] min_point min point of the OBB* \param[out] max_point max point of the OBB* \param[out] position position of the OBB* \param[out] rotational_matrix this matrix represents the rotation transform这个方法提供了对计算出的方向包围框的访问。如果当前值(离心率,转动惯量等)有效则返回true,否则返回false。
*注意,为了得到OBB,给定的AABB的每个顶点(用min_point和max_point指定)必须旋转给定的旋转矩阵(旋转变换),然后定位。
*还要注意的是,这不是最小可能的边界框。这是根据特征向量定向的边界框。
* \param[out] min_point OBB的最小点
* \param[out] max_point OBB的最大点
* param[out] position OBB的位置
* \param[out] rotational_matrix这个矩阵表示旋转变换*/boolgetOBB (PointT& min_point, PointT& max_point, PointT& position, Eigen::Matrix3f& rotational_matrix) const;/** \brief This method gives access to the computed eigen values. It returns true* if the current values (eccentricity, moment of inertia etc) are valid and false otherwise.* \param[out] major major eigen value* \param[out] middle middle eigen value* \param[out] minor minor eigen value这个方法提供了对计算出的特征值的访问。如果当前值(离心率,转动惯量等)有效则返回true,否则返回false。
* \param[out] major主要特征值
* \param[out] middle中间特征值
* \param[out] minor小的特征值*/boolgetEigenValues (float& major, float& middle, float& minor) const;/** \brief This method gives access to the computed eigen vectors. It returns true* if the current values (eccentricity, moment of inertia etc) are valid and false otherwise.* \param[out] major axis which corresponds to the eigen vector with the major eigen value* \param[out] middle axis which corresponds to the eigen vector with the middle eigen value* \param[out] minor axis which corresponds to the eigen vector with the minor eigen value
这种方法提供了对计算出的特征向量的访问。如果当前值(离心率,转动惯量等)有效则返回true,否则返回false。
* \param[out]长轴,对应于具有主特征值的特征向量
* \param[out]中轴,对应于具有中间特征值的特征向量
* \param[out]小轴,对应于具有小特征值的特征向量*/boolgetEigenVectors (Eigen::Vector3f& major, Eigen::Vector3f& middle, Eigen::Vector3f& minor) const;/** \brief This method gives access to the computed moments of inertia. It returns true* if the current values (eccentricity, moment of inertia etc) are valid and false otherwise.* \param[out] moment_of_inertia computed moments of inertia这种方法可以得到计算出的转动惯量。如果当前值(离心率,转动惯量等)有效则返回true,否则返回false。
* \param[out] moment_of_惯性计算的惯性矩*/boolgetMomentOfInertia (std::vector <float>& moment_of_inertia) const;/** \brief This method gives access to the computed ecentricities. It returns true* if the current values (eccentricity, moment of inertia etc) are valid and false otherwise.* \param[out] eccentricity computed eccentricities这个方法提供了对计算出的偏心度的访问。它返回true当前值(离心率,转动惯量等)是有效的,否则返回false。
param[out] eccentricity计算出的偏心度*/boolgetEccentricity (std::vector <float>& eccentricity) const;/** \brief This method gives access to the computed mass center. It returns true* if the current values (eccentricity, moment of inertia etc) are valid and false otherwise.* Note that when mass center of a cloud is computed, mass point is always considered equal 1.* \param[out] mass_center computed mass center这种方法可以访问计算出的质心。如果当前值(离心率,转动惯量等)有效则返回true,否则返回false。
*注意,当计算云的质心时,质点总是被认为等于1。
* \param[out] mass_center计算质量中心*/boolgetMassCenter (Eigen::Vector3f& mass_center) const;private:/** \brief This method rotates the given vector around the given axis.* \param[in] vector vector that must be rotated* \param[in] axis axis around which vector must be rotated* \param[in] angle angle in degrees* \param[out] rotated_vector resultant vector这个方法使给定的向量围绕给定的轴旋转。
* \param[in] vector必须旋转的向量
* \param[in] axis旋转矢量的轴
param[in] Angle表示角度
* \param[out] rotated_vector结果向量*/voidrotateVector (const Eigen::Vector3f& vector, const Eigen::Vector3f& axis, const float angle, Eigen::Vector3f& rotated_vector) const;/** \brief This method computes center of mass and axis aligned bounding box. */
/** \brief该方法计算质心和轴对齐的包围盒。*/voidcomputeMeanValue ();/** \brief This method computes the oriented bounding box. */
/*这个方法计算有方向的包围框。*/voidcomputeOBB ();/** \brief This method computes the covariance matrix for the input_ cloud.* \param[out] covariance_matrix stores the computed covariance matrix这种方法计算输入云的协方差矩阵。
* \param[out] covariance_matrix存储计算的协方差矩阵*/voidcomputeCovarianceMatrix (Eigen::Matrix <float, 3, 3>& covariance_matrix) const;/** \brief This method computes the covariance matrix for the given cloud.* It uses all points in the cloud, unlike the previous method that uses indices.* \param[in] cloud cloud for which covariance matrix will be computed* \param[out] covariance_matrix stores the computed covariance matrix这种方法计算给定云的协方差矩阵。
*它使用了云中的所有点,不像之前使用索引的方法。
param[in] cloud 云的协方差矩阵将计算
* \param[out] covariance_matrix存储计算的协方差矩阵*/voidcomputeCovarianceMatrix (PointCloudConstPtr cloud, Eigen::Matrix <float, 3, 3>& covariance_matrix) const;/** \brief This method calculates the eigen values and eigen vectors* for the given covariance matrix. Note that it returns normalized eigen* vectors that always form the right-handed coordinate system.* \param[in] covariance_matrix covariance matrix* \param[out] major_axis eigen vector which corresponds to a major eigen value* \param[out] middle_axis eigen vector which corresponds to a middle eigen value* \param[out] minor_axis eigen vector which corresponds to a minor eigen value* \param[out] major_value major eigen value* \param[out] middle_value middle eigen value* \param[out] minor_value minor eigen value该方法计算给定协方差矩阵的特征值和特征向量。注意,它返回总是形成右手坐标系的标准化特征向量。
* \param[in] covariance_matrix
* \param[out] major_axis特征向量,对应于一个主要特征值
* \param[out] middle_axis特征向量,对应中间特征值
* \param[out] minor_axis特征向量,对应于一个小特征值
* \param[out] major_value主特征值
* \param[out] middle_value中间特征值
* \param[out] minor_value小特征值*/voidcomputeEigenVectors (const Eigen::Matrix <float, 3, 3>& covariance_matrix, Eigen::Vector3f& major_axis,Eigen::Vector3f& middle_axis, Eigen::Vector3f& minor_axis, float& major_value, float& middle_value,float& minor_value);/** \brief This method returns the moment of inertia of a given input_ cloud.* Note that when moment of inertia is computed it is multiplied by the point mass.* Point mass can be accessed with the corresponding get/set methods.* \param[in] current_axis axis that will be used in moment of inertia computation* \param[in] mean_value mean value(center of mass) of the cloud/** \brief这个方法返回给定输入云的惯性矩。
*注意当计算转动惯量时,转动惯量乘以质点质量。
*点质量可以通过相应的get/set方法访问。
* \param[in] current_axis用于计算惯性矩的轴
param[in] mean_value云的平均值(质心)*/floatcalculateMomentOfInertia (const Eigen::Vector3f& current_axis, const Eigen::Vector3f& mean_value) const;/** \brief This method simply projects the given input_ cloud on the plane specified with* the normal vector.* \param[in] normal_vector nrmal vector of the plane* \param[in] point point belonging to the plane* \param[out] projected_cloud projected cloud
这个方法简单地将给定的输入云投影到法向量指定的平面上。
\param[in] normal_vector平面的法向量
param[in]点属于平面的点
* \param[out] projted_cloud投影的云*/voidgetProjectedCloud (const Eigen::Vector3f& normal_vector, const Eigen::Vector3f& point, typename pcl::PointCloud <PointT>::Ptr projected_cloud) const;/** \brief This method returns the eccentricity of the projected cloud.* \param[in] covariance_matrix covariance matrix of the projected cloud* \param[in] normal_vector normal vector of the plane, it is used to discard the*            third eigen vector and eigen value*//** \brief这个方法返回投影云的离心率。
* param[in] covariance_matrix投影云的协方差矩阵
* \param[in] normal_vector平面的法向量,用来丢弃
*第三个特征向量和特征值*/floatcomputeEccentricity (const Eigen::Matrix <float, 3, 3>& covariance_matrix, const Eigen::Vector3f& normal_vector);private:/** \brief Indicates if the stored values (eccentricity, moment of inertia, AABB etc.)* are valid when accessed with the get methods. */bool is_valid_;/** \brief Stores the angle step */float step_;/** \brief Stores the mass of point in the cloud */float point_mass_;/** \brief Stores the flag for mass normalization */bool normalize_;/** \brief Stores the mean value (center of mass) of the cloud */Eigen::Vector3f mean_value_;/** \brief Major eigen vector */Eigen::Vector3f major_axis_;/** \brief Middle eigen vector */Eigen::Vector3f middle_axis_;/** \brief Minor eigen vector */Eigen::Vector3f minor_axis_;/** \brief Major eigen value */float major_value_;/** \brief Middle eigen value */float middle_value_;/** \brief Minor eigen value */float minor_value_;/** \brief Stores calculated moments of inertia */std::vector <float> moment_of_inertia_;/** \brief Stores calculated eccentricities */std::vector <float> eccentricity_;/** \brief Min point of the axis aligned bounding box */PointT aabb_min_point_;/** \brief Max point of the axis aligned bounding box */PointT aabb_max_point_;/** \brief Min point of the oriented bounding box */PointT obb_min_point_;/** \brief Max point of the oriented bounding box */PointT obb_max_point_;/** \brief Stores position of the oriented bounding box */Eigen::Vector3f obb_position_;/** \brief Stores the rotational matrix of the oriented bounding box */Eigen::Matrix3f obb_rotational_matrix_;public:EIGEN_MAKE_ALIGNED_OPERATOR_NEW};
}#define PCL_INSTANTIATE_MomentOfInertiaEstimation(T) template class pcl::MomentOfInertiaEstimation<T>;#ifdef PCL_NO_PRECOMPILE
#include <pcl/features/impl/moment_of_inertia_estimation.hpp>
#endif#endif

【注释说明】pcl库中OBB和AABB包围盒头文件pcl/features/moment_of_inertia_estimation.h,中文翻译注释说明,欢迎补充相关推荐

  1. (曲率系列3:)PCL:PCL库中的两种曲率表示方法pcl::NormalEstimation和PrincipalCurvaturesEstimation

    PCL里有两个计算曲率的调用函数: (1)pcl::NormalEstimation 这里边计算的曲率不是数学上定义的曲率. (2)pcl::PrincipalCurvaturesEstimation ...

  2. PCL库中Marching Cubes(移动立方体)算法的解析

    PCL库中Marching Cubes(移动立方体)算法解析 1. Marching Cubes算法的原理这里不再赘述,不懂的话,提供一下文献资源: 链接:MARCHING CUBES A HIGH ...

  3. 学习PCL库:PCL库中的IO模块介绍

    公众号致力于点云处理,SLAM,三维视觉,高精地图等领域相关内容的干货分享,欢迎各位加入,有兴趣的可联系dianyunpcl@163.com.未经作者允许请勿转载,欢迎各位同学积极分享和交流. IO模 ...

  4. Effective Objective-C 2.0 — 第二条:类的头文件中尽量少引入其他头文件

    第二条:类的头文件中尽量少引入其他头文件 使用向前声明(forward declaring) @class EOCEmployer 1, 将引入头文件的实际尽量延后,只在确有需要时才引入,这样就可以减 ...

  5. Visual Studio 中使用万能头文件 #include bits/stdc++.h

    进行各种练习赛后,看题解代码时经常会看到这么一个陌生的头文件 #include <bits/stdc++.h> ,这个头文件是一个C++万能头文件,里面包含了程序比赛中所有可能用到的头文件 ...

  6. 教你如何从Spring官网上查找SpringIOC框架中的beans的配置头文件

    进入Spring官网:https://spring.io 找到projects并点击,如图: 然后进入如下界面: 点击Spring Framework,进入如下图: 点击红圈处,进入如下界面: 找到I ...

  7. Ubuntu16.04安装PCL库的python实现python-pcl,并且通过pcl加载pcd文件验证python-pcl是否安装成功

    1. 安装PCL库 使用如下指令安装PCL库. sudo apt install libpcl-dev 如果提示"Unable to locate package libpcl-dev&qu ...

  8. Git从库中移除已删除大文件

    写在前面 大家一定遇到过在使用Git时,不小心将一个很大的文件添加到库中,即使删除,记录中还是保存了这个文件.以后不管是拷贝,还是push/pull都比较麻烦.今天在上传工程到github上,发现最大 ...

  9. C++ 中的模板类声明头文件和实现文件分离后,如何能实现正常编译?

    著作权归作者所有. 商业转载请联系作者获得授权,非商业转载请注明出处. 作者:余天升 链接:http://www.zhihu.com/question/20630104/answer/15722407 ...

  10. Linux中常用C/C++一些头文件的作用

    2019独角兽企业重金招聘Python工程师标准>>> 1. Linux中一些头文件的作用: <assert.h>:ANSI C.提供断言,assert(表达式) < ...

最新文章

  1. 生产上如何设置线程池参数?拒绝策略怎么配?|| Executors 中 JDK 给你提供了,为什么不用??
  2. C++ 强制类型转换(转载)
  3. 关于ST02看到SWAP红色的讨论
  4. 多语言报表的改动方法
  5. 用sqlalchemy对mysql数据库增删改查demo
  6. git分支建立删除,打tag
  7. 【转】深度解析 Qt 中动态链接库
  8. java仿百度分页_java仿百度假分页代码实现
  9. 通过TXT文件批量生成PDF417码
  10. 9月全球搜索引擎市场份额:7个版本Google上榜
  11. 名人名言大全API 推荐
  12. css样式表诞生,[css]简明教程 CSS样式表概述
  13. cad相对坐标快捷键_Auto CAD中常用的快捷键(1)
  14. 苏州IT外包公司如何选择?IT外包服务案例分析
  15. 经纬度和坐标之间怎么相互转换
  16. bertram_Bertram是什么意思
  17. 关于html5外文翻译三千字,论文外文文献翻译3000字左右.pdf
  18. Flickr8k和Flickr8kCN 数据下载
  19. IT售前咨询能力范围
  20. 什么是非抢占式和抢占式调度方式?抢占式调度方法和非抢占式调度方法有哪些?

热门文章

  1. 幸福的小故事,愿岁月安好
  2. [经典论文分享] Decision Transformer: Reinforcement Learning via Sequence Modeling
  3. 星际争霸II sc2 台湾版试玩
  4. 文件服务器和nas区别,nas和ftp服务器的区别
  5. 合肥工业大学计算机保研,合肥工大(合肥工业大学保研去向)
  6. 触发器(数据库原理术语)
  7. 自学iOS开发系列----UI(视图编程入门:UIView)
  8. 谷歌浏览器翻译插件 划词翻译
  9. 以太坊主动数据同步简析
  10. cpc按点击计算怎么算_亚马逊CR怎么算?亚马逊CR及CTR计算公式介绍