How a video be processed in a original format(RGB format)?

2 ビュー (過去 30 日間)
Logaprabhavathy
Logaprabhavathy 2014 年 2 月 21 日
コメント済み: Logaprabhavathy 2014 年 3 月 19 日
Sir,
I have a codings to track the people in a video.My codings is
%Tracking people
hsrc = vision.VideoFileReader('D:/videos/vi.avi', ...
'ImageColorSpace', 'Intensity', ...
'VideoOutputDataType', 'uint8');
hfg = vision.ForegroundDetector(...
'NumTrainingFrames', 5, ... % 5 because of short video
'InitialVariance', 30*30); % initial standard deviation of 30
hblob = vision.BlobAnalysis(...
'CentroidOutputPort', false, 'AreaOutputPort', false, ...
'BoundingBoxOutputPort', true, 'MinimumBlobArea', 10);
hsnk = vision.VideoPlayer();
while ~isDone(hsrc)
frame = step(hsrc);
fgMask = step(hfg, frame);
bbox = step(hblob, fgMask);
% draw bounding boxes around people
out = insertShape(frame, 'Rectangle', bbox, 'Color', 'green');
step(hsnk, out); % view results in the video player
end
release(hsnk);
release(hsrc);
But the video have been processed as a gray video. How can I process this in original RGB format.

採用された回答

Logaprabhavathy
Logaprabhavathy 2014 年 2 月 21 日
編集済み: Logaprabhavathy 2014 年 2 月 21 日
sir, Can you give the RGb format instance?
  2 件のコメント
Walter Roberson
Walter Roberson 2014 年 2 月 21 日
%Tracking people
hsrc = vision.VideoFileReader('D:/videos/vi.avi', ...
'ImageColorSpace', 'RGB', ...
'VideoOutputDataType', 'uint8');
hfg = vision.ForegroundDetector(...
'NumTrainingFrames', 5, ... % 5 because of short video
'InitialVariance', 30*30); % initial standard deviation of 30
hblob = vision.BlobAnalysis(...
'CentroidOutputPort', false, 'AreaOutputPort', false, ...
'BoundingBoxOutputPort', true, 'MinimumBlobArea', 10);
hsnk = vision.VideoPlayer();
while ~isDone(hsrc)
frame = step(hsrc);
fgMask = step(hfg, frame);
bbox = step(hblob, fgMask);
% draw bounding boxes around people
out = insertShape(frame, 'Rectangle', bbox, 'Color', 'green');
step(hsnk, out); % view results in the video player
end
release(hsnk);
release(hsrc);
Notice that all that was changed was 'Intensity' became 'RGB'
Logaprabhavathy
Logaprabhavathy 2014 年 2 月 25 日
Thank u sir!

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2014 年 2 月 21 日
Change 'ImageColorSpace', 'Intensity' to one of the RGB formats.
That's it. I have traced through the calls you use, and all of them should work with RGB frames.
  1 件のコメント
Logaprabhavathy
Logaprabhavathy 2014 年 3 月 19 日
Sir, How can convert the above output video into number of frames?

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

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by