Dear All,
As the question suggests, I need to know how to clear the background image after I plotted the interpolated curve.
if truergb = imread('leaf.jpg');figureimshow(rgb);axis([0 500 0 500]);hold on;xy = [];disp('Left mouse button picks points.')disp('Right mouse button picks last point.')p = 1; %Loop flag
n = 0; %Incrementer for points.
while p == 1 [xi,yi,p] = ginput(1); plot(xi,yi,'ro') n=n+1; xy(:,n) = [xi,yi];end%Interpolate with a Spline curve.
t = 1:n;ts = 1:0.1:n;xys = spline(t,xy,ts);% Plot the interpolated curve.
plot(xys(1,:),xys(2,:),'b-');hold offclf(rgb) % code
end
Thanks to all! 🙂
Best Answer