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!
0 个评论
采纳的回答
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 个评论
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 Exchange 中查找有关 Image Segmentation and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!