How to get the coordinates of two points?

조회 수: 2 (최근 30일)
Zara Khan
Zara Khan 2020년 1월 28일
편집: Zara Khan 2020년 1월 29일
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?

답변 (1개)

Guillaume
Guillaume 2020년 1월 28일
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.
  댓글 수: 3
Guillaume
Guillaume 2020년 1월 28일
Of course it's possible:
Ypoints = linspace(toRowY, centroidRow, 11); %divide the Y coordinates into 10 zones (== 11 boundaries)
Zara Khan
Zara Khan 2020년 1월 29일
편집: Zara Khan 2020년 1월 29일
how can draw circles through these points?

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

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by