How to save a 3D convex hull without displaying it

조회 수: 1 (최근 30일)
no_nickname
no_nickname 2015년 5월 19일
답변: Sean de Wolski 2015년 5월 19일
I used the convhull function to get the convex hull of my 3D image. I'd like to save it as few .png files, but without displaying it as a matlab figure.
I'd like to do something like this:
K = convhull(myPixelLis, 'simplify', true);
myConvexHull = zeros(size(image));
myConvexHull(K == 1) = 1;
for i =1:size(image, 3)
imwrite(myConvexHull(:,:,i), ['path', num2str(i), '.png'],'.png');
end
The code doesn't work, because K isn't a list of pixel indexes. But how can properly I do it?

답변 (1개)

Sean de Wolski
Sean de Wolski 2015년 5월 19일
Use poly2mask to build the convex image from the points list and then write it out.

카테고리

Help CenterFile Exchange에서 Bounding Regions에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by