Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % read first 5 frames of a video file
- vid = VideoReader('shuttle.avi');
- I = read(vid, [1 5]); % (a HxWx3x5 array)
- clear vid
- % coordinates
- [X,Y] = meshgrid(1:size(I,2), 1:size(I,1));
- Z = ones(size(I,1),size(I,2));
- % plot each slice as a texture-mapped surface
- % (truecolor RGB images stacked along the Z-dimension)
- for k=1:size(I,4)
- surface('XData',X-0.5, 'YData',Y-0.5, 'ZData',Z.*k, ...
- 'CData',I(:,:,:,k), 'EdgeColor','none', 'FaceColor','texturemap')
- end
- view(3), box on, axis tight square
- set(gca, 'YDir','reverse', 'ZLim',[0 size(I,4)+1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement