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