How to remove a contour inside contour in Python OpenCV?

后端 未结 2 897
长发绾君心
长发绾君心 2020-12-28 19:55

OpenCV in Python provides the following code:

regions, hierarchy = cv2.findContours(binary_image, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)


for region in reg         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-28 20:36

    img_output, contours, hierarchy = cv2.findContours(blank_image_firstImage, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
    

    This removes the child contour

提交回复
热议问题