Measuring line length using ridge detection

Tags: #<Tag:0x00007fb890568b50> #<Tag:0x00007fb8905688a8> #<Tag:0x00007fb8905684c0> #<Tag:0x00007fb890568240>



I am trying to measure the line length of the blue lines shown in the image below. I have tried using various combinations of making it binary, auto threshold, using skeleton 3d, and other image altering processes to get ridge detection to properly read the lines, but I am having no luck. I always end up with ridge detection saying I have more blue lines than I actually do. Has anyone had any luck with a similar project that can point me in the right direction or is using a different method to alter the picture so ridge detection can properly work?

Any help is greatly appreciated!


Good day!

I guess your image doesn’t show real data …

What precision do you expect?

I would use the perimeter and an estimate of the width of the structures. With these measures the length could be estimated as
(perimeter - 2 * width) / 2




Hello Herbie,

I have attached a link to a picture of what i want the image process to work on. I was using the above picture since it as a lot easier to validate whether the length is correct or not. Please let me know whether your advice would change having viewed this photo. I am looking for it to be decently precise, anything above 80% would be great.




we had this task before:

Good luck



It seems to work well on that picture, but i cannot get it to work on pictures such as below


I guess the question is whether there is a specific method that would be possible, or if i need to look into changing the pictures to provide a larger contrast between the lines and the background since i haven’t been able to do so with threshold


Good day!

the fundamental problem with this image is noise and spatial resolution. The former is much too high and the latter is rather low …




The provided link to an earlier forum discussion
contains a number of approaches that you should consider.

In my opinion the main problem with images such as the one you refer to here:
are overlapping/crossing/joining fibers (and perhaps low spatial resolution). Both problems are inexistent with your introductory task.

If you study the proposed approaches you will realize that a solution of the task is far from trivial.