There are plenty of examples that show how to use background subtraction and blob detection, but they are pretty terrible. This is a simple program that showcases background subtraction, blob detection, and face detection complete with code comments.
I've written this for the Eclipse environment but it could be easily changed for the Processing environment (just remove the class definition, the main function, and any 'public' tags).