Download and Compiling with Mercurial and SConsWe have switched from Subversion to Mercurial repositories. First, you need Mercurial; type "sudo apt-get install mercurial". Mercurial is a version control system similar to Subversion, but with distributed features. To download the current version of OCRopus, please do the following: $ hg clone http://iulib.googlecode.com/hg iulib
$ hg clone http://ocropus.googlecode.com/hg ocropus There are a number of prerequisites. On Ubuntu 9.04, you can install them by running: $ sudo sh -x ocropus/ubuntu-packages You can build OCRopus with either scons or autoconf/automake. Scons is intended to work only on Ubuntu 9.04 and we're using it for development. There are two steps for the installation. First, install the "iulib" library: $ cd iulib
$ scons
$ sudo scons install Next, install OCRopus itself: $ cd ocropus
$ scons
$ sudo scons install This will install files in /usr/local/... You should put /usr/local/bin on your PATH (or do something equivalent). Running OCRopusThere is a simple recognizer you can use for a quick test: $ ocropus page data/testimages/simple.png However, this is not the recommended way of running OCRopus; among other things, it doesn't take advantage of multicore machines. It's just a quick and simple test. For documents with multiple pages, the recommended way is: $ ocropus book2pages work *.png # copies the page images into the book directory
$ ocropus pages2lines work # perform layout analysis and output text lines in 0000/0000.png etc.
$ ocropus lines2fsts work # perform character recognition on all the text lines
$ ocropus fsts2text work # apply a language model to the text
$ ocropus buildhtml work > result.html # put the result together into a simple HTML output format (Yes, we'll wrap this up more nicely later.) Autoconf / AutomakeAutoconf/automake should work for compilations across many platforms, but we don't test it as much. Patches for autoconf/automake are greatly appreciated. In order to build with autoconf/automake, you must run the build script (both in iulib and in ocropus): $ ./build The build script will actually generate the Makefile.am files. Then you can continue as usual. Build ProblemsThere are a bunch of things that can cause your builds to fail. Please check these before reporting a bug: - On Ubuntu 9.04, use scons for building, on all other platforms, use build (autoconf/automake).
- Both scons and autoconf will build whatever source files they can find. Sometimes, file get deleted from the repository but are still present in your checked out tree and this may cause compiles to fail. Use "hg status" to identify any out-of-date files.
- If an autoconf build fails after a checkout, try running the "./build" script in the top level of OCRopus; it regenerates the makefiles based on the set of source files it finds. (We're trying to do this ourselves before pushing changes and releases but forget every now and then.)
|
On Ubuntu 9.04 latest scons (v1.2.0.r3842 the only one available through Synaptic atm) doesn't work to compile ocropus https://answers.launchpad.net/ubuntu/+source/scons/+question/74190
For me at least, ocropus was not installed in /usr/local/bin, but rather could be run from ocropus/commands/ocropus.
Also ocropus page file.png fails with FATAL: /usr/local/share/ocropus/models/default.model: failed to load (/usr/local/share/ocropus/models/default.model: failed to load (/usr/local/s)
Yeah, I had the same issue with ocropus not being installed in /usr/local/bin I noticed that this "installs" version .3, I was able to get ocropus to install using this method by downloading version .4 and starting over. Although, the program installs in /usr/local/share.
I can get the program to run now, but am having difficulty getting it to work with TIF files...
libavfilter-dev is not available through apt-get on Ubuntu 8.10
I tried to install it but got an error saying bookstore.h is missing.
Under ubuntu 9.04 you will also have to do
sudo apt-get install scons
of course...
You guys need to start using configure/make yourselves. That's the only way the autoconf-based build stuff will ever work.
And add a "make dist" branch to the top-level makefile. That way you won't forget to do things before "pushing changes and releases".
Well, whether we use it or not, we simply can't test it in all the configurations since the only platform we're running is Ubuntu.
More likely, we may drop autoconf and use scons for everything from now on. It seems to work on most Linux systems and OS X, and for Windows, someone needs to write a VS build file anyway.
I am on ubuntu 9.04 and have followed all the build and installation steps. When I run the test I get the following error "ocropus: error while loading shared libraries: libocropus.so: cannot open shared object file: No such file or directory". Any pointers ...
The same problem. "ocropus: error while loading shared libraries: libocropus.so: cannot open shared object file: No such file or directory"
I solved the "ocropus: error while loading shared libraries: libocropus.so: cannot open shared object file: No such file or directory" by copying libocropus.so and libiulib.so to the /lib/ folder ( ubuntu 9.04)
I have the same problem (error while loading shared libraries) and solved it by running "sudo ldconfig" (/usr/local/lib should be referenced in /etc/ld.so.conf.d/).
The shared library problem can also be worked around by setting (or adding to) the LD_LIBRARY_PATH environment variable to the directory containing the .so.
idea's here? During a make.. I get...
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/../../../../i686-pc-linux-gnu/bin/ld: warning: libjpeg.so.62, needed by /usr/lib/libtiff.so, may conflict with libjpeg.so.7 libocropus.a(ocr-commands.o): In function `DSection': /usr/local/include/iulib/dgraphics.h:41: undefined reference to `iulib::dsection_set(char const)' libocropus.a(ocr-commands.o): In function `~DSection': /usr/local/include/iulib/dgraphics.h:44: undefined reference to `iulib::dsection_set(char const)' /usr/local/include/iulib/dgraphics.h:44: undefined reference to `iulib::dsection_set(char const)' libocropus.a(ocr-commands.o): In function `DSection': /usr/local/include/iulib/dgraphics.h:41: undefined reference to `iulib::dsection_set(char const)' libocropus.a(ocr-commands.o): In function `~DSection': /usr/local/include/iulib/dgraphics.h:44: undefined reference to `iulib::dsection_set(char const)' libocropus.a(ocr-commands.o):/usr/local/include/iulib/dgraphics.h:44: more undefined references to `iulib::dsection_set(char const)' follow libocropus.a(ocr-commands.o): In function `ocropus::Pages::addFile(char const)': /home/imoss/work/ocropus/./ocr-utils/pages.h:124: undefined reference to `iulib::Tiff::Tiff(char const, char const)' /home/imoss/work/ocropus/./ocr-utils/pages.h:124: undefined reference to `iulib::Tiff::numPages()' /home/imoss/work/ocropus/./ocr-utils/pages.h:124: undefined reference to `iulib::Tiff::~Tiff()' /home/imoss/work/ocropus/./ocr-utils/pages.h:124: undefined reference to `iulib::Tiff::~Tiff()' libocropus.a(ocr-commands.o): In function `ocropus::Pages::loadImage()': /home/imoss/work/ocropus/./ocr-utils/pages.h:196: undefined reference to `iulib::Tiff::Tiff(char const, char const)' /home/imoss/work/ocropus/./ocr-utils/pages.h:196: undefined reference to `iulib::Tiff::getPage(colib::narray<unsigned char>&, int, bool)' /home/imoss/work/ocropus/./ocr-utils/pages.h:196: undefined reference to `iulib::Tiff::~Tiff()' /home/imoss/work/ocropus/./ocr-utils/pages.h:196: undefined reference to `iulib::Tiff::~Tiff()' libocropus.a(glclass.o): In function `glinerec::MlpClassifier?::train(glinerec::IDataset&)':
...
I cannot seem to get ocropus to output the result of OCR...
I get the following for the quick test:
and I cannot find the OCR result. Is this the expected output, and is the OCR result somewhere?
Here's what I did on 9.04 ...
Followed the instructions above and then went back to http://code.google.com/p/ocropus/ and tried running hg update -r ocropus-0.4.3 in both iulib and ocropus
I don't really know how scons works, or whether I'm supposed to run scons and sudo scons install every time I update.
The error I'm getting is
In fact, it does exist:
So any idea what gives?
Duh. Sorry, there are about six comments above on this from andrea.batazzi, nikolaynag and scottdw0001.
try running ldconfig as root.. shared libraries are not linked