Question for 'Detecting Pedestrians in the Wild'

52 views
Skip to first unread message

kg....@gmail.com

unread,
Feb 19, 2018, 7:29:17 PM2/19/18
to Machine Learning for OpenCV
Hello everyone,

I've run Jupyter notebook provided from 'Machine Learning for OpenCV' book. 
I've stuck in '06.02-Detecting-Pedestrians-in-the-Wild'. It seems that the notebook doesn't work. Below is the main part of the notebook that I tested. it is the same with the code on the book.
Does the svm trained by sample of the book not work well ? Or Did I make some mistake? I'd like to know some hint for that.
Thanks in advance.

hog = cv2.HOGDescriptor(win_size, block_size, block_stride, cell_size, num_bins)

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

found, _ = hog.detectMultiScale(img_test)


Michael Beyeler

unread,
Mar 2, 2018, 10:57:05 PM3/2/18
to Machine Learning for OpenCV
Hi,

Sorry for the late reply, I've been busy. I remember having trouble with passing the support vectors to the HOG descriptor - it is a poorly documented feature whose implementation has changed a lot over different OpenCV versions. Thus it's possible that the example SVM doesn't work so well.

What OpenCV version are you running? Do the default detectors work for you?

Best,
Michael

sok...@gmail.com

unread,
Mar 13, 2018, 12:44:39 AM3/13/18
to Machine Learning for OpenCV
Hello, Michael

I am very appreciated for your response. My openCV version is 3.3.1 and the openCV's default detector works fine. But I’d like to make my own algorithm using SVM. If you find some solution, please let me know it. Anyway, I’d rather to pass to next chapter.

Best Regards,
Seok

tudouz...@gmail.com

unread,
Mar 10, 2019, 5:05:30 AM3/10/19
to Machine Learning for OpenCV
Hello everyone
I got the same question in this chapter. My opencv version is 4.0.0.Please tell me if you can help me solve this question.
It output the right rectangle when I put the positive image which in the list of train dataset but output the wrong rectangle when I put the image in the list of test dataset or a new picture. 

Reply all
Reply to author
Forward
0 new messages