Class: viewSet

Find matched points across multiple views


tracks = findTracks(vSet)
tracks = findTracks(vSet,viewIds)


tracks = findTracks(vSet) finds point tracks across multiple views.

tracks = findTracks(vSet,viewIds) finds point tracks across a subset of views.

Input Arguments

expand all

viewSet object.

Subset of views in the viewSet object, specified as a vector of integers.

Output Arguments

expand all

Point track objects, returned as an array of pointTrack objects. Each track contains 2-D projections of the same 3-D world point.


expand all

Load images.

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);

Create a viewSet object.

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;

Find point tracks.

tracks = findTracks(vSet);

Introduced in R2016a