Effacer les filtres
Effacer les filtres

how to locate blobs upper middle and lower middle points and plot it

2 vues (au cours des 30 derniers jours)
i am trying to locate points like it shows in the figure 4 below were the centroid i have marked as shown in figure 2 from the binary image now i have to mark upper lower and left and right boundry point as in fig 4 ..any one help me
I have marked the centroid of the blob using
s = regionprops(binaryImage, 'centroid');
centroids = cat(1, s.Centroid);
imshow(binaryImage);
hold(imgca,'on');
plot(imgca,centroids(:,1), centroids(:,2), ...
'r*','MarkerSize', 10, 'LineWidth', 3);

Réponse acceptée

Image Analyst
Image Analyst le 9 Déc 2013
  1 commentaire
Anandakumar Selvaraj
Anandakumar Selvaraj le 8 Jan 2014
Modifié(e) : Anandakumar Selvaraj le 8 Jan 2014
The answer to my question is already answered by Image Analyst in Ths Post
centroidColumn = int32(centroid(1)); % "X" value
centroidRow = int32(centroid(2)); "Y" value.
Then extract a row or column and use find to find the first and last element that's set:
middleColumn = binaryImage(:, centroidColumn);
topRowY = find(middleColumn, 1, 'first'); % Find top.
bottomRowY = find(middleColumn, 1, 'last'); % Find bottom.
middleRow = binaryImage(centroidRow, :);
leftColumnX = find(middleRow, 1, 'first'); % Find left.
rightColumnX= find(middleRow, 1, 'last'); % Find right.
so i am accepting his above answer

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by