Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV Assertion failed in function 'setSVMDetector'

I am learning how to train custom HOG descriptor for pedestrians detection. When I pass parameters to the hog object using following code

rho, _, _ = svm.getDecisionFunction(0)
sv = svm.getSupportVectors()
hog.setSVMDetector(np.append(sv.ravel(), rho))

I came across this error:

---------------------------------------------------------------------------
error                                     Traceback (most recent call last)
<ipython-input-23-445de3dc92d7> in <module>
      1 rho, _, _ = svm.getDecisionFunction(0)
      2 sv = svm.getSupportVectors()
----> 3 hog.setSVMDetector(np.append(sv.ravel(), rho))

error: OpenCV(4.0.0) /Users/travis/build/skvark/opencv-python/opencv/modules/objdetect/src/hog.cpp:115: error: (-215:Assertion failed) checkDetectorSize() in function 'setSVMDetector'

A complete ipynotebook is available here The error is present on line 23.

The test image is present at this link

How do I solve this.

OpenCV Assertion failed in function 'setSVMDetector'

I am learning how to train custom HOG descriptor for pedestrians detection. When I pass parameters to the hog object using following code

rho, _, _ = svm.getDecisionFunction(0)
sv = svm.getSupportVectors()
hog.setSVMDetector(np.append(sv.ravel(), rho))
found = hog.detectMultiScale(img_test)

I came across this error:

---------------------------------------------------------------------------
error                                     Traceback (most recent call last)
<ipython-input-23-445de3dc92d7> in <module>
      1 rho, _, _ = svm.getDecisionFunction(0)
      2 sv = svm.getSupportVectors()
----> 3 hog.setSVMDetector(np.append(sv.ravel(), rho))

error: OpenCV(4.0.0) /Users/travis/build/skvark/opencv-python/opencv/modules/objdetect/src/hog.cpp:115: error: (-215:Assertion failed) checkDetectorSize() in function 'setSVMDetector'

A complete ipynotebook is available here The error is present on line 23.

The test image is present at this link

How do I solve this.

click to hide/show revision 3
retagged

updated 2019-03-12 06:53:59 -0500

berak gravatar image

OpenCV Assertion failed in function 'setSVMDetector'

I am learning how to train custom HOG descriptor for pedestrians detection. When I pass parameters to the hog object using following code

rho, _, _ = svm.getDecisionFunction(0)
sv = svm.getSupportVectors()
hog.setSVMDetector(np.append(sv.ravel(), rho))
found = hog.detectMultiScale(img_test)

I came across this error:

---------------------------------------------------------------------------
error                                     Traceback (most recent call last)
<ipython-input-23-445de3dc92d7> in <module>
      1 rho, _, _ = svm.getDecisionFunction(0)
      2 sv = svm.getSupportVectors()
----> 3 hog.setSVMDetector(np.append(sv.ravel(), rho))

error: OpenCV(4.0.0) /Users/travis/build/skvark/opencv-python/opencv/modules/objdetect/src/hog.cpp:115: error: (-215:Assertion failed) checkDetectorSize() in function 'setSVMDetector'

A complete ipynotebook is available here The error is present on line 23.

The test image is present at this link

How do I solve this.

click to hide/show revision 4
retagged

updated 2019-03-12 06:54:14 -0500

berak gravatar image

OpenCV Assertion failed in function 'setSVMDetector'

I am learning how to train custom HOG descriptor for pedestrians detection. When I pass parameters to the hog object using following code

rho, _, _ = svm.getDecisionFunction(0)
sv = svm.getSupportVectors()
hog.setSVMDetector(np.append(sv.ravel(), rho))
found = hog.detectMultiScale(img_test)

I came across this error:

---------------------------------------------------------------------------
error                                     Traceback (most recent call last)
<ipython-input-23-445de3dc92d7> in <module>
      1 rho, _, _ = svm.getDecisionFunction(0)
      2 sv = svm.getSupportVectors()
----> 3 hog.setSVMDetector(np.append(sv.ravel(), rho))

error: OpenCV(4.0.0) /Users/travis/build/skvark/opencv-python/opencv/modules/objdetect/src/hog.cpp:115: error: (-215:Assertion failed) checkDetectorSize() in function 'setSVMDetector'

A complete ipynotebook is available here The error is present on line 23.

The test image is present at this link

How do I solve this.