I want to drag and drop an image file to cv2.imshow()
window and fetch the filename path.
There is no event named drag and drop and I need some help.
In my project I remove the background image and I want to change the background with any image.
I did the hard part (removing the background) but I don't know how to handle drag/drop files event in OpenCV python.
def mouse_events(event, x,y, flags,param):
if event == cv2.EVENT_??: # ?? drag/drop a file event
# return the filename
while True:
...
cv2.setMouseCallback(windowName, mouse_events)
...
Thanks in advance