This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

findTracks

Class: viewSet

Find matched points across multiple views

Syntax

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

Description

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.

Examples

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

Find point tracks.

tracks = findTracks(vSet);

Introduced in R2016a