How to find the coordinate of the intersection multiple lines?

4 ビュー (過去 30 日間)
Misha Patel
Misha Patel 2017 年 7 月 11 日
コメント済み: Image Analyst 2017 年 7 月 12 日
If i have lines drawn on an image, how can I find the coordinate of the intersection of the lines? (multiple lines are intersecting)

採用された回答

KSSV
KSSV 2017 年 7 月 11 日
  7 件のコメント
KSSV
KSSV 2017 年 7 月 12 日
You are providing....data points to line....
Image Analyst
Image Analyst 2017 年 7 月 12 日
If you need the data at any arbitrary point, you have the two end points and can compute the line formula, so you have everything you need. If you want digitized/quantized coordinates, you can round the double numbers or you can look at Bresenham's line algorithm: https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm

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

その他の回答 (1 件)

Image Analyst
Image Analyst 2017 年 7 月 11 日
編集済み: Image Analyst 2017 年 7 月 11 日
Use bwmorph() and ask for branchpoints on your skeletonized binary image.
crossings = bwmorph(binaryImage, 'branchpoints');
binaryImage should have only single pixel wide lines in it. Threshold it and call bwmorph(binaryImage, 'skel', inf) if you need to.
binaryImage = grayImage < 150; % Whatever...
skeletonImage = bwmorph(binaryImage, 'skel', inf); % Thin down to one pixel wide lines.
crossings = bwmorph(skeletonImage, 'branchpoints');

Community Treasure Hunt

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

Start Hunting!

Translated by