Main Content

addCorrespondences

Update world points in a world point set

Since R2020b

Description

wpSet = addCorrespondences(wpSet,viewId,pointIndices,featureIndices) adds correspondences between 3-D world points and 2-D feature points to the world point set wpSet, using the point indices pointIndices and the feature indices featureIndices for the specified view viewId. Use this syntax if you added points using the addWorldPoints function without specifying unique point identifiers pointIds.

example

wpSet = addCorrespondences(wpSet,viewId,pointIds,featureIndices) adds correspondences between 3-D world points and 2-D feature points to the world point set wpSet, using the point identifiers pointIds and the feature indices featureIndices for the specified view viewId. Use this syntax if you added points using the addWorldPoints function by specifying unique point identifiers pointIds.

Examples

collapse all

Generate 3-D world points.

worldPoints = rand(100,3);

Create a worldpointset object.

wpSet = worldpointset;

Add world points.

wpSet = addWorldPoints(wpSet,worldPoints);

Add correspondences to View 1 for the first 10 points.

viewId = 1;
pointIndices   = 1:10;
featureIndices = 1:10;
wpSet  = addCorrespondences(wpSet,viewId,pointIndices,featureIndices);

Generate 3-D world points.

worldPoints = rand(100,3);

Generate pointIds.

pointIds = randperm(100);

Create a worldpointset object.

wpSet = worldpointset;

Add world points.

wpSet = addWorldPoints(wpSet,worldPoints,pointIds);

Add correspondences to View 1 for the first 10 points.

viewId = 1;
featureIndices = 1:10;
wpSet  = addCorrespondences(wpSet,viewId,pointIds(1:10),featureIndices);

Input Arguments

collapse all

World point set, specified as a worldpointset object.

View identifier, specified as a scalar.

Identifiers for 3-D points in wpSet, specified as an M-element row vector of integers.

World point indices, specified as an M-element column vector of integers. M is the number of world points for which you are adding correspondences.

Feature point indices, specified as an M-element column vector of integers. M is the number of world points for which you are adding correspondences.

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 R2020b