How write this image with plotted boundary in a folder

1 次查看(过去 30 天)
figure;imshow(Img);
title('Hill Climbing Segmentation');
axis image; % Make sure image is not artificially stretched because of screen's aspect ratio.
hold on;
boundaries = bwboundaries(bw);
numberOfBoundaries = size(boundaries, 1);
for k = 1 : numberOfBoundaries
thisBoundary = boundaries{k};
plot(thisBoundary(:,2), thisBoundary(:,1), 'g', 'LineWidth', 2);
end
hold off;
have got this image want to write this image in directory with its boundary how to write,have used imwrite() in for loop but it write only image not image with boundary is not present

回答(1 个)

Image Analyst
Image Analyst 2015-7-1
You can use getimage() though it will just get a 24 bit RGB image of what's in the axes, so the graphics won't be burned in at the full image resolution. Though maybe that will be good enough for your needs. Then just call imwrite to write the image to disk:
displayedImage = getimage();
imwrite(displayedImage, fullFileName);

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by