Is there a way to segment this image into 3 parts, even though the colours are so similar?

2 ビュー (過去 30 日間)
Hi folks, I am trying to segment the following image of a seed. The points of interest look very similar in RGB, HSV, LAB and YCbCr colour spaces. Is there a way to segment out the 3 areas of interest? I am looking specifically to segment out the germ, endosperm (corneus + floury) and pericarp. I need to find an automated way to do this as there are hundreds of images to analyse!
Below is an example of my images, followed by a labelled diagram of the seed.
Thanks in advance!

採用された回答

yanqi liu
yanqi liu 2021 年 12 月 1 日
yes,sir,may be use kmeans or watershed
clc;
clear all;
close all;
img = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/818419/image.png');
img = imresize(img, 0.3, 'bilinear');
im = rgb2gray(img);
bw = ~imbinarize(im,'adaptive','ForegroundPolarity','dark','Sensitivity',0.6);
bw = imclose(imopen(bw, strel('disk', 2)), strel('disk', 5));
bw = bwareafilt(bw,1);
bw = imfill(bw, 'holes');
bw = imopen(bw, strel('disk', 13));
bw = bwareafilt(bw,1);
im = im .* uint8(bw);
% make segment
im = mat2gray(im);
bw1 = imbinarize(im,'adaptive','ForegroundPolarity','dark','Sensitivity',0.7);
bw1 = imclose(bw1, strel('disk', 5));
bw1 = imopen(bw1, strel('disk', 15));
bw1 = imdilate(bwareafilt(bw1,1), strel('disk', 5));
figure; imshow(img);
hold on;
h=imshow(label2rgb(bwlabel(bw1)),[]);
set(h,'AlphaData', 0.6)
  2 件のコメント
Teshan Rezel
Teshan Rezel 2021 年 12 月 10 日
@yanqi liu thank you for responding, but I'm looking to segment the top image, not the bottom one! The technique you used doesn't appear to work for that one...
yanqi liu
yanqi liu 2021 年 12 月 11 日
yes,sir,is it to segment 3 parts,may be by color or pixel,such as
clc;
clear all;
close all;
img = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/818414/image.png');
J = rgb2lab(img);
im = mat2gray(J(:,:,1));
mk = im2bw(im,0.9);
mk = ~mk;
mk = imfill(mk, 'holes');
mk = bwareafilt(mk,1);
im(~mk) = 0;
thresh = multithresh(im,3);
seg_im = imquantize(im,thresh);
figure; imshow(img);
hold on;
h=imshow(label2rgb(seg_im),[]);
set(h,'AlphaData', 0.6)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Segmentation and Analysis についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by