preliminary line segmentation