Main Content


(To be removed) Find matched points across multiple views

The viewSet object and its findTracks function will be removed in a future release. Use the imageviewset object and its findTracks function instead. For more information, see Compatibility Considerations.



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

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


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

Input Arguments

collapse all

viewSet object.

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

Output Arguments

collapse all

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

Version History

Introduced in R2016a

collapse all

R2020a: findTracks function of viewSet object will be removed

The viewSet object and its findTracks function will be removed in a future release. Instead, manage views and pairwise connections between views of data using use the imageviewset object. Finds point track across views of the imageviewset object using its findTracks function.