Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

coordinate

Solved!
Go to solution

hello:

 

I am writing to say how can i make the user mouse-click two points and get the coordinate of the selected two points, subtract the coordinate of the selected two points x1-x2 and y1-y2 and then send the value to the divison part of the "match"

 

by the way , if i want the user first select  the region they are interested in and then in this region the user will select the part they want to track . In other words, i mean that for the search process we only deal part of the images only the whole images which should be time saving. Is that possible and how?

 

 

 

xiaocheng ou

0 Kudos
Message 1 of 14
(5,436 Views)

Hello,

 

the snapshot below shows one of the possible solutions for obtaining clicked coordinates on a displayed image (you can put the event in a parallel loop to the acquisition for better efficiency):

 

Example_VI_BD.png

 

Certainly it is possible to limit the search region. This not only improves the matching time, but also gives you a more roboust solution in different cases. The attached program is an example on how to select a rectangular region on a displayed image and then learn the pattern matching descriptor. This template can be searched only inside the specified search ROI, which depends on the previous match position and the user specified search size (in pixels).

 

To try the program (Labview 2013), first select the object on the displayed image (rectangular ROI) and click "learn template". You can than click "search" to search for the template on a live image, limited by the ROI size specified by the user "Search ROI (half size)".

 

The code is not cleaned up - you should make some subVI's for better readability.

 

Hope this helps a bit. If anything is unclear, please let me know.

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Message 2 of 14
(5,414 Views)

thanks for your help~~~Smiley Happy

0 Kudos
Message 3 of 14
(5,406 Views)

hello:

 

i have add the mouse uo event but the vi can not run successfully. Can you help me to figure it out?

 

 

Download All
0 Kudos
Message 4 of 14
(5,355 Views)

hello:

 

the final version of the vi but can not run successfully. Could you help me?

 

Download All
0 Kudos
Message 5 of 14
(5,348 Views)

Hello,

 

what exactly is the problem?

There are no errors visible, so obviousy the program can be compiled.

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 6 of 14
(5,343 Views)

it seems that when i load the avi, i can not select the two points and i gott stuck . I have send the video (It is on the first flour)

My goal is first load the avi and then select two points ( the user will tell you the real length and ) and then select the region for search and then learn the template and then match the template . But now the vi got stuck when i try to select the two points and select the region for search.

0 Kudos
Message 7 of 14
(5,331 Views)

Hello,

 

hmmm... You have an event inside another event. And the "top event" never times out, so it reacts only to the user input.

 

I would say that you should put the "mouse up event" in a parallel while loop. Or create another event on a "top level" that will handle the mouse clicks. Also, remove the for loop and pass the clicked coordinates via a shift register until two u,v coordinates are set and then pass them to the rest of the processing...

 

You can also attach a short avi file for me to test the program.

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 8 of 14
(5,325 Views)

see this avi . so i do not understand if i remove the for loop how can i get two ordinates

0 Kudos
Message 9 of 14
(5,323 Views)

i have changed the vi right now  but it seem that there is also some mistakes.

0 Kudos
Message 10 of 14
(5,320 Views)