Why does VideoReader always interpret the coded Image frame as a RGB Value.

3 ビュー (過去 30 日間)
Pratik
Pratik 2017 年 8 月 8 日
コメント済み: Image Analyst 2017 年 8 月 15 日
Hello everyone. I am trying to use VideoReader to extract frames from a .avi file and display it. However everytime I try to use the following, >> Video = VideoReader('Filename1.avi'); >> Frame_50 = read(Video,50);
I do get the frame but when I display it its all messed up. I know that the codec I use has the Image matrix as a 16 bit value e.g 512*512(16 bit value). However I get the image as a RGB value of 512*512*3. I am guessing that since VideoReader always treats it as a RGB it somehow messes things up and we do not get the correct Image Frame. The older Matlab versions had aviread() which worked perfectly fine returning a "cdata" value.
So any idea on how to tackle this would be appreciated.
  5 件のコメント
Pratik
Pratik 2017 年 8 月 8 日
This is the Messed up Image
Pratik
Pratik 2017 年 8 月 8 日

サインインしてコメントする。

回答 (1 件)

Sangeetha Jayaprakash
Sangeetha Jayaprakash 2017 年 8 月 15 日
Have you tried using "readFrame" function instead of "read"? You can try using "VideoFormat" when using the "readFrame" function to specify the desired format.
Refer this link for more information on this function:
  2 件のコメント
Pratik
Pratik 2017 年 8 月 15 日
Using "R2013b" which does not support "readFrame" function
Image Analyst
Image Analyst 2017 年 8 月 15 日
Can you upgrade?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by