Image segmentation for image processing
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a soil image to do analysis. I need to extract the size(diameter) of each soil particles from the image to determine the type of soil. I have done the segmentation using image filters but it seems like not working. It can't extract minute particles from the image. Please help! Thank you! Below is the sample image.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/165111/image.jpeg)
The below is the code I have used :-
rgbImage = imread('S01-15.tiff');
grayImage = rgb2gray(rgbImage);
se = strel('disk', 1,8);
filteredImage = imbothat(grayImage, se);
binaryImage = filteredImage > 1;
cc = bwconncomp(binaryImage,8);
n= cc.NumObjects;
Area = zeros(n,1);
Diameter = zeros(n,1);
MajorAxis = zeros(n,1);
Sand = zeros(n,1);
Silt = zeros(n,1);
Clay = zeros(n,1);
k = regionprops(cc,'Area','EquivDiameter','MajorAxisLength');
numClayParticles = 0;
numSiltParticles = 0;
numSandParticles = 0;
for m=1:n
Area(m) = k(m).Area;
Diameter(m) = k(m).EquivDiameter;
MajorAxis(m) = k(m).MajorAxisLength;
if Diameter(m) < 0.0236
Clay(m)=Diameter(m);
numClayParticles = numClayParticles + 1;
elseif Diameter(m) >=0.0236 && Diameter(m) < 0.5906
Silt(m)= Diameter(m);
numSiltParticles = numSiltParticles + 1;
elseif Diameter(m) >= 0.5906
Sand(m) = Diameter(m);
numSandParticles = numSandParticles + 1;
end
end
0 comentarios
Respuestas (0)
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!