How to get RGB-values out of video frames using VideoReader-function. When reading an individual frame using impixel-function I get only 3 times zero for RGB.
古いコメントを表示
videoObject = VideoReader('TypeI_4_1_TestClipped.wmv');
imageData = read(videoObject);
numFrames = get(videoObject, 'NumberOfFrames');
Heig= get(videoObject, 'Height');
Wid= get(videoObject, 'Width');
Rateframe= get(videoObject, 'FrameRate');
time=get(videoObject, 'Duration');
% To cut down the time for this trial height and width are reduced
Wid=200;
Heig=100;
Hii = Heig*(ones(1,Wid));
mov(10).cdata = read(videoObject,10);
P1=impixel(mov(10).cdata,wii,Hii);
% or
imagedata=read(videoObject,10);
P2=impixel(mov(10).cdata,wii,Hii);
% Both P1 and P2 appear to became 200 x 3 full of zeros
4 件のコメント
Walter Roberson
2015 年 6 月 30 日
What is wii ?
The code is demonstrating that you can read into a "movie" structure or that you can treat the data as "one frame at a time". The same content is going to go into mov(10).cdata and to imagedata so you would expect the same results.
Dinesh Iyer
2015 年 7 月 1 日
Can you examine the output of VideoReader/read using
imshow(imageData(:, :, :, 2)) % 2 can be replaced by any valid index
before modifying it in your code?
Pekka Koivisto
2015 年 7 月 2 日
Pekka Koivisto
2015 年 7 月 3 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Develop Apps Using App Designer についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!