video convert to PNG but black and white

1 回表示 (過去 30 日間)
sunghyun chung
sunghyun chung 2019 年 11 月 29 日
Hello,
I would like convert video file to PNG file as below
video file is color, but when I do below script, PNG result is black and white
woud you please help me why I got that result?
thank you
=================================================================================
v = VideoReader('xxxxxx.mov');
mkdir images
while hasFrame(v)
A = readFrame(v);
filename = ['images\' sprintf('%03d',v.CurrentTime) '.png'];
imwrite(A,filename,'BitDepth',8);
imshow(A);
end
=================================================================================

回答 (1 件)

Constantino Carlos Reyes-Aldasoro
Constantino Carlos Reyes-Aldasoro 2019 年 11 月 29 日
It may be an issue with data types like double, uint8, etc. Instead of imshow try imagesc and also try
imshow(A/max(A(:)));
As it may be a problems of the scaling

カテゴリ

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