Using C API of tesseract 3.02 with ctypes and cv2 in python
问题 I am trying to use Tesseract 3.02 with ctypes and cv2 in python. Tesseract provides a DLL exposed set of C style APIs, one of them is as following: TESS_API void TESS_CALL TessBaseAPISetImage(TessBaseAPI* handle, const unsigned char* imagedata, int width, int height, int bytes_per_pixel, int bytes_per_line); So far, my code is as follows: tesseract = ctypes.cdll.LoadLibrary('libtesseract302.dll') api = tesseract.TessBaseAPICreate() tesseract.TessBaseAPIInit3(api, '', 'eng') imcv = cv2.imread(