フィルターのクリア

How do i plot a bounding box around the output of a Moving object algorithm?

4 ビュー (過去 30 日間)
Sanjeev
Sanjeev 2013 年 3 月 17 日
ive used the background subtraction process to find moving objects from a real time video input and would like to plot the bounding box around only the moving object detected. is it possible??? and can i plot the centroid of the same???

回答 (1 件)

ChristianW
ChristianW 2013 年 3 月 17 日
With Image Processing Toolbox:
doc regionprops
An example:
BW = imread('text.png'); imshow(BW)
bb = regionprops(BW, {'BoundingBox','Centroid'});
centroids = cat(1, bb.Centroid);
boundingboxes = cat(1, bb.BoundingBox);
hold on
plot(centroids(:,1), centroids(:,2), 'r+')
for k = 1:size(boundingboxes,1)
rectangle('position',boundingboxes(k,:),'Edgecolor','g')
end
hold off
  2 件のコメント
Image Analyst
Image Analyst 2013 年 3 月 17 日
The Computer Vision System Toolbox has lots of demos for tracking. You can search for them online. Here's one page: http://www.mathworks.com/products/computer-vision/description4.html. I've also seen a demo tracking people. You might save yourself a lot of time and effort (more than the cost of the toolbox) if you get that toolbox. It's not easy so take advantage of a whole team of people who worked through the difficult issues to make it easy for you.
Sanjeev
Sanjeev 2013 年 3 月 25 日
thanks for that Image Analyst.
i used the centroid code.. But when more than 2 objects come into picture i shld be getting 2 individual centroids rather than 1. how do i modify this?????

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

カテゴリ

Help Center および File ExchangeColor Space Formatting and Conversions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by