How to find the coordinate of the intersection multiple lines?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Misha Patel
am 11 Jul. 2017
Kommentiert: Image Analyst
am 12 Jul. 2017
If i have lines drawn on an image, how can I find the coordinate of the intersection of the lines? (multiple lines are intersecting)
0 Kommentare
Akzeptierte Antwort
KSSV
am 11 Jul. 2017
Go through this file exchange: https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections?focused=5165138&tab=function
7 Kommentare
Image Analyst
am 12 Jul. 2017
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
Weitere Antworten (1)
Image Analyst
am 11 Jul. 2017
Bearbeitet: Image Analyst
am 11 Jul. 2017
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');
Also, see Steve's blog: http://blogs.mathworks.com/steve/2016/04/12/intersecting-curves-that-dont-intersect/
0 Kommentare
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!