[common] multiStep (update/growing) extension of computeMeanAndCovarianceMatrix

未关闭
#5,736 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
cpp

调研方向

从现有的 common-module computeMeanAndCovarianceMatrix 实现开始,然后检查提议的 updateMeanAndCovarianceMatrix API 及其通过 segment_ByOBBMT -> segment_ByOBBThread -> updateCentroidAndOBB 的使用方式。随着点云增长,将增量结果与完整重新计算的结果进行比较;当该扩展适合通用使用并保留正确的均值和协方差值时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

status: triage

In my segmentation developments I needed and implemented an extension of computeMeanAndCovarianceMatrix to apply periodically to the growing segment without having every time to apply the for loops to all points

essentially as the segment/cluster grows, for segmentation conditions, I needed to recompute mean and covariance.
to make each step faster i calculate mean and covariance as a variation of the previously old calculated values, with a for loop only on added points

the function looks like this

template <typename PointT, typename Scalar> inline unsigned int
updateMeanAndCovarianceMatrix (const pcl::PointCloud &cloud,
Eigen::Matrix<Scalar, 3, 3> &covariance_matrix,
Eigen::Matrix<Scalar, 4, 1> &centroid,
unsigned int oldSize,
size_t & point_count
)

the first time it is called with oldSize=0 and it works exactly as computeMeanAndCovarianceMatrix
new size and point_count are recorded after this first call

the second time it is called with oldSize= size of previous call
inside the for loop will be shorter like
for (size_t i=oldSize; i<cloud.points.size();++i)
{

and then there are specifically developed formulas to update the global values of mean and covariance putting together the old and the new segment of point cloud

the algorithm is effective and fast

it can be reapplied at every added point or every n added points or also non periodically when you need to update mean or covariance as the set changes

at each step you have to pass mean and covariance of previous call,
they will be updated with new values

I thought it might be useful for PCL common module?
you can see it on my fork implemented and used with this chain of calls

segment_ByOBBMT (thread call)-> segment_ByOBBThread -> updateCentroidAndOBB ->updateMeanAndCovarianceMatrix

but it can be used general purpouse

主要语言
C++
星标
11.2k
派生
4.7k
平均合并
6 天 13 小时
30 天内合并 PR
10

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PointCloudLibrary/pcl 的其他 Issue

查看 PointCloudLibrary/pcl 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。