HoG Detect MultiScale Detect
I am working on License Plate Detection using HoG. I am now in the testing phase. When I use
hog.detectmultiscale()
to localize the number plate, I get just a single rectangle false positive localization. Below is the code:
hog = cv2.HOGDescriptor((64,64), (16,16), (8,8), (8,8), 9)
svm = cv2.SVM()
svm.load('trained.xml')
img = cv2.imread('6.png', cv2.IMREAD_COLOR)
h = hog.compute(img)
p = svm.predict(h)
print p
model = pickle.load(open("svm.pickle"))
hog.setSVMDetector(np.array(model))
rects, weights= hog.detectMultiScale(img, 1.5, (7,7),(10,10), 1,1)
for (x, y, w, h) in rects:
cv2.rectangle(img, (x, y), (x + w, y + h), (0, 255, 0), 2)
print x,y,w,h
cv2.imshow('person', img)
cv2.waitKey(0)
cv2.destroyAllWindows()
Also I get the same points for every image I test.
Well your command
rects, weights= hog.detectMultiScale(img, 1.5, (7,7),(10,10), 1,1)
is quite strange. It would mean that it can only find objects in the range 7x7 to 10x10 pixels. Which are completely wrong dimensions since a license plate is always longer then it is in height. How did you define those dimensions?I changed the dimensions. But still no difference.
Can you update your code?
Just changed the dimensions, such as winstride, padding and scaling. Code still the same as above.