Straight lines with an edge detection algorithm
You're probably looking for the Hough transform or one of it's extensions. 

The simplest version of this transform is linear and appropriate for detecting straight lines. 

In the transformed space (Hough space), angles and distances are found as points where curves intersect. 

Libraries for calculating the Hough transform exist in 


C++ - OpenCV (Has Python bindings)
Matlab - hough in the image processing toolbox
Python - Scikits-image 


Related Questions and Answers

See this previous answer for more help on understanding the Hough transform.