reduced number of lines by only selecting local minimum distances