Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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()

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()

image description

Also I get the same points for every image I test.