title: Not able to find faces(face-detection) in django (using python-opencv) project
body: <p>This block of code (in views.py) is triggered by a URL.No problem in importing cv2.(Same thing tried with virtualenvwrapper shows same result <em>(after adding all required libraries)</em> Camera initializes and ....</p>
  
  <pre><code>def caminit(request):  
    cam.open(0)
    img=cam.read()
    cv2.imwrite("snap"+".jpg",img[1])
    cam.release()                                #takes the instant pic
  
    faceCascade =cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
    eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml')
  </code></pre>
  
  <p>When checked for  <code>print type(faceCascade)</code>  gives <code>&lt;type 'cv2.CascadeClassifier'&gt;</code>.The object is created.</p>
  
  <p>moving on further in same <code>caminit</code></p>
  
  <pre><code>image = cv2.imread("snap.jpg")
  
  # when checked with image.dtype it shows correct uint8 also image.shape shows correct data {Eg: (480, 640, 3)}
  
  gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
  
  # Detect faces in the image
  faces = faceCascade.detectMultiScale(
      gray,
      scaleFactor=1.1,
      minNeighbors=5,
      minSize=(30, 30),
      flags = cv2.cv.CV_HAAR_SCALE_IMAGE
  )
  </code></pre>
  
  <p>now THE crucial part "Finding the no. of faces"</p>
  
  <pre><code>print "Found {0} faces!".format(len(faces))
  </code></pre>
  
  <p>OUTPUT in TERMINAL:</p>
  
  <pre><code>Found 0 faces!
  </code></pre>
  
  <p>Why is this happening?</p>
  
  <p>I have tried debugging by printing in terminal.I have mentioned them in comments.Camera being used is My laptop (HP envy) camera which gives snap with resolution 640x480.</p>
  
  <p>I suspect something needs to be tweaked in <code>faceCascade.detectMultiScale(..)</code> block.(The parameters).I tried with <code>scalefactor = 1.000001</code> and <code>minNeighbors = 3</code> to no avail.</p>