Patent ID: 8311329

Claim:
A method for converting an image of text comprising background and foreground graphical representations of elements to a binary image representation of the image in a computer system, by using a threshold technique, the method comprises the steps of: a) providing an analysis of the background by identifying grey levels of pixels, in sections of the image, and record positions of grey levels with a highest level representing a colour white within each respective section, b) using the recorded positions of white pixels from step a) to estimate a local background level of the image in each respective section, c) selecting a sub-image part of the image and investigate if there are text elements in the sub-image part, d) if no text element is identified in c), select another next sub-image part and investigate if there is a text element in this next sub-image part, e) repeat step c) and d) until a text element is identified, f) use an edge detector on the sub-image comprising the identified text element, thereby identifying positions of pixels in the edge around the element, g) use the identified pixel positions of the edges to generate a histogram of grey levels representing the edges, h) use the histogram of the grey levels of the edges from step g) to derive a local threshold level, wherein the local threshold identifies the local foreground level of the grey levels of pixels, and use the position of the identified pixels in the edges to find a corresponding section around these pixels that was used in step a) and use the estimated local background of this corresponding section from step b) to provide a relative threshold level of the image as being proportional to the difference between the local threshold level and the estimated background level, i) use the relative threshold level from step h) as a contrast measure of the image and use this contrast measure to convert the image to a binary image representation of the image.