I am working on road extraction from the image. As a result of HoughLineP applied on the binary image shown below, I have small segments. what I want is to is to group the collinear segments and draw a center line, But i couldn't figure out how can I group the segments based on there proximity/connectivity, Or is there anyother approach to join collinear segments?