Deleting Background Image After Interpolation
Show older comments
Dear All,
As the question suggests, I need to know how to clear the background image after I plotted the interpolated curve.
if true
rgb = imread('leaf.jpg');
figure
imshow(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 off
clf(rgb)
% code
end
Thanks to all! :)
Accepted Answer
More Answers (0)
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!