Ask Your Question

Revision history [back]

click to hide/show revision 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)

image description

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)

image description

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)

image description

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)

image description