title: Remove an opencv contour from a list of contours
body: <p>With <code>opencv</code>, I'm detecting contours and selecting some of them:</p>
  
  <pre><code>CNTS = []
  _, contours, _ = cv2.findContours(gray, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
  for c in contours:
      if some_condition(c):
          CNTS.append(c)
  </code></pre>
  
  <p>Then I'm looping over 2-subsets {c1, c2} of the list of contours, and removing some of them:</p>
  
  <pre><code>TMP = CNTS[:]  # copy it, to avoid deleting element from a list while looping on it!
  for c1, c2 in itertools.combinations(TMP, 2):
      if dist(c1, c2) &lt; 100  # custom function to evaluate distance between 2 contours
          if c1 in CNTS:  # it might have been already removed
              CNTS.remove(c1)
  </code></pre>
  
  <p>Here comes the problem in the <code>CNTS.remove(c1)</code> line:</p>
  
  <blockquote>
    <p>ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()</p>
  </blockquote>
  
  <p><strong>How to correctly remove a contour from a list of <code>opencv</code> contours?</strong>  </p>
  
  <p>Note: in fact, it works most of the time, but sometimes, after a few iterations, I have this bug. Maybe because a contour is a list of points, and then <strong>testing if a "list of points" is member of another list</strong> is ambiguous?  </p>
  
  <p>More generally, in Python, are there some ambiguous cases when testing if a list of points (=list of lists of 2 elements!) is itself a member of another list?</p>