title: Segmentation fault with opencv, in python on Raspberry
body: <p>I'm making a really simple program which capture a video from a Raspberry pi camera, using opencv in python. I'm using Raspbian as OS.
  I've already made a few programs with the version 2.4.5 of opencv and now i've installed opencv 2.4.9.
  All the programs that i used to run on the previous version of opencv are not working now, and i think i found the point in which the programs gives me errors.
  Just trying to launch the following code:</p>
  
  <pre><code>import cv2
  import numpy as np
  
  cap = cv2.VideoCapture(0)
  resAcquisitionWidth = 160
  resAcquisitionHeight = 120
  cap.set(3, resAcquisitionWidth);
  cap.set(4, resAcquisitionHeight);
  cv2.namedWindow('frame')  
  i = 0
  while(True):
      print(i)
      i = i + 1
      ret, frame = cap.read()
      gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
      cv2.imshow('frame',frame)
      if cv2.waitKey(1) &amp; 0xFF == ord('q'):
          break
  
  cap.release()
  cv2.destroyAllWindows()
  </code></pre>
  
  <p>i get the error </p>
  
  <blockquote>
    <p>Segmentation fault</p>
  </blockquote>
  
  <p>I found out that if i run the same code, but without trying to adjust the resolution (so without the cap.set() commands on the lines 7-8) everything works fine. So it should be something related with that.
  I've already seen other posts about similar errors, and all of those seem to come for other reasons. 
  Anybody know what the resasone could be ?</p>