我有一个简单的matlab序列,旨在从uint16图像的集合中创建AVI电影:
video = VideoWriter( vidName );
video.FrameRate = ( frmRate );
open( video );
for i=1:size
img = imread( picNames(i).name );
writeVideo( video, img );
end
close( video );
这会产生错误IMG must be one of the following classes: double, single, uint8
。关于我如何解决这个问题的任何想法,而不会丧失精确或增加压缩?
您应该在writeVideo( video, img );
之前添加以下行:
img=im2double(img);
您不会失去精度。