Image analysis: Finding the cusp spacing
Show older comments
Hi all,
I am stuck with an issue.Please forgive and redirect me if these type of problems are already addressed.
Please refer the following picture, https://picasaweb.google.com/116243239493929305987/ImageAnalysis#5654551982275072578, I would like to measure the spacing between the cusps of the long black laths...Right now I am doing it manually by drawing a bisector to the lath and measuring the length to the hill and the valley ( as shown in red line in figure). As analysing hundreds of images in this way is a huge task, it will be of great help if you give me some guidance on how to automate this thing in matlab. Thanks in advance
8 Comments
Image Analyst
on 20 Sep 2011
I find it hard to figure out where you decided to start and stop your red lines. And many of your long black laths seem connected.
Walter Roberson
on 20 Sep 2011
I agree: I could not see the logic of where the red lines were to be drawn or not.
Shan Kapoor
on 23 Sep 2011
Shan Kapoor
on 23 Sep 2011
Walter Roberson
on 23 Sep 2011
I do not seem to be able to make any sense of the choices for red lines under the assumption that the black lath corresponds to globular portions. The positions of the red lines in the image would make much more sense to me under the following hypothesis:
Imagine that the black areas correspond to material that rises out of the plane of the screen; imagine that the material is fine-grained enough to have a near-constant slope angle (e.g., akin to sand-dunes), and thus that a wider area corresponds to a local peak and a narrower area corresponds to a local valley. In such a situation, the local minima of the boundaries of the black regions would correspond to local valleys, and the local maxima of the boundaries of the black regions would correspond to local peaks. Smooth the edge of the boundary first to avoid noise, find the minima and maxima, and draw the perpendiculars at each.
The hypothesis does break down a bit for the large lath that extends from roughly the horizontal center on rightward, but one lath upward from the vertical center; the long lath with very few perpendiculars on its upper left. That lath shows an obvious grain structure with sharp edges (which would be evidence against the globular material explanation.) The puzzle there is as to why there are not some perpendiculars near-ish to the grain boundaries, as they clearly represent some kind of cusp; also there is a local minima on the upper left portion that is not given a perpendicular even that there are other locations on the image were smaller relative minima are marked.
Image Analyst
on 23 Sep 2011
I'm afraid I can't help you. Looking at the very large mass in the lower right, you have 4 regions identified by the red lines and I can't figure out at all how you got them when it looks like one big connected mass and not 4 smaller masses that are just barely touching, at least to my eyes. Good luck with that.
Shan Kapoor
on 27 Sep 2011
Image Analyst
on 27 Sep 2011
I'm sorry but this if far too involved and complicated to answer in an online message. And I can't take on a paid consulting job like this right now. I still don't know what you're looking for and I couldn't even do it manually if I had to. Even for you I bet there are a huge number of judgment calls on what is or is not a feature you want to count. If and when you do figure it out you could probably get a paper out of it.
Answers (2)
Walter Roberson
on 27 Sep 2011
0 votes
When you say "putting an aspect ratio", do you mean you are excluding any black area whose major to minor axis ratio exceeds 3 ?
It appears to me that the automatic steps consists approximately of the following:
Binarize with a low threshold that converts gray and upwards to white. It might be a bit tricky to have the gray area in the upper left blue circle left out (converted to white) but not the circular-like gray area in the upper center blue circle. If a good simple threshold cannot be found, then you might need to use more advanced techniques based upon contrast with adjacent areas. "watershed" filtering perhaps.
Once you have the binary image, negate it (0->1, 1->0), so that the solid black crystals become solid white and everything else becomes a formless mass of black.
label the image; bwlabel() is the older routine and I have not memorized the name of the newer routine yet
Let the ratio of permitted major axis to minor be R -- e.g., 3 in your case. Define g = (R-1)/R. Then calculate the eccentricity, e, of the ellipse is sqrt(g*(2-g)). For R=3, you should come out with e = 2/3 * sqrt(2), I calculate.
regionprops() the labeled image. Throw away all portions whose eccentricity as measured by regionprops is greater than e
If you like, add additional "common sense" rejection of the regions, such as throwing out areas too small or too large to be relevant.
In theory, with luck, what remains should be information about the globular regions.
It would not surprise me if, after you negated the thresholded image, you had to do an imerode step to separate adjacent regions better.
Tolga Birdal
on 23 Jan 2013
Edited: Tolga Birdal
on 23 Jan 2013
0 votes
Shan,
How about:
Inform me if this might be interesting.
Regards, Tolga
Categories
Find more on Image Segmentation 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!