Main Content

updateMap

Update centroid and point cloud segment locations in map

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.

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')

Figure contains an axes object. The axes object with title Initial Map contains an object of type scatter.

Define the transformation.

theta = 45; % degrees
rot = [cosd(theta) sind(theta) 0; ...
      -sind(theta) cosd(theta) 0; ...
            0           0      1];
trans = [100 200 0];
tform = rigid3d(rot,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')

Figure contains an axes object. The axes object with title Transformed Map contains an object of type scatter.

Input Arguments

collapse all

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

Transforms, specified as an M-element vector of rigid3d 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.

See Also

Functions

Objects

Introduced in R2021a