Patent ID: 8068684

Claim:
A method for creating a binary mask image from an inputted digital image of a scanned document, comprising the steps of: a) creating a binarized image by binarizing said inputted digital image, b) detecting in said binarized image first text regions representing light text on a dark background in said inputted digital image, and c) inverting said first text regions in said binarized image, such that a transformed binary image is formed in which the inverted first text regions are interpretable in the same way as dark text on a light background, wherein the step of inverting said first text regions comprises the following subsequent steps: creating from the binarized image a first image by keeping only first large black blobs with a number of pixels above a predetermined first minimum; inverting the first image; combining the binarized image with the inverted first image to form a second image in which the first large black blobs are removed; creating from the second image a third image by keeping only second large black blobs with a number of pixels above a predetermined second minimum; inverting the third image; combining the second image with the inverted third image to form a fourth image in which the second large black blobs are removed; and combining the second and fourth images to form the transformed binary image.