distance line from a point

3 ビュー (過去 30 日間)
pasta pontikaki
pasta pontikaki 2019 年 5 月 8 日
コメント済み: pasta pontikaki 2019 年 5 月 11 日
Hi all, lets say i have a binary image, and i want to find the distance of a line (the one with the blue) from my mesh which is pictured in the above image.
The red points are the "aces" on the image. The values with 1 in my binary image
Any help?

回答 (1 件)

darova
darova 2019 年 5 月 8 日
But you already have those pixels/points:
n = 100; % number of pixels
x0 = round( linspace(min(x),max(x),n) ); % coordinates/columns of points/pixels
y0 = round( linspace(min(y),max(y),n) ); % coordinates/rows of points/pixels
Please look at the picture, because i did my best
Untitled.png
Perpendicular vector p:
Then use equation of a line from two points:
- line from x and x0
- line from x and x1
We have to find x,y then distance:
Accept the answer please if i helped you
  5 件のコメント
darova
darova 2019 年 5 月 11 日
You are right
Can you please unaccept my answer so other peaple can help you?
pasta pontikaki
pasta pontikaki 2019 年 5 月 11 日
okey

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeRead, Write, and Modify Image についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by