Overlapped Objects Counting From an Image

1 次查看(过去 30 天)
I want to count tiny line objects in the following image. There are three lines but my program counts two. How can I count three tiny line objects from the image?
Code:
I=imread('d1.png');
figure; imshow(I);
J = rgb2gray(I);
Y=im2bw(B,0.45);
C = imcomplement(Y);
X = bwpropfilt(C, 'MinorAxisLength',[0 350]);
Z = bwpropfilt(X, 'MajorAxisLength',[250 1000]);
L = bwlabel(Z);
s = regionprops(L, 'Centroid');
figure
imshow(Z)
for k = 1:numel(s)
c = s(k).Centroid;
text(c(1), c(2), sprintf('%d', k),'Color', 'g', ...
'HorizontalAlignment', 'center', ...
'VerticalAlignment', 'middle');
end
The ouput image:

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing and Computer Vision 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by