compatibility issue with contourArea in openCV 3

前端 未结 4 1056
既然无缘
既然无缘 2020-12-17 08:52

I am trying to do a simple area calculation of contours I get from findContours. My openCv version is 3.1.0

My code is:

cc = cv2.findContours(im_bw.c         


        
4条回答
  •  无人及你
    2020-12-17 09:30

    Thanks for @ZdaR; By the way, you can do the following in OpenCV 4.1:

    contours, hierarchy = cv2.findContours(im_bw.copy(), cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
    

提交回复
热议问题