Remove an opencv contour from a list of contours [duplicate]
问题 This question already has answers here : Test if a numpy array is a member of a list of numpy arrays, and remove it from the list (3 answers) Closed last year . With opencv , I'm detecting contours and selecting some of them: CNTS = [] _, contours, _ = cv2.findContours(gray, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) for c in contours: if some_condition(c): CNTS.append(c) Then I'm looping over 2-subsets {c1, c2} of the list of contours, and removing some of them: TMP = CNTS[:] # copy it, to