Lines detection
Hi All, the following is a quite difficult task so any kind of help, even simple, will be much appreciated.
After color segmentation I generated the following image
I need to get lines that approximates white areas (roads), as shown in the following hand-made image
Using probabilistic HoughLines with following parameters (image and lines are Mat instances):
Imgproc.HoughLinesP(image, lines, 2, Math.PI /180, 200, 100, 5);
I get the following result:
I tried several combinations of parameters and shown result seems to be the best that I can achieve.
My questions:
Overall, what do you think of this approach ?
Any idea on how to select 'strongest' lines after HoughLines transform ? Is there any way to cluster every bundle of lines into a single significative line ?
Thanks
clustering the results to 13 centers ? seems like a good idea, did you try that ?
There should be 14 centers, since there are 14 segments. The main problem is that I don't know how to deal with object lines. For sure I know how iterate each line to get start/end points
but that said I am stuck ...
kmeans, dbscan, em, chinese_whispers, partitioning, did you try any of that ? (i still think, clustering is a good idea)(tried, poor results)there is an additional complexity thay I omitted. I have a set of images (the one I posted is just an example), each could have a different number of centers. For kmeans it think centers should be known before. What is chinese_whispers ? never heard before
Hi, my suggestion is clustering too... But I recommend that you use "superpixel", like SLIC. The SLIC will automatically figure out the centroids in a degree of "understanding the image".
Here is the comparision between some superpixel methods:
Hi, my suggestion is clustering too... But I recommend that you use "superpixel", like SLIC. The SLIC will automatically figure out the centroids in a degree of "understanding the image".
Here is the comparision between some superpixel methods:
thanks moHe. Do you have concrete example ?
I tried dbscan using Apache Maths. I am able to cluster centers of Houghlines, but I am not able to return back to lines from my clustered points.