Open anirudhsundar98 opened 7 years ago
Any luck for error in Updated Section ? I too facing the same problem.
this worked for me : https://github.com/meh/ruby-tesseract-ocr/issues/50#issuecomment-327005723
I'm having the same problem.
$> uname -r
4.18.5-041805-generic
$> ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
$> tesseract -v
tesseract 3.04.01
leptonica-1.73
libgif 5.1.2 : libjpeg 8d (libjpeg-turbo 1.4.2) : libpng 1.2.54 : libtiff 4.0.6 : zlib 1.2.8 : libwebp 0.4.4 : libopenjp2 2.1.2
The fix from #50 does not work for me (or rather I don't understand how to apply it) as I'm on Ubuntu 16.04 and not Mac.
The log states
g++ -shared -fPIC -o /tmp/.ffi-inline-1000/da27b7b6426451f95823530285eb4150cb4f91cc.so /tmp/.ffi-inline-1000/da27b7b6426451f95823530285eb4150cb4f91cc.cpp -ltesseract 2>>/tmp/.ffi-inline-1000/da27b7b6426451f95823530285eb4150cb4f91cc.log
/home/shinku/.rvm/gems/ruby-2.5.1@global/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb: In function ‘void set_image(tesseract::TessBaseAPI*, const Pix*)’:
/home/shinku/.rvm/gems/ruby-2.5.1@global/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb:171:22: error: invalid conversion from ‘const Pix*’ to ‘Pix*’ [-fpermissive]
api->SetImage(pix);
^
In file included from /tmp/.ffi-inline-1000/da27b7b6426451f95823530285eb4150cb4f91cc.cpp:1:0:
/usr/include/tesseract/baseapi.h:356:8: note: initializing argument 1 of ‘void tesseract::TessBaseAPI::SetImage(Pix*)’
void SetImage(Pix* pix);
^
/home/shinku/.rvm/gems/ruby-2.5.1@global/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb: In function ‘bool process_pages(tesseract::TessBaseAPI*, const char*, STRING*)’:
/home/shinku/.rvm/gems/ruby-2.5.1@global/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb:183:55: error: no matching function for call to ‘tesseract::TessBaseAPI::ProcessPages(const char*&, NULL, int, STRING*&)’
return api->ProcessPages(filename, NULL, 0, output);
^
In file included from /tmp/.ffi-inline-1000/da27b7b6426451f95823530285eb4150cb4f91cc.cpp:1:0:
/usr/include/tesseract/baseapi.h:541:8: note: candidate: bool tesseract::TessBaseAPI::ProcessPages(const char*, const char*, int, tesseract::TessResultRenderer*)
bool ProcessPages(const char* filename, const char* retry_config,
^
/usr/include/tesseract/baseapi.h:541:8: note: no known conversion for argument 4 from ‘STRING*’ to ‘tesseract::TessResultRenderer*’
/home/shinku/.rvm/gems/ruby-2.5.1@global/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb: In function ‘bool process_page(tesseract::TessBaseAPI*, Pix*, int, const char*, STRING*)’:
/home/shinku/.rvm/gems/ruby-2.5.1@global/gems/tesseract-ocr-0.1.8/lib/tesseract/c/baseapi.rb:189:71: error: no matching function for call to ‘tesseract::TessBaseAPI::ProcessPage(Pix*&, int&, const char*&, NULL, int, STRING*&)’
return api->ProcessPage(pix, page_index, filename, NULL, 0, output);
^
In file included from /tmp/.ffi-inline-1000/da27b7b6426451f95823530285eb4150cb4f91cc.cpp:1:0:
/usr/include/tesseract/baseapi.h:556:8: note: candidate: bool tesseract::TessBaseAPI::ProcessPage(Pix*, int, const char*, const char*, int, tesseract::TessResultRenderer*)
bool ProcessPage(Pix* pix, int page_index, const char* filename,
^
/usr/include/tesseract/baseapi.h:556:8: note: no known conversion for argument 6 from ‘STRING*’ to ‘tesseractultRenderer*’
On mac for several years only Tesseract 3.05 has been released on Homebrew, and this ruby wrapper doesn't support Tesseract > 3.03... On Linux we restrict the tesseract version installed. For Ubuntu:
apt-get install tesseract-ocr=3.03.02-3 tesseract-ocr-eng=3.02-2 \
tesseract-ocr-osd=3.02-2 tesseract-ocr-equ=3.02-2 \
tesseract-ocr-fra=3.02-2 libtesseract-dev=3.03.02-3 libtesseract3=3.03.02-3
For debian:
apt-get install tesseract-ocr=3.03.03-1 tesseract-ocr-eng=3.02-2 \
tesseract-ocr-osd=3.02-2 tesseract-ocr-equ=3.02-2 \
tesseract-ocr-fra=3.02-2 libtesseract-dev=3.03.03-1 libtesseract3=3.03.03-1
Then we need french extension and there is a naming error so we run this script: https://gist.github.com/ShamoX/49143fa1b1a539fcd641b0c009c0f579
We do that from 2014... So we would appreciate that the #50 is accepted and a new release should be released.
same issue here tested on
lsb_release -a
No LSB modules are available.
Distributor ID: Kali
Description: Kali GNU/Linux Rolling
Release: 2019.1
Codename: n/a
Ruby
ruby -v
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-gnu]
Also tested on Mac with the same result
I've been trying to fix this error for quite some time now but nothing seems to work. Weird thing is, the gem used to work for me. I used it on quite a few images and it produced pretty good results. Then one day, requiring the gem just started throwing compilation errors. I've read through the other Compilation Error posts but i don't think the same problem occurs here/the solution there didn't work for me.
Ruby version :
Tesseract version :
OS :
Debian GNU/Linux 8 (jessie)
I built the leptonica and tesseract libraries from source and the tesseract command line tool works beautifully.
Here's the error output: Within irb :
Log file :
require 'tesseract-ocr'
produces the same error.So on looking at the log file i noticed from the first part that
stdint.h
seems to be missing. But even after adding that header file the error doesnt change.List of headers :
Please help.
UPDATE:
So i removed the tesseract version i had and built the 3.05.00 release. I still get a compilation error though. But this time the contents of the log file are different.
Log File:
Tesseract Version: