Merging multiple double matrix into an Video
Show older comments
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)
Answers (1)
Walter Roberson
on 9 Feb 2019
0 votes
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 .
Categories
Find more on Video Formats and Interfaces in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!