main Content

世界点集

管理3-D到2-D点对应

描述

世界点集对象在3-D世界点和跨摄像头视图之间存储对应关系。您可以使用世界点集对象带ImageViewSetobject to manage image and map data for structure-from-motion, visual odometry, and visual simultaneous localization and mapping (SLAM).

创建

描述

例子

WPSET= WorldPointSet使用默认属性创建WorldPointSet对象。使用对象函数执行诸如添加,修改或删除对应关系,查找观点中的点以及查找点视图之类的动作。

特性

展开全部

This property is read-only.

3-D世界点,指定为m-by-3矩阵,包含[Xyz] world points.mis the number of 3-D world points.

This property is read-only.

与世界点相关的观点的标识符,指定为n- 整数的元素行向量。

This property is read-only.

3-D世界点的数量,指定为标量。

This property is read-only.

3-D至2-D点对应关系,指定为三列表。

Column 描述
PointIndex Each row contains the linear index of a world point.
ViewID 每行都包含一个1乘n向量指定与相应世界点相关的视图的ID。n是与世界点相关的观点数量。
功能index 每行都包含一个1乘nvector specifying the indices of the feature points that correspond to the world point. Each element is the index of the feature point in the view specified by the corresponding element in theViewID细胞。

对象功能

addworldpoints 将世界点添加到世界点集
删除Worldpoints 从世界上的世界删除世界点
UpdateWorldPoints 更新世界重点的世界点
addCorrespondences 更新世界重点中的世界点
删除对应 Remove 3-D to 2-D correspondences from world point set
更新回答 在世界点集中更新3-D到2D通信
findviewsofworldpoint 找到观察世界重点的观点
Findworldpointsintracks 查找与点轨道相对应的世界点
Findworldpointsinview 查找观点观察到的世界点

例子

全部收缩

加载a垫-将立体声参数包含到工作区中的文件。

加载('WebCamssceneReconstruction.mat');

Read a stereo pair of images into the workspace.

i1 = imread('sceneReconstructionleft.jpg');i2 = imread('sceneReconstructionright.jpg');

Undistort the images.

i1 = untostortimage(i1,stereoparams.cameraparameters1);i2 = untostortimage(i2,stereoparams.cameraparameters2);

以格式定义矩形区域(ROI)[X Y宽度高度]。

ROI = [30 30尺寸(I1,2)-30尺寸(I1,1)-30];

Detect and extract Speeded-Up Robust Features (SURF) from both images using the ROI.

imagePoints1 = detectSURFFeatures(im2gray(I1),'roi',,,,roi); imagePoints2 = detectSURFFeatures(im2gray(I2),'roi',,,,roi); [feature1,validPoints1] = extractFeatures(im2gray(I1),imagePoints1,'直立',真的);[feature2,有效点2] = extractfeatures(im2gray(i2),imagepoints2,'直立',真的);

互相匹配提取的功能。

indexpairs = matchfeatures(feature1,feature2);

Compute the 3-D world points.

匹配点1 =有效点1(indexpairs(:,1));匹配点2 =有效点2(indexpairs(:,2));worldpoints =三角剖分(匹配点1,匹配点2,stereoparams);

创建一个世界点集对应对应的对象。

wpset = worldPointSet;

Add the world points to the世界点集

[wpset,newpointIndices] = addworldpoints(wpset,worldpoints);

Add the 3-D to 2-D point correspondences to the世界点集

wpset = addCorrespondences(WPSET,1,newPointIndices,indexpairs(:,1));wpset = addCorrespondences(WPSET,2,newPointIndices,indexpairs(:,2));

显示世界点。

pcshow (wpSet。WorldPoints,'VerticalAxis',,,,'y',,,,'垂直线索',,,,'down',,,,'MarkerSize',45)

扩展功能

C/C ++代码生成
Generate C and C++ code using MATLAB® Coder™.

版本历史记录

在R2020b中引入

也可以看看

功能

对象