Object for managing data for structure-from-motion and visual odometry
vSet = viewSet
The viewSet object will be removed in a future release. Use the
imageviewset object instead.
vSet = viewSet
viewSet object that stores views and connections
between views. A view includes feature points and an absolute camera
pose. A connection between two views includes point correspondences
and the relative camera pose between them. Once you populate a
you can use it to find point tracks across multiple views and retrieve
the camera poses to be used by
Code Generation Support:
Supports Code Generation: No
Supports MATLAB Function block: No
These properties are read-only.
NumViews— Number of views
Number of views, stored as an integer.
Views— View attributes
View attributes, stored as a four-column table. The table contains
Location. Use the
to obtain the IDs, orientation, and location for the points.
Connections— Pairwise connections between views
Pairwise connections between views, stored as a five-column
table. The columns are
RelativeLocation. The number of entries in
the table represent the number of connections. Each index in the
represents a connection between the two views indicated by the view
vSet— View set object
viewSet object used to store views and connections
between the views.
|addConnection||Add a connection between two views|
|addView||Add a new view to view set object|
|deleteConnection||Delete a connection between two views from view set object|
|deleteView||Delete an existing view from view set object|
|findTracks||Find matched points across multiple views|
|hasConnection||Check if a connection exists between two views|
|hasView||Check if view exists|
|poses||Returns camera poses associated to views|
|updateConnection||Modify a connection between two views in a view set object|
|updateView||Modify an existing view in a view set object|
imageDir = fullfile(toolboxdir('vision'),'visiondata','structureFromMotion'); images = imageSet(imageDir);
Compute features for the first image.
I = rgb2gray(read(images, 1)); pointsPrev = detectSURFFeatures(I); [featuresPrev,pointsPrev] = extractFeatures(I,pointsPrev);
vSet = viewSet; vSet = addView(vSet,1,'Points',pointsPrev);
Compute features and matches for the rest of the images.
for i = 2:images.Count I = rgb2gray(read(images,i)); points = detectSURFFeatures(I); [features, points] = extractFeatures(I,points); vSet = addView(vSet,i,'Points',points); pairsIdx = matchFeatures(featuresPrev,features); vSet = addConnection(vSet,i-1,i,'Matches',pairsIdx); featuresPrev = features; end
Find point tracks.
tracks = findTracks(vSet);