# How to get the coordinates of two points?

1 view (last 30 days)
Zara Khan on 28 Jan 2020
Edited: Zara Khan on 29 Jan 2020
centroidColumn = int32(measurements.Centroid(1));
centroidRow = int32(measurements.Centroid(2));
middleColumn = binaryImage(:, centroidColumn);
topRowY = find(middleColumn, 1, 'first');
bottomRowY = find(middleColumn, 1, 'last');
middleRow = binaryImage(centroidRow, :);
leftColumnX = find(middleRow, 1, 'first');
rightColumnX= find(middleRow, 1, 'last');
imshow(Y);hold(imgca,'on');plot(centroidColumn, centroidRow,'m*','MarkerSize', 6, 'LineWidth', 3);
plot(centroidColumn, topRowY,'r*','MarkerSize', 6, 'LineWidth', 3);
By doing this I am able to mark two points. How can I get coordinates of these two points?

Guillaume on 28 Jan 2020
I'm a bit confused by your question. You pass the coordinates of the points to plot, so you already know these coordinates:
1st point (magenta): (centroidColumn, centroidRow)
2nd point (red): (centroidColumn, topRowY)
---
Note: you should be using round instead of int32 to round numbers.
Zara Khan on 29 Jan 2020
Edited: Zara Khan on 29 Jan 2020
how can draw circles through these points?