title: Error while resizing image: "error: (-215:Assertion failed) func != 0 in function 'resize'"
body: <p>I'm trying to preprocess images dataset, represented in numpy array with images of shape <code>(28, 28)</code> by rescaling them to <code>(10, 10)</code>. I wrote a function for that:</p>
  <pre class="lang-py prettyprint-override"><code>import cv2 as cv
  
  def resize_dataset(images):
      resized_images = []
      for img in images:
              img = img.reshape((28,28))
              resized_img = cv.resize(img, dsize=(10, 10))
              resized_images.append(resized_img)
      return numpy.array(resized_images)
  </code></pre>
  <p>But when I actually try to rescale them, I get the following error in <code>cv.resize</code>:</p>
  <pre><code>error: OpenCV(4.0.0) /io/opencv/modules/imgproc/src/resize.cpp:3662: error: (-215:Assertion failed) func != 0 in function 'resize'
  </code></pre>
  <p>In google I only found people with the same error writing on c++ doing very different stuff, like this one: <a href="https://stackoverflow.com/questions/7385465/resize-an-image-and-changing-its-depth">resize an image and changing its depth</a> and this: <a href="http://answers.opencv.org/question/19715/error-215-func-0-in-function-convertto/" rel="nofollow noreferrer">http://answers.opencv.org/question/19715/error-215-func-0-in-function-convertto/</a></p>
  <p>How do I fix it?</p>