• Remix
  • Share
  • New Entry

on 8 Nov 2023
  • 7
  • 28
  • 0
  • 2
  • 459
drawframe(48)
Write your drawframe function below
function drawframe(f)
% designed to look nice when looped with 48 frames
hh = imshow('peppers.png');
im = hh.CData;
x = [4 2 1 2 1 4 1 4 2 1];
y = [2 4 3 2 1 3 4 2 4 3];
num_points = length(x);
xx = interp1(1:num_points,x,1:0.1489:num_points,'spline');
yy = interp1(1:num_points,y,1:0.1489:num_points,'spline');
img_scale = [size(im,2) size(im,1)]/5;
h = drawellipse('AspectRatio',1,'Center',[xx(1), yy(1)] .* img_scale,...
'SemiAxes',img_scale/2,'Visible','off');
h.Center = [xx(f+7), yy(f+7)] .* img_scale;
BW = createMask(h);
hh.CData = im .* uint8(BW);
end
Animation
Remix Tree