Coder Social home page Coder Social logo

Comments (8)

mirko0x5f avatar mirko0x5f commented on September 17, 2024 4

The problem seems to be in this line

result = append(result, "-psm")

we managed to fix it only for tesseract 4.0 by changing it in
result = append(result, "--psm")
probably it's needed to switch between the 2 cases to make the change backward compatible.

from open-ocr.

serhii-eleks avatar serhii-eleks commented on September 17, 2024 1

Yes, would be great to improve docs available output formats.
But the main issue is the system cannot execute tesseract with "--psm" parameter.

from open-ocr.

serhii-eleks avatar serhii-eleks commented on September 17, 2024

I found config argument: "tessedit_create_hocr": "1" in order to return data in hocr format.

from open-ocr.

tleyden avatar tleyden commented on September 17, 2024

Do the docs need to be improved?

from open-ocr.

serhii-eleks avatar serhii-eleks commented on September 17, 2024

Hello @tleyden

Do you have any updates?

Thanks.

from open-ocr.

mirko0x5f avatar mirko0x5f commented on September 17, 2024

Hello! We're having the exact same problem. We would like to launch tesseract with the psm:3 parameter but we fail to do so for tesseract 4.0.

from open-ocr.

overwerk avatar overwerk commented on September 17, 2024

we managed to fix it only for tesseract 4.0 by changing it in
result = append(result, "--psm")

Could you please say where exactly I need to replace it? I went into the docker container of the worker and httpd and located the mentioned file, changed it and restarted both containers. Error is still the same.

from open-ocr.

thliew avatar thliew commented on September 17, 2024

There is a workaround solution for this issue..
Get into OCR worker container
You should be able to list your running docker container with command below
docker ps
List should contain dockercompose_openocr_1, dockercompose_openocrworker_1, dockercompose_strokewidthtransform_1 and dockercompose_rabbitmq_1 in NAMES column which corresponding to HTTP handler, OCR worker, pre-processor and RabbitMQ.

Use command below to get into OCR worker container
docker exec -it <container_id> /bin/bash

Refactor the source code
cd /opt/go/src/github.com/tleyden/open-ocr/
vim tesseract_engine.go
Around line 87:
Change result = append(result, "-psm") into result = append(result, "--psm")

Recompiling execution file
cd /opt/go/src/github.com/tleyden/open-ocr/cli-worker && go build -v -o open-ocr-worker && cp open-ocr-worker /usr/bin

If you encountered the message below:
cp: cannot create regular file '/usr/bin/open-ocr-worker': Text file busy
you may try to restart the container and try cp it again

Restart docker container
Exit docker container and restart it by using command below:
docker restart <container_id>

from open-ocr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.