Main Content

findViewsOfWorldPoint

Find views that observe a world point

Since R2020b

Description

example

viewIds = findViewsOfWorldPoint(wpSet,pointIndices) finds the identifiers for views viewIds that observe the 3-D world points specified by pointIndices in a world point set wpSet. Use this syntax if you added points using the addWorldPoints function without specifying unique point identifiers pointIds. Use this syntax if you added points using the addWorldPoints function without specifying unique point identifiers pointIds.

[viewIds,featureIndices] = findViewsOfWorldPoint(wpSet,pointIndices) additionally returns the indices of the 2-D feature points that correspond to each 3-D world point for each associated view. Use this syntax if you added points using the addWorldPoints function without specifying unique point identifiers pointIds.

viewIds = findViewsOfWorldPoint(wpSet,pointIds) finds the identifiers for views viewIds that observe the 3-D world points specified by pointIds in a world point set wpSet. Use this syntax if you added points using the addWorldPoints function by specifying unique point identifiers pointIds.

[viewIds,featureIndices] = findViewsOfWorldPoint(wpSet,pointIds) additionally returns the indices of the 2-D feature points that correspond to each 3-D world point for each associated view. 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 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 views of world points.

pointIndex = 6:10;
viewIds = findViewsOfWorldPoint(wpSet,pointIndex);

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 views of world points.

viewIds = findViewsOfWorldPoint(wpSet,pointIds(6:10))
viewIds=5×1 cell array
    {2x1 uint32}
    {2x1 uint32}
    {2x1 uint32}
    {2x1 uint32}
    {2x1 uint32}

Input Arguments

collapse all

World point set, specified as a worldpointset object.

World point indices, specified as a scalar or an N-element vector of integers. This input is valid when sequential indices are used for the points in the wpSet object.

World point identifiers, specified as an M-element vector of integers. M is the number of world points. This input is valid when points were added using addWorldPoints.

Output Arguments

collapse all

View identifiers, returned as an M-element column vector or N-element cell array. The function returns an M-element vector column, where M is the number of views that observe the world point, when pointIndex is a scalar. The function returns an N-element cell array when pointIndex is an N-element vector of integers. Each cell contains a column vector of the view identifiers for the associated world point.

2-D feature point indices, returned as an M-element column vector or N-element cell array. The function returns an M-element vector column, where M is the number of views that observe the world point, when pointIndex is a scalar. The function returns an N-element cell array when pointIndex is an N-element vector of integers. Each cell contains a column vector of the corresponding feature indices for the associated world point.

Extended Capabilities

Version History

Introduced in R2020b