Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the position of the cursor in an IMAQ window

I am currently working on a project using LabView 6.0 and IMAQ Vision. I need to get the instantaneous coordinates of the cursor in an IMAQ window, without clicking the mouse button. The purpose is to let a laser beam follow the movement of the cursor.

The coordinates are in the toolbox as shown in the attached diagram. Is there any simple way to get these coordinates, preferably without using external code? Thanks!
0 Kudos
Message 1 of 4
(4,102 Views)
G'Day,

You can't follow the mouse cursor natively in LabVIEW unless one of the mouse buttons is down, but I've attached a VI that will trace a freehand draw operation - maybe that will help?

PS: This is an example VI from my upcoming book "image Acquisition and Processing with LabVIEW" - would you mind if I used your image in my book as an example?

cheers,
Christopher

Christopher G. Relf
Certified LabVIEW Developer

Christopher.Relf@mBox.com.au
International Voicemail & Fax: +61 2 8080 8132
Australian Voicemail & Fax: (02) 8080 8132

---
EULA
1) This is a private email, and although the views expressed within it may not be purely my own, unless specifically referenced I do not suggest they are necessarily associated with anyone else incl
uding, but not limited to, my employer(s).
2) This email has NOT been scanned for virii - attached file(s), if any, are provided as is. By copying, detaching and/or opening attached files, you agree to indemnify the sender of such responsibility.
3) Because e-mail can be altered electronically, the integrity of this communication cannot be guaranteed.




Copyright © 2004-2024 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 4.0 License.
0 Kudos
Message 2 of 4
(4,102 Views)
I found a way to track the motion of the mouse. I am not sure if this will do what you want.

Select the "Point" ROI tool. Click once on the screen to create a Point ROI. Grab the ROI and drag it around. While you are dragging it, you can read the current ROI and extract the position. This will give you a continuous readout of the mouse position within the image without needing to repeatedly click the mouse. Unfortunately, it is not an intuitive operation for the user.

Bruce
Bruce Ammons
Ammons Engineering
Message 3 of 4
(4,102 Views)
Might another suggestion be to use the mouse tracking tools in the LabVIEW Windows API utility library (search DevZone)/G toolbox(http://www.geocities.com/gzou999/)?

I forget if this is simply mouse position across the entire screen i.e. 1024x768 or whatever your current screen resolution is or whether you can specify a window in which you wish to track mouse movement. There are window utilities that will allow you to get a pointer to the IMAQ Vision window so this "should" work....

Possibly a more user-friendly solution? It is a thought rather than a "I've tried this and it works" as I am away from all my software development tools at the moment!

Jeremy
0 Kudos
Message 4 of 4
(4,102 Views)