title: Detecting irregular lines/polyline in matlab
body: <p>I am quite new to matlab and image processing </p>
  
  <p>What I am trying to achieve is to detect irregular lines in an image. for example, in the following image, there are 4 polylines:</p>
  
  <p><img src="https://i.stack.imgur.com/FEXx7.jpg" alt="enter image description here"></p>
  
  <p>My goal is to get a set of pixel points representing these 4 irregular lines/poly line . something like this.</p>
  
  <p><img src="https://i.stack.imgur.com/z1FQn.jpg" alt="enter image description here"></p>
  
  <p>I have read through some topics like edge detection (canny) and hough line detection. I applied them but I do not know how to tune them for my purpose, and I am not sure whether I am going the right direction. I would appreciate if you can give me some advices or point me to useful resources/articles/algorithms/libraries. 
  -------------------Edit ------------------------------------</p>
  
  <p>Thank you for all your input, i think it gets me to the right direction.
  My question is simpler then you might think. I am not trying to detect whether the lines are irregular or not, but just to get the pixels of detected lines.</p>
  
  <p>In matlab, I followed this routes:</p>
  
  <p>rgb2gray -> 2bw -> bwmorgh(skeletonize) -> bwconncomp(get connected components)</p>
  
  <p>The result looks good for me at the moment, thanks.</p>