Main Content

selectWorldPoints

Select world points from world point set

Since R2024a

Description

example

wpSetSelected = selectWorldPoints(wpSet,pointIds) selects world points from wpSet using the identifiers in pointIds. 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);

Generate point IDs.

pointIds = randperm(100);

Create a worldpointset object.

wpSet = worldpointset
wpSet = 
  worldpointset with properties:

                   WorldPoints: [0×3 single]
                       ViewIds: [1×0 uint32]
                      PointIds: [1×0 uint32]
              ViewingDirection: [0×3 single]
                DistanceLimits: [0×2 single]
          RepresentativeViewId: [0×1 double]
    RepresentativeFeatureIndex: [0×1 double]
                         Count: 0
               Correspondences: [0×3 table]

Add the world points to the world point set.

wpSet = addWorldPoints(wpSet,worldPoints,pointIds);

Select the first 50 points in the point set.

points = selectWorldPoints(wpSet,pointIds(1:50))
points = 50×3 single matrix

    0.1577    0.6827    0.6699
    0.1665    0.2842    0.4921
    0.9152    0.5038    0.7163
    0.1393    0.0580    0.1907
    0.6703    0.1710    0.7205
    0.5399    0.2495    0.9283
    0.8973    0.5022    0.7917
    0.9272    0.5898    0.0153
    0.2026    0.0748    0.2160
    0.1765    0.1055    0.2241
      ⋮

Input Arguments

collapse all

World point set, specified as a worldpointset object.

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

Output Arguments

collapse all

Selected 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 R2024a