It is not clear with what format your video frames should start, so I assume that they are loaded into MATLAB as a structural array of movie frames (as described here ). I will create some examples of movie data (one image is repeated 200 times) to show you first how you can load the first frame into the image, and also create an image from the top and side edges of all your frames (for use as the top and side of the cuboid) :
M = repmat(im2frame(imread('peppers.png')),1,200); %
nFrames = numel(M); %
face1 = frame2im(M(1)); %
[R,C,D] = size(face1); %
face2 = zeros(R,nFrames,3,'uint8'); %
face3 = zeros(nFrames,C,3,'uint8'); %
for k = 1:nFrames %
img = frame2im(M(k)); %
face2(:,k,:) = img(:,end,:); %
face3(k,:,:) = img(1,:,:); %
end
, RGB, . , colormap FRAME2IM, RGB IND2RGB.
SURF:
offset = nFrames/sqrt(2); %
%
%
surf([0 C; 0 C],... %
[R R; 0 0],...
[0 0; 0 0],...
'FaceColor','texturemap',...
'CData',face1);
hold on; %
surf([C C+offset; C C+offset],... %
[R R+offset; 0 offset],...
[0 0; 0 0],...
'FaceColor','texturemap',...
'CData',face2);
surf([0 C; offset C+offset],... %
[R R; R+offset R+offset],...
[0 0; 0 0],...
'FaceColor','texturemap',...
'CData',face3);
axis equal %
view(2); %
axis off %
set(gcf,'Color','w'... %
'Position',[50 50 C+offset+20 R+offset+20]);
set(gca,'Units','pixels',... %
'Position',[10 10 C+offset R+offset]);
:
