ビデオファイルをグレースケールに変換しようとしています。 Matlabスクリプトを実行しようとすると、「無効なビデオデータ - 数値または論理データ型でなければならない」というメッセージが表示されます。誰かが私が間違っていることで私を助けることができますか?私はまた、MATLABに新しいです。ビデオをmatlabのグレースケールに変換する
filename = 'Project1.m4v';
vid = VideoReader(filename);
newVid = VideoWriter('NewVid');
open(newVid);
numFrames = vid.NumberOfFrames;
for frame = 1 : numFrames
% Extract the frame from the movie structure.
thisFrame = read(vid, frame);
%Convert each frame to black and white
gray = rgb2gray(thisFrame);
writeVideo(newVid,gray);
end
close(newVid);
implay(newVid);
(http://stackoverflow.com/questions/22306581/convert-color-video-to-grayscale-video-in-matlab)MATLABで階調映像をカラー映像に変換]の可能な重複 –