How to Count Not Counted Objects on Image Processing

조회 수: 1 (최근 30일)
Murat Kocaman
Murat Kocaman 2018년 7월 30일
댓글: Murat Kocaman 2018년 7월 31일
Hello,
I have attached photo as a result of image object count with image processing.
As it seems obviously, some objects are not counted. At this result I would like to add manual count function to count uncounted objects manually. Also, there are some over counts.
How could I add manual count and extract function to add uncounted ones and extract over counts with the numbers 11 and 4 ?
What I want to do is to add numbers for the arrowed ones by mouse clicking on it.
Is there a way to do this?
  댓글 수: 1
Murat Kocaman
Murat Kocaman 2018년 7월 31일
I think I should have adapted this into my code but I can not play on my result image with counting numbers.
Maybe you could help at this point?
% Display an image.
imshow('Filepath');
hold on;
% Initialize counter.
count = 0;
message = sprintf('Click as many points as you want.\nHit return when done.');
title(message, 'FontSize', 20);
button = questdlg(message, 'Continue?', 'OK', 'Cancel', 'OK');
drawnow; % Refresh screen to get rid of dialog box remnants.
if strcmpi(button, 'Cancel')
return;
end
% Begin loop where user clicks points over display (plot or image or whatever).
while count < 1000 % or whatever failsafe you want.
% User clicks one point. If user types Enter/Return, x is empty.
[x,y] = ginput(1);
if isempty(x)
break;
end
% Put a cross over the point.
plot(x, y, 'r+', 'MarkerSize', 24, 'LineWidth', 3);
% Increment the count.
count = count + 1
% Save coordinates (if desired).
allX(count) = x;
allY(count) = y;
end

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by