I need to know how do i draw lines between four points? all points are detected by contours. There are four red points.as shown below these points are detected using cv2.findContours. After I need to draw lines on each of points like a rectangle. Can someone please help me to solve this ? Also I used convexhull to do this but i couldn't sort it out.
here is the code that i used
ret, frame = cap.read()
hsv = cv2.cvtColor(frame,cv2.COLOR_BGR2HSV)
RedMask = cv2.inRange(hsv,(0,100,100),(10,255,255))
contours1, _ = cv2.findContours(RedMask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
for cnt1 in contours1:
#area = cv2.contourArea(cnt1)
#Draw it
#cv2.drawContours(frame,[cnt],0,(255,0,0),2)
hull = cv2.convexHull(cnt1)
cv2.drawContours(frame,hull,3,(255,0,0),2)