Summary of specific question:
1) How can I go about creating a custom HOG & SVM classifier in opencv so that I can identify the object in frame and draw a rectangle around it?
2) When training a new HOG & SVM, what type of data preparation needs to be done on training set images. For example, do positive images need to have only the objects of interest cropped and centered or the like before feeding to train?
Detail:
I'm relatively new to openCV and am trying to create a new HOG and SVM classifier to detect vehicles from a web camera. The majority of tutorials that I've found use the default people detector with the detectMultiScale() functions below (example,https://www.programcreek.com/python/example/89410/cv2.HOGDescriptor_getDefaultPeopleDetector).
import cv2
hog = cv2.HOGDescriptor()
hog.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector())
cv2.detectMultiScale()
I did found a separate post, Apply HOG+SVM Training to Webcam for Object Detection, that describes how to create one's own HOG and then use it to identify whether an image/frame contains the object of interest. However, it does not describe how one might modify this to be used with the setSVMDetector() method and detectMultiScale(), which would allow for object detection and location isolation of object. I also found this link,http://answers.opencv.org/question/56655/how-to-use-a-custom-svm-with-hogdescriptor-in-python/, which I believe explains how to create one's own HOG object, but I'm too new to opencv to fully understand how to implement this in my own code.
Is there a way to train one's own classifier and the use it to identify objects in test sets by drawing a rect obj. around them? Or is there a simpler solution to achieve this result?
I would appreciate any advice or insight others could provide.
Thank you.