1. A method of correcting a captured image for lens shading artifacts, comprising: capturing a plurality of reference images with a lens; averaging the plurality of captured reference images to determine a single reference image; using the determined single reference image to determine, for the lens, a two-dimensional lens shading correction function L(x,y) which is a function of an image location (x,y) and which is to be applied to subsequent images captured by the lens in order to correct for lens shading artifacts; applying a sampling technique to sample the determined function L(x,y) at selected points (x,y) based on a sampling grid; and storing a two-dimensional table comprising data points (x,y) corresponding to the sampled function L(x,y) in memory.