Abstract:
A method and system automatically determines proper background values for a document. A histogram of the document is generated and it is determined whether a background characteristic of the document is uniform. If the background is uniform, a white background value is set equal to a first calculated white peak value. If the background is non-uniform, the white background value is set equal to a second calculated white peak value. A foreground value of the document is analyzed for validity when it is determined that a background characteristic of the document is uniform. A black background value is set equal to a black peak value calculated from the histogram when it is determined that a foreground value of the document is valid.