Thanks for the explanation, Quan. I had just stumbled upon the post that you noted. If you do have success in future, please let me know. I have other ways of scanning, but the integrated approach would be handy. I'll keep following this thread in case you are successful. Just for the record... Your VietOCR app is fantastic. I'm doing a volunteer project to transcribe some World War 1 typewritten documents. Tesseract was the only OCR engine that seemed to do a decent job. Without VietOCR, the complex...
Quan; A bit more info about the SANE installation on a Mac. The 'scanimage', 'sane-find-scanner' and 'sane-config' executables are installed in '/usr/local/bin' by Mattias' install packages. The directory '/usr/local/bin' is in the PATH.
Quan; Re: Scanning functionality The SAN packages were installed from precompiled binaries (http://www.ellert.se/twain-sane/) supplied by Mattias Ellert. So it gets istalled in the regular usr directory structure. I decided to use his installation package, as it has a preference pane configuration applet, which leaves less room for error. I'm getting the following NullPointerException. Not sure what the isuue might be. Any ideas for me to follow up? Last login: Wed Jan 27 07:47:59 on ttys001 Garys-MacBook-Pro:~...
SUCCESS!!!! That worked perfectly and I can now correct errors in the OCR'd text. There's only one function left for me to debug and get working. Could I ask if the scan function requires 32-bit or will it run with a 64-bit SANE install? Of course; I'll also check the symlinks to make sure they're OK as well.
SUCCESS!!!! That worked perfectly and I can now correct errors in the OCR'd text. There's on;y one function left for me to debug and get working. Could I ask if the scan function requires 32-bit or will it run with a 64-bit SANE install? Of course; I'll also check the symlinks to make sure they're OK as well.
Quan; This version gets further, but seems to have an issue. I've verified that 'libhunspell.dylib' is present as a symlink in '/opt/local/lib' and points to '/opt/local/lib/libhunspell-1.7.0.dylib'. I've checked that that 'hunspell' itself works from the command line. So I'm not quite sure what to make of the following console message. Is this due to VietOCR expecting hunspell to be 32-bit and finding a 64-bit library? (If so, this could also be the same issue that is haunting the scanner extension....
Quan; This version gets further, but seems to have an issue. I've verified that 'libhunspell.dylib' is present as a symlink in '/opt/local/lib' and points to '/opt/local/lib/libhunspell-1.7.0.dylib'. I've checked that that 'hunspell' itself works from the command line. So I'm not quite sure what to make of the following console message. Last login: Wed Jan 27 06:19:47 on ttys000 /Users/garygauthier/VietOCR3/VietOCR.sh ; exit; Garys-MacBook-Pro:~ garygauthier$ /Users/garygauthier/VietOCR3/VietOCR.sh...
Thanks for following up on this. I just ran the new test-version, but got a different exception. Looks like it got further though. Not sure, but there could be a simple typo in the target library name in the code. Here is the console window output. Last login: Tue Jan 26 17:20:31 on ttys000 /Users/garygauthier/VietOCR3/VietOCR.sh ; exit; Garys-MacBook-Pro:~ garygauthier$ /Users/garygauthier/VietOCR3/VietOCR.sh ; exit; Warning: Invalid resolution 0 dpi. Using 70 instead. Estimating resolution as 246...
Sorry to bother you further Quan. I thought to have a look at the nature of the spellcheck error that came up in the console window. Jan 26, 2021 10:00:20 AM net.sourceforge.vietocr.GuiWithSpellcheck jToggleButtonSpellCheckActionPerformed WARNING: Spellcheck initialization error! java.lang.Exception: Spellcheck initialization error! at net.sourceforge.vietpad.utilities.SpellCheckHelper.enableSpellCheck(Unknown Source) at net.sourceforge.vietocr.GuiWithSpellcheck.jToggleButtonSpellCheckActionPerformed(Unknown...
Quan; I put things back to invoking the dylib labelled v1.7, but when I ran the hunspell executable to check the correct version was running it came up with; @(#) International Ispell Version 3.2.06 (but really Hunspell 1.7.0) Sounds like Macports doesn't actually install a true version 1.7. Could you tell me what your system says in response to the "hunspell -v" command? I may have to re-install hunspell.
Quan; I put things back to invoking the dylib labelled v1.7, but when I ran the hunspell executable to check the correct version was running it came up with; @(#) International Ispell Version 3.2.06 (but really Hunspell 1.7.0) Sounds like Macports doesn't actually install a true version 1.7. Could you tell me what your system says in response to the "hunspell -v" command? I may have to re-install hunspell.
Quan; I ran "hunspell -v" and got the following curious response: @(#) International Ispell Version 3.2.06 (but really Hunspell 1.7.0) Copyright (C) 2002-2014 László Németh. License: MPL/GPL/LGPL. Based on OpenOffice.org's Myspell library. Myspell's copyright (C) Kevin Hendricks, 2001-2002, License: BSD. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, to the extent permitted by law. So they call...
Hi Quan; Ok. I found that since I have LibreOffice/NeoOffice installed (which uses hunspell), the dynamic hunspell library was already in the /usr/lib directory. So I created a symlink (libhunspell.dylib) in the /opt/local/lib directory that points to /usr/lib/libhunspell-1.2.0.0.0.dylib That should work, since the symlink is on the specified library path when starting VietOCR. Because LibreOffice/NeoOffice installed, the dictionaries are in both the VietOCR/dict directory as well as in /Users/[user-name]/Library/Spelling...
Actually; I did a bit or digging and found that I've already told VietOCR to look in the "/opt/local/lib/" directory, because I invoke it with "java -Djna.library.path=/opt/local/lib/ -Xms128m -Xmx2048m -jar /Applications/VietOCR3/VietOCR.jar". So it really should be finding the symlink and invoking the correct .dylib file.
Actually; I did a bit or digging and found that I've already told VietOCR to look in the "/opt/local/lib/" directory, because I invoke it with "java -Djna.library.path=/opt/local/lib/ -Xms128m -Xmx2048m -jar /Applications/VietOCR3/VietOCR.jar". So it really should be finding. the symlink and invoking the correct .dylib file.
Actually; I did a bit or digging and found that I've already told VietOCR to look in the "/opt/local/lib/" directory, because I invoke it with "java -Djna.library.path=/opt/local/lib/ -Xms128m -Xmx2048m -jar /Applications/VietOCR3/VietOCR.jar". So it really should be finding. the symlink and inviking the correct .dylib file.
Quan; I got rid of the previously noted symlink and created a libhunspell.dylib one that links to libhunspell-1.7.0.dylib in the same /opt/local/lib directory. Unfortunately it still doesn't seem to find it. Perhaps VietOCR doesn't know to look for the libhunspell.dylib in /opt/local/lib? I'm not sure how Java knows where to look. Should "/opt/local/lib" be added to the profile? My .profile file is currently set as: # MacPorts Installer addition on 2021-01-22_at_15:09:56: adding an appropriate PATH...
Ok. A bit of headway. I noticed that the hunspell 1.70 installed libhunspell-1.7.a in /opt/local/lib. So, I made a symbolic link called libhunspell.a that pointed to it. However; I still getting the same error, as if VietOCR doesn't find it and needs a commandline switch. By the way the MacPort version of hunspell was packaged as hunspell-1.7.0_1.darwin_18.x86_64.tbz2, which impies that it was made for the mac and 64-bit operation. Is that the issue?
Quan; I'm still working on getting the scanning functioning. Installing SANE on a Mac for my Epson scanner is a bit dfficult. I've contacted the author for help. I wasn't able to use the instructions on the noted page for "hunspell"., since I use MacPorts. I installed hunspell 1.70 and the dictionaries, plus checked that hunspell could list them using the "-D" option at the command prompt. That worked. Then I went to VietOCR and tried to initiate a spell-check. It returned the error, "Spellcheck...
That worked. Thank you so much, Quan! Just need to get scanning and spell-checking working. I thought scanning was built-in, but seems there must be something missing. As for spell-checking, I need to find the components I need to install. Is there anything that covers those two issues?
Hi Quan; I'm not a Java wizard, but it I do believe that the issue of Apple "tightening" system security is relevant to why the GUI is not working. On the current O/S Mojave, there is no "/lib" in "/usr/local" and nothing can be added or changed in the "/usr" directory. Apple has prevented access to it. It seems that user-added files now must be placed in the "/opt" directory structure instead. The file libtesseract.4.dylib and the symlink to it, "/opt/local/lib/libtesseract.dylib", are both located...
Hi Quan; I'm not a Java wizard, but it I do believe that the issue of Apple "tightening" system security is relevant to why the GUI is not working. On the current O/S Mojave, there is no "/lib" in "/usr/local/lib" and nothing can be added or changed in the "/usr" directory. Apple has prevented access to it. It seems that user-added files now must be placed in the "/opt" directory structure instead. The file libtesseract.4.dylib and the symlink to it, "/opt/local/lib/libtesseract.dylib", are both...
I should also note that the installation with MacPorts already created the symbolic link that vectors a request for libtesseract.dylib to /opt/local/lib/libtesseract.4.dylib
I installed the MacPorts version of Tesseract 4.1.1 on Mojave (macOS v10.14.6) and set up the environment variables to allow running tesseract from the command prompt. I also set the $TESSDATA_PREFIX to "/opt/local/share/tessdata" which is the parent directory of my "traineddata" directory. ( Tesseract installation puts a few other files in the parent directory). I can run tesseract from the command line. I can also have it list the installed traineddata files. So; it and the environment variables...