LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

angle between two objects approximated as lines

Hi there,
 
I have NI Vision and have been wondering the best way to get the angle of two objects that has been approximated by a line (say using edge detection). I have attached one frame of the avi file for your perusal. The scene is changing from frame to frame where the objects are constantly being shifted and rotated. I can track either the small object or the big object in isolation using pattern matching algorithms but the issue lies in moving the edge detection rake from frame to frame for two objects in a single trial. Please advise.

Cheers, B.
0 Kudos
Message 1 of 4
(3,098 Views)
In the attached image I would like fit a line on the leg of the image and another line on the spike coming out of the leg and get an angle between the two. The present image has been convereted from color to grayscale with a power (3.5) look-up table filter.
0 Kudos
Message 2 of 4
(3,094 Views)
Hi,

You can do this in several ways. The straight forward way would be to use the trigonometric funtions. If you filter the image you are acquiring to get the co-ordinates of the edges of the stick and also the refence to ground, as shown in the image attached, you can use the known values to calculate the angle the stick is aligned to ground.

Here, treat the picture as a 2D image, get the x,y co-ordinates of the point of interception (C) and the co-ordinates of a point in your stick (A). The difference in value of y between A and ground is your "p" and the difference in value of x between C and x value of the point (A) is your "b". Use the supplied equation to work out the angle as shown in image.

This should get you started and hope it helps.

Regards,
0 Kudos
Message 3 of 4
(3,032 Views)
Hi,

Thought this page contains some relative information about - What Algorithms Does the NI Vision Software Use?
Hope this helps.

Regards,
0 Kudos
Message 4 of 4
(2,992 Views)