My favorites | Sign in
Logo
                
Search
for
Updated Jun 14, 2009 by tmb...@gmail.com
DevInstall  
Installing the Development Version

Download and Compiling with Mercurial and SCons

We 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 OCRopus

There 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 / Automake

Autoconf/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 Problems

There are a bunch of things that can cause your builds to fail. Please check these before reporting a bug:


Comment by yaroslavvb, Jun 13, 2009

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

Comment by oneeyedmen, Jun 15, 2009

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)

Comment by njalterio, Jun 17, 2009

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...

Comment by yaroslavvb, Jun 17, 2009

libavfilter-dev is not available through apt-get on Ubuntu 8.10

Comment by mic.tja, Jun 18, 2009

I tried to install it but got an error saying bookstore.h is missing.

Comment by jonathan.carse, Jun 28, 2009

Under ubuntu 9.04 you will also have to do

sudo apt-get install scons

of course...

Comment by Bill.Janssen, Jul 09, 2009

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".

Comment by tmb...@gmail.com, Aug 10, 2009

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.

Comment by ready.eddy, Aug 29, 2009

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 ...

Comment by vesko.kolev, Sep 01, 2009

The same problem. "ocropus: error while loading shared libraries: libocropus.so: cannot open shared object file: No such file or directory"

Comment by andrea.batazzi, Sep 04, 2009

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)

Comment by nikolaynag, Sep 06, 2009

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/).

Comment by scottdw0001, Sep 07, 2009

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.

Comment by imbiea, Oct 17, 2009

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&)':

...

Comment by falkenhagen, Nov 19, 2009

I cannot seem to get ocropus to output the result of OCR...

I get the following for the quick test:

$ ocropus page data/testimages/simple.png
[info] got 240 bboxes
[info] all = 0

and I cannot find the OCR result. Is this the expected output, and is the OCR result somewhere?

Comment by moraving, Nov 20, 2009

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

error while loading shared libraries: libiulib.so: cannot open shared object file: No such file or directory

In fact, it does exist:

[0 amanda@brahms build]$ locate libiulib.so
/srv/ocropus/build/iulib/libiulib.so
/usr/local/lib/libiulib.so

So any idea what gives?

Comment by moraving, Nov 20, 2009

Duh. Sorry, there are about six comments above on this from andrea.batazzi, nikolaynag and scottdw0001.

Comment by neil.ablang, Nov 23, 2009

try running ldconfig as root.. shared libraries are not linked


Sign in to add a comment
Hosted by Google Code