Skip to content

Instantly share code, notes, and snippets.

@rysk-t
Created January 29, 2016 05:40
Show Gist options
  • Select an option

  • Save rysk-t/35ee2cedac722d6ae0ac to your computer and use it in GitHub Desktop.

Select an option

Save rysk-t/35ee2cedac722d6ae0ac to your computer and use it in GitHub Desktop.
movie render example
% 画像
im = imread('eight.tif');
imagesc(i); colormap gray; axis image; hold on
% dummy 視線データ
x = [linspace(50,125,50) linspace(125,200,50) linspace(200, 250, 50)];
y = [linspace(150,50,50) linspace(50,200,50) linspace(200,50,50)];
x = x+3*randn(size(x));
y = y+0*randn(size(y));
%%
writerObj = VideoWriter('eyelink.avi');
open(writerObj);
imagesc(im)
axis tight
set(gca,'nextplot','replacechildren');
set(gcf,'Renderer','zbuffer');
for i = 1:length(x)
imagesc(im); colormap gray; hold on
plot(x(i),y(i), '+r', 'MarkerSize', 25);
F = getframe(gca);
writeVideo(writerObj,F);
end
close(writerObj);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment