How to get a frame from output of STEP fuction

2 vues (au cours des 30 derniers jours)
Mammo Image
Mammo Image le 20 Août 2016
Commenté : Mammo Image le 21 Août 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 commentaires
Mammo Image
Mammo Image le 21 Août 2016
HOW SHOULD I ASK TO BEEN ANSWERED ?
Mammo Image
Mammo Image le 21 Août 2016
IS THERE SOMETHING WRONG IN MY QUESTION ! :(

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Image Processing and Computer Vision 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