MATLAB Answers

I want to load a video and extract frames from it, save them and then use rgb2gray, edge detection and matching on specific frames...what will be the MATLAB commands for it??

조회 수: 20(최근 30일)
VideoReader

  댓글 수: 0

로그인 to comment.

채택된 답변

Florian Morsch
Florian Morsch 24 May 2018
To load a video: videoFileReader = vision.VideoFileReader('Video.avi');
Take a frame from the video: videoFrame = step(videoFileReader);
RGB to gray: videoFrameGray = rgb2gray(videoFrame);
Edge detection (canny or sobel): sobelEdge = edge(image,'sobel'); cannyEdge = edge(image,'canny');
For matching you have to set the features yourself and then check the frames you want for the features.

  댓글 수: 2

SURILA GUGLANI
SURILA GUGLANI 24 May 2018
Is this only for one frame?? Or will it work for Different frames altogether?
Florian Morsch
Florian Morsch 24 May 2018
If you use
videoFrame = step(videoFileReader);
thats only for one frame. If you want it for multiple frames you can use a while-loop with a condition. For example you can create a while-loop which runs as long as you video is playing. When the video is finished, the loop ends, like this:
while ~isDone(videoFileReader)
% Do something
end
Also dont forget to release the file reader and if you display it, also the video player.

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.

제품


릴리스

R2017a

Translated by