Do object recognition with HOG feature and SVM classifier.
[Usage]
Training Algorithm Flow
manually select representive _sample_s to generate TrainSet and TestSet
Extract HOG feature for each samples either in TrainSet or in TestSet
Attatch label to each sample
Set parameters and train Model (you can determine save Model or not. If saved, Model will be saved into a XML file.)
Predict samples in TestSet with SVM Model
Training Example Code with EndToEnd1
2
3
4
5
6
7
8
9
10....
....
string dirPath = "..."
HOG_SVM hog_svm;
hog_svm.SetSvmParameter(....);
float result = hog_svm.EndToEnd(dirPath);
....
....
Predict with Model in in practice:
1 | .... |
[Example]
White rectangle bounding boxes denote the topk (which select topk Main Region with Depth Segmentation Algorithm in the previous blog) color candidate regions to calculate HOG features, which will be classified by an SVM classifier. The recognition results of the right image show that cuboid regions filtered by the classifier are marked red, while the rest white regions are removed from candidate regions after classifying.
Color | Depth |
---|---|
Regions | Classification |
---|---|