Git Product home page Git Product logo

ocrdesktop's People

Contributors

chrys87 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ocrdesktop's Issues

Tesseract data not found on Debian

Hello all,

It seems the Tesseract data directory is not the same between Debian and Arch so this time ocrdesktop can't find the data directory.

I'll propose a patch to fix that.

Best regards.

can't launch the application because of Tesserwrap

Hello,
on latest ARch Linux, probably after upgrade to Python 3.10, the ap does not work.
I get this:

Traceback (most recent call last):
File "/usr/bin/ocrdesktop", line 23, in
from tesserwrap import tesseract
File "/usr/lib/python3.10/site-packages/tesserwrap/init.py", line 1, in
from .core import tr
File "/usr/lib/python3.10/site-packages/tesserwrap/core.py", line 74, in
tr = load_library('libtesserwrap', os.path.dirname(file))
File "/usr/lib/python3.10/site-packages/tesserwrap/core.py", line 70, in load_library
raise exc
File "/usr/lib/python3.10/site-packages/tesserwrap/core.py", line 67, in load_library
return cdll[libpath]
File "/usr/lib/python3.10/ctypes/init.py", line 449, in getitem
return getattr(self, name)
File "/usr/lib/python3.10/ctypes/init.py", line 444, in getattr
dll = self._dlltype(name)
File "/usr/lib/python3.10/ctypes/init.py", line 374, in init
self._handle = _dlopen(self._name, mode)
OSError: /usr/lib/python3.10/site-packages/libtesserwrap.so: cannot open shared object file: No such file or directory

However, the python-tesserwrap package is installed, I compiled it against the latest Python.

Provide a setup.py

Please provide a setup.py installation script using either distutils or
setuptools to ease the installation in development scenarios (virtualenv) and
for packaging.

Thanks

OCRDesktop does not work on Wayland

Tested this on ArchLinux with kde Plasma 5.27.6, wayland session.
OCRDesktop does not work under Wayland.

Steps to reproduce:

  1. log in to a Wayland session.
  2. open a terminal and try the command: "ocrdesktop"
  3. the command will throw an error that I can't copy paste for some reason, but you'll get it none the less.

Expected results: OCRDesktop should work under Wayland as well, giving the user more flexibility of choice when it comes to display server.

Actual results: the program does not work under Wayland at all.

mouse-based cropping

OCR desktop provides a gui interface that with a number of options. It generates a list of the rectangles of each word, which could potentially be used to facilitate word highlighting for the screen reader. My goal is to allow a screenshot to be taken similar to gnome-screenshot area selection and still know the position of every word.

some options are:

  • Add an option with -f to make OCR desktop search the entire screen for the partial area screenshot that it was passed -- probably, something similar would be necessary to find the position of text copied by the user so it could be highlighted as it is read even though it was accessible to begin with.
  • Patch gnome-screenshot to print the position of the screenshot and patch OCR desktop to accept that as an option with -f
  • Rewrite this file in python and include it in ocrdesktop: https://gitlab.gnome.org/GNOME/gnome-screenshot/-/blob/master/src/screenshot-area-selection.c -- this would allow us to define an area for repeated screen shots if desired

Does one of these seam like the most practical?

Please bear in mind that I am a high school student with mediocre time management skills. Also considered that we are discussing libraries that I know very little about.

Does not work with Tesseract 4

Arch Linux, Ocrdesktop from git (AUR package), Tesseract 4.0.0.
When running just ocrdesktop I get this:
❯ ocrdesktop
/usr/bin/ocrdesktop:413: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_toggleview = Gtk.MenuItem("Toggle _View")
/usr/bin/ocrdesktop:416: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_ocroptions = Gtk.MenuItem("_OCR Options")
/usr/bin/ocrdesktop:420: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_invert = Gtk.CheckMenuItem("_Invert")
/usr/bin/ocrdesktop:422: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_grayscale = Gtk.CheckMenuItem("_Grayscale")
/usr/bin/ocrdesktop:424: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_barrierbw = Gtk.CheckMenuItem("_Barrier Black White")
/usr/bin/ocrdesktop:436: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_retry = Gtk.MenuItem("_Retry OCR")
/usr/bin/ocrdesktop:439: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_clipboard = Gtk.MenuItem("Send to _Clipboard")
/usr/bin/ocrdesktop:442: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_font = Gtk.MenuItem("_Font")
/usr/bin/ocrdesktop:444: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_close = Gtk.MenuItem("_Close")
/usr/bin/ocrdesktop:459: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_preclick = Gtk.CheckMenuItem("_Preclick")
/usr/bin/ocrdesktop:462: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_leftclick = Gtk.MenuItem("_Left Click")
/usr/bin/ocrdesktop:465: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_doubletclick = Gtk.MenuItem("_Double Click")
/usr/bin/ocrdesktop:468: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_rightclick = Gtk.MenuItem("_Right Click")
/usr/bin/ocrdesktop:471: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_middleclick = Gtk.MenuItem("_Middle Click")
/usr/bin/ocrdesktop:474: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_routeto = Gtk.MenuItem("Route _To")
/usr/bin/ocrdesktop:477: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_sendkey = Gtk.MenuItem("Send _Key")
/usr/bin/ocrdesktop:496: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_save = Gtk.MenuItem("_Save As")
/usr/bin/ocrdesktop:499: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_load = Gtk.MenuItem("_Load")
/usr/bin/ocrdesktop:502: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_delete = Gtk.MenuItem("_Unload")
/usr/bin/ocrdesktop:505: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_run = Gtk.MenuItem("_Run")
/usr/bin/ocrdesktop:518: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_about = Gtk.MenuItem("_About")
/usr/bin/ocrdesktop:523: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_ocrdesktop = Gtk.MenuItem("_OCRDesktop")
/usr/bin/ocrdesktop:525: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_interact = Gtk.MenuItem("_Interact")
/usr/bin/ocrdesktop:527: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_macro = Gtk.MenuItem("_Macro")
/usr/bin/ocrdesktop:529: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.item_help = Gtk.MenuItem("_Help")
/usr/bin/ocrdesktop:542: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self._keyboardOverlayLabel = Gtk.Label("Please insert keyboard commands. exit with: F4")
/usr/bin/ocrdesktop:207: DeprecationWarning: Soon 'tesseract' will be deprecated, use Tesseract instead
self._tess = tesseract(tesseractData, self._languageCode)
!strcmp(locale, "C"):Error:Assert failed:in file baseapi.cpp, line 209
Neoprávněný přístup do paměti (SIGSEGV) (core dumped [obraz paměti uložen])

Unable to run the script alone due to a wrong shebang?

Hello all,

When you try to run the ocrdesktop script like this:
./ocridesktop

You will obtain the following error:
bash: ./ocrdesktop: /bin/python3: bad interpreter: No such file or directory

On Debian, the python3 binary is on "/usr/bin/python3". I assume it's the same on Arch, can you confirm this to me? If yes, I could send you a pull request to fix that or you could do that yourself as the change looks easy to do..

Best regards.

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.