Image Segmentation to obtain smallest particle
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How do I do segmentation to obtain smallest particle from a soil image?? I have used the following coding but its not giving accurate result. Please help. Thank you.
soil=imread('Example Image');
soil=rgb2gray(soil);
I_eq=adapthisteq(soil);
bw=im2bw(I_eq,graythresh(I_eq));
bw2=imfill(bw,'holes');
bw3=imopen(bw2,ones(5,5));
bw4=bwareaopen(bw3,40);
bw4_perim=bwperim(bw4);
mask_em=imextendedmax(I_eq,30);
I_eq_c=imcomplement(I_eq);
I_mod=imimposemin(I_eq_c,~bw4|mask_em);
L=watershed(I_mod);
cc = bwconncomp(L,8);
n= cc.NumObjects;
0 commentaires
Réponses (1)
Walter Roberson
le 5 Juin 2017
That is a JPEG image. The smallest particle will probably be a single pixel, and you will have a heck of a time figuring out what is going wrong in your algorithm.
The short summary: never try to do scientific analysis on JPEG images -- not unless what you are trying to analyze is the operation of the JPEG algorithm itself.
3 commentaires
Walter Roberson
le 5 Juin 2017
PNG or TIFF or BMP or DICOM.
I am fond of TIFF format; Image Analyst tends to favor PNG.
If you need to store multiple related images together, such as hyperspectral images, then TIFF or DICOM are designed for that, and PNG can be made to work for that, but not the other image formats.
Voir également
Catégories
En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!