Image Segmentation to obtain smallest particle
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Walter Roberson
2017 年 6 月 5 日
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 件のコメント
Walter Roberson
2017 年 6 月 5 日
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.
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!