How to get a frame from output of STEP fuction

3 visualizaciones (últimos 30 días)
Mammo Image
Mammo Image el 20 de Ag. de 2016
Comentada: Mammo Image el 21 de Ag. de 2016
Hi,
I used vision.foreground to find the silhouette of moving person. Now I would like to make frame extraction for the output of this code but I dont know how to extract the window that result from step function.
another thing please, why ( out) and ( bbox) variables are zero when I implement the code.
videoSource = vision.VideoFileReader('person01_walking_d1_uncomp.avi','ImageColorSpace','Intensity','VideoOutputDataType','uint8');
detector = vision.ForegroundDetector(...
'NumTrainingFrames', 500, ...
'InitialVariance', 900);
blob = vision.BlobAnalysis(...
'CentroidOutputPort', false, 'AreaOutputPort', false, ...
'BoundingBoxOutputPort', true, ...
'MinimumBlobAreaSource', 'Property', 'MinimumBlobArea', 250);
shapeInserter = vision.ShapeInserter('BorderColor','White');
videoPlayer = vision.VideoPlayer();
while ~isDone(videoSource)
frame = step(videoSource);
fgMask = step(detector, frame);
bw2 = bwareaopen (fgMask, 250);
bbox = step(blob, fgMask);
out = step( shapeInserter, bw2,bbox);
step (videoPlayer, out);
end
release(videoPlayer);
release(videoSource);
  • _ I found the following code for extract frames from video but I dont know where should I put it exactly in the previous code._*
obj = VideoReader('person01_walking_d1_uncomp.avi');
for k = 1 : obj.NumberOfFrames %fill in the appropriate number
this_frame = read(obj, k);
thisfig = figure();
thisax = axes('Parent', thisfig);
image(this_frame, 'Parent', thisax);
title(thisax, sprintf('Frame #%d', k));
end
  2 comentarios
Mammo Image
Mammo Image el 21 de Ag. de 2016
HOW SHOULD I ASK TO BEEN ANSWERED ?
Mammo Image
Mammo Image el 21 de Ag. de 2016
IS THERE SOMETHING WRONG IN MY QUESTION ! :(

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Image Processing and Computer Vision en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by