title: How to specify a custom output size in cv2.pyrDown() or pyrUp() method
body: <p>I want to explicitly specify the output size of the image when applying <a href="https://docs.opencv.org/3.1.0/d4/d86/group__imgproc__filter.html#gaf9bba239dfca11654cb7f50f889fc2ff" rel="noreferrer">cv2.pyrDown()</a> on images.</p>
  
  <pre><code>def gaussian_pyramid(image, scale=1.5, minSize=(30, 30)):
      yield image
      while True:
          w = int(image.shape[1] / scale)
          h = int(image.shape[0] / scale)
          image = cv2.pyrDown(image, dstsize=(w, h))
          if image.shape[0] &lt; minSize[1] or image.shape[1] &lt; minSize[0]:
              break
          yield image
  </code></pre>
  
  <p>But it is throwing an error something similar to this. </p>
  
  <pre><code>OpenCV Error: Assertion failed (ssize.width &gt; 0 &amp;&amp; ssize.height &gt; 0 &amp;&amp; std::abs(dsize.width*2 - ssize.width) &lt;= 2 &amp;&amp; std::abs(dsize.height*2 - ssize.height) &lt;= 2) in pyrDown_, file /io/opencv/modules/imgproc/src/pyramids.cpp, line 873
  </code></pre>
  
  <p>Any idea how to specify the output size of the image as a method argument. </p>