(To be removed) Modify connection between two views in view set object
viewSet object and its
updateConnection function will be removed in a future release.
imageviewset object and its
updateConnection function instead. For more information, see Compatibility Considerations.
Update Connection Between Two Views in View Set Object
Create an empty
vSet = viewSet;
Read a pair of images.
imageDir = fullfile(toolboxdir('vision'),'visiondata','structureFromMotion'); I1 = rgb2gray(imread(fullfile(imageDir,'image1.jpg'))); I2 = rgb2gray(imread(fullfile(imageDir,'image2.jpg')));
Detect interest points in the two images.
points1 = detectSURFFeatures(I1); points2 = detectSURFFeatures(I2);
Add the points to the
vSet = addView(vSet, 1,'Points',points1); vSet = addView(vSet, 2,'Points',points2);
Extract feature descriptors.
features1 = extractFeatures(I1,points1); features2 = extractFeatures(I2,points2);
Match features and store the matches.
indexPairs = matchFeatures(features1, features2); vSet = addConnection(vSet,1,2,'Matches',indexPairs);
Update the connection to store a relative pose between the views.
vSet = updateConnection(vSet,1,2,'Orientation', eye(3),'Location',[1 0 0]);
Specify optional pairs of arguments as
the argument name and
Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name in quotes.
Matches — Indices of matched points between two views
Indices of matched points between two views, specified as the
comma-separated pair consisting of '
Matches' and an
Orientation — Orientation of the second camera relative to the first camera
Orientation of the second camera relative to the first camera,
specified as the comma-separated pair consisting of
Orientation' and a 3-by-3 matrix that
orientation of the second camera.
Location — Location of the second camera relative to the first camera
Location of the second camera relative to the first camera, specified
as the comma-separated pair consisting of
Location' and a three-element vector that
location of the second camera in the first camera’s coordinate
Version HistoryIntroduced in R2016a
updateConnection function of
viewSet object will be removed
Not recommended starting in R2020a