If anyone intersted there is an example of using linear svm + hog descriptor in opencv, but opencv uses libsvm and using liblinear will be faster. https://github.com/Itseez/opencv/blob/ddf82d0b154873510802ef75c53e628cd7b2cb13/samples/cpp/train_HOG.cpp https://www.csie.ntu.edu.tw/~cjlin/liblinear/