Image Segmentation to obtain smallest particle
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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;
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/164858/image.jpeg)
0 comentarios
Respuestas (1)
Walter Roberson
el 5 de Jun. de 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 comentarios
Walter Roberson
el 5 de Jun. de 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.
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!