A project that detects specific objects in images/videos using an SVM on HOG features. The program is written in C++.
- hogtrainfeatures.cpp : Extracts HOG features from a given set of images and stores them in a .xml file.
- hogtrainsvm.cpp : Uses the extracted HOG features and trains a SVM with them.
- hogobjectdetect.cpp : Uses the trained SVM to detect objects in images/livefeed/videos.
OpenCV (used version 3.0.1)
Code to be run in terminal
$ cd Object-Detection
$ make train
$ ./output /PathToDirectoryContainingPositiveImages/ positive.xml
$ ./output /PathToDirectoryContainingNegativeImages/ negative.xml
$ make svm
$ ./output positive.xml negative.xml trainedsvm.xml
$ make all
# for detection in image
$ ./output trainedsvm.xml /PathToTestImage
# for detection in livefeed
$ ./output trainedsvm.xml
# for detection in video
$ ./output trainedsvm.xml /PathToTestVideo
- PepsiCan
- Leaf