Irregular lines / polyline detection in matlab

I am new to Matlab processing and image processing

What I am trying to achieve is to detect irregular lines in the image. for example, the following image has 4 polylines:

enter image description here

My goal is to get a set of pixel points representing these 4 irregular lines / poly lines. something like that.

enter image description here

I read some topics like edge detection (canny) and hough line detection. I have applied them, but I do not know how to set them up for my purpose, and I am not sure if I will go back in the right direction. I would appreciate it if you could give me some advice or point me to helpful resources / articles / algorithms / libraries. ------------------- Edit ------------------------------ ------

Thank you for all your data, I think he took me in the right direction. My question is simpler than you think. I am not trying to determine if the lines are irregular or not, but simply to get the pixels of the lines found.

In Matlab, I followed the following routes:

rgb2gray -> 2bw -> bwmorgh (skeletonize) -> bwconncomp (get connectivity components)

The result looks good to me at the moment, thanks.

+3


source to share


1 answer


for this scenario

after a simple binary threshold, skeleton the image, label line areas, create straight lines using their endpoints (the endpoint of the skeleton has only one neighbor)

find the maximum distance from the skeleton to this line, if it exceeds a certain threshold (for example, line length / dmax <20), then this skeleton is an irregular line

http://opencv-code.com/quick-tips/implementation-of-guo-hall-thinning-algorithm/



dmax

for map script

I think you want to find specific roads or boundaries. at least they have different colors and widths, you might want to flatten aggressively and apply a color threshold after that. yet you have to work with thousands of different maps to find a common algorithm.

+3


source







All Articles