Re: [tesseract-ocr] Re: Example how to use tessseract C-API in python with cffi

2019-04-03 Thread 2020shatgiskessell
I tried running this code and it crashed my kernel (on Mac OSX 10.12.6). Do you know why this could be? On Wednesday, April 3, 2019 at 1:05:16 AM UTC-4, Guru Govindan wrote: > > Thanks a lot for your response and example. I will try today. I dont have > much experience with cffi. So I decided to

Re: [tesseract-ocr] Re: Example how to use tessseract C-API in python with cffi

2019-04-02 Thread Guru Govindan
Thanks a lot for your response and example. I will try today. I dont have much experience with cffi. So I decided to write my tesseract python interface with just ctypes. The following is my code for the same. It seems to work. So for loading the tesseract library it takes about 160ms and recogn

Re: [tesseract-ocr] Re: Example how to use tessseract C-API in python with cffi

2019-04-02 Thread Zdenko Podobny
OK. I have more time to look at you code and I see there few problems: - Whitelist does not work at tesseract 4.0 (search for more details in forum/issue tracker) - Setting variable: there is no variable like "image_default_resolution" in tesseract 4.x - you need to check return value

Re: [tesseract-ocr] Re: Example how to use tessseract C-API in python with cffi

2019-04-01 Thread Zdenko Podobny
My code use PIL to open image files. You need to convert cv image structure to pix or send the data to tesseract[1] with void SetImage(const unsigned char* imagedata, int width, int height, int bytes_per_pixel, int bytes_per_line)[2] [1] https://stackoverflow.com/questions/8115368/converting-cvm

[tesseract-ocr] Re: Example how to use tessseract C-API in python with cffi

2019-04-01 Thread Guru Govindan
Hi Thanks a lot for the great post. I am trying to use cffi wrapper in my project as the pytesseract was really slow. I use opencv to read my image and I am trying to use your cffi setup and initiate. But I the tesseract is not recognizing any text. import ctypes import os import cffi import