title: an error of opencv on python about boundingRect
body: <p>When I try the code about motion capture,I can't run succesfully because of this error.</p>
  
  <pre><code>    Traceback (most recent call last):
    File "G:\machine learning\CV\Video Capture\motion capture with square.py", line 21, in &lt;module&gt;
      x,y,w,h=cv2.boundingRect(thresh)
  error: ..\..\..\..\opencv\modules\imgproc\src\contours.cpp:1895: error: (-215) points.checkVector(2) &gt;= 0 &amp;&amp; (points.depth() == CV_32F || points.depth() == CV_32S) in function cv::boundingRect
  </code></pre>
  
  <p>Firtly, I thought maybe the data type may wrong, so I change the type to the 'float32' and 'int32'. But it can't help, so I have no idea.</p>
  
  <p>And here is my code:</p>
  
  <pre><code>import cv2  
  import numpy as np
  camera=cv2.VideoCapture(0)  
  firstframe=None  
  while True:  
      ret,frame = camera.read()
      #cv2.imshow("frame", frame)
      if not ret:  
          break  
      gray=cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)  
      gray=cv2.GaussianBlur(gray,(21,21),0)  
      if firstframe is None:  
          firstframe=gray  
          continue  
  
      frameDelta = cv2.absdiff(firstframe,gray)  
      thresh = cv2.threshold(frameDelta, 25, 255, cv2.THRESH_BINARY)[1]  
      thresh = cv2.dilate(thresh, None, iterations=2)  
      #(cnts,_)= cv2.findContours(thresh.copy(),cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE)
  
      x,y,w,h=cv2.boundingRect(thresh)  
      frame=cv2.rectangle(frame,(x,y),(x+w,y+h),(0,255,0),2)  
      cv2.imshow("frame", frame)  
      cv2.imshow("Thresh", thresh)  
      cv2.imshow("frame2", frameDelta)  
      key = cv2.waitKey(1)&amp;0xFF  
  
      if key == ord("q"):  
          break  
  
  camera.release()  
  cv2.destroyAllWindows()  
  </code></pre>