- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用点云库提供的 RANSAC 方法估计通过点云点的线。我可以创建对象,并毫无问题地估计线模型,如下所示:
pcl::PointCloud<pcl::PointXYZ>::ConstPtr source_cloud(new pcl::PointCloud<pcl::PointXYZ>);
pcl::ModelCoefficients::Ptr line_coefficients(new pcl::ModelCoefficients);
pcl::PointIndices::Ptr inliers (new pcl::PointIndices);
// Populate point cloud...
// Create the segmentation object
pcl::SACSegmentation<pcl::PointXYZ> seg;
seg.setModelType (pcl::SACMODEL_LINE);
seg.setMethodType (pcl::SAC_RANSAC);
seg.setDistanceThreshold (distance_thresh);
seg.setInputCloud (source_cloud);
seg.segment (*inliers, *line_coefficients);
我现在尝试访问模型参数,但我太笨了,无法做到...根据 API应该有六个可访问的参数:
The six coefficients of the line are given by a point on the line and the direction of the line as: [point_on_line.x point_on_line.y point_on_line.z line_direction.x line_direction.y line_direction.z]
因此我尝试这样访问它们:
line_coefficients->line_direction->x
但是,这不起作用。我不断收到错误消息:
No member named 'line_direction' in in 'pcl::ModelCoefficients'.
我真的不知道我做错了什么……有人有什么想法吗?提前致谢!
最佳答案
文档只是告诉您如何解释这些值。 <强> pcl::ModelCoefficients
是一个结构,它有一个成员 values
类型 std::vector<float>
.
因此,要获得 line_direction 和 point_on_line,请执行以下操作:
const auto pt_line_x = line_coefficients->values[0];
const auto pt_line_y = line_coefficients->values[1];
const auto pt_line_z = line_coefficients->values[2];
const auto pt_direction_x = line_coefficients->values[3];
const auto pt_direction_y = line_coefficients->values[4];
const auto pt_direction_z = line_coefficients->values[5];
关于c++ - PCL:使用 RANSAC 访问 pcl::ModelCoefficients::Ptr 的字段以进行线模型近似,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54494275/
我想知道是否有任何方法可以创建一个可用于 RANSAC 方案的模型,其中可以从嘈杂的 3D 点云确定样条线或多段线。 我拥有的是一个在每个 XY 平面上包含一组点的体积,例如在 Z 方向上有 400
我对如何使用 OpenCV findHomography 方法计算最佳变换感到困惑。 我的使用方式如下: cv::Mat h = cv::findHomography(src, dst, CV_RAN
我正在使用 RANSAC 作为我的稳健回归方法。我找到了一个整洁的工具箱 here它执行 Marco Zuliani 的 RANSAC。我看到有直线和平面的例子,但是如果像多元回归那样有很多自变量怎么
paper Fischler 和 Bolles 为 RANSAC 定义了 3 个未指定的参数。其中之一是 the threshold t, which is the number of compati
我已经能够在 3D 点云上为常用模型(即球体、线、平面)成功实现 RANSAC。然而,我很难思考如何为一个长方体做这件事,特别是一个 3d 盒子。我不确定如何使用点来参数化框。 理想情况下,我希望获得
我正在尝试使用 sklearn 的 RANSAC: RANdom SAmple Consensus 来拟合没有截距的线性模型(强制截距为 0)算法。在 LinearRegression可以很容易地设置
我正在使用 2D 激光雷达,并以相对于激光雷达位置的角度和距离的形式获取数据。我必须使用激光雷达创建平面图,下面给出的数据代表一个房间。我想使用 RANSAC 算法来查找房间的墙壁。如果我能装上 RA
我研究了如何使用 rand()%n(其中 n 是样本总数)生成两个随机整数,但它们似乎通常有偏差。 有没有更好(最好是更简单)的方法来生成 0 到 n(样本数)之间的随机数? n 是从包含数据点列表的
RANSAC 用于查找与两个图像相关的单应性矩阵。为了计算矩阵,我们需要至少 4 个对应关系。同形矩阵是描述任何透视变换的通用 3*3 矩阵。如果我们只给出3个对应关系,那么如何计算同源矩阵?由于两幅
我一直认为机器学习结果有所不同,因为数据每次都会预先随机洗牌,从而导致不同的训练集。因此,当没有随机播放时,每次的结果应该是相同的。与 sklearn.linear_model.LinearRegre
我有一个矩阵( vector 的 vector ),其中有几个点(来自传感器的测量值)应该代表墙壁。所有的墙都是平行/垂直的。 我想将这些点安装到各自的墙上。我想过使用 ransac,但我找不到一种简
我正在使用 SIFT 特征检测器和描述符。我正在匹配两个图像之间的点。我正在使用 OpenCV 的 findHomography() 函数和 RANSAC 方法。 当我读到 RANSAC 算法时,据说
matches = sorted(matches, key = lambda x: x.distance) src_pts = np.float32([ kp1[m.queryIdx].pt for
我有一组点,需要使用它们与相应正弦线的邻近度进行分组。我尝试使用标准霍夫变换来确定线条,但这并没有解决问题(只检测到几条线条)。 我想测试 RANSAC 是否能更好地检测各种 sin 曲线。你有类似算
我已经阅读了维基百科的文章并观看了一些关于 RANSAC 的视频。 如果我没理解错的话,优化RANSAC的方法之一如下: 根据 wikipedia ,它的最大迭代次数: 根据这个website ,在查
我正在使用 features2d(ORB、SIFT 等)进行一些对象检测 我正在使用 RANSAC 进一步研究单应性。我发现很多好的点被错误地标记为异常值。 对象(书)内部有很多不应该是异常值的异常值
TL;DR:是否有 RANSAC 或其他可自由用于任意二维点集的稳健对应算法的 C++ 实现? 我知道存在许多包含或使用对应算法(例如 RANSAC(随机抽样共识))的实现。它们通常用于计算机视觉应用
据我所知,OpenCV 使用 RANSAC 来解决 findHomography 的问题,它返回一些有用的参数,例如 homograph_mask。 但是,如果我只想估计 2D 变换,这意味着仿射矩阵
当使用 findHomography 时使用 OpenCV Features2D + Homography Documentation ,它调用 CV_RANSAC 作为它的第三个参数: Mat H
我有一组 3D 点。 Points_[x,y,z]% n*3 where n is number of points 我想安装一个平面(它是地板)并检查平面的高度。我认为这是二维问题。 z=bo+b1
我是一名优秀的程序员,十分优秀!