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 #47: binarizeEdgePlus #48

Closed zvezdochiot closed 1 year ago

zvezdochiot commented 1 year ago

Hi @vigri and @lightsilverberryfox .

:warning: This PR is just a recipe. I was only able to build binarizeEdgePlus into the general functionality. At the same time, I use the Sauvola options, which I don’t think is correct (the new threshold requires smaller area values ​​and larger coefficient values). Due to this, projects with a new threshold are safely saved. Use this PR as a recipe.

Good Luck.


Example

Origin Otsu threshold Sauvola threshold Wolf threshold EdgePlus threshold EdgePlus threshold EdgePlus threshold
(screenshot from 600dpi scan) (default) (default: ws:200 c:0.34) (default) (default: ws:200 c:0.34) (manual: ws:20 c:0.80) (manual: ws:5 c:0.99 Equalize:0ff Savitzky-Golay:off)
screen-origin screen-otsu screen-sauvola screen-wolf screen-edgeplus-default screen-edgeplus-a20-c80 screen-edgeplus-a5-c99-off-sav-norm

Links

Closes #47

zvezdochiot commented 1 year ago

Hi @vigri , @lightsilverberryfox .

The usefulness of the new thresholds has been confirmed (worst part of the scanned material): Origin Otsu Sauvola Wolf Wolf EdgePlus BlurDiv
(600dpi) (default) (default) (default) (ws:20,c:0.75) (ws:20,c:0.75) (ws:20,c:0.75)
test test otsu test sauvola test wolf test wolf_20_075 test edgeplus_20_075 test blurdiv_20_075

See threshold BlurDiv.

zvezdochiot commented 1 year ago

[Feature request] thresholdAdjustment in other threshold. #59

zvezdochiot commented 1 year ago

Mod epdbta of release 1.0.18: https://github.com/ImageProcessing-ElectronicPublications/scantailor-advanced/releases/tag/v1.0.18

alfish2000 commented 1 year ago

Hi! Is there any chance that the PRs here get merged and e.g. a new version 1.0.19 is released? It gets confusing because it seems that this PR is now released here https://github.com/ImageProcessing-ElectronicPublications/scantailor-advanced as 1.0.18

zvezdochiot commented 1 year ago

@alfish2000 say:

Is there any chance that the PRs here get merged and e.g. a new version 1.0.19 is released?

I don't hope so. Therefore, I release mods for existing releases. ;)

mara004 commented 1 year ago

Is there any chance that the PRs here get merged and e.g. a new version 1.0.19 is released?

I don't hope so. Therefore, I release mods for existing releases. ;)

I'm confused by your "I don't hope so." Are you still OK with this being merged and included in a release here eventually? Otherwise, I think you should close the PR, mark it as draft, or similar.

zvezdochiot commented 1 year ago

Hi @mara004 .

I don't have enough experience with Qt and XML. If there are bugs, it will be difficult for me to eliminate them. If this PR enters the mainstream, I will be happy. Doubts are caused purely by lack of skill (especially in XML).

PS: During testing, I did not notice any failures.

zvezdochiot commented 1 year ago

Hi @mara004 , @lightsilverberryfox , @vigri .

Demo of new thresholds: Origin Otsu EdgePlus
150dpi 600dpi (d: 16) 600dpi (d:16, ws: 20, c: 0.99)
p-004 p-004 otsu p-004 pbm
zvezdochiot commented 1 year ago

Hi @mara004 , @lightsilverberryfox , @vigri .

Github Action: build-linux-qt5:

...
Err:12 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libinput-bin amd64 1.20.0-1ubuntu0.2
  404  Not Found [IP: 52.154.174.208 80]
Err:13 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libinput10 amd64 1.20.0-1ubuntu0.2
  404  Not Found [IP: 52.154.174.208 80]
