问题
I need to build tesseract without leptonica dependency for some work(to porting using emscripten). I looked into the make files and it seems tesseract requires leptonica header files and lib files in order to build.
Providing header files is not an issue but i can't provide lib files because of some reason(emscripten doesn't generate lib files of leptonica). and i tried to stop tesseract asking for leptonica by editing make files but it seems i'm heading in wrong way.
I'm very new to make/autotools stuff and what i did was removing $LIB
flag from "ac_link
" variable throughout the script and also in more few places i thought it was calling.
But i guess these build system might have a way to remove dependencies in a cleaner way without editing the arbitrary places in configure script(may be some places like makefile.am, or somewhere). Or is there any other way i can build tesseract without leptonica and how can i exactly do it ?.
Sorry if i have used wrong terminologies like i said i'm not much familiar with above build systems.
回答1:
I'm afraid there is no way to omit Leptonica unless you provide some replacement for required functionality.
I did some research regarding this matter. At the time being, Leptonica counts 2481 functions but Tesseract uses a small subset of them - 163 functions in total.
So you have to provide a replacement for non-trivial 163 functions, mostly doing complex image manipulation like mathematical morphology, rotation by shearing and binarization of color images.
The fact it isn't possible to recompile Leptonica to Javascript votes for a better modularization of Leptonica. At the moment being, it's a huge monolithic library depending toughly on several image formats like jpeg, gif, tiff, webp etc. Therefore, you'll have to recompile the appropriate libraries like libtiff, libgiff, libz, libwebp etc. into Javascript as well. This is what could be better implemented as plugins.
Just my two cents...
来源:https://stackoverflow.com/questions/31230127/building-tesseract-without-leptonica