How to get a frame from output of STEP fuction

2 ビュー (過去 30 日間)
Mammo Image
Mammo Image 2016 年 8 月 20 日
コメント済み: Mammo Image 2016 年 8 月 21 日
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 件のコメント
Mammo Image
Mammo Image 2016 年 8 月 21 日
HOW SHOULD I ASK TO BEEN ANSWERED ?
Mammo Image
Mammo Image 2016 年 8 月 21 日
IS THERE SOMETHING WRONG IN MY QUESTION ! :(

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing and Computer Vision についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by