Comment 2 for bug 158435

Revision history for this message
danh (danh-archive) wrote :

Regarding the contrast enhancement:

Leptonica and pnmnorm (which is the program currently used for contrast enhancement) seem to use the same algorithm, at least in the gray case. (The basic algorithm is that you create some map which sends [0, ... 255] to [0, ... 255] with the lower numbers getting pushed closer to 0 and the higher numbers getting pushed closer to 255.) The difference in implementation is that leptonica does not round, whereas pnmnorm does round. I enhanced an image using both leptonica and pnmnorm, with results in ~/recs/images/contrast_enhancement/. This directory also includes information on how to try out other images if desired. There are 7 remap values at which they differ in the particular map i tried (which is our standard 30-240/black-white map, as defined in petabox/www/common/OrigJp2ImOp.inc). I don't think i can tell the difference (except using software)---the gray values are 1 notch apart---and so i plan to just use the map leptonica provides to make the code easier to maintain.

But anybody please advise if this is too incautious (but for now the train is rolling ahead).