Main Content

findTracks

(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 Version History.

Description

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

example

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

Examples

collapse all

Load images.

imageDir = fullfile(toolboxdir('vision'),'visiondata','structureFromMotion');
imds = imageDatastore(imageDir);

Compute features for the first image.

I = rgb2gray(read(imds));
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:length(imds.Files)
 I = rgb2gray(read(imds));
 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);

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.