I'm using Python and OpenCV for some vision application. I need to save mouse position in variables and I don't know how. I can get the current mouse position to print in window, but can't save it to variable.
My problem is similar to this one only I work in python: OpenCV Return value from mouse callback function
I define my function like this (for printing mouse position):
def mousePosition(event,x,y,flags,param):
if event == cv2.EVENT_MOUSEMOVE:
print x,y
I use it in my program like this:
cv2.setMouseCallback('Drawing spline',mousePosition)