OCRopus and document layout analysis

123 views
Skip to first unread message

Bill

unread,
Jun 3, 2009, 4:10:55 AM6/3/09
to ocropus
Hello,

I hope this question hasn't been too often stated on this group - if
that's the case, then sorry for repeating it again...

I am truly fascinated by the wealth of functions which OCRopus offers.
One is of my special interest - document layout analysis. As I'm
trying to evaluate this function for my own use, I have a couple of
general questions:

1. What is the most up-to-date repository to use with OCRopus? I've
noticed Mercurial has the newest version, but it lacks ocroscript...
2. Is it possible using LUA scripts to analyse the layout of an image
of a document and output the result to an image (with boxes around
paragraphs present etc.)?

Thank you in advance for your help,
Regards

Bill

tmb

unread,
Jun 8, 2009, 6:59:56 PM6/8/09
to ocropus
> 1. What is the most up-to-date repository to use with OCRopus? I've
> noticed Mercurial has the newest version, but it lacks ocroscript...

The main Mercurial repositories are at Google Code (now that Google
supports Mercurial).

ocroscript hasn't been fully converted yet. If you want to help, you
can pull a copy from mercurial.iupr.org and try to get it to work.

> 2. Is it possible using LUA scripts to analyse the layout of an image
> of a document and output the result to an image (with boxes around
> paragraphs present etc.)?

Yes. Or you can write a very small C++ command line tool.

Either way, the pixel-accurate format for page segmentation output is
described in this document:

http://docs.google.com/Doc?id=dfxcv4vc_92c8xxp7

Tom

Bill

unread,
Jun 9, 2009, 11:58:28 AM6/9/09
to ocropus
> > 2. Is it possible using LUA scripts to analyse the layout of an image
> > of a document and output the result to an image (with boxes around
> > paragraphs present etc.)?
>
> Yes.  Or you can write a very small C++ command line tool.
>
> Either way, the pixel-accurate format for page segmentation output is
> described in this document:
>
> http://docs.google.com/Doc?id=dfxcv4vc_92c8xxp7
>
> Tom

Hello,
Thanks for the reply. I will have a proper look at the supplied
document.

One thing I would love to achieve at this stage is something similar
to http://ocrocourse.iupr.com/layout-analysis/rast-layout.png?attredirects=0.
I went through all LUA test scripts and applied the following
workflow:
1. Open image
2. Deskew image
3. Binarize image
4. Segment image using the RAST method
5. Extract regions
...
And this is where I get stuck. I know that the object of the
RegionExtractor class has a method called bbox() which outputs the
coordinates of the bounding box in a rectangle-data type. I went
through IUlib and even found something called bounding_boxes(), but
I'm still struggling to use it in LUA.
I would really appreciate your help,
Thanks again for the earlier answer,
Sending kind regards,
Bill

Bill

unread,
Jun 11, 2009, 12:02:53 PM6/11/09
to ocropus
Hello,
I've managed to display the RAST layout analysis results (doing it in C
++ and using the newest revision of OCRopus from GoogleCode).
Now I have a problem with the textImageSegByLogReg (using the
ITextImageClassification interface). After calling the
textImageProbabilities method I get:

terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted

Is there a way to make the text/image segmentation work? I'm using G++
4.3.3 under Ubuntu 9.04.

Thanks for your reply,
Regards,
Bill

Thomas Breuel

unread,
Jun 11, 2009, 1:01:42 PM6/11/09
to ocr...@googlegroups.com
I'm not sure what's wrong there. For now, just use the
Leptonica-based component. In addition, text/image segmentation is
not yet well integrated with layout analysis.

In 0.5, we'll have a better text/image segmentation than either of
those, and it will be better integrated.

Tom

Bill

unread,
Jun 11, 2009, 2:36:08 PM6/11/09
to ocropus
Hello,
Thanks for the advice. I forgot that there are other methods to do the
segmentation.

Regards,
Bill
Reply all
Reply to author
Forward
0 new messages