How to find the point where most lines intersect in a binary image?

4 ビュー (過去 30 日間)
Aon
Aon 2018 年 9 月 14 日
コメント済み: Felix Onofrei sunt 2020 年 5 月 13 日
In a multi-line binary image with different slopes and center points. How do you find the coordinate where most lines intersect? (it should be close where the red arrow points)
Thanks in advance
  5 件のコメント
Aon
Aon 2018 年 9 月 15 日
Yes with the help of InterX function I now have an array with the intersectpoints. Is it possible to find the cluster with only the array?
jonas
jonas 2018 年 9 月 15 日
Yep, see the latest comment on the answer for two methods. Id try hist3 first

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

採用された回答

jonas
jonas 2018 年 9 月 14 日
編集済み: jonas 2018 年 9 月 15 日
A good solution would be to identify each line by e.g. Hough transform, determine each intersection (e.g. InterX ) and then find the cluster with the highest density of intersections using e.g hist3.
In this case, it seems the point of interest is also the point with the highest density of white pixels, so you could apply some smoothing filter and then find the highest value in the matrix. Here's an example using a very simple 10x10 pixel average.
w=ones(10,10);
A=conv2(I,w/numel(w),'same')
imagesc(A)
colormap(gca,'jet')
  5 件のコメント
jonas
jonas 2018 年 9 月 16 日
Nice! My pleasure
Felix Onofrei sunt
Felix Onofrei sunt 2020 年 5 月 13 日
Aon, could you tell me how did you use the interX function to get the intersection of every line, not only two? I am trying to use this function for geographical track lines. Basically i want the same thing, and then to find the cluster. Thanks in advance!

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

その他の回答 (1 件)

Image Analyst
Image Analyst 2018 年 9 月 15 日
  2 件のコメント
Aon
Aon 2018 年 9 月 16 日
hist3 helped me very well but I will read more about dbscan also. Thank you!
Image Analyst
Image Analyst 2018 年 9 月 16 日
Alternatively you could threshold the blurred image and use regionprops to find the weighted centroid of the region.

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

Community Treasure Hunt

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

Start Hunting!

Translated by