1 | initial version |
Contour lines doesn't exists because a contour is a set of points. You can draw lines between points with polylines. By the way convexHull will give what you want ! try it.
cnt = cnts[0]
hull = cv2.convexHull(cnt)
cv2.polylines(img,hull,true,(0,255,0),3)
2 | No.2 Revision |
Contour lines doesn't exists because a contour is a set of points. You can draw lines between points with polylines. By the way as @sturkmen, convexHull will give what you want ! try it.
ima,cnts,hie= cv2.findContours(canny,cv2.CV_RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE)
cnt = cnts[0]
hull = cv2.convexHull(cnt)
cv2.polylines(img,hull,true,(0,255,0),3)
3 | No.3 Revision |
Contour lines doesn't exists because a contour is a set of points. You can draw lines between points with polylines. .
By the way as @sturkmen, convexHull will give what you want ! try it.
ima,cnts,hie= cv2.findContours(canny,cv2.CV_RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE)
cnt = cnts[0]
hull = cv2.convexHull(cnt)
cv2.polylines(img,hull,true,(0,255,0),3)
4 | No.4 Revision |
Contour lines doesn't exists because a contour is a set of points. You can draw lines between points with polylines.
By the way as @sturkmen, already said by @sturkmen: convexHull will give what you want ! try it. solves your problem ...try it.
ima,cnts,hie= cv2.findContours(canny,cv2.CV_RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE)
cnt = cnts[0]
hull = cv2.convexHull(cnt)
cv2.polylines(img,hull,true,(0,255,0),3)