I tried to use tesseract on my project at C# and i finished it works great at my computer but when i try to use this project at another PC first it gave vcruntime140.dll error, i solved it and after it works great except OCR, and i use exactly same version of tesseract at 2 PC. I will call my computer source.
Source PC
Windows10
Project written at VS2017 C#
.NET Framework 3.5
Tesseract Version
tesseract 4.0.0-alpha.20180109
leptonica-1.74.4
libgif 4.1.6(?) : libjpeg 8d (libjpeg-turbo 1.5.0) : libpng 1.6.24 : libtiff 4.0.6 : zlib 1.2.8 : libwebp 0.4.3 : libopenjp2 2.1.0
Target PC
Windows7
It has all dependicies
Tesseract Version
tesseract 4.0.0-alpha.20180109
leptonica-1.74.4
libgif 4.1.6(?) : libjpeg 8d (libjpeg-turbo 1.5.0) : libpng 1.6.24 : libtiff 4.0.6 : zlib 1.2.8 : libwebp 0.4.3 : libopenjp2 2.1.0
I know it has all image format's library but i tried png and tiff both with my last hope =)
Thanks!
Abdullah
It throws this when OCR try to work ;
"the exception was created by an invocation target"
Related
Screenshots have been captured on two windows 10 machines with the same tesseract (I just copied tesseract folder from one to another machine). I noticed that every 2 corresponding pixels in images differ in 1-2 (I have no idea why they are different. Both have been made using python pillow's ImageGrab module. Windows color settings are identical). I tried to normalize images (https://stackoverflow.com/a/7422584/13635865), but with other images it doesn't work. Tesseract version:
tesseract v5.1.0.20220510
leptonica-1.78.0
libgif 5.1.4 : libjpeg 8d (libjpeg-turbo 1.5.3) : libpng 1.6.34 : libtiff 4.0.9 : zlib 1.2.11 : libwebp 0.6.1 : libopenjp2 2.3.0
Found AVX2
Found AVX
Found FMA
Found SSE4.1
Found libarchive 3.5.0 zlib/1.2.11 liblzma/5.2.3 bz2lib/1.0.6 liblz4/1.7.5 libzstd/1.4.5
Found libcurl/7.77.0-DEV Schannel zlib/1.2.11 zstd/1.4.5 libidn2/2.0.4 nghttp2/1.31.0
cmd: tesseract <good/bad>.png stdout -l rusResult with good.png: Карта получателяResult with bad.png: ЕВЕGood image: https://ibb.co/bHLtP67Bad image: https://ibb.co/G3FT2cT
Why there is such a big difference in tesseract results on almost the same images?
Can not reproduce problem:
>tesseract good.png - -l rus
Карта получателя
>tesseract bad.png - -l rus
Карта получателя
>tesseract -v
tesseract 5.1.0-70-g0df5
leptonica-1.83.0 (Jun 24 2022, 17:48:50) [MSC v.1929 LIB Release x64]
libgif 5.2.1 : libjpeg 6b (libjpeg-turbo 2.0.91) : libpng 1.6.37 : libtiff 4.4.0 : zlib 1.2.12 : libwebp 1.2.2 : libopenjp2 2.5.0
Found AVX2
Found AVX
Found FMA
Found SSE4.1
Found libarchive 3.5.1 zlib/1.2.11 liblzma/5.2.4 bz2lib/1.0.6 libzstd/1.4.9
Found libcurl/7.75.0 zlib/1.2.12 libssh2/1.10.1_DEV
I'm using ngx translate for translation in my ionic 4 project. But when i try to run:
ionic cordova build android -prod
Throws this error:
ERROR in Illegal State: referring to a type without a variable {"filePath":"C:/XXX/XXX/XXX/XXX/PROJECTNAME/node_modules/#ngx-translate/core/ngx-translate-core.d.ts","name":"TranslatePipe","members":[]}
[ERROR] An error occurred while running subprocess ng
My ionic info:
Ionic:
Ionic CLI : 5.2.7 (C:\Users\USER\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : #ionic/angular 4.9.0
#angular-devkit/build-angular : 0.801.3
#angular-devkit/schematics : 8.1.3
#angular/cli : 8.1.3
#ionic/angular-toolkit : 2.0.0
Cordova:
Cordova CLI : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : not available
Cordova Plugins : not available
Utility:
cordova-res : 0.6.0
native-run : 0.2.8
System:
Android SDK Tools : 26.1.1 (C:\Users\USER\AppData\Local\Android\Sdk)
NodeJS : v12.5.0 (C:\Program Files\nodejs\node.exe)
npm : 6.9.0
OS : Windows 10
Please help!!!
The accepted answer is a solution to avoid the problem, but when a production build is needed, things are looking bad.
Workaround to achieve this is to access your tsconfig.json and disable fullTemplateTypeCheck to false. Include it, if you can not find it.
"angularCompilerOptions": {
"fullTemplateTypeCheck": false,
...
},
This error actually means that a reference failure is present among your components and modules. That could be a dupliate reference in a module or and submodule or any the like. This would result in ommiting to make a needed variable available. In your case that is the variable of ngx-translate (which your either call in the template or component file).
Setting the fullTemplateTypeCheck to false will help you to get the insights (including code line) about your false module references. But you must fix it yourself. Usually an easy fix. If you are uncertain, run again ng build --prod --verbose to see get more indications about the false relations.
you do not need to write -prod because it converts the file into minified version so device to hard to read. u just need run without -prod
ionic cordova build android
if you want a release APK just run
ionic cordova build android --release
after that, u do not face any issue.
Runtime Error
Module build failed: Error: ENOENT: no such file or directory, open '/Users/.../src/constants/Strings.js.map' at Error (native)
typescript": "2.3.4"
Ionic info
global packages:
#ionic/cli-utils : 1.4.0
Cordova CLI : 7.0.1
Ionic CLI : 3.4.0
local packages:
#ionic/app-scripts : 1.3.7
#ionic/cli-plugin-cordova : 1.4.0
#ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms : android 6.2.3 ios 4.4.0
Ionic Framework : ionic-angular 3.4.2
System:
Node : v6.10.3
OS : macOS Sierra
Xcode : Xcode 8.3.2 Build version 8E2002
ios-deploy : 1.9.1
ios-sim : 5.0.13
npm : 5.0.3
reading this post on the official ionic blog it seems like it could be some import that are unmatched because capital letters.
Give it a try, hope this helps you to solve your problem.
I try to use video.js as my video player, but reaches error:
Uncaught (in promise): Error: Cannot find module "safe-json-parse/tuple" Error: Cannot find module "safe-json-parse/tuple"
Steps I did:
npm install -S video.js
import videojs from 'video.js';
write code in palyer.ts => videojs('my-player', { controls: true});
above error appears when player page is hit.
Anybody has any idea? Or what other 3rd party html5 video player can be easily plugged in?
environment details:
ionic info
global packages:
#ionic/cli-utils : 1.4.0
Cordova CLI : 7.0.1
Ionic CLI : 3.4.0
local packages:
#ionic/app-scripts : 1.3.7
#ionic/cli-plugin-cordova : 1.4.0
#ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms : android 6.2.3
Ionic Framework : ionic-angular 3.3.0
System:
Node : v6.10.3
OS : Linux 4.10
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
npm : 3.10.10
I did the same thing, I had a safe-json-parse module so thought I was fine, but after doing:
npm install -s safe-json-parse
new files were added and the error was gone.
I downloaded the videojs js and css files to assets/ folder and references them in index.html.
By this way videojs works, though not as elegant as with npm package
I have spent the last several nights trying to install py2cairo on Mac OSX Lion using gcc-4.2 and Python2.6, attempting a number of the approaches mentioned in these links (among many others; as a new user, I can post only two links):
http://www.niconomicon.net/blog/2011/10/09/2120.wrestling.python.snow.leopard
How to install PyCairo 1.10 on Mac OSX with default python
Unfortunately, I'm still running into a problem with the wrong header files being found. See below for my environment settings and the error output from waf build. I'd greatly appreciate any pointers. Thanks!
Steves-Mac-Pro:py2cairo-1.10.0 dr_steve_kramer$ env
MANPATH=/sw/share/man:/usr/share/man:/usr/local/share/man:/usr/X11/man:/usr/local/mysql/man:/sw/lib/perl5/5.12.3/man:/usr/X11R6/man
TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/8r/2kt_yqyx2dg2g83m0dyhcy740000gn/T/
LIBRARY_PATH=/Developer/SDKs/MacOSX10.6.sdk/usr/lib
PERL5LIB=/sw/lib/perl5:/sw/lib/perl5/darwin
Apple_PubSub_Socket_Render=/tmp/launch-bnnjZo/Render
TERM_PROGRAM_VERSION=303
OLDPWD=/private/tmp
TERM_SESSION_ID=3A9C4E28-D669-4134-A333-A13920514ED7
USER=dr_steve_kramer
LD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/6.3/lib:/Library/Frameworks/Python.framework/Versions/6.3:
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-c3CJUO/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0:0
Apple_Ubiquity_Message=/tmp/launch-pYg8fw/Apple_Ubiquity_Message
PATH=/Library/Frameworks/Python.framework/Versions/6.3/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/bin:/usr/local/mysql/bin:/usr/local/bin/f2j-0.7/bin:/usr/local/jaxws-ri:/usr/X11R6/bin
MKL_NUM_THREADS=1
C_INCLUDE_PATH=/Developer/SDKs/MacOSX10.6.sdk/usr/include
PWD=/private/tmp/py2cairo-1.10.0
LANG=en_US.UTF-8
JAXWS_HOME=/usr/local/jaxws-ri
CXX=g++-4.2
SHLVL=1
HOME=/Users/dr_steve_kramer
CFLAGS=-I/usr/include/gcc/darwin/4.2/
LINKFLAGS=-search_dylibs_first -L /Library/Frameworks/Python.framework/Versions/6.3/lib/
PYTHONPATH=/Library/Frameworks/Python.framework/Versions/6.3/bin
LOGNAME=dr_steve_kramer
ACLOCAL_FLAGS=-I/usr/local/Cellar/pkg-config/0.25/share/aclocal
PKG_CONFIG_PATH=/sw/bin/pkg-config
ARCHFLAGS=-arch x86_64
INFOPATH=/sw/share/info:/sw/info:/usr/share/info
CC=/usr/bin/gcc-4.2
DISPLAY=/tmp/launch-CzK5Wg/org.x:0
_=/usr/bin/env
Steves-Mac-Pro:py2cairo-1.10.0 dr_steve_kramer$ python2.6 waf configure
./options()
Setting top to : /private/tmp/py2cairo-1.10.0
Setting out to : /private/tmp/py2cairo-1.10.0/build_directory
./configure()
Checking for 'gcc' (c compiler) : ok
Checking for program python : /Library/Frameworks/Python.framework/Versions/6.3/bin/python
python executable '/Library/Frameworks/Python.framework/Versions/6.3/bin/python' different from sys.executable '/Library/Frameworks/Python.framework/Versions/6.3/Resources/Python.app/Contents/MacOS/Python'
Checking for python version : (2, 6, 6, 'final', 0)
Checking for library python2.6 : yes
Checking for program python2.6-config : /Library/Frameworks/Python.framework/Versions/6.3/bin/python2.6-config
Checking for header Python.h : yes
Checking for program pkg-config : /sw/bin/pkg-config
Checking for 'cairo' >= 1.10.0 : yes
Configuration:
PREFIX : /usr/local
LIBDIR : /usr/local/lib
'configure' finished successfully (1.577s)
Steves-Mac-Pro:py2cairo-1.10.0 dr_steve_kramer$ python2.6 waf build
./options()
Waf: Entering directory `/private/tmp/py2cairo-1.10.0/build_directory'
./build()
src/build()
[1/9] c: src/cairomodule.c -> build_directory/src/cairomodule.c.1.o
[2/9] c: src/context.c -> build_directory/src/context.c.1.o
[3/9] c: src/font.c -> build_directory/src/font.c.1.o
[4/9] c: src/path.c -> build_directory/src/path.c.1.o
[5/9] c: src/pattern.c -> build_directory/src/pattern.c.1.o
[6/9] c: src/matrix.c -> build_directory/src/matrix.c.1.o
[7/9] c: src/surface.c -> build_directory/src/surface.c.1.o
[8/9] subst: pycairo.pc.in -> pycairo.pc
In file included from /Library/Frameworks/Python.framework/Versions/6.3/include/python2.6/unicodeobject.h:4In file included from /Library/Frameworks/Python.framework/Versions/6.3/include/python2.6/unicodeobject.h:4In file included from /Library/Frameworks/Python.framework/Versions/6.3/include/python2.6/unicodeobject.h:4,
from /Library/Frameworks/Python.framework/Versions/6.3/include/python2.6/Python.h:85,
from /Library/Frameworks/Python.framework/Versions/6.3/include/python2.6/Python.h:85In file included from /Library/Frameworks/Python.framework/Versions/6.3/include/python2.6/unicodeobject.h:4,
from ../src/pattern.c:32,
from /Library/Frameworks/Python.framework/Versions/6.3/include/python2.6/Python.h:85In file included from /Library/Frameworks/Python.framework/Versions/6.3/include/python2.6/unicodeobject.h:4,
from ../src/surface.c:32,
from ../src/matrix.c:32In file included from /Library/Frameworks/Pyth:
:
/usr/include/gcc/darwin/4.2/stdarg.h:5:2:,
from /Library/Frameworks/Python.framework/Versions/6.3/include/python2.6/Python.h:85on.framework/Versions/6.3/include/python2.6/unicodeobject.h:4In file included from /Library/Frameworks/Python.framework/Versions/6.3/include/python2.6/unicodeobject.h:4,
from /Library/Frameworks/Python.framework/Versions/6.3/include/python2.6/Python.h:85/usr/include/gcc/darwin/4.2/stdarg.h:5:2: ,
from ../src/cairomodule.c:32:
error: :
,
from ../src/path.c:32 /usr/include/gcc/darwin/4.2/stdarg.h:5:2:,
from /Library/Frameworks/Python.framework/Versions/6.3/include/python2.6/Python.h:85#error ,
from /Library/Frameworks/Python.framework/Versions/6.3/include/python2.6/Python.h:85"This header only supports __MWERKS__." :
,
from ../src/context.c:32error: /usr/include/gcc/darwin/4.2/stdarg.h:5:2:,
from ../src/font.c:32error:
#error /usr/include/gcc/darwin/4.2/stdarg.h:5:2::
:
"This header only supports __MWERKS__." #error /usr/include/gcc/darwin/4.2/stdarg.h:5:2:/usr/include/gcc/darwin/4.2/stdarg.h:5:2:
"This header only supports __MWERKS__."error: #error
error: "This header only supports __MWERKS__."#error error: error:
"This header only supports __MWERKS__."#error #error
"This header only supports __MWERKS__.""This header only supports __MWERKS__."
In file included from /Developer/SDKs/MacOSX10.6.sdk/usr/include/wchar.h:111,
from /Library/Frameworks/Python.framework/Versions/6.3/include/python2.6/unicodeobject.h:120,
from /Library/Frameworks/Python.framework/Versions/6.3/include/python2.6/Python.h:85,
from ../src/matrix.c:32:
/usr/include/gcc/darwin/4.2/stdarg.h:5:2: error: #error "This header only supports __MWERKS__."
If you haven’t solved this yet, try cairocffi: http://packages.python.org/cairocffi/
In case anyone is still have issues with py2cairo on OSX. I was able to get running by using install_name_tool. The config/build process was working and finding the correct version of python. However the compiled binary was linked against the incorrect version of python. This appears to be a bug in waf build system.
To fix the problem...
$ cd /usr/local/lib/python2.7/site-packages/cairo
$ otool -L _cairo.so
_cairo.so:
/Users/charlie/Downloads/py2cairo/build_directory/src/_cairo.so (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/libcairo.2.dylib (compatibility version 11403.0.0, current version 11403.2.0)
/System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.6)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
$ sudo install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /Library/Frameworks/Python.framework/Versions/2.7/Python _cairo.so
$ otool -L _cairo.so
_cairo.so:
/Users/charlie/Downloads/py2cairo/build_directory/src/_cairo.so (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/libcairo.2.dylib (compatibility version 11403.0.0, current version 11403.2.0)
/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.6)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
You can then import and use cairo in the version of python that you ran the waf script with.