trufanov-nok / scantailor-universal

ScanTailor Universal - a fork based on Enhanced+Featured+Master versions of ST
http://scantailor.org
Other
184 stars 16 forks source link

scantailor-universal-cli is giving an error #61

Closed raster-blaster closed 5 years ago

raster-blaster commented 5 years ago

I am trying to use scantailor-universal-cli tool. Its giving an error during last stages of processing

The Error:

command: scantailor-universal-cli -v image.tif ./out/
Filter: 1
    Processing: /home/image.tif
Filter: 2
    Processing: /home/image.tif
Filter: 3
    Processing: /home/image.tif
Filter: 4
    Processing: /home/image.tif
Filter: 5
    Processing: /home/image.tif
Filter: 6
    Processing: /home/image.tif
terminate called after throwing an instance of 'char const*'
Aborted (core dumped)

Even with some addition options ( --disable-content-detection, --margins-0, etc ...) I am getting above mentioned error.

Could you please look after this issue. If I am making any mistake please let me know.

Scantailor-universal-cli version: Version: 0.2.7 Operating system: Distributor ID: Ubuntu Description: Ubuntu 18.04.1 LTS Release: 18.04 Codename: bionic

Scantailor-universla-cli version: Version: 0.2.5 Operating System: Distributor ID: Ubuntu Description: Ubuntu 16.04.6 LTS Release: 16.04 Codename: xenial

I am getting same error on both ubuntu 16 and 18.

trufanov-nok commented 5 years ago

Frankly, I'm not putting any efforts in -cli version development, never used it and consider it as legacy feature from original ST project. If it's finally got broken then may be it's time to remove it. I don't understand a use case for it. Can you provide some details about -cli version usage? My doubts based on the idea that STU fork is mostly about useful UI controls and a huge set of settings that could be tweaked. And it's impossible to provide access to all of those settings without GUI.

raster-blaster commented 5 years ago

Thank you very much for your quick response.

Can you provide some details about -cli version usage?

In my current project, We would like to develop an OCR system for historical documents. The first key step in our project is preprocessing the user uploaded documents(mostly scanned) before sending them to OCR engine. We would like to automate this process. Initially, we developed our preprocessing pipelines. Later we came across scantailor-cli, it was giving prominent results. Especially, normalize illumination, deskew, despeckle. Content-detection also working fine but, it is not consistent all the time. Dewarping is not working in -cli.

sample -cli commands, which have given proper results:

scantailor-cli -l=1 --deskew=auto --content-detection=cautious --margins=0 --alignment=center --dpi=600 --output=600 --color-mode=color_grayscale --white-margins=true --normalize-illumination=true -v image.tif ./out/

# batch process

for file in *.tif; do scantailor-cli -l=1.5 --margins=0 --alignment=center --dpi=600 --output=600 --color-mode=color_grayscale --white-margins=true --normalize-illumination=true -v $file ./out/; done;

In my opinion, scantailor-cli can be helpful to automate the processing of document images.

I agree with you as its impossible to get the same functionality of GUI in -cli version. If scantailor-universal-cli works with default or auto options, it saves lots of work (At least in my case).

If its much work to look after -cli version issues and -cli version development, then please close this issue. I will raise same issue in scantailor.

silverbacknet commented 5 years ago

I'm not sure why there needs to be more than a bare minimum of options, with a primary "profile" option that loads from a file or from stdin if it's "-". The profile is a bit more complicated but much easier to save from the GUI, keeps pace with all changes to the software, and easier to adjust when the software changes. Then there's never a reason to deprecate the cli, it's just as simple as the gui rather than a maintenance nightmare.

trufanov-nok commented 5 years ago

@silverbacknet need to think about this, but it certainly can't be in my priority list. @Parthiv20 I've updated the sources. Could you check the latest commit in master branch? Just pull a fresh sources and rebuild from scratch (delete all files in build folder if needed). -cli version should work after that. Let me know if something goes wrong.

raster-blaster commented 5 years ago

@trufanov-nok I've pulled from master branch and rebuilt from scratch. I checked your last commit as well. -cli version works fine now. Thank you very much for fixing this issue.