How to save/write video ??
조회 수: 3 (최근 30일)
이전 댓글 표시
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
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Computer Vision Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
