DocumentationHelp CenterDocumentation
Class: sphereModel
Plot sphere in a figure window
plot(model)
plot(model,'Parent',ax)
H = plot(model) plots a sphere in the current figure. H is the handle to surf, a 3-D shaded surface plot.
H
model
surf
H = plot(model,'Parent',ax) additionally allows you to specify an output axes.
'Parent'
ax
expand all
Parametric sphere model returned by sphereModel.
sphereModel
gca
Output axes, specified as the comma-separated pair of 'Parent' and the current axes for displaying the visualization.
Load point cloud.
load('object3d.mat');
Display point cloud.
figure pcshow(ptCloud) xlabel('X(m)') ylabel('Y(m)') zlabel('Z(m)') title('Detect a sphere in a point cloud')
Set the maximum point-to-sphere distance (1cm), for sphere fitting.
maxDistance = 0.01;
Set the region of interest to constrain the search.
roi = [-inf, 0.5; 0.2, 0.4; 0.1, inf]; sampleIndices = findPointsInROI(ptCloud, roi);
Detect the globe in the point cloud and extract it.
model = pcfitsphere(ptCloud, maxDistance, 'SampleIndices', sampleIndices);
Plot the sphere.
hold on plot(model)
pcfitsphere | sphereModel
pcfitsphere
You have a modified version of this example. Do you want to open this example with your edits?
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office