How to save/write video ??
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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._
0 commentaires
Réponses (1)
Image Analyst
le 10 Mai 2018
You need to use VideoWriter, not vision.VideoPlayer. See attached demos.
Voir également
Catégories
En savoir plus sur Computer Vision Toolbox dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
