How does undistortion works ?
I am reading the book Learning OpenCV by Reilly and I can't seem to figure out how the distortion coefficients are computed.
1) How are the coefficients computed ? Is it through least squares fit ? Like how the homography matrix can be computed ?
1) How are the points even established ? If we use a chessboard we would only be able to obtain xd and yd i.e. the distorted points ? How do we get xp and yp ?
Look in the opencv Doku probably you can find your answer there. Also you can look up "photogrammetry" books to make yourself clear what is mentioned there. The calibration of a camera is one of the important things there.