Overlapped Objects Counting From an Image
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Convert Image Type in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!