Camera position w.r.t. basketball court
You said you could see lines, so I assume you could see their intersections. If you could assume to have at least 4 fixed points of the court which are always visible (corners might be a good choice), this problem is similar to the 3D pose estimation problem, since you are essentially looking for a pose (position and orientation) of a known 3D object in a 2D image.

You might find it useful to read about POSIT, an iterative algorithm published in 1992 and there is also this algorithm from 1999. Both algorithm solve the 3D pose estimation problem.