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

7 views (last 30 days)
Teshan Rezel
Teshan Rezel on 30 Nov 2021
Commented: yanqi liu on 11 Dec 2021
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!

Accepted Answer

yanqi liu
yanqi liu on 1 Dec 2021
yes,sir,may be use kmeans or watershed
clear all;
close all;
img = imread('');
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;
set(h,'AlphaData', 0.6)
yanqi liu
yanqi liu on 11 Dec 2021
yes,sir,is it to segment 3 parts,may be by color or pixel,such as
clear all;
close all;
img = imread('');
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;
set(h,'AlphaData', 0.6)

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by