Line detection | Angle detection with Java

Viewed 4810

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

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

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

thresholded image

And also used an edge detection algorithm to get this:

laplacian filter

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

1 Answers
Related