Installed Tesseract to do some OCR testing with Selenium WebDriver (Java).
This is my maven dependency for Tess4J
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId`enter code here`>tess4j</artifactId>
<version>2.0.0</version>
<scope>test</scope>
</dependency>
Installed Tesseract 3.03.00 via brew. Setup TESSDATA_PREFIX to the path
/usr/local/Cellar/tesseract/3.04.00/share/tessdata
But, actually, when I did the following command
sudo find / -name tessdata
I found that tessdata folder in 4 different locations.
/Users/<username>/Downloads/Tess4J/tessdata
/Users/<username>/tesseract-ocr/tessdata
/usr/local/Cellar/tesseract/3.04.00/share/tessdata
/usr/local/share/tessdata
Confused now if I have setup my TESSDATA_PREFIX correctly or not since I am getting the following error when tried to run my junit test
Error opening data file ./tessdata/eng.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory.`enter code here`
Failed loading language 'eng'
Tesseract couldn't load any languages!
AdaptedTemplates != NULL:Error:Assert failed:in file adaptmatch.cpp, line 174
TESSDATA_PREFIX should be set to the parent directory of tessdata, i.e., /usr/local/Cellar/tesseract/3.04.00/share/.
This problem is resolved by setting the path programmatically using the method
instance.setDatapath(parentPath);
You might see a pop "The last time you opened java, it unexpectedly quit while reopening windows. Do you want to try to reopen its windows again?", click "Reopen" and it will never appear again.
All my tests are running perfectly fine now.
For those having problems with path on Tesseract (wich is likely to happen) i've see that usually you can pass the path of tessdata as first parameter on the instance.
On others you can programatically set it before.
Case of Python and Tesserwrap i just did: https://stackoverflow.com/a/38821791/2480481
I know that's MacOS, but the key of the answer is "put the path at the instance and pray", it worked for me.
Related
I am a student who has gotten a part time job embedded system programming. I am given a program the company uses, and asked to understand it. This is a working program. Therefore, the project can be built and flashed on ESP32 by the developers with no problem. So, the code and CMake files should have no issues. However, I cannot build the program either with VSCode extension nor with idf.py. In fact, I cannot build esp-idf examples from the official website, either.
Note: I am new to StackOverflow as well as to ESP32, so sorry if I made any mistakes here. If this post is problematic in any way, please inform me.
The error message from the terminal is shown here
I was initially using VSCode on Windows 10 (Windows is not activated). At first, ESP extension was completely failing to start the building process because it could not locate the tools. I was getting "could not be located" errors for all the tools. Below is a list of what I did in this setting:
I had v5.0.0 for esp-idf downloaded from Espressif server. I deleted it and tried v4.3.3 and then I tried to download from Github server. I downloaded the requirements for idf.py scripting environment and completed the settings for it as described by the Espressif's documentation.
I manually set the environment variables for IDF_PATH and PATH for both the user and for the system.
After 2, the initial error was gone. Unfortunately, I had a new error which indicated that ".elf" file for the project output could not be found. I do not exactly recall the error but if it is integral to the problem's solution I can try to replicate this issue.
I tried to delete and reinstall VSCode. I tried running VSCode with admin authority.
I tried changing the IDF_TOOLS_PATH in the VSCode esp-idf extension configurations from ".espressif" to "esp\esp-idf".
At this point, I moved to try to build the project on Ubuntu 22.04.1 LTS:
In Ubuntu, I got the fatal error: esp_event.h: No such file or directory error.
It does not seem to be a common issue and I could not find much about it online.
I followed the Linux setup steps in the documentation. It said that only step 1 (Downloading the prerequisites) was necessary for the VSCode extension.
I decided to try the "master branch" from esp-idf configurations as well. After I downloaded the master branch, the error changed to the current version: 'fatal error: esp_wifi.h: No such file or directory'
I also tried the idf.py in Ubuntu but I got the same error.
Both in Ubuntu and in Windows, the Doctor Command returns nothing. It does not even open the terminal or any window. I am not sure what it should return but some online discussions were asking about its return so I wanted to note it here.
Edit: When I tried the examples on Ubuntu, they actually build just fine. Doctor Command also works with examples.
However, the main code has still issues. Initially, I assumed I made some mistakes with esp-idf configurations. But, perhaps that was not the case.
I had the same problem and ended up editing my project's CMakeLists.txt. When I added "esp_wifi" to the "REQUIRES" list, it worked for me:
idf_component_register(
SRCS "main.c"
INCLUDE_DIRS res
EMBED_FILES res/settings.html
REQUIRES esp_wifi
)
I have a small issue here. I installed Jboss-6.1.0 and when I run the 'run' bat file, JBoss does not get started and I get this error. (Please refer the attached)
My OS is Windows 8.1.I have set my Path and Java_Home variables correctly.Is there any more configuration to do?
A help is much appreciated.Thanks in advance.
I also had the same problem although with java 1.8. These are the steps I followed.
1.Go to the “bin” directory where you’ve installed JBoss
2.Edit the “run.bat” file
3.Search for the line “
set JAVA_OPTS=-Dprogram.name=%PROGNAME% -Dlogging.configuration=file:%DIRNAME%logging.properties %JAVA_OPTS%“
Change the %DIRNAME%
to your absolute path to the “bin” directory of your installed JBoss.e.g.
set JAVA_OPTS=-Dprogram.name=%PROGNAME% -Dlogging.configuration=file:”C:\Java\jboss-6.1.0-final\bin\logging.properties” %JAVA_OPTS%
I do not think the java version difference would affect the solution. It should work.
I've installed the Protobuf-dt plugin in Eclipse and It's working okay, except for a weird problem related to it's integration with Protoc.
When I point it to it's executable, it says the file isn't protoc. If I point it to PATH, it doesn't show me any error but when I save the .proto file, it shows me an error saying that it haven't found protoc.
If I compile my .proto file manually with command line (using the same executable), it works okay.
Could it be a problem related to my 64 bits environment (windows/eclipse/jdk)? I haven't found a win64 executable of protoc.
Does anyone had the same problem? Any tip would be appreciated.
Thanks in advance.
I believe it was some Bug. I raised an Issue on theirs Google Code page and they seem to have fixed.
http://code.google.com/p/protobuf-dt/issues/detail?id=103
I am trying to install ZEND FRAMEWORK on my localhost but failing miserable. I am following the below mentioned steps but don't know where am I going wrong. Please help me with the same.
Steps are as follows that I followed:
Downloaded the ZEND Framework full package version 1.11.7 which is about 25 Mb in a zipped version and then unzipped it to a folder called ZendFrameWork.
Copied the ZendFramework folder inside my c:\xampp\php\
changed the "include_path = '.;\xampp\php\PEAR;\.;C:\xampp\php\ZendFramework\library' " in the php.ini file.
Then restarted the apache server.
EDIT :: I have successfully managed to get the zf command to run without any errors. but now, all it does is, after i enter "zf create myproject" it just gets stuck with the cursor blinking on the next line. And if i press CTRL+C, i get the message : Terminate batch job ? (Y/N)
Then set the environment variable for zf.bat file as " C:\xampp\php\ZendFramework\bin "
But when I try to execute the " zf create sampleProjName " from command line it does nothing, so then I used Windows Powershell and it gives the error which I have attached below.
Waiting for your response.
Thanks in advance.
Try using normal cmd - not powershell. Works fine for me.
Thanks for all your response.
I successfully installed Zend Framework.
I removed the full installation and replaced it with minimal installation and also I did not have php.exe set as an environment variable, so i did that too and also in the php.ini file i needed to write the zend library first before the pear one.
And this was it, TA-DA, it worked.
:)
While building our project on the Build Server, the compilation fails with the error message:
TlbImp: error TI0000 : The input file 'C:\*.dll' is not a valid type library.
We tried to manually invoke the TlbImp command thru the VS2005 Command Prompt and the same error message appeared.
To investigate, we tried to create a clean build environment in a Virtual Machine (Vbox), then we run the build there. It went fine.
We also tried to invoke the same TlbImp command thru the VS2005 Command Prompt and it succeeded.
With that, we are assuming that there is nothing wrong with the DLL. Do you have any idea what scenario(s) can cause this problem?
EDIT:
Found the problem, see my answer. ;)
If it is working on one machine and not on the other, then most probably some dependency of this DLL is missing in your machine. Inspect the dll through DependencyWalker and you will get to know that which dependency hasn't been built properly.
After closer inspection, we found out that the environment variables on the official build server is FUBAR.
The official build server was installed with both VS2003 and VS2005. Our project is VS2005. The build script is using components from VS2003 instead of VS2005 because the VS2003 paths (Path, LIB, LIBPATH and INCLUDE) were first declared before the VS2005 paths.
A simple SET command to override the environment variables with the "correct ones" fixed the build!
Thanks!