how to change color space of any video

5 ビュー (過去 30 日間)
Awais Khan
Awais Khan 2019 年 4 月 24 日
コメント済み: Awais Khan 2019 年 4 月 24 日
how to change color space of any video, e.g video in rgb color space is converting into hsv or gray?

採用された回答

KSSV
KSSV 2019 年 4 月 24 日
vidObj = VideoReader('C:\Users\Public\Videos\Sample Videos\Wildlife.wmv'); % video file
%% Read the video frame by frame
numFrames = 0;
iwant = cell([],1) ;
while hasFrame(vidObj)
F = readFrame(vidObj);
numFrames = numFrames + 1;
imagesc(F)
drawnow
iwant{numFrames} = F ;
end
%% Write to video
v = VideoWriter('myFile','Archival');
v.VideoCompressionMethod
open(v)
for i = 1:numFrames
writeVideo(v,rgb2gray(iwant{i}))
end
close(v)
  3 件のコメント
KSSV
KSSV 2019 年 4 月 24 日
Read about videowriter. You may use some thing like below:
v = VideoWriter('newfile.avi','Motion JPEG AVI');
Awais Khan
Awais Khan 2019 年 4 月 24 日
done its working

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by