Setting up vision.VideoFileWriter in multiObjectTracking.
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I need to write my tracking results to a new video file but Function obj is not accepting the filewriter variable:
obj = setupSystemObjects();
...
function obj = setupSystemObjects()
% Initialize Video I/O
% Create objects for reading a video from a file, drawing the tracked
% objects in each frame, and playing the video.
% Create a video file reader.
obj.reader = vision.VideoFileReader('D4_17.avi');
% Create two video players, one to display the video,
% and one to display the foreground mask.
obj.videoPlayer = vision.VideoPlayer('Position', [20, 200, 700, 400]);
obj.maskPlayer = vision.VideoPlayer('Position', [740, 200, 700, 400]);
obj.videoFWriter = vision.VideoFileWriter('C:\Users\Daevin\Videos\Loop\test.avi', ...
'FrameRate', videoFReader.info.VideoFrameRate');
% Create system objects for foreground detection and blob analysis
% The foreground detector is used to segment moving objects from
% the background. It outputs a binary mask, where the pixel value
% of 1 corresponds to the foreground and the value of 0 corresponds
% to the background.
obj.detector = vision.ForegroundDetector('NumGaussians', 3, ...
'NumTrainingFrames', 40, 'MinimumBackgroundRatio', 0.7);
% Connected groups of foreground pixels are likely to correspond to moving
% objects. The blob analysis system object is used to find such groups
% (called 'blobs' or 'connected components'), and compute their
% characteristics, such as area, centroid, and the bounding box.
obj.blobAnalyser = vision.BlobAnalysis('BoundingBoxOutputPort', true, ...
'AreaOutputPort', true, 'CentroidOutputPort', true, ...
'MinimumBlobArea', 400);
end
Error:Undefined function or variable 'setupSystemObjects'.
Any help would be greatly appriciated.
0 comentarios
Respuestas (1)
Dima Lisin
el 8 de Sept. de 2014
Hi Daevin,
Are you modifying the example script? Are you running the modified script, or are you trying to run setupSystemObjects on the command line?
0 comentarios
Ver también
Categorías
Más información sobre Computer Vision with Simulink en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!