Borrar filtros
Borrar filtros

Overlapped Objects Counting From an Image

1 visualización (últimos 30 días)
Md Hafizur Rahman
Md Hafizur Rahman el 18 de Feb. de 2020
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:

Respuestas (0)

Categorías

Más información sobre Image Processing and Computer Vision en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by