Image analysis for speckle pattern

I have a NxN real (double) matrix which contains the information of a speckle pattern like the one shown in figure 1 (see the attachement).
The main goal here is to have a size distribution of the "speckle grains", so we can divide the problem in two different parts:
  1. given the image (or the matrix, whatever is the best for the algorithm), try to find the grains of the image;
  2. for each grain, apply some sort of analysis (contour? regionprops? edge?) in order to extrapolate the information of its size (i.e.: is it possible to fit a circunference and then extrapolate the diameter/radius?)
The idea is to apply a sort of "pattern recognition" in order to extrapolate both the number of grains and their size information, is it possible?

2 个评论

In order to isolate the grains and get information about their properties, you need to first decide what defines a "grain" and how each grain is distinct from the background and its neighbors.
I see a lot of features that are large entangled blobs. If you expect those features to be divided into smaller parts, @Benjamin Thompson's suggestion might be a good place to start.
Thank you for replying. I think that the crux of the problem is to isolate the grains, given the complexity of the pattern. You are right, Benjamin's suggestion is a good place to start, but, unfortunately, it fails in separating all those (very complicated) entangled blobs.

请先登录,再进行评论。

回答(3 个)

3 个评论

Thank you very much for your answer. The idea might be correct, however, I think that my pattern is way too complicated. The "bwconncomp" command (which is the crux of the algorithm) states that pixels are connected if their edges touch, which take the algorithm to group many grains that would otherwise be detached, leading to an overestimation of the grain area. Maybe a more sophisticated way is needed, or maybe I am missing something
We cannot help you define what is a grain in your problem, but once you have done that, these methods will calcalate the grain area and other properties. If you are having problems with this, sometimes changing how the image is captured can help. Try different lighting, a different type of camera, etc.
I agree with you. Indeed, thank you very much for your answer, it helped me by looking at my problem from a different perspective. To answer the last part of your reply: unfortunately I cannot change my image since it is a simulation, so I cannot change lighting, or similar.

请先登录,再进行评论。

It's not obvious what a single grain is. What instrument created this? Was it an AFM? Can you zoom in so that the "grains" are bigger than a few pixels? What material is this?
Otherwise I think you'll need to look to other metrics to describe what you are trying to correlate your image analysis measurement to. Like for example you want some image metric to correlate with strength of the material. Well maybe you can measure some bulk metric like the standard deviation of the gray levels and that might be just as good as if you were able to find the grain area distribution.

6 个评论

Thank you very much for your answer.
I totally agree with you, "it's not obvious what a single grain is", that's a huge problem. This is also because the grain size in about 2-3 pixels, which complicates the pattern and the detection of the single grain. Unfortunately, this is a simulation, so I can obtain easily different pattern and different grain sizes (i.e. 10-20 pixel or even more). Despite that, the simulation in which I need this kind of analysis has a pattern similar to the one shown in figure_1.
The second part of your anser is raising a very interesting point of view. Maybe the single grain cannot be detected by "standard image analysis", but the discriminant can be connected to the standard deviation of the gray levels. I will look forward to implement something around this idea. Do you have any suggestions?
There are tons of things that can be measured. What is the characteristic of the material that you'd like to model the image analysis measurements to? Strength? Melting point? pH? Stiffness? Glossiness? Roughness or coefficient of friction? Flexibility? Density? There has to be something. I mean, let's say you were able to measure grain/cell size. Ok, so what? What are you going to do with that information?
Maybe you can supply 3 examples, like a "best" material, a "worst" material, and one in the middle. Then we can see what changes from one image to the next.
Actually the simulation is given by a speckle pattern possibly generated by surface roughness and/or contamination. It's not a simulation of a specific material.
Knowing the grain size can help to have a better idea of the distribution of sizes, in order to adjust a future algorithm who will be able to detect a spot of similar intensity and size in a pattern like the one shown.
I hope I've been clear. Thank you again for your answer.
Not really. It sounds like you're essentially saying "I need the grain size distribution because I need the grain size distribution." I'm not sure I see any spots but if you just want to find bright spots, you can threshold -- you don't need the sizes to do that.
If you really want to find grain boundaries and regions then you might try watershed.
In a certain way you are right. In fact I need the grain size distribution let's say "for statistical reasons", which might sounds silly. The main reason why I'm struggling in doing this is because I want to compare the value that will come from this "statistical study" to the theoretical value.
I'm already trying to thresholding the image and then calculate the areas of the "binary image" that I obtain in the process. Thank you very much for the suggestion of the "watershed" tool. I appreciate it

请先登录,再进行评论。

A couple of things I'd try would be to determine the size-distribution of the speckles at different intensity-levels. This I'd do by determining the grain-boundaries at some intensity-levels using contour and either of contour-matrix-to-coordinates or getcontourlinecoordinates to get the speckle-boundaries, then find all contours that are closed and calculate their areas using
For each speckle j.
It should be reasonably straightforward to determine which contours are closed - same start and end-point, at least to within double-precision.
Once you have the contour-coordinates and loop over all speckles you might as well calculate the total intensity inside a speckle, for that you should have good use of inpolygon to determine which pixels belong to a speckle (this might not be very efficient, but this should not be a too time-consuming task anyway). You might just as well calculate the centroids (both the area-centroid and the center-of-intensity) of the speckles and look at the distribution of those over the image (nearest-neighbor-distance and whatnot.)
HTH

产品

版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by