title: cv2.rectangle() calls overloaded method, although I give other parameter
body: <p>cv2.rectangle has two ways of calling:</p>
  
  <ul>
  <li>img =   cv.rectangle(   img, <strong>pt1, pt2,</strong> color[, thickness[, lineType[, shift]]]  )</li>
  <li>img =   cv.rectangle(   img, <strong>rec</strong>, color[, thickness[, lineType[, shift]]]</li>
  </ul>
  
  <p>source:<a href="https://docs.opencv.org/4.1.2/d6/d6e/group__imgproc__draw.html#ga07d2f74cadcf8e305e810ce8eed13bc9" rel="noreferrer">https://docs.opencv.org/4.1.2/d6/d6e/group__imgproc__draw.html#ga07d2f74cadcf8e305e810ce8eed13bc9</a></p>
  
  <p>I call rectangle as following:</p>
  
  <blockquote>
    <p>cv2.rectangle(img=cv2_im, pt1=a, pt2=b, color=(0, 255, 0),
    thickness=3, lineType=cv2.LINE_AA)</p>
  </blockquote>
  
  <p>Error Message:</p>
  
  <blockquote>
    <p>cv2.rectangle(img=cv2_im, pt1=a, pt2=b, color=(0, 255, 0), thickness=3, lineType=cv2.LINE_AA)
    TypeError: rectangle() missing required argument 'rec' (pos 2)</p>
  </blockquote>
  
  <p>I do not understand why the application tries to call the overloaded version of the method. U explicitly define version 1 call. 
  I tried changing the variable a with (x,y) etc. but it doesn't work. The correct method call only works the <em>first time</em> I call the retangle() afterwards it expects me to use the overloaded version of it. </p>
  
  <hr>
  
  <ul>
  <li>Python 3.7.5 64 bit </li>
  <li>Pillow                7.0.0 </li>
  <li>numpy        1.18.1 </li>
  <li><p>opencv-contrib-python 4.1.2.30</p>
  
  <pre><code>imgname='fly_1.jpg'   
  im = Image.open(imgname)
  cv2_im = np.array(im)
  
  #x,y,w,h aus Image Labeler
  box= [505.54, 398.334, 1334.43, 2513.223]
  x,y,w,h = box
  a = (x, y)
  b = (x+w, y+h)
  
  #First rectanglecall
  cv2.rectangle(img=cv2_im, pt1=a, pt2=b, color=(0, 255, 0), thickness=3, lineType=cv2.LINE_AA)
  #calls two cv2 methods which shouldn't influence rectangle
  rects = getRegionProposals(im,'f',normalized=True)   
  
  
  for i,rect in enumerate(rects):
  
       x, x_max, y, y_max = rect
       a = (x*width,y*height)
       b = (x_max*width, y_max*height)
  
       if (IoU is not False and IoU &gt; 0.5):
           #second and further calls
           cv2.rectangle(img=cv2_im, pt1=a, pt2=b, color=(0, 255, 0), thickness=3, lineType=cv2.LINE_AA)
  </code></pre></li>
  </ul>
  
  <p>In between the second call I used cv2 selective search and set the following: 
      cv2.setUseOptimized(True)
      cv2.setNumThreads(4)</p>
  
  <p>Hope u guys see what I'm doin wrong. </p>