How to get a frame from output of STEP fuction

4 Ansichten (letzte 30 Tage)
Mammo Image
Mammo Image am 20 Aug. 2016
Kommentiert: Mammo Image am 21 Aug. 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 Kommentare
Mammo Image
Mammo Image am 21 Aug. 2016
HOW SHOULD I ASK TO BEEN ANSWERED ?
Mammo Image
Mammo Image am 21 Aug. 2016
IS THERE SOMETHING WRONG IN MY QUESTION ! :(

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Image Processing and Computer Vision finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by