aviObject = avifile('Myvid1.avi')
for ctr = 441:500
iFrame = clock;
fname = ['IMG' num2str(ctr),'.PNG'];
I = imread(fname);
F = im2frame(I);
aviObject = addframe(aviObject,I);
elapsed = etime(clock, iFrame);
pause(5 - elapsed);
end
aviObject = close(aviObject); This is my code to create video from frames.. It shows error..
??? Error using ==> im2frame Indexed movie frame must have a non-empty colormap
Why..? My images are 600*800uint8 type..
No products are associated with this question.
[I, cmap] = imread(fname); F = im2frame(I, cmap);
still problem.. colormap is empty for image.
cmap = []
This is the image
Before the loop:
cmap = gray(256);
Then in the loop,
I = imread(fname); F = im2frame(I, cmap);
0 Comments