1. A method of enhancing an image for optical character recognition, comprising: detecting the edges of the image to create an edge detected image; binarizing the edge detected image to create a binary edge image for processing; dilating the binary edge image to create a dilated binary edge image; taking the XOR difference between the binary edge image and the dilated binary edge image to obtain a text boundary; superimposing the text boundary on the image and determining the pixels of the image that are covered by the text boundary; calculating the average grayscale value of the pixels of the image that are covered by the text boundary; and setting background pixels of the image to the calculated average grayscale value of the pixels of the image that are covered by the text boundary.