Create a mask of irregular pore-like shapes
Afficher commentaires plus anciens
I would love to have an automatic way of creating random masks consisting of irregular shapes which resemble pores in some kind of material. With a mask, I mean an image with pixels of value 1 where the shapes are present and pixels of value 0 where no shapes are present. As an example, consider the following mask (create in MS Paint with manual labor :-)): Pore-like irregular shaped mask Ideally, the code should have the following parameters:
- average size of pores
- number of pores
- some irregularity parameter, high = highly irregular, low = more circular shaped
I did some attempts myself, but haven't found anything satisfying so far. The following example creates a mask that's to "regular" in my opinion:
figure();
imshow(imdilate(imerode(1-(randn(100,100)>0),strel('disk',1)),strel('disk',1)),[]);
3 commentaires
Geert
le 14 Oct 2013
Ottavia Rossini
le 16 Mai 2017
hey, did you manage to solve your problem? I have a similar task and can't really find an answer. Thanks
Image Analyst
le 16 Mai 2017
Did you try the voronoi() function like I suggested in my answer?
x = gallery('uniformdata',[1 10],0);
y = gallery('uniformdata',[1 10],1);
voronoi(x,y)

Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Process Point Clouds dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!