title: cv.filter2D return TypeError
body: <p>My platform is Mac OS X 10.6 and install python 2.7.2/opencv by homebrew.
  I want to use cv.filter2D to do Lanczos resampling, here is my code:</p>
  
  <pre><code>import cv
  
  src = cv.imread('img.jpg')
  dst = cv.CloneMat(src)
  kernel = cv.CreateMat(7, 7, cv.CV_32FC1)
  
  for i in range(-3, 4):
      for j in range(-3, 4):
          kernel[i+3, j+3] = L(i, 3) * L(j, 3)
  
  cv.filter2D(src, dst, kernel)
  cv.imshow(dst)
  </code></pre>
  
  <p>My problem is cv.filter2D. 
  If I use </p>
  
  <pre><code>cv.filter2D(src, dst, kernel) 
  </code></pre>
  
  <p>, which wrote in OpenCV Reference Manual, it will get error message.</p>
  
  <pre><code>Traceback (most recent call last):
    File "lanczos.py", line 27, in &lt;module&gt;
      cv.filter2D(src, dst, kernel)
  TypeError: only length-1 arrays can be converted to Python scalars
  </code></pre>
  
  <p>Under python I type </p>
  
  <pre><code>cv.filter2D.__doc__
  </code></pre>
  
  <p>, it said the function prototype is</p>
  
  <pre><code>'filter2D(src, ddepth, kernel[, dst[, anchor[, delta[, borderType]]]]) -&gt; dst'
  </code></pre>
  
  <p>if I use</p>
  
  <pre><code>cv.filter2D(src, -1, kernel, dst)
  </code></pre>
  
  <p>instead, the error message become</p>
  
  <pre><code>Traceback (most recent call last):
    File "lanczos.py", line 27, in &lt;module&gt;
      cv.filter2D(src, 1 , kernel, dst)
  TypeError: &lt;unknown&gt; is not a numpy array
  </code></pre>
  
  <p>seems no people encounter this problem before?</p>