How to remove a contour inside contour in Python OpenCV? : <p>OpenCV in Python provides the following code:</p>

<pre><code>regions, hierarchy = cv2.findContours(binary_image, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)


for region in regions:
    x, y, w, h = cv2.boundingRect(region)

    cv2.rectangle(image, (x, y), (x + w, y + h), (0, 255, 0), 1)
</code></pre>

<p>This gives some contours within contour. How to remove them in Python?</p>
