addView
Description
Examples
Add Features and Segments to a Map
Create a map representation to hold point cloud segments and features.
sMap = pcmapsegmatch('CentroidDistance',1);
Load point cloud scans.
data = load('fullParkingLotData.mat');
ptCloudScans = data.fullParkingLotData;
Set the radius to select a cylindrical neighborhood.
outerCylinderRadius = 30; innerCylinderRadius = 3;
Set the threshold parameters for segmentation.
distThreshold = 0.5; angleThreshold = 180;
Segment each point cloud and add the features and point cloud segments to the map.
for n = 1:numel(ptCloudScans); ptCloud = ptCloudScans(n); % Segment and remove the ground plane. groundPtsIdx = segmentGroundFromLidarData(ptCloud,'ElevationAngleDelta',11); ptCloud = select(ptCloud,~groundPtsIdx,'OutputSize','full'); % Select cylindrical neighborhood. dists = sqrt(ptCloud.Location(:,:,1).^2 + ptCloud.Location(:,:,2).^2); cylinderIdx = dists <= outerCylinderRadius ... & dists > innerCylinderRadius; ptCloud = select(ptCloud,cylinderIdx,'OutputSize','full'); % Segment the point cloud. [labels, numClusters] = segmentLidarData(ptCloud,distThreshold,angleThreshold,'NumClusterPoints',[50 5000]); % Extract features from the point cloud. [features,segments] = extractEigenFeatures(ptCloud,labels); % Add the features and segments to the map. sMap = addView(sMap,n,features,segments); end
Display the map of segments.
figure; show(sMap);
Input Arguments
sMapIn
— Original map of segments and features
pcmapsegmatch
object
Original map of segments and features, specified as a pcmapsegmatch
object.
viewId
— View identifier
positive integer
View identifier, specified as an integer. Each view identifiers is unique to a specific view.
features
— Eigenvalue-based features
vector of eigenFeature
objects
Eigenvalue-based features, specified as a vector of eigenFeature
objects. The function filters out features that already exist in the map are filtered
out as duplicates based on their centroid location and the distance specified by the
CentroidDistance
property of the map.
You should extract new features from only a point cloud registered to the point clouds of existing features
segments
— Point cloud segments
vector of pointCloud
objects
Point cloud segments, specified as a vector of pointCloud
objects. To use the show
object
function for visualization, you must specify this argument.
For improved performance, do not include segments
in the map
with findPose
and
updateMap
object functions. Alternatively, you can use the deleteSegments
object function to remove the existing segments before
using findPose
or
updateMap
.
Output Arguments
sMapOut
— Updated map of segments and features
pcmapsegmatch
object
Updated map of segments and features, returned as a pcmapsegmatch
object.
Version History
Introduced in R2021a
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)