1. Skew detection apparatus, for estimating a skew angle of a document shown in an image, the apparatus comprising: an input adapted to receive the image; and a processor adapted to, for each of a plurality of sides of the image: determine the locations of a set of foreground pixels or a set of edge pixels of the document that are nearest to the side of the image; generate from said set of pixels an estimate of the probability distribution of the angle of a line joining any two pixels from the set; and determine the angle corresponding to the maximum value in the estimated probability distribution, to produce a first estimated skew angle by combining said angles determined for each of the plurality of sides of the image, and to estimate a first confidence value for the first estimated skew angle.