convert line to pixel coordinate

조회 수: 8(최근 30일)
mohammed alany
mohammed alany 2019년 8월 3일
편집: Image Analyst 2019년 8월 4일
Hi,
if i have a path consist of six points , and i have obstacle, what i want is to put nodes in all the path to count the minimum distance between
the obstacle and the path
example.jpg
  댓글 수: 4
mohammed alany
mohammed alany 2019년 8월 3일
the problem i wanted all the coordinate of midpoints between each two nodes

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

채택된 답변

Image Analyst
Image Analyst 2019년 8월 4일
What if you just take the average of the initial, known points?
x = sort(rand(9, 1));
y = sort(rand(9, 1));
plot(x, y, '.-', 'Color', [247, 148, 20]/255, 'MarkerSize', 40);
grid on;
xlabel('X');
ylabel('Y');
xAve = (x(1:end-1) + x(2:end))/2;
yAve = (y(1:end-1) + y(2:end))/2;
hold on;
plot(xAve, yAve, '.', 'Color', [206, 24, 18]/255, 'MarkerSize', 40);
legend('Original Points', 'Mid Points', 'Location', 'north');
0001 Screenshot.png
  댓글 수: 3
mohammed alany
mohammed alany 2019년 8월 4일
many thanks Image Analyst

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

추가 답변(1개)

Image Analyst
Image Analyst 2019년 8월 3일
Use bwdist().
  댓글 수: 9
darova
darova 2019년 8월 4일
What about interparc()?

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

범주

Find more on Convert Image Type in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by