1. A method of detecting lines in an image, comprising: pre-processing the image using a processor, comprising: generating an edge map of the image; and removing non-collinear edge pixels from the edge map to obtain a cleaned edge map, comprising: filtering the edge map using an anisotropic line filter, pruning edge pixels from the edge map based on a density analysis of the edge map, and removing the non-collinear edge pixels from the edge map based on a connected component analysis of the edge map; and detecting a line in the edge map.