![]() ![]() The event variable contains events like mouse clicks. X and y are image coordinates, not in screen coordinates (so they follow zoom, etc). NamedWindow("Image",WINDOW_NORMAL|WINDOW_KEEPRATIO) the coordinates will be in x and y variables this function will be called every time you move your mouse over the image Static void onMouse(int event,int x,int y,int,void*) The following code will display a crosshair at the mouse position: #include I'm not sure if I understood you correctly, but maybe you want to use the mouse callbacks. The above reasons are why I am looking for an OpenCV function to give me cursor coordinates derived from an OpenCV image. I can see that if I have a camera derived image/matrix from OpenCV, that the XY coordinates received by the MS function might not (probably will not) be aligned with the XY matrix generated by OpenCV.I don't necessarily wish to use the MS operating system long term for the final version.Two problems that I see with using these MS c++ functions: Now, there are a number of MS Windows functions that are used to get cursor coordinates and display them. All that I need now is a way to read the cursor X/Y coordinates. One such that I can change the cursor position on the bounded image by using a joystick or mouse. I am going to generate my own cursor using OpenCV on an OpenCV modified image (matrix). Now, I am working with OpenCV and I have seen how I can draw lines and circles (probably more complex shapes as well) using OpenCV functions (or do you call them modules?). 35 years ago, when I was working in the Image Processing industry (yes, I am that old) we made our own cursors from lookup tables. ![]()
0 Comments
Leave a Reply. |