Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

how to dynamically measure distance between two points

I am trying to measure the distance between two points as they move away from each other and then back again. I have aquired the image and built a script script in vision assistant to do what I want it to, but I am unsure as to how to handle the data for display purposes. Can someone please help me with this? Let me know if I have not provided enough details. Thanks everyone in advance.

 

Nic

0 Kudos
Message 1 of 6
(6,424 Views)

Hello,

 

it depends on your goal. What do you want to display? How do you want to display it? You need to think what kind of results interpretation would give you the best and most extensive information about your measurements.

 

In your case I would probably go with an image display with the overlaid points and distances (text and a line) and perhaps I would also plot the distances on a waveform chart in order to have some history. Are you measuring the Euclidean distance or vertical and horizontal distances seperately?

 

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 2 of 6
(6,406 Views)

I am calculating the Euclidean distance, and I do want to show the line and text like you're saying. I just don't understand how to make those things appear in my picture. Sorry, I am a novice with this Vision stuff. I have included a screenshot of my code to hopefully allow you to see exactly where I am going wrong. Thank you for your help.

 

Screenshot of Measurement code.jpg

0 Kudos
Message 3 of 6
(6,397 Views)

Hello,

 

maybe something like this (I have just made up two points, i.e. Point 1 and Point 2):

 

Example_VI_FP.png

 

 

Example_VI_BD.png

 

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 4 of 6
(6,386 Views)

Note that the distance calculation can be dramatically simplified by using complex math.

 

 

 

(assums that the two input arrays have two elements)

Message 5 of 6
(6,383 Views)

Thank you everyone for your help. It is very much appreciated.

0 Kudos
Message 6 of 6
(6,374 Views)