1. An image forming apparatus comprising: (a) an image reading device for reading an image on a document and for generating image data; (b) an image forming device for forming an image on a recording sheet on the basis of the image data and for outputting the image; (c) a pattern generator for generating pattern data for recording a set of test patterns at respective specified positions thereof on the recording sheet; (d) a positional deviation detector for detecting a positional deviation at each characteristic point included in the set of test patterns generated by the pattern generator, in the image data read from the recording sheet on which the image containing the set of test patterns has been formed, by comparing with a position of the proper output at each characteristic point; and (e) a deviation correcting device for calculating operational values for a correction of each pixel with reference to the respective positional deviations of the characteristic points detected by the positional deviation detector and for carrying out a processing to eliminate the positional deviation of each pixel at the time of image formation by using the operational values, thereby a deviation or an inclination of a document image to be formed from a document when the document is read by the image reading device is corrected.