|
|
|
@ -63,14 +63,14 @@ def onmouse(event,x,y,flags,param): |
|
|
|
|
if rectangle == True: |
|
|
|
|
img = img2.copy() |
|
|
|
|
cv2.rectangle(img,(ix,iy),(x,y),BLUE,2) |
|
|
|
|
rect = (ix,iy,abs(ix-x),abs(iy-y)) |
|
|
|
|
rect = (min(ix,x),min(iy,y),abs(ix-x),abs(iy-y)) |
|
|
|
|
rect_or_mask = 0 |
|
|
|
|
|
|
|
|
|
elif event == cv2.EVENT_RBUTTONUP: |
|
|
|
|
rectangle = False |
|
|
|
|
rect_over = True |
|
|
|
|
cv2.rectangle(img,(ix,iy),(x,y),BLUE,2) |
|
|
|
|
rect = (ix,iy,abs(ix-x),abs(iy-y)) |
|
|
|
|
rect = (min(ix,x),min(iy,y),abs(ix-x),abs(iy-y)) |
|
|
|
|
rect_or_mask = 0 |
|
|
|
|
print " Now press the key 'n' a few times until no further change \n" |
|
|
|
|
|
|
|
|
|