【发布时间】:2017-10-18 11:24:10
【问题描述】:
我有一个边界,我希望使用动画线散布图。如何控制/减慢此操作的速度?
脚本:
clc;
clear;
I = imread('http://dreamicus.com/data/key/key-01.jpg');
I = rgb2gray(I);
I=imcomplement(I);
level = graythresh(I);
BW = im2bw(I,level);
BW_filled = imfill(BW,'holes');
boundaries = bwboundaries(BW_filled);
figure,imshow(I);
b = boundaries{1};
plot(b(:,2),b(:,1),'b','LineWidth',2);
an = animatedline;
x=b(:,2);
y=b(:,1);
for k = 1:numel(x)
disp(k)
addpoints(an, x(k), y(k))
drawnow
% Wait for 0.1 seconds
pause(0.1)
end
【问题讨论】:
-
你检查过内置函数吗:pause
标签: matlab