Line detection | Angle detection with Java
===

I'm processing some images that my UGV (Unmanned Ground Vehichle) captures to make it move on a line.

I want to get the angle of that line based on the horizon. I'll try to explain with a few examples:

![90 degrees image][1]


The image above would make my UGV to keep straight ahead, as the angle is about 90 degrees. 
But the following would make it turn left, as the angle compaired to the horizon rounds about 120.

![120 degrees image][2]


I could successfully transform those images into the image below using otsu for thresholding:

![thresholded image][3]

I'm stuck right now trying to find an algorithm that detecs edges/lines and outputs or helps me to output the angle of such line..

  [1]: http://i.stack.imgur.com/A2IX2.jpg
  [2]: http://i.stack.imgur.com/wGjP8.jpg
  [3]: http://i.stack.imgur.com/4BfbP.png