Main Content

updateRepresentativeView

Update representative view ID and corresponding feature index

Since R2022b

Description

wpSet = updateRepresentativeView(wpSet,pointIndices,viewTable) updates representative view ID and corresponding feature index of world points in the world point set object, wpSet. The representative view is based on a table of views, viewTable. pointIndices is the index to the world point related to the update. Use this syntax if you added points using the addWorldPoints function without specifying unique point identifiers pointIds.

example

wpSet = updateRepresentativeView(wpSet,pointIds,viewTable) updates representative view ID and corresponding feature point identifier of world points in the world point set object, wpSet. The representative view is based on a table of views, viewTable. pointIds is the point identifier to the world point related to the update. Use this syntax if you added points using the addWorldPoints function by specifying unique point identifiers pointIds.

Examples

collapse all

Create an imageviewset object.

vSet = imageviewset;

Add three views related to binary features.

viewId1 = 1;
features1 = binaryFeatures(randi(255,[10, 32],"uint8"));
vSet = addView(vSet,viewId1,Features=features1);
viewId2 = 2; 
features2 = binaryFeatures(randi(255,[10, 32],"uint8"));
vSet = addView(vSet,viewId2,Features=features2);
viewId3 = 3;
features3 = binaryFeatures(randi(255,[10, 32],"uint8"));
vSet = addView(vSet,viewId3,Features=features3);

Create a worldpointset object and add world points

wpSet = worldpointset;
worldPoints = rand(10, 3); % Add world points
wpSet = addWorldPoints(wpSet, worldPoints);

Add correspondences for three views.

pointIndices= 1:10; 
featureIndices1 = randperm(10);
wpSet  = addCorrespondences(wpSet,viewId1,pointIndices,featureIndices1);
featureIndices2 = randperm(10);
wpSet  = addCorrespondences(wpSet,viewId2,pointIndices,featureIndices2);
featureIndices3 = randperm(10);
wpSet  = addCorrespondences(wpSet,viewId3,pointIndices,featureIndices3);

Update representative view.

viewTable = findView(vSet, [viewId1,viewId2,viewId3]);
wpSet = updateRepresentativeView(wpSet,pointIndices,viewTable);

Check representative view ID and feature index.

wpSet.RepresentativeViewId
ans = 10×1

     1
     3
     1
     2
     3
     3
     1
     3
     1
     2

wpSet.RepresentativeFeatureIndex
ans = 10×1

     9
     1
     8
     2
     6
     2
     2
     4
    10
     3

Create an imageviewset object.

vSet = imageviewset;

Add three views related to binary features.

viewId1 = 1;
features1 = binaryFeatures(randi(255,[10, 32],"uint8"));
vSet = addView(vSet,viewId1,Features=features1);
viewId2 = 2; 
features2 = binaryFeatures(randi(255,[10, 32],"uint8"));
vSet = addView(vSet,viewId2,Features=features2);
viewId3 = 3;
features3 = binaryFeatures(randi(255,[10, 32],"uint8"));
vSet = addView(vSet,viewId3,Features=features3);

Create a worldpointset object and add world points

wpSet = worldpointset;
worldPoints = rand(10, 3); % Add world points
pointIds = randperm(10);
wpSet = addWorldPoints(wpSet, worldPoints, pointIds);

Add correspondences for three views.

featureIndices1 = randperm(10);
wpSet  = addCorrespondences(wpSet,viewId1,pointIds,featureIndices1);
featureIndices2 = randperm(10);
wpSet  = addCorrespondences(wpSet,viewId2,pointIds,featureIndices2);
featureIndices3 = randperm(10);
wpSet  = addCorrespondences(wpSet,viewId3,pointIds,featureIndices3);

Update representative view.

viewTable = findView(vSet, [viewId1,viewId2,viewId3]);
wpSet = updateRepresentativeView(wpSet,pointIds,viewTable);

Check representative view ID and feature index.

wpSet.RepresentativeViewId
ans = 10×1

     1
     2
     2
     2
     2
     1
     1
     2
     1
     3

wpSet.RepresentativeFeatureIndex
ans = 10×1

     9
     1
     9
     3
     6
    10
     6
     4
     5
     7

Input Arguments

collapse all

World point set, specified as a worldpointset object.

Point index, specified as an M-element column vector of integers, where M is the number of world points. The function updates the representative view ID and corresponding feature index of the point that corresponds to the specified index.

World point identifiers, returned as an M-element vector of integers. M is the number of world points. The function updates the representative view ID and corresponding feature point identifier of the point that corresponds to the specified index. Use this input when points were added using addWorldPoints.

One or more connected or indirectly connected views, specified as a four-column table. The table must contain the columns as described in this table.

ColumnDescription
ViewIdView identifier for the view, specified as a unique integer
AbsolutePoseAbsolute pose of the view, specified as a rigidtform3d object.
FeaturesFeature vectors, specified as an M-by-N matrix of M feature vectors or as a binaryFeatures.
Points

Image points, specified as one of these options:

  • M-by-2 matrix of coordinates in the format [x,y]

  • M-element feature point array.

For more details, see Point Feature Types.

Output Arguments

collapse all

World point set, returned as a worldpointset object.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2022b