Background on my project:
---------------------------------------
So I'm making an object tracking program in Matlab and right now how the program figures out how many objects are in the frame is: it takes the color image, thresholds it to black and white, then usese bwlabel to figure out how many separate objects there are. Then, using the labeled regions, i can use the .boundingbox and .centroid commands to find the center point of each region and draw a bounding box around it.
The code looks something like this...
[imLabeled numOfRegions] = bwlabel(BWimage, 8);
data = regionprops(imLabeled,'basic');
boundingBox = data(i).BoundingBox;
center = data(i).Centroid;
NOTE: in the above code there is an 'i' when getting the centroid and boundingbox properties because the grabbing of that data is actually done later on in a for loop using the variable i.
As you can imagine, the bwlabel command (pretty much by itself) cuts the framerate in which i can acquire data from about 9/10fps to about 4/5fps. This 50% reduction sometimes causes significant problems in the tracking of the objects.
The question:
--------------------
Is there another, much faster way, without having to actually label every region, to figure out the number of separate regions in a given black and white image, and the center point/bounding box properties for every region.
I really appreciate all your support and help, not just with this problem but with all the problems I've had over the years. With your help on these forums I've been able to create some pretty neat stuff. Thanks !!
--Zac
"ZK " <zs...@hotmail.com> wrote in message <gg58km$qo4$1...@fred.mathworks.com>...
"ZK " <zs...@hotmail.com> wrote in message <gg58km$qo4$1...@fred.mathworks.com>...
Try using video.BlobAnalysis in "Video and Image Processing Blocsket". It
is a System object, so be sure to read documentation on how to use these.
You can configure it to give you the centroid and bounding boc of each blob
and a count of the number of blobs in your video frame, all in one line of
code. It is also more computationally efficient than the Image Processing
Toolbox functions you are using.
Hope this helps,
Bruce
"usha kiran peddala" <kira...@gmail.com> wrote in message
news:i9i6qn$ruh$1...@fred.mathworks.com...