opencvdragrect
opencvdragrect copied to clipboard
Late finding
It seems the waitkey() in clearCanvasNDraw() of the selectinwindow.py causes the recursive stack.
My temporary solution is to comment it out:
selectinwindow.py:
def clearCanvasNDraw(dragObj):
# Draw
# ...
drawSelectMarkers(tmp, dragObj)
cv2.imshow(dragObj.wname, tmp)
# cv2.waitKey() # <-- comment out
script.py:
cv2.imshow(wName, rectI.image) # draw image once
while True:
# display the image
# cv2.imshow(wName, rectI.image) <-- move to outside of the loop
key = cv2.waitKey(1) & 0xFF
# if returnflag is True or 'q' is hit, break from the loop
if rectI.returnflag or key == ord('q'):
break