ScanTailor-Advanced / 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
204 stars 8 forks source link

Feature Request: Binarization Algorithms #8

Closed H748 closed 1 year ago

H748 commented 2 years ago

Hi, I use STA on a regular basis to edit archival research and am very happy to see that is maintained again. I think it would be great, if STA offered more and some of the improved binarization algorithms like WAN or ISauvola. Often, the images I have to work with have subpar quality and some of the new and improved algorithms would be greatly welcomed.

Anyway: Thanks for maintaining the project!

zvezdochiot commented 1 year ago

Hi @lightsilverberryfox .

Interested in the possibility of mixing canny/sobel into the original image before threshold:

Ic = (1.0-k) * I + k * I * (255 - canny) / 255

or

Ic = I * (255 -  k * canny) / 255

where:
  k = { 0.0 (no canny) .. 1.0 (add 100% canny) }
  canny = image{ 0 (no edge) .. 255 (edge), {width, height == origin image} }

Mixing canny allows you to:

  1. keep tails and jumpers of individual letters (bad paper)
  2. keep the original halftone pattern of the images (k = 1.0, changes threshold value).
Example save the original halftone pattern of the images:
screen-20230411
(Gray -> BW, 600dpi, k=1.0, laplasian+bimod/otsu, bad paper): obj.0099.s.01.pdf
Without canny (no laplasian):
screen-20230411-withoutcanny
Current scantailor-advanced (1.0.18) obj.0099.s.01.tif.pdf:
screen-20230411-scantailor
Origin image:
obj 0099 s 01
Gray, 600dpi

PS: See also https://github.com/4lex4/scantailor-advanced/issues/197

vigri commented 1 year ago

@zvezdochiot can I close this one? As to my understanding, this is "fixed" with #48

zvezdochiot commented 1 year ago

Hi @vigri .

This is not my issue. But I think it's been resolved: https://github.com/ScanTailor-Advanced/scantailor-advanced/commit/b0788fc5055ab8f7f7a6b5d727dd13eea1006212

vigri commented 1 year ago

Thanks for your response.

I'll close this one.

@H748 If you think your request is still not fulfilled, please feel free to open a new issue.