Merging multiple double matrix into an Video
显示 更早的评论
I am trying to merge a set of double matrix stored in a cell covstored into an .avi video. I want to preserve the double values while I store this(uncompressed). But when I try to run the following code, I get the error, Frames of type double must be in the range 0 to 1.
Note: The pixel values of all the matrices stored in covstored are already between the range 0 to 1. These matrices are color images and i want to preserve them in the same way.
workingDir = 'C:\Users\mruna\Documents\MATLAB\';
outputVideo = VideoWriter(fullfile(workingDir,'shuttle_out.avi'));
outputVideo.FrameRate = 30;
open(outputVideo)
for ii = 1:length(covstored)
imgi=double(covstored{ii}*255);
writeVideo(outputVideo,imgi)
end
close(outputVideo)
回答(1 个)
Walter Roberson
2019-2-9
0 个投票
avi cannot preserve double. If you need to preserve double you need to use DICOM or you need to use the file Exchange contribution to write floating point Tiff files, neither of which can create movies .
I do not know if there are any movie formats that support double precision; none of the movie formats supported by Mathworks handle floating point .
类别
在 帮助中心 和 File Exchange 中查找有关 Audio and Video Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!