First you subtract the x from the x and the y from the y coordinates to normalize them.
You then figure out the yaw, pitch and roll of the landscape view and the translation transformation then place them into a 4x4 rotation matrix then multiply that by a projection matrix and invert it. Then multiply the landscape view ball coordinates by the inverted matrix and the results should be the ideal view coordinates.
So you want to invert this matrix: Rotation(yaw,pitch,roll,translation) * Projection
To find the pitch you pick two corner squares on the table, preferably the close and far ones on the right. Then normalize the coordinates of the found corners through subtraction. The first goal is to remove the pitch from the table because after this is solved for the yaw and roll will be trivial to solve for. So you find the distance in both terms of x and y (but not the magnitude) of parallel diagonal from each of the two chosen corners. The goal is to find a rotational pitch transformation with yaw and roll set as zero where this distance will be equal. So you have this system:
Distance1*rotation_transformation(pitch)=Distance2
Then you solve for pitch.
Now that pitch is solved you do something similar to find yaw and roll.
The last thing to solve for is the translation. You can figure that out.
At this point you have the system:
Landscape_coordinates * Inverted_Matrix = Ideal Coordinates
So you want to perform this matrix multiplication to find the ideal coordinates.
To construct the projection matrix want to use parameters that you extract from the camera information on the cell phone
Obviously it is more complex than a single linear function.