Main Content

updateMap

Update centroid and point cloud segment locations in map

Since R2021a

Description

example

sMapOut = updateMap(sMapIn,tforms) updates the centroid and point cloud segment locations by applying the specified transformation tforms.

Examples

collapse all

Load a map of segments and features from a MAT file into the workspace.

data = load("segmatchMapFullParkingLot.mat");
sMap = data.segmatchMapFullParkingLot;

Visualize the map.

figure
show(sMap)

Change the viewing angle to top-view.

view(2)
title("Initial Map")

Define the transformation.

eulerAngles = [0 0 45]; % degrees
trans = [100 200 0];
tform = rigidtform3d(eulerAngles,trans);
numViews = numel(sMap.ViewIds);
tforms = repmat(tform,numViews,1);

Update the segments and features of each view with the defined transformation.

sMap = updateMap(sMap,tforms);

Visualize the transformed map.

figure
show(sMap)

Change the viewing angle to top-view.

view(2)
title("Transformed Map")

Input Arguments

collapse all

Original map of segments and features, specified as a pcmapsegmatch object.

Transformations, specified as an M-element vector of rigidtform3d objects. M is the number of views in the map.

Output Arguments

collapse all

Updated map of segments and features, returned as a pcmapsegmatch object. After the function updates the locations, it removes possible duplicates in the map based on the CentroidDistance property of the map.

The function resets the selected submap, specified by the SelectedSubmap property of the pcmapsegmatch object, to the extent of the map based on the centroid locations.

Tips

  • To improve performance, remove all segments from the map using the deleteSegments function.

Version History

Introduced in R2021a

expand all

See Also

Functions

Objects