Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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);

Respuesta aceptada

Image Analyst
Image Analyst el 9 de Dic. de 2013
  1 comentario
Anandakumar Selvaraj
Anandakumar Selvaraj el 8 de En. de 2014
Editada: Anandakumar Selvaraj el 8 de En. de 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

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by