4lex4 / scantailor-advanced

ScanTailor Advanced is the version that merges the features of the ScanTailor Featured and ScanTailor Enhanced versions, brings new ones and fixes.
GNU General Public License v3.0
1.15k stars 128 forks source link

[Feature request] Tile contrast #197

Closed zvezdochiot closed 12 months ago

zvezdochiot commented 1 year ago

Hi all.

A very favorable effect is the admixture of tile contrast on old scanned pages that have turned gray from time to time.
Example, original:
09
ScanTailor Otsu threshold:
09 st ScanTailor Wolf threshold:
09 st wolf

Mixing in 25% tile contrast:
09 adc ScanTailor Otsu threshold:
09 adcst

I think it's worth looking at ways to reproduce such a contrast without OpenCV: opencv_adc.cpp.gz

This method is much more adjustable in terms of both tile size and mixing ratio than the alternative thresholding methods. And he doesn't have much of an impact on bold headlines like Wolf.

See also:

zvezdochiot commented 1 year ago

Managed to get a similar effect by simply multiplying an image by itself:
1929-22-sq

In this case, such a multiplication is again decomposed into an adjustable scheme:

Isq = I * I / 255 => I + I * (I - 255) / 255

Add a k knob and you get a simple but effective contrast adjustment scheme:

Ik =  I - k * I * (255 - I) / 255, where k = {0.0 .. 1.0}
zvezdochiot commented 12 months ago

Resolved: STEX: 0.20230805: control

leonleon33156 commented 12 months ago

这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。