Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ix=0
- iy=0
- cropping=False
- refPt=[]
- def draw(event, x, y, flags, param):
- global ix, iy, drawing, right_mouse_button, left_mouse_button, \
- refPt, cropping, color, thickness
- ix = int(x)
- iy = int(y)
- if event == cv2.EVENT_MBUTTONDOWN:
- if not cropping:
- refPt = [(x, y)]
- cropping = True
- else:
- cropping = False
- refPt.append((x, y))
- cv2.rectangle(o2, refPt[0], refPt[1], color, thickness, cv2.LINE_8)
- cv2.setMouseCallback('normal', draw)
- o2 = cv2.rectangle (o2, (refPt[0]), (refPt[1]), (0, 255, 0), 3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement