title: Python - CV2 change dimension and quality
body: <p>I managed to take a picture with Python and CV2 library, but I'd like to change the dimension of the image and get something not high quality and resize it down at 640.</p>
  
  <p>My code is:</p>
  
  <pre><code>cam = VideoCapture(0)   # 0 -&gt; index of camera
  s, img = cam.read()
      if s:    # frame captured without any errors
               imwrite(filename,img) #save image
  </code></pre>
  
  <p>I have tried to use the method <code>set</code> but it doesn't work.</p>