Ask Your Question

Neldar's profile - activity

2016-10-08 09:30:58 -0600 commented question Haar Training detectMultiScale does not work very well when size vary

The code I'm using to test my classifier is the following: import numpy as np import cv2

parking_cascade = cv2.CascadeClassifier('cascadeP2.xml')
cap = cv2.VideoCapture(0)

while 1:
    ret, img = cap.read()
    gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

    # image, reject levels level weights.
    parkinges = parking_cascade.detectMultiScale(gray, 5, 50)

    for (x,y,w,h) in parkinges:
        cv2.rectangle(img,(x,y),(x+w,y+h),(255,255,0),2)
    cv2.imshow('img',img)
    k = cv2.waitKey(30) & 0xff
    if k == 27:
        break

cap.release()
cv2.destroyAllWindows()

I trained my classifier withe 1950 negative, positives images and 30 steps for the haartraining.

2016-10-07 14:27:39 -0600 asked a question Haar Training detectMultiScale does not work very well when size vary

Hello,

I created my CascadeClassifier in order to find in some images if a parking sign is present. Sadly, it does not work very well. When I analyse the image from my webcam, taking a picture of a parking sign I printed and vary the distance between the image and my webcam, it only work when I am at a quite precise distance. The cascade identifier does not work when the image appear too big or too small.

I played with the scaleFactor but it didn't helped. Could you help me find a way to identify if a parking sign is in the picture, whatever the size of it in the picture?