title: OpenCV GrabCut doesn't update mask when on GC_INIT_WITH_MASK mode
body: <p>I followed <a href="https://docs.opencv.org/3.4/d8/d83/tutorial_py_grabcut.html" rel="nofollow noreferrer">this opencv tutorial</a> and used my own image and mask to improve segmentation using opencv grabcut algorithm, but the resulted mask is the same as the initial mask. </p>
  
  <p>Code:</p>
  
  <pre><code>import cv2
  
  init_mask = cv2.imread('/path/to/mask.png',0)
  img = cv2.imread('/path/to/image.png')
  
  mask = np.zeros(image.shape[:2],np.uint8)
  mask[init_mask == 255] = 1
  
  bgdModel = np.zeros((1,65),np.float64)
  fgdModel = np.zeros((1,65),np.float64)
  
  mask, bgdModel, fgdModel = 
  cv2.grabCut(img,mask,None,bgdModel,fgdModel,5,cv2.GC_INIT_WITH_MASK)
  
  mask = np.where((mask==2)|(mask==0),0,1).astype('uint8')
  mask[mask == 1] = 255
  
  np.all(mask==init_mask) # True
  </code></pre>
  
  <p>Initial mask:</p>
  
  <p><a href="https://i.stack.imgur.com/Otiqe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Otiqe.png" alt="enter image description here"></a></p>
  
  <p>Image:</p>
  
  <p><a href="https://i.stack.imgur.com/8yWu5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8yWu5.png" alt="enter image description here"></a></p>
  
  <p>Thank you!</p>