主要内容

worldpointset

管理3-D到2-D的点通信

描述

worldpointset对象存储了跨摄像机视图的三维世界点和二维图像点之间的对应关系。你可以用worldpointset对象与一个imageviewset对象来管理图像和地图数据,用于从运动到结构、视觉里程计和视觉同步定位和绘图(SLAM)。

创建

描述

例子

wpSet= worldpointset创建具有默认属性的worldpointset对象。使用对象函数来执行诸如添加、修改或删除通信、在视图中查找点以及查找点的视图等操作。

属性

全部展开

此属性是只读的。

三维世界点,指定为- × 3矩阵,行包含[xyz分)世界。是三维世界点的数量。

此属性是只读的。

与世界点关联的视图的标识符,指定为N-元素的整数行向量。

此属性是只读的。

三维世界点的数量,指定为标量。

此属性是只读的。

3-D到2-D点对应,指定为一个三列表。

描述
PointIndex 每一行包含一个世界点的线性索引。
ViewId 每行包含一个1 ×N向量指定与相应世界点关联的视图的id。N是与世界点相关的视图数。
FeatureIndex 每行包含一个1 ×N向量,指定与世界点对应的特征点的指标。中的对应元素指定的视图中特征点的索引ViewID细胞。

对象的功能

addWorldPoints 添加世界点到世界点集
removeWorldPoints 从世界点集合中移除世界点
updateWorldPoints 更新世界点集合中的世界点
addCorrespondences 更新世界点集合中的世界点
removeCorrespondences 从世界点集中去除3-D到2-D的对应
updateCorrespondences 更新世界点集的3-D到2-D对应
findViewsOfWorldPoint 找到观察世界点的观点
findWorldPointsInTracks 找到与点轨道对应的世界点
findWorldPointsInView 找到观察到的世界点

例子

全部折叠

加载一个垫,文件包含立体声参数进入工作空间。

负载(“webcamsSceneReconstruction.mat”);

将一对立体图像读入工作区。

I1 = imread (“sceneReconstructionLeft.jpg”);I2 = imread (“sceneReconstructionRight.jpg”);

Undistort图像。

I1 = undistortImage (I1, stereoParams.CameraParameters1);I2 = undistortImage (I2, stereoParams.CameraParameters2);

定义一个矩形感兴趣区域(ROI),格式为[宽度高度]。

roi = [30 30 size(I1,2)-30 size(I1,1)-30];

利用感兴趣区域对两幅图像进行加速鲁棒特征检测和提取。

imagePoints1 = detectSURFFeatures (im2gray (I1),“投资回报”roi);imagePoints2 = detectSURFFeatures (im2gray (I2),“投资回报”roi);[feature1, validPoints1] = extractFeatures (im2gray (I1) imagePoints1,“正直”,真正的);[feature2, validPoints2] = extractFeatures (im2gray (I2) imagePoints2,“正直”,真正的);

将提取的特征进行匹配。

indexPairs = matchFeatures (feature1 feature2);

计算三维世界点。

matchedPoints1 = validPoints1 (indexPairs (: 1));matchedPoints2 = validPoints2 (indexPairs (:, 2));worldPoints =满足(matchedPoints1 matchedPoints2 stereoParams);

创建一个worldpointset对象来管理通信。

wpSet = worldpointset;

加上世界指向worldpointset

[wpSet, newPointIndices] = addWorldPoints (wpSet worldPoints);

将3-D到2-D的点对应worldpointset

wpSet = addCorrespondences (wpSet 1 newPointIndices indexPairs (: 1));wpSet = addCorrespondences (wpSet 2 newPointIndices indexPairs (:, 2));

显示世界点数。

pcshow (wpSet。WorldPoints,“VerticalAxis”“y”“VerticalAxisDir”“下来”“MarkerSize”, 45岁)

另请参阅

功能

对象

介绍了R2020b