MATLAB Answers

video convert to PNG but black and white

4 views (last 30 days)
sunghyun chung
sunghyun chung on 29 Nov 2019
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
=================================================================================

  0 Comments

Sign in to comment.

Answers (1)

Constantino Carlos Reyes-Aldasoro
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

  0 Comments

Sign in to comment.

Sign in to answer this question.