IDE crashes when I run OCR

Asked by Waikit Lau

I'm trying to do number extraction from a webpage using Tessaract/OCR.

I have installed Tesseract v4.1.1. on my MacOS machine (running 10.13.6 High Sierra).

When I run just this test code snippet, the Sikuli IDE crashes. The crash repost says "Termination Reason: DYLD, [0x4] Symbol missing"

import sys
priceRegion = Region(79,192,80,32)
price = priceRegion.text()
print(price)

What am I doing wrong?

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

running macOS 11.4 using Java 11 and IDE 2.0.5 from a Terminal via java command.

I have Tesseract 4.1.1 installed via homebrew.

tesseract --version says:
tesseract 4.1.1
 leptonica-1.79.0
  libgif 5.2.1 : libjpeg 9d : libpng 1.6.37 : libtiff 4.1.0 : zlib 1.2.11 : libwebp 1.1.0 : libopenjp2 2.3.1
 Found AVX2
 Found AVX
 Found FMA
 Found SSE

and a test as
print selectRegion().text()

simply does what it should do.

So check your setup and run from terminal with parameters -v -c

Revision history for this message
Waikit Lau (waikitlau) said :
#2

When I ran your test from terminal, it still crashes after the IDE loads and have the same crash report "Termination Reason: DYLD, [0x4] Symbol missing"

This was the command I ran - "java -jar "/Users/waikit/Downloads/sikulixide-2.0.5.jar" -r -v -c "/Users/waikit/Dropbox/TestOCR.sikuli"

I'm running macOS 10.13.6 using Java 16 and IDE 2.0.5

I have Tesseract 4.1.1 and when I run --version, it says:
tesseract 4.1.1
 leptonica-1.81.0
  libgif 5.2.1 : libjpeg 9d : libpng 1.6.37 : libtiff 4.3.0 : zlib 1.2.11 : libwebp 1.2.0 : libopenjp2 2.4.0
 Found AVX2
 Found AVX
 Found FMA
 Found SSE

Revision history for this message
RaiMan (raimund-hocke) said :
#3

please run
java -jar "/Users/waikit/Downloads/sikulixide-2.0.5.jar" -v -c

then in the IDE run a script like so:

Debug.on(3)
selectRegion().text()

... select some area

... and send the complete output you get in the terminal to my mail sikulix---at---outlook---dot---com

Revision history for this message
RaiMan (raimund-hocke) said :
#4

again tested:

- tesseract installed via homebrew
- this creates a symlink for libtesseract.dylib in /usr/local/lib

... and everything works

so check, wether there is an entry (real or symlink) for libtesseract.dylib in /usr/local/lib

Can you help with this problem?

Provide an answer of your own, or ask Waikit Lau for more information if necessary.

To post a message you must log in.