How can I change movie to gray (frame by frame)?
2 ビュー (過去 30 日間)
古いコメントを表示
I know there are probably easier methods but it must be frame by frame
this is what I have:
movi = VideoReader('xylophone.mpg');
nFrames = movi.NumberOfFrames;
vidHeight = movi.Height;
vidWidth = movi.Width;
mov(1:nFrames) = ... struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),... 'colormap', []);
for k = 1 : nFrames
poj_ramka=mov(k).cdata;
funkcja=zad(poj_ramka);
kraw=uint8(funkcja)*255;
kraw=cat(3,kraw,kraw,kraw);
mov(k)=struct('cdata',kraw,'colormap',[]);
end
okno=figure;
set(okno,'position',[150 150 vidWidth vidHeight]);
movie(okno,mov,1,25);
and zad.m file:
function[obraz]=zad(poj_ramka)
obraz=rgb2gray(poj_ramka);
end
what i get is a black window :/
0 件のコメント
採用された回答
Image Analyst
2013 年 4 月 5 日
Why not just use rgb2gray() and im2frame():
kraw = rgb2gray(poj_ramka);
mov(k)= im2frame(kraw);
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!