From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

detect distances to edges

Good afternoon,

 

Is there any function that can measure the distance from any pixel in an image to all the surrounding pixels which represent a border?. Just like a Laser Range Finder would work. I Just want to compare real distances to simulated distances in an image.

 

I tried with almost all the Labview examples but no one seems very useful to me.

 

Thanks in advance.

 

 

0 Kudos
Message 1 of 4
(2,397 Views)

Are you using the vision VI's?

You can do 'find edge' to find your border.

This will give you a X or Y value depending whether your border is horizontal or vertical.

 

Substract that value from you point value.

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 2 of 4
(2,389 Views)

The above will give you the shortest distance to the border.  If you truely want the distance to each pixel contained within the border, you will first need to establish the coordinates for each pixel that creates the border.  Then, you can use distance equations to calcluate the distance (in pixels) for each using a for loop.

 

 

0 Kudos
Message 3 of 4
(2,381 Views)

Thanks to both of you,

 

I'll try what you said. I also saw clamp Horizontal Min/Max and clamp vertical Min/Max that detect dinstances in search areas. 

 

The problem that I see in "Find edge" is that it only searches for lines, so when I get angles it maybe doesn't recognize them. Also, searching directions dont include diferent angles, just from left to righ, top to bottom and vice versa

0 Kudos
Message 4 of 4
(2,366 Views)