arccoder / opencvdragrect

Drag a rectangle on an image window using opencv
https://arccoder.github.io/opencvdragrect/
40 stars 21 forks source link

TypeError: an integer is required (got type tuple) #2

Closed AkkuAg closed 5 years ago

darkprince1337 commented 5 years ago

Did your problem solved?

AkkuAg commented 5 years ago

Did your problem solved?

Yes. Typecasted the values to integer

darkprince1337 commented 5 years ago

Can you tell me where exactly? or Can you please upload the updated selectinWindow.py?

AkkuAg commented 5 years ago

Can you tell me where exactly? or Can you please upload the updated selectinWindow.py? in drawSelectMarkers for top left cv2.rectangle(image, (int(dragObj.outRect.x - dragObj.sBlk), int(dragObj.outRect.y - dragObj.sBlk)), (int(dragObj.outRect.x - dragObj.sBlk + dragObj.sBlk * 2), int(dragObj.outRect.y - dragObj.sBlk + dragObj.sBlk * 2)), (0, 255, 0), 2) Similarly for all others it needs to be done in drawSelectMarkers

darkprince1337 commented 5 years ago

Can you tell me where exactly? or Can you please upload the updated selectinWindow.py? in drawSelectMarkers for top left cv2.rectangle(image, (int(dragObj.outRect.x - dragObj.sBlk), int(dragObj.outRect.y - dragObj.sBlk)), (int(dragObj.outRect.x - dragObj.sBlk + dragObj.sBlk * 2), int(dragObj.outRect.y - dragObj.sBlk + dragObj.sBlk * 2)), (0, 255, 0), 2) Similarly for all others it needs to be done in drawSelectMarkers

Damn! that's time consuming. Can you please share your updated selectinWindow.py file?

AkkuAg commented 5 years ago

selectinwindow.txt

darkprince1337 commented 5 years ago

selectinwindow.txt

Thanks a lot man!

sureshsass commented 4 years ago

The program crashes after some time while trying to resize or move the rectangle Using the script example provided. Any way this can be solved