title: Get area within contours Opencv Python?
body: <p>I have used an adaptive thresholding technique to create a picture like the one below:</p>
  
  <p><img src="https://i.stack.imgur.com/DJATa.png" alt="enter image description here"></p>
  
  <p>The code I used was:</p>
  
  <pre><code>image = cv2.adaptiveThreshold(image, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY_INV, 45, 0)
  </code></pre>
  
  <p>Then, I use this code to get contours:</p>
  
  <pre><code>cnt = cv2.findContours(image, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)[0]
  </code></pre>
  
  <p>My goal is to generate a mask using all the pixels within the outer contour, so I want to fill in all pixels within the object to be white.  How can I do this?</p>
  
  <p>I have tried the code below to create a mask, but the resulting mask seems no different then the image after applying adaptive threshold</p>
  
  <pre><code>mask = np.zeros(image.shape[:2], np.uint8)
  cv2.drawContours(mask, cnt, -1, 255, -1)
  </code></pre>