読み取った動画を1フレーム分表示させると、トリミングされて引き伸ばされてしまいます。
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
下記コードを実行すると添付のファイルのように、画像がトリミングされた上に引き伸ばされてしまいます。 別のMatlabでは問題なく実行できたので設定が原因と思うのですが、どうしても原因がわからなかったので質問します。
vidObj = VideoReader('xylophone.mp4');
vidHeight = vidObj.Height;
vidWidth = vidObj.Width;
s = struct('cdata',zeros(vidHeight,vidWidth,3,'uint8'),'colormap',[]);
k = 1;
while hasFrame(vidObj)
s(k).cdata = readFrame(vidObj);
k = k+1;
end
image(s(1).cdata)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/190727/image.png)
0 commentaires
Réponses (1)
Tohru Kikawada
le 22 Mai 2018
image(s(1).cdata) を imshow(s(1).cdata) としてお試しください。アスペクト比が保持されると思います。
7 commentaires
Voir également
Catégories
En savoir plus sur オーディオとビデオ dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!