This block of code (in views.py) is launched using a URL. No problem importing cv2. (The same as using virtualenvwrapper, it shows the same result (after adding all the necessary libraries). Initializing the camera and ....
def caminit(request): cam.open(0) img=cam.read() cv2.imwrite("snap"+".jpg",img[1]) cam.release()
When checking for print type(faceCascade) , <type 'cv2.CascadeClassifier'> . Object created.
moving on in the same caminit
image = cv2.imread("snap.jpg")
Now the important part of โFace Searchโ
print "Found {0} faces!".format(len(faces))
EXIT IN TERMINAL:
Found 0 faces!
Why is this happening?
I tried debugging by typing in terminal. I mentioned them in the comments. The camera used is my laptop (HP envy), which gives a snap with a resolution of 640x480.
I suspect that something needs to be changed in the faceCascade.detectMultiScale(..) block. (Options). I tried with scalefactor = 1.000001 and minNeighbors = 3 no avail.
Mohit kumar
source share