Distance between edges
Anonymous  [1 posts]
17 year
Is there a way to determine the distance (in pixels) between 2 edges?

For instance:  Trying to fill bottles of different heights with water and stopping the water level at the same distance below the bottle lip.

I can use the edge detection filters to get a line for the top of the bottle and the water level but I need to get the distance between them so I can stop filling the bottle at a predetermined distance.

Anonymous 17 year

Have a quick look at the first part of another posting at


which has some discussion around distance between edges.

Basically you can use the Blob Filter to generate a list of COG's (select the Create Blobs Array checkbox and add in at least one filter) and then use VBScript to calculate the distance between those two blobs or lines. See the robo-file in the other posting.

Can you also post an image? In that way we can better understand the problem and propose a solution.

distance between features
David from United States  [3 posts]
17 year
Here's an example image.

what I'm looking for is the distance between the lower edge of the white half moon near the center of the image and the faint horizontal line in the upper quarter.  

my original thought was to use a vertical intensity profile.  Basically a histgram along a verticle line.  Then measure the distance between to maxima.  

I've tried to generate blobs and use COG but the contrast is too low.

Any suggestions?


Anonymous 17 year

What you can start with is the hough transform that finds the upper line.

Then threshold to get the lower white blob, then crop to a thin middle slice and get the topmost and lowest points. From there you can calculate the distance.

Here's the hough lines superimposed on the image:

and the thresholded largest blob merged with the white hough lines looks like:

which when cropped and point detected give you

Attached is the robofile. I assume you can take it from here??

Note this works with just this image ... you'll need to try it on others to check for other situations that may cause this to fail.

Anonymous 17 year

Works great.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index