title: How to resize an OpenCV Image in Python?
body: <p>I am using <strong>OpenCV</strong> in python and I am trying to train a cascade. As a beginner, I wanted some practice in creating cascades, and my cascade is going to detect a rubber.</p>
  <p>Here I have a simple positive image, with dimension <strong>665*851</strong> pixels.
  <a href="https://i.stack.imgur.com/vB1nW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vB1nW.jpg" alt="This is the rubber image" /></a></p>
  <p>To make it easier to train, I want to scale the image down to <strong>50*50</strong> pixels. I tried running this simple code in my python shell:</p>
  <pre><code>import cv2 as cv
  
  img = cv.imread('img.jpg')
  
  resized_img = cv.resize(img, (50,50))
  
  cv.imwrite('img1.jpg', img)
  </code></pre>
  <p>This is a lightweight, simple code. My file, <code>img.jpg</code> is located in the same directory as this python file. The new file does save, however, the size does not change for some reason.</p>
  <p><a href="https://i.stack.imgur.com/3gW09.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3gW09.png" alt="enter image description here" /></a></p>
  <p>Please tell me if there is something wrong with my code...</p>
  <p>Thanks.</p>