Opencv Python SVM + HOG

时间:2017-03-30 15:43:08

标签: python opencv svm object-detection

我正在使用Opencv和python中的对象检测器。我目前正在为我的问题尝试几种变体。我注意到detectmultiscale()以及predict()似乎只使用一个处理器。这使我的程序非常慢。 我想询问是否可以在多个处理器上分配任务。

我使用训练有素的分类器制作了这个简单的程序来检测我的对象。在这里,我缩放整个图像,然后应用滑动窗口。之后我使用predict来检测当前窗口中的对象。这非常慢,但它只使用了我的cpu的25%。有没有一个解决方案来加快速度,通过使用更多的资源?

# loop over the image pyramid
for resized in pyramid(image, scale=1.5):
    # loop over the sliding window for each layer of the pyramid
    for (x, y, window) in sliding_window(resized, stepSize=32, windowSize (winW, winH)):
         # if the window does not meet our desired window size, ignore it
         if window.shape[0] != winH or window.shape[1] != winW: 
         continue
         # now comes the prediction as well as marking the detected objects with rectangles

0 个答案:

没有答案