필터 지우기
필터 지우기

Overlapped Objects Counting From an Image

조회 수: 1 (최근 30일)
Md Hafizur Rahman
Md Hafizur Rahman 2020년 2월 18일
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