if classes[i]==1:
                cv2.putText(img,'lane'+str(cls_boxes[i,4]),(center_bbox_x,center_bbox_y),  cv2.FONT_HERSHEY_SIMPLEX , 1,myColorList[0],1,cv2.LINE_AA)
                cv2.drawContours(img,contour,-1,myColorList[0],1)
                #将轮廓集contour中的第一条轮廓进行多边形拟合
                epsilon = 0.02*cv2.arcLength(contour[0],True)
                approx = cv2.approxPolyDP(contour[0],epsilon,True)
                cv2.drawContours(img,[approx],-1,(255,0,100),3) #如果“approx”不加上“[ ]”画出来的是拟合后的点

 

python opencv 多边形拟合

 

相关文章:

  • 2021-04-16
  • 2021-05-31
  • 2021-07-01
  • 2022-02-09
  • 2021-10-27
  • 2022-01-04
  • 2022-02-09
  • 2021-12-16
猜你喜欢
  • 2022-12-23
  • 2021-07-03
  • 2021-10-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案