Main Content

poses

Absolute poses associated with views in view set

Description

example

sensorPoses = poses(vSet) returns a table of absolute poses associated with the views contained in the view set, vSet.

Examples

collapse all

Load images into the workspace.

imageDir = fullfile(toolboxdir("vision"),"visiondata","structureFromMotion");
images = imageDatastore(imageDir);

Compute features for the first image.

I = im2gray(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 = im2gray(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 the absolute poses.

sensorPoses = poses(vSet)
sensorPoses=5×2 table
    ViewId      AbsolutePose  
    ______    ________________

      1       1×1 rigidtform3d
      2       1×1 rigidtform3d
      3       1×1 rigidtform3d
      4       1×1 rigidtform3d
      5       1×1 rigidtform3d

Input Arguments

collapse all

Image view set, specified as an imageviewset object.

Output Arguments

collapse all

Absolute poses, returned as a two-column table. The table contains columns as described in this table.

ColumnDescription
ViewIDView identifier, returned as a positive integer. View identifiers are unique to a specific view.
AbsolutePoseAbsolute pose of the view, returned as a rigidtform3d object.

Extended Capabilities

Version History

Introduced in R2020a

expand all

See Also

Objects