Absolute poses associated with views in view set
sensorPoses = poses(vSet)
example
sensorPoses = poses(vSet) returns a table of absolute poses associated with the views contained in the view set, vSet.
sensorPoses
vSet
collapse all
Load images into the workspace.
imageDir = fullfile(toolboxdir('vision'),'visiondata','structureFromMotion'); images = imageDatastore(imageDir);
Compute features for the first image.
I = rgb2gray(readimage(images,1)); pointsPrev = detectSURFFeatures(I); [featuresPrev,pointsPrev] = extractFeatures(I,pointsPrev);
Create an image view set and add the extracted feature points to the image view set.
vSet = imageviewset; vSet = addView(vSet,1,'Points',pointsPrev);
Compute features and matches for the rest of the images.
for i = 2:numel(images.Files) I = rgb2gray(readimage(images,i)); points = detectSURFFeatures(I); [features,points] = extractFeatures(I,points); vSet = addView(vSet,i,'Features',features,'Points',points); pairsIdx = matchFeatures(featuresPrev,features); vSet = addConnection(vSet,i-1,i,'Matches',pairsIdx); featuresPrev = features; end
Get absolute poses.
sensorPoses=5×2 table ViewId AbsolutePose ______ _____________ 1 [1x1 rigid3d] 2 [1x1 rigid3d] 3 [1x1 rigid3d] 4 [1x1 rigid3d] 5 [1x1 rigid3d]
imageviewset
Image view set, specified as an imageviewset object.
Absolute poses, returned as a two-column table. The table contains columns as described in this table.
ViewID
AbsolutePose
rigid3d
You have a modified version of this example. Do you want to open this example with your edits?