Grain Model how to remove smaller grains
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a grain model which consists of lots of tiny grains and clusters of of larger grains. I am wondering how it is possible to separate the smaller grains from the larger grains like the example below
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1025105/image.png)
I plot my grains by reading in rectilinear coordinates via reading in an Amira file to Matlab. This lets me plot my material matrix but I have no idea how to go about separating the grains. Has anyone done something similar before? I would be more than happy to share my files if anyone can point me in the right direction.
Thanks :)
0 comentarios
Respuestas (3)
Constantino Carlos Reyes-Aldasoro
el 8 de Jun. de 2022
A bit difficult to help more without the data but I think that your problem can be fixed by selecting your grains by the properties using ismember
Have a look and let us know if this solves your problem or not
Image Analyst
el 8 de Jun. de 2022
If you have a binary image of the grains, you can use bwareaopen or bwareafilt to extract grains of a certain size.
2 comentarios
Image Analyst
el 8 de Jun. de 2022
Do you have a labeled image? Or indexed image? It looks like you do because you have separate colors for them. If you do, you can do it.
Constantino Carlos Reyes-Aldasoro
el 8 de Jun. de 2022
Ok, I think now I understand your problem. I thought you had information on the grains themselves, but if you are starting with a grainy image, what you need to do is to filter the image. Take your original image (this one includes the title and labels as it is the one you sent)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1025605/image.png)
Use a median filter like this
imagesc(medfilt3(MatGrid,[5 5 1]))
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1025610/image.png)
And that removes the small grains from the image.
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!