Extracting points from polyshape

4 次查看(过去 30 天)
MaryD
MaryD 2021-6-8
回答: darova 2021-7-24
I have a figure defined as polyshape and I want to create pointcloud representing full boundary and inside of polygon, not only vertices. The only idea i have for now is to fill polygon in black, open plot as bw image and get th coordinates of the black pixels. Is there any method to do that better? If no, can I 'save' the plot as an image directly to worspace ?

回答(1 个)

darova
darova 2021-7-24
See this link about curve interpolation: LINK
Saving the data as a picture is a good idea too: try print
x = 0:20;
y = sin(x);
plot(x,y)
% make axes invisible
set(gca,'Xcolor','w', ...
'Ycolor','w', ...
'xtick',[], ...
'ytick',[])
I0 = print('-RGBImage','-r300'); % returns an image with 300 dots per inch resolution
I1 = im2bw(I0);
imshow(I1)

类别

Help CenterFile Exchange 中查找有关 Elementary Polygons 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by