1. A method of calibrating a projector comprising: receiving by a processing element a first calibration image of a first calibration pattern projected onto a projection surface; generating a perspective projection matrix by a processing element by analyzing the first calibration image and the first calibration pattern; and determining by the processing element a non-linear mapping function by analyzing the first calibration image.