I would like to have a vector graphics video output such that I can resize the window during the video play in Matlab 2016a. I would like to have similar characteristics as .eps 3 format in pictures but for video. Some overview of the pseudocode
- read picture data as .mat in 10 second chunks so you can choose any vector picture format which probably works in video
- have figure handles in
colormap(gray)
instead of storing pictures first toimgRGB
/imgPNG
/... with specific customizations - add figure handles
hFig
to the listsignal
- loop figure handles for video
where I am uncertain about having many figure handles in a list and looping them inside a major figure. It may not be possible.
My current approach with non-vectorised imgRGB
/imgPNG
/... which I would like to reject because of several problems with resizing window and zooming
imgRGB
is 15x15x3. Doingsignal=cat(2,signal,imgRGB);
increases signal to 15x30x3, ..., 15x15Nx3, which does not seem to be a good way in storing many pictures.
Pseudocode
%% Make vector graphics pictures that are parts of the video
signal=[];
for k=1:3
A=load(filenameMat); % = A.time, A.potential, A.matrix
% TODO convert to some vector form each picture which should work in video too
% I can make N .eps pictures and figure handle to all of them.
% So probably having a list of those figure handles is the way to go.
hFig=figure(); % but not sure if possible with vectorised video play
signal=cat(2,signal,hFig); % pseudo
end
%% Put parts together in the main Figure i.e. video
% http://stackoverflow.com/a/29952648/54964
windowWidth = 320;
hFig=figure('Menubar','figure', 'NumberTitle','off', 'Color','k', 'Visible', 'on');
hImg = imshow(signal(:,1:1 + windowWidth,:), ...
'InitialMagnification', 100, 'Border', 'tight');
vid = VideoWriter('signal.avi');
vid.Quality = 100;
vid.FrameRate = 60;
open(vid);
M = size(signal,2);
for k=1:(M - windowWidth)
set(hImg, 'CData', signal(:,k:k + windowWidth,:))
writeVideo(vid, getframe());
end
close(vid);
How can you have vector graphics video output in Matlab?