Length Measurement on Pictures

Hi,
i have images with fibres on them and I need a simple way to measure the length of those fibres.
My idea is, that I can add a starting point and several points in between the starting point and a endpoint, maybe just by left mouse click, and finish the process by right click. Since not all the fibres at straight but also curved, I need more than a starting and end point.
What would be the easiest way to write a program for that? Using GUI? Any ideas ? :)
Thanks for your help

6 Comments

Is it possible to isolate the individual fibres in the image? If so then it might be possible to derive a length automatically.
Any length you derive will have to be in pixels unless you have a "ruler" to compare against.
The problem is that you have a lot if intersections, i already tested several codes which do all the skeletonizing and finding intersections, but they take too much time and are not working very well. So it is easier for me to just do it manually.
what I got so far now is :
im = double(imread('detail4.bmp'))+1;
n = figure;
hold on;
image(im);
colormap(gray(256));
for i=1:10
[x(i),y(i)] = ginput(n);
if rem(i,2) == 0
%endpoint and line between start and end
plot(x(i),y(i),'y');
plot(x((i-1):i),y((i-1):i),'-g')
else
%start point
plot(x(i),y(i),'m');
end
i = i+1;
end
but like this I still can not put points in between start and end point
can you post a sample image?
http://dl.dropbox.com/u/48034073/detail4.bmp
the images look like this ... this is just a small part of the scan. As you can see, the fibers are not all straight.
I'll play with it in my free time at work tomorrow, see if I can figure something out quickly to segment it.
well good luck, i have tested the code of a guy who wrote a whole master thesis about this problem.
but if you find a way, it would be great ;)

Sign in to comment.

 Accepted Answer

Image Analyst
Image Analyst on 8 Jun 2012
That looks tough. I can foresee A LOT of false positives and false negatives. You might have to combine a multitude of approaches, like thresholding, edge detection, Hough() or Houghlines(), morphological filters, etc. Or do some research on ridge and valley detection: http://en.wikipedia.org/wiki/Ridge_detection

6 Comments

Doesn't the canny filter use ridge detection?
yes, that why I want to do it manually. I dont have the time to code a complicate program. And i don't have to do the measurement on many pictures.
Is there a way, to set some points on the fibre with left click maybe, and finishing the measurement on one fibre with right click?
Use Photoshop or ImageJ (This if free from the NIH).
Yes. Use improfile(). You get the x,y coordinates of the points you click on and then you can use the Pythagorean theorem or hypot() to get the distance between the points.
Ryan, I don't believe Canny uses ridge detection: http://en.wikipedia.org/wiki/Canny_edge_detector
I was under the impression that the nonmaximal supression step in Canny edge detection was needed as a result of the ridges that result in the gradient calculation.

Sign in to comment.

More Answers (0)

Categories

Find more on Read, Write, and Modify Image in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!