Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

HoG Training Using SVM

I have successfully trained my positive and negative samples of my dataset. However, when I try to use the hog.setSVMDetector(), I get the following error :

_svmdetector data type = 17 is not supported

Here is the code:

hog = cv2.HOGDescriptor() svm = cv2.SVM() svm.load('trained.xml') img = cv2.imread('t_.png', cv2.IMREAD_COLOR) h = hog.compute(img) p = svm.predict(h) print p hog.setSVMDetector(np.array(svm))

HoG Training Using SVM

I have successfully trained my positive and negative samples of my dataset. However, when I try to use the hog.setSVMDetector(), I get the following error :

_svmdetector data type = 17 is not supported

supported

Here is the code:

hog = cv2.HOGDescriptor()
svm = cv2.SVM()
svm.load('trained.xml')
img = cv2.imread('t_.png', cv2.IMREAD_COLOR)
h = hog.compute(img)
p = svm.predict(h)
print p
hog.setSVMDetector(np.array(svm))

hog.setSVMDetector(np.array(svm))