I am currently busy with a robot that needs to obtain it's orientation relative to a line seen by a camera. At the moment, I am using Hough lines to obtain a gradient for the line, but the gradient obtained is not the same as the orientation of the robot relative to the line. In other words, if I place the line 45 degrees Infront of the robot, the returned gradient of the line is not 1 (for a 45 degree line). I'm guessing this is due to the line being in a different plane to that of the camera image. The camera is tilted 15 degrees down, but can be made to be exactly vertical.
How would I calculate the orientation of the robot relative to the line from the lines obtained in the camera? I have attached an image to help aid in my explanation.
I would like to know if using the rotation and translation matrix of cameras would help solve this problem too.