Page 1 of 1

Detecting blank scans

Posted: 2008-12-22T08:04:37-07:00
by RobLewis
I have a bunch of scans of the back sides of old photos. Some of them have handwritten notes; many are blank.

Is there a way to run them through IM and get some kind of report back to distinguish the blank ones from the nonblank ones?

Complication #1: many of the photos have a line or 2 of data printed by the photofinisher on the back, typically in a rather crude dot matrix font.

Complication #2: some of them have discolored patches or stains.

Complication #3: often the notes are written very lightly in pencil; readable to the eye but pretty low in contrast.

Enhancement: could IM generate a compressed, contrast-enhanced JPEG of nonblank images it finds? Readability and small file size are more important than image fidelity.

My idea was to assume that blank images would compress better than nonblank ones, and use the file size of the compressed image to tell whether it was blank or not.

Thanks.

Re: Detecting blank scans

Posted: 2008-12-22T11:09:21-07:00
by fmw42
Do you consider complication 1 and 2 as blank or not blank?

Re: Detecting blank scans

Posted: 2008-12-22T11:41:37-07:00
by RobLewis
fmw42 wrote:Do you consider complication 1 and 2 as blank or not blank?
Complication 2 is definitely a blank.

Complication 1 (photofinisher imprint) should probably be treated as blank, at least as the default option, if possible.

Re: Detecting blank scans

Posted: 2008-12-22T12:55:08-07:00
by fmw42
Not an easy problem unless it is absolutely blank.

Re: Detecting blank scans

Posted: 2008-12-25T01:11:52-07:00
by anthony
I would threshold the image first or other types of convertsion to pure black and white. Fred Weinhaus has a lot of scripts and alturnative to simple threshold too.

Once in black and white output a histogram report to get a count of the number of 'valid' pixels. That will give you a good measure of the amount of information on the page. If you have a speicific line or area that appears offten and you don't want included in the count, overlay a mask or draw white to blank that area before getting the pixel count.