Main Content

findWorldPointsInView

Find world points observed in view

Since R2020b

Description

pointIndices = findWorldPointsInView(wpSet,viewId) finds the indices of the 3-D world points pointIndices observed in the specified view viewId. Use this syntax if you added points using the addWorldPoints function without specifying unique point identifiers pointIds.

example

pointIds = findWorldPointsInView(wpSet,viewId) finds the point identifiers of the 3-D world points pointIds observed in the specified view viewId. Use this syntax if you added points using the addWorldPoints function by specifying unique point identifiers pointIds.

[___,featureIndices] = findWorldPointsInView(wpSet,viewId) additionally returns the indices of the corresponding 2-D feature points in the view.

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 3-D to 2-D correspondences for view 1.

viewId1 = 1;
pointIndices1   = 1:10;
featureIndices1 = 1:10;
wpSet  = addCorrespondences(wpSet,viewId1,pointIndices1,featureIndices1);

Add 3-D to 2-D correspondences for view 2.

viewId2 = 2;
pointIndices2   = 6:10;
featureIndices2 = 1:5;
wpSet  = addCorrespondences(wpSet,viewId2,pointIndices2,featureIndices2);

Find world points in view 2.

[pointIndices,featureIndices] = findWorldPointsInView(wpSet,viewId2)
pointIndices = 5×1

     6
     7
     8
     9
    10

featureIndices = 5×1

     1
     2
     3
     4
     5

Generate 3-D world points and point Ids.

worldPoints = rand(100,3);
pointIds = randperm(100);

Create a worldpointset object.

wpSet = worldpointset;

Add world points.

wpSet = addWorldPoints(wpSet,worldPoints,pointIds);

Add 3-D to 2-D correspondences for view 1.

viewId1 = 1;
featureIndices1 = 1:10;
wpSet  = addCorrespondences(wpSet,viewId1,pointIds(1:10),featureIndices1);

Add 3-D to 2-D correspondences for view 2.

viewId2 = 2;
featureIndices2 = 1:5;
wpSet  = addCorrespondences(wpSet,viewId2,pointIds(6:10),featureIndices2);

Find world points in view 2.

[pointIdsInView,featureIndices] = findWorldPointsInView(wpSet,viewId2);

Input Arguments

collapse all

World point set, specified as a worldpointset object.

View identifier, specified as a scalar or an N-element vector. N is the number of views specified. The dimensions of the pointIndices and featureIndices arguments depends on the value of the viewId argument.

viewIdpointIndicesfeatureIndices
scalarM-element column vectorM-element column vector
N-element arrayN-element cell array N-element cell array

Output Arguments

collapse all

3-D world point indices, returned as an M-element column vector or an N-element cell array. M is the number of world points with corresponding feature points in the specified view. N is the number of views specified, and each element of the cell array contains a column vector of the world point indices with corresponding feature points in the associated view. This output is valid when sequential indices are used for the points in the wpSet object.

World point identifiers, returned as an M-element vector of integers. M is the number of world points found from the wpSet object. This output is valid when points were added using addWorldPoints.

2-D feature point indices, returned as an M-element column vector or an N-element cell array. M is the number of world points with corresponding feature points in the specified view. N is the number of views specified, and each element of the cell array contains a column vector of the feature point indices in the associated view with corresponding world points.

Extended Capabilities

Version History

Introduced in R2020b