Created
January 29, 2016 05:40
-
-
Save rysk-t/35ee2cedac722d6ae0ac to your computer and use it in GitHub Desktop.
movie render example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % 画像 | |
| 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