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
189 stars 7 forks source link

[Feature request] thresholdAdjustment in other threshold. #59

Closed zvezdochiot closed 1 year ago

zvezdochiot commented 1 year ago

Hi @vigri , @lightsilverberryfox .

https://github.com/ScanTailor-Advanced/scantailor-advanced/blob/b4d8638bf96c564f434e35803dfd0fc8a432a2c6/src/core/filters/output/BlackWhiteOptions.cpp#L15 :question: Maybe add thresholdAdjustment in other threshold (Sauvola, Wolf, EdgePlus and BlurDiv) as an additional regulator?

https://github.com/ScanTailor-Advanced/scantailor-advanced/blob/b4d8638bf96c564f434e35803dfd0fc8a432a2c6/src/imageproc/Binarize.cpp#L87 to

      if (int(grayLine[x]) < (threshold + m_thresholdAdjustment)) {

https://github.com/ScanTailor-Advanced/scantailor-advanced/blob/b4d8638bf96c564f434e35803dfd0fc8a432a2c6/src/imageproc/Binarize.cpp#L188 to

      if ((grayLine[x] < lowerBound) || ((grayLine[x] <= upperBound) && (int(grayLine[x]) <  (threshold + m_thresholdAdjustment)))) {

and so on...

And add a slider to all widgets of thresholds?

PS: lowerBound and upperBound it is also desirable to use in all thresholds.

Complite BinarizationOptionsWidget for all threshold: BinarizationOptionsWidget ui BinarizationOptionsWidget.ui.gz

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

https://github.com/ScanTailor-Advanced/scantailor-advanced/commit/b0788fc5055ab8f7f7a6b5d727dd13eea1006212