comp.soft-sys.matlab - The MathWorks calculation and visualization package.
2. bwlabel code
hi does anyone know if there is some way i can view the code for the bwlabel function in matlab as I would like to know how this computes the number of objects in the image? thanks
Hey guys. As usual, I'm having a little difficultly and really would appreciate your help. In order to try and be more clear in the problem I'm having, I've tried to include some code and background on the project at hand. 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
Hello, maybe somebody have or know where can i get theory of this "bwlabel" function??? Detailed algorithm, how it works and so on. Cause i want to write abut it in my last project. In matlab help i found this one "Haralick, Robert M., and Linda G. Shapiro, Computer and Robot Vision, Volume I, Addison-Wesley, 1992, pp. 28-48." but its not free, and without paying i cant read it. Thanks Tomas
Hi, I've been using imageDif between two consecutive frames to recognize moving objects - specifically people (no static background photo). the problem is that when i try to catalog different moving items, bwlabel will return very near parts of a person as different itentities (different index's since i use two consecutive frames and i get just the contour of the person!), i wish to find a way so that two items which are close be identified as one (with same index). can anyone think of a way or another procedure other then bwlabel for this ? thanks in advance LT