Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to measure curved strip width?

Hi,
 
I have some kind of long flexible vegetables (stalk), and i need to measure its width and length in the product line.
You can think about the problem of measuring a snake width, and length; the width change as function of the distance from the head...
 
The simple caliper in AI Builder measure only the distance between two straight lines, and i didnt found any build-in function that will measure a flxible strip.
 
So the two question are:
1) How to measure a constant width of flexible strip (snake, without the head and tail)
2) How to measure a changing width of flexible strip (full version of snake Robot Happy )
 
 
How i can do it in elegant and non cpu-consuming way. (fast product line)
 
 
tnx,
HaD
0 Kudos
Message 1 of 2
(2,917 Views)
Hello HaD!

Thank you for contacting National Instruments! I have a couple of ideas on how to do these kind of measurements.  The key to measuring the width is to come up with some kind of algorithm that will probably involve some geometry.  One way is to have a bunch of edge detection lines on a region of interest and then calculate the distance between two detected edges for each line.  The smallest width for all the lines will be the actual width of the stalk.  This works for a constant width.  The length could then be calculated in a similar fashion by thresholding the image and turning it into a particle.  You could then do a particle analysis and find the area of the particle and simply divide the Area by the Width to get the length.  Again this will only work for a constant width.  You could do this for the changing width but then you would need to calculate all the widths for the entire length.  One idea is to set up a kind of search method where you could do edge detection on a line then rotate the line a number of degrees and then calculate the edges and distance again until you get the smallest distance.  These are just a couple of ideas that will hopefully get you started.  For particle analysis you can go to the Help Menu and load the solution "Cell Analysis".  This example will show you how to turn your image into a binary image for analysis.  Good luck on the project and I invite anyone else with experience doing this to post with some ideas.

Regards,
Mark T
Applications Engineer | National Instruments
0 Kudos
Message 2 of 2
(2,899 Views)