You have several options here. You can try theDetect and Track Multiple Faces example on the File Exchange, which detects and tracks multiple faces. You can try the same thing: replacingvision.CascadeObjectDetector withvision.PeopleDetector.
Alternatively, if your camera is stationary, you can usevision.ForegroundDetector to detect any moving objects. SeeMotion-Based Multiple Object Tracking example in the Computer Vision System Toolbox.
In either case, if you want to track people reliably for 10-15 minutes, you will have to do a lot of tweaking and tuning of parameters.
How did you do it? If you did it with bwlabel or beconncomp, you can get it from the return argument(s). If you used the Computer Vision System Toolbox example, I'm sure it's one of the returned properties.
Best Answer