Page 1 of 1

Removing water mark from scanned image

Posted: 2019-06-26T02:15:23-07:00
by darktangent
we are going through digitization of records. The problem we are facing is that documents have water mark on them. When the documents are scanned and put through OCR the watermark disturbs the OCR process and the text can not be extracted. An example of the documents we are processing is like https://imgur.com/QqprgcR

One can see the diagonal watermark of Approved. We need to remove this water mark keeping the text above it e.g Deputy as shown in Image. I am a newbie to imagemagick, i have tried different tutorials related to closed component labeling and morphology but could not get the watermark removed.

Can some body help to guide what would be efficient manner to remove the watermark from the document by using imagemagick?

Re: Removing water mark from scanned image

Posted: 2019-06-26T06:10:29-07:00
by snibgo
From the image you supply, I doubt there is a good solution. I can't see what distinguishes the large text from the small text. You could remove the long lines of the large text but cleanly removing these, while leaving "ep" of "Deputy", seems impossible.

Re: Removing water mark from scanned image

Posted: 2019-06-26T12:31:14-07:00
by darktangent
snibgo wrote: 2019-06-26T06:10:29-07:00 From the image you supply, I doubt there is a good solution. I can't see what distinguishes the large text from the small text. You could remove the long lines of the large text but cleanly removing these, while leaving "ep" of "Deputy", seems impossible.
What would be the way to remove long lines of large text?

Re: Removing water mark from scanned image

Posted: 2019-06-26T12:40:08-07:00
by snibgo
With "-connected-components".

Threshold the image, possibly after a blur, then use "-connected-components" with an area threshold to get just the large black components. Negate that, and "-compose Lighten -composite" with the original. The result will have the largest black marks whitened. But this will also whiten "ep" of "Deputy".