Extracting points from polyshape

4 Ansichten (letzte 30 Tage)
MaryD
MaryD am 8 Jun. 2021
Beantwortet: darova am 24 Jul. 2021
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 ?

Antworten (1)

darova
darova am 24 Jul. 2021
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)

Kategorien

Mehr zu Elementary Polygons finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by