How to save/write video ??

5 vues (au cours des 30 derniers jours)
umut
umut le 9 Mai 2018
Commenté : umut le 10 Mai 2018
foregroundDetector = vision.ForegroundDetector('NumGaussians', 3, 'NumTrainingFrames',50);
blobAnalysis = vision.BlobAnalysis('BoundingBoxOutputPort',true,...
'AreaOutputPort',false, 'CentroidOutputPort', false,...
'MinimumBlobArea', 150);
videoFWriter = vision.VideoFileWriter('myFile.avi','FrameRate',...
videoReader.info.VideoFrameRate)
videoReader = vision.VideoFileReader('hareket.avi');
fgPlayer = vision.VideoPlayer;
videoPlayer = vision.VideoPlayer;
while ~isDone(videoReader)
videoFrame = step(videoReader);
% figure,imshow(videoFrame);
foreground = step(foregroundDetector,videoFrame);
cleanForeground = imopen(foreground,strel('Disk',1));
bbox = step(blobAnalysis, cleanForeground);
result = insertShape(videoFrame, 'Rectangle', bbox, 'Color', 'green');
numCars = size(bbox, 1);
result = insertText(result, [10 10], numCars, 'BoxOpacity', 1, ...
'FontSize', 14);
% result = videoFrame;
step(videoPlayer,result);
a=step(videoPlayer,result);
step(videoFWriter,a)
% step(fgPlayer,cleanForeground);
end
step(videoFWriter);
release(videoPlayer);
ı want to save my new video with bounding box. I get an error on this line "a=step(videoPlayer,result);" and it's Error using vision.VideoPlayer/step _ Too many output arguments; 1 output(s) requested but only 0 output(s) available._

Réponses (1)

Image Analyst
Image Analyst le 10 Mai 2018
You need to use VideoWriter, not vision.VideoPlayer. See attached demos.
  1 commentaire
umut
umut le 10 Mai 2018
Sir i dont understand these demos. This my new video with bounding box. it play "step(videoPlayer,result);" with this.
how can i extract frames of this video. maybe this method can help me

Connectez-vous pour commenter.

Catégories

En savoir plus sur Computer Vision Toolbox 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!

Translated by