The classification of various objects is the ability to learn the type of object. So rather than merely recognizing that something is there, classification determines the type of object: human, animal, car, truck, boat.
Two approaches are possible:
1 - Use of Bag of Words. Usually, they have four steps:
Get the feature points from training data;
Create a vocabulary from the features;
Train (using SVM for example);
Test in an image (not in training examples).
There is an example here and in opencv/samples/cpp/bagofwords.cpp
2 - Use of a latent SVM detector. The explanation is here. Have a running example of detection/categorization in opencv/samples/cpp/latentsvmdetector.cpp. You also require the opencv_extra/testdata/cv/latentsvm to properly test it.
For more information regarding Human Motion Detection and Tracking for Video Surveillance, refer to the following link:
https://pdfs.semanticscholar.org/11cd/be81c995377edfb943d652d3a5c22f859f06.pdf