Using Watershed to seperate Ellipsis

3 Ansichten (letzte 30 Tage)
Karsten Gros
Karsten Gros am 20 Nov. 2018
Kommentiert: Karsten Gros am 21 Nov. 2018
Hi, I habe a problem regarding the watershed-function...
I tried it with circles, which worked basically as I intended.
Now I want to seperate ellipsis, but it doesn't work...
Here's the code I used:
bw = imread('111.jpg'); % read Image
bw=im2bw(bw); % Binarize
bw=~bw; % invert
%% Smooth edges
windowSize = 51;
kernel = ones(windowSize) / windowSize ^ 2;
blurryImage = conv2(single(bw), kernel, 'same');
binaryImage = blurryImage > 0.8; % Rethreshold
%% Using the Watershed function as the Matlab-help suggests
bw = binaryImage;
D = bwdist(~bw);
D = -D;
D(~bw) = Inf;
L = watershed(D);
L(~bw) = 0;
rgb = label2rgb(L,'jet',[.5 .5 .5]);
It doesn't really separate the ellipsis, does it even work for objects that aren't circles?
If it does, has anybody an idea how to solve this problem?
Thanks in advance and best regards
Karsten

Akzeptierte Antwort

Image Analyst
Image Analyst am 20 Nov. 2018
  1 Kommentar
Karsten Gros
Karsten Gros am 21 Nov. 2018
Hi,
Thanks for the two links, they helped a lot :)
Best regards

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by