convert line to pixel coordinate

8 views (last 30 days)
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 Comments
mohammed alany
mohammed alany on 3 Aug 2019
the problem i wanted all the coordinate of midpoints between each two nodes

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 4 Aug 2019
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 Comments

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 3 Aug 2019
Use bwdist().
  9 Comments
darova
darova on 4 Aug 2019
What about interparc()?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by