Main Content

findTracks

Find matched points across multiple views

Description

example

tracks = findTracks(vSet) finds and returns point tracks across multiple views in the view set, vSet. Each track contains 2-D projections of the same 3-D world point.

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

tracks = findTracks(___,'MinTrackLength',trackLength) specifies the minimum length of the tracks.

Examples

collapse all

Load images

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

Compute features for the first image.

I = rgb2gray(readimage(images,1));
pointsPrev = detectSURFFeatures(I);
[featuresPrev, pointsPrev] = extractFeatures(I,pointsPrev);

Create an image view set object and add feature points of first image.

vSet = imageviewset;
vSet = addView(vSet,1,'Points',pointsPrev);

Compute features and matches for the rest of the images and add to the image view set.

for i = 2:numel(images.Files)
 I = rgb2gray(readimage(images,i));
 points = detectSURFFeatures(I);
 [features, points] = extractFeatures(I,points);
 vSet = addView(vSet, i,'Features',features,'Points',points);
 pairsIdx = matchFeatures(featuresPrev,features);
 vSet = addConnection(vSet,i-1,i,'Matches',pairsIdx);
 featuresPrev = features;
end

Find point tracks across the sequence of images.

tracks = findTracks(vSet);

Input Arguments

collapse all

Image view set, specified as an imageviewset object.

View identifiers, specified as a vector of positive integers. View identifiers are unique to a specific view.

Minimum length of the tracks, specified as a positive integer equal to or greater than 2.

Output Arguments

collapse all

Point tracks across multiple views, returned as a pointTrack object.

Introduced in R2020a