Main Content

removeWorldPoints

Remove world points from world point set

Since R2020b

Description

wpSet = removeWorldPoints(wpSet,pointIndices) removes the world points at the specified indices pointIndices from the world point set wpSet. Use this syntax if you added points using the addWorldPoints function without specifying unique point identifiers pointIds.

example

wpSet = removeWorldPoints(wpSet,pointIds) removes the world points specified by pointIDs from the world point set wpSet. 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 the world points to the world point set. Display the world point set.

[wpSet,newPointIndices] = addWorldPoints(wpSet,worldPoints);
wpSet
wpSet = 
  worldpointset with properties:

                   WorldPoints: [100x3 single]
                       ViewIds: [1x0 uint32]
                      PointIds: [1x0 uint32]
              ViewingDirection: [0x3 single]
                DistanceLimits: [0x2 single]
          RepresentativeViewId: [0x1 double]
    RepresentativeFeatureIndex: [0x1 double]
                         Count: 100
               Correspondences: [100x3 table]

Remove the first 50 world points from the world point set.

wpSet = removeWorldPoints(wpSet,newPointIndices(1:50))
wpSet = 
  worldpointset with properties:

                   WorldPoints: [50x3 single]
                       ViewIds: [1x0 uint32]
                      PointIds: [1x0 uint32]
              ViewingDirection: [0x3 single]
                DistanceLimits: [0x2 single]
          RepresentativeViewId: [0x1 double]
    RepresentativeFeatureIndex: [0x1 double]
                         Count: 50
               Correspondences: [50x3 table]

Generate 3-D world points.

worldPoints = rand(100,3);

Generate pointIds.

pointIds = randperm(100);

Create a worldpointset object.

wpSet = worldpointset;

Add the world points to the world point set. Display the world point set.

[wpSet,newPointIndices] = addWorldPoints(wpSet,worldPoints,pointIds);

wpSet

Remove the first 50 world points from the world point set.

wpSet = removeWorldPoints(wpSet,pointIds(1:50))
wpSet = 
  worldpointset with properties:

                   WorldPoints: [50x3 single]
                       ViewIds: [1x0 uint32]
                      PointIds: [16 67 75 39 12 5 27 54 47 62 80 89 77 95 83 30 71 14 29 11 53 56 64 2 55 52 9 87 44 15 24 8 93 7 85 18 23 70 92 63 91 42 48 41 13 68 86 50 34 59]
              ViewingDirection: [0x3 single]
                DistanceLimits: [0x2 single]
          RepresentativeViewId: [0x1 double]
    RepresentativeFeatureIndex: [0x1 double]
                         Count: 50
               Correspondences: [50x3 table]

Input Arguments

collapse all

World point set, specified as a worldpointset object.

World point indices, specified as an M-element vector of integers. M is the number of world points to remove from the worldpointset object. Use this input when sequential indices are used to identify points.

  • pointIds — Unique identifiers assigned to points when using the addWorldPoints to add points.

  • pointIndices — Sequential identifiers assigned to points.

Table showing sequential identifiers for each row of data, 1,2,3,4. In the second column, identifier integers for each row of data, 23, 82, 16, 103.

World point identifiers, specified as an M-element vector of integers. M is the number of world points to remove from the worldpointset object. Use this input if you used the addWorldPoints function when points were added.

  • pointIds — Unique identifiers assigned to points when using the addWorldPoints to add points.

  • pointIndices — Sequential identifiers assigned to points.

Table showing sequential identifiers for each row of data, 1,2,3,4. In the second column, identifier integers for each row of data, 23, 82, 16, 103.

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

expand all