...
E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/main/libi/libinput/libinput-bin_1.20.0-1ubuntu0.2_amd64.deb  404  Not Found [IP: 52.147.219.192 80]
E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/main/libi/libinput/libinput10_1.20.0-1ubuntu0.2_amd64.deb  404  Not Found [IP: 52.147.219.192 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Error: Process completed with exit code 100.

http://azure.archive.ubuntu.com/ubuntu/pool/main/libi/libinput/:

name date size
libinput-bin_1.20.0-1_amd64.deb 2022-02-22 23:45 19K
libinput-bin_1.20.0-1_i386.deb 2022-03-02 14:09 24K
libinput-bin_1.20.0-1ubuntu0.1_amd64.deb 2022-05-02 06:13 19K
libinput-bin_1.20.0-1ubuntu0.1_i386.deb 2022-05-02 06:13 24K
libinput-bin_1.20.0-1ubuntu0.3_amd64.deb 2023-06-16 18:24 19K
libinput-bin_1.20.0-1ubuntu0.3_i386.deb 2023-06-16 18:24 24K

Thu, 13 Jul 2023 15:49:44 +0300

Resolved:

vigri commented 1 year ago

I can tell you put a lot of effort in this PR and wanted to say thank you, you have also offered your input on other issues and bugs, so if vigri sees this, he may want to consider sending you an invitation to our organization so you have write access (I can't invite you myself, I don't have owner permissions).

apologies very much.

Thank you very much @zvezdochiot. As @lightsilverberryfox said: If you are interested, I can send you an invitation. Please let me know.

Regarding this PR: Pleasse see my "review".

zvezdochiot commented 1 year ago

@lightsilverberryfox say:

Is issue #59 also solved by this PR?

This PR closes the issues:

PS: Me, @plzombie and @trufanov-nok will oversee the STA fork at organization https://github.com/ImageProcessing-ElectronicPublications. Participation in https://github.com/ScanTailor-Advanced is not required.

mara004 commented 1 year ago

PS: Me, @plzombie and @trufanov-nok will oversee the STA fork at organization https://github.com/ImageProcessing-ElectronicPublications. Participation in https://github.com/ScanTailor-Advanced is not required.

Wouldn't it be better to join efforts in one repo/organization, instead of all the fragmentation?

zvezdochiot commented 1 year ago

@mara004 say:

Wouldn't it be better to join efforts in one repo/organization

Maybe, but not now. I myself specialize in console utilities (GUI is not mine), @plzombie is busy with depress (it is more important to him), @trufanov-nok is in charge of STU. Everyone is busy with their projects.

PS: Until I figure out the STA (XML) projects, my help is over. I won't figure it out until I see how it's done. Such are the things.

zvezdochiot commented 1 year ago

Hi @mara004 , @lightsilverberryfox , @vigri .

New version? 1.0.19? I need for forums.

Current: https://github.com/ScanTailor-Advanced/scantailor-advanced/blob/b0788fc5055ab8f7f7a6b5d727dd13eea1006212/version.h.in#L6

vigri commented 1 year ago

Hi @mara004 , @lightsilverberryfox , @vigri .

New version? 1.0.19? I need for forums.

Current:

https://github.com/ScanTailor-Advanced/scantailor-advanced/blob/b0788fc5055ab8f7f7a6b5d727dd13eea1006212/version.h.in#L6

I've uploaded 1.0.19 now. https://github.com/ScanTailor-Advanced/scantailor-advanced/releases/tag/v1.0.19

ireun commented 11 months ago

Guys it would be great to have the docs improves to explain the new thresholds, maybe with examples or when to use what. :)

zvezdochiot commented 11 months ago

Hi all, @ireun .

:warning: Don't clutter this repository! Documentation can be updated, but examples and stuff only in a separate repository. In this link only!

"Recommendations from the author":

  1. EdgeDiv is the most balanced combination of Otsu threshold prefilters. This is a "universal solution" when you need clearly drawn letters without thickening and narrowing. Requires additional cleaning of the result from "garbage". Initial parameters: d:0, ws:20, c:0.75.
  2. EdgePlus is an ill-balanced Otsu threshold prefilter. It is used when it is necessary to highlight the weakly expressed contours of letters at any cost. Creates a lot of "garbage", requires thorough cleaning. Initial parameters: d:0, ws:5, c:0.99.
  3. BlurDiv is an ill-balanced Otsu threshold prefilter. Whitens the background. It is used when it is necessary to get rid of a very noisy background and at the same time, if possible, preserve the characters. Initial parameters: d:0, ws:50, c:0.75.

-- Google Translit