Image segmentation for image processing

조회 수: 1 (최근 30일)
Tinna Armasamy
Tinna Armasamy 2017년 6월 13일
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.
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개)

카테고리

Help CenterFile Exchange에서 Agriculture에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by