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 Compatibility Considerations.

Description

example

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

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

Examples

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

Compatibility Considerations

expand all

Not recommended starting in R2020a

Introduced in R2016a