title: What does the python interface to opencv2.fillPoly want as input?
body: <p>I'm trying to draw a polygon using the python interface to opencv, cv2. I've created an empty image, just a 640x480 numpy array. I have a list of polygons (four point quadrilaterals) that I want to draw on the image, however, I can't seem to get the formate right to instruct cv2 where the quadrilaterals should be, and I keep getting this error:</p>
  
  <pre><code>OpenCV Error: Assertion failed (points.checkVector(2, CV_32S) &gt;= 0) in fillConvexPoly, file .../OpenCV-2.4.0/modules/core/src/drawing.cpp, line 2017
  </code></pre>
  
  <p>My code consists of essentially the following:</p>
  
  <pre><code>binary_image = np.zeros(image.shape,dtype='int8')
  for rect in expected:
      print(np.array(rect['boundary']))
      cv2.fillConvexPoly(binary_image, np.array(rect['boundary']), 255)
  fig = pyplot.figure(figsize=(16, 14))
  ax = fig.add_subplot(111)
  ax.imshow(binary_image)
  pyplot.show()
  </code></pre>
  
  <p>where my list of rects in expected has the 'boundary' containing the value of a list of (x,y) points. The code prints:</p>
  
  <pre><code>[[ 91 233]
   [419 227]
   [410 324]
   [ 94 349]]
  </code></pre>
  
  <p>I figured that this is the list of points for a polygon, but apparently that list has an invalid <code>points.checkvector</code>, whatever that is. A google search for that error turned up nothing useful.</p>