Drawing a rectangle around all contours in OpenCV Python

前端 未结 3 641
无人及你
无人及你 2021-02-06 15:54

i have a code which identifies contours after applying filters on video frames. Now in my case i get 3 contours and i show them by drawing rectangles around them, what i want to

3条回答
  •  终归单人心
    2021-02-06 16:28

    If you want to box everything in a binary image, you can generate points from all non zero values and apply the algorithms on that. This is done as seen below:

        points = cv2.findNonZero(thresholdImage)
        rect = cv2.minAreaRect(points)
    

提交回复
热议问题