Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to fix shift in y-direction of mouse position

Hi,

I draw a polygon using mouse clicks and realised some shifts in the returned y-position. 1. when clicking on the top part of the frame, the mouse click position is shifted by a few pixels up 2. when clicking in the lower part of the frame, the mouse click position is shifted by a few pixels down 3. when clicking in the middle of the frame, the mouse click position is correct

I could observe this in my code and could replicate it with the code of the tutorial Draw circles: https://pysource.com/2018/03/27/mouse-events-opencv-3-4-with-python-3-tutorial-27/

I am using OpenCV 3.4.2, Python-binding, OSX 10.14.3

Thanks for any help

Best Andreas

click to hide/show revision 2
retagged

updated 2019-05-03 04:01:53 -0500

berak gravatar image

How to fix shift in y-direction of mouse position

Hi,

I draw a polygon using mouse clicks and realised some shifts in the returned y-position. 1. when clicking on the top part of the frame, the mouse click position is shifted by a few pixels up 2. when clicking in the lower part of the frame, the mouse click position is shifted by a few pixels down 3. when clicking in the middle of the frame, the mouse click position is correct

I could observe this in my code and could replicate it with the code of the tutorial Draw circles: https://pysource.com/2018/03/27/mouse-events-opencv-3-4-with-python-3-tutorial-27/

I am using OpenCV 3.4.2, Python-binding, OSX 10.14.3

Thanks for any help

Best Andreas