OCR-Ergebnis mit in ein PDF packen
Jan-Benedict Glaw
jbglaw at lug-owl.de
Tue Apr 21 10:40:45 CEST 2009
On Mon, 2009-04-20 22:00:13 +0200, Martin Heggemann <martin.hf at gmx.de> wrote:
> Am Wed, 15 Apr 2009 19:19:37 +0200 schrieb Jan-Benedict Glaw <jbglaw at lug-owl.de>:
> in einer anderen Mail hast Du geschrieben:
> Zitat: "Ich hab' mittlerweile auch aus zwei großen Scan-Serien
> tolle PDFs erzeugt, mitsamt dahinterliegendem Text, der such- und
> cut'n'paste-bar ist." Zitatende
>
> Beschreib' doch mal bitte, wie du's nun gelöst hast!
Ich habe /n/ multi-page TIFFs im A4-Portrait-Format, 600dpi. Jede
Seite enthält zwei A5-Seiten, dementsprechend sind die um 90° gedreht.
Der Workflow ist also:
multi-page TIFFs -> single-page TIFFs (via tiffsplit)
single-page TIFF -> PBM (via convert)
PBM drehen und in Einzelseiten zerschneiden (via unpaper)
Einzelseiten OCRen (via ocroscript rec-tess)
Einzelseiten wieder nach TIFF konvertieren, Auflösung manuell setzen (via convert, tiffset)
OCR-Ergebnis mit der Einzel-TIFF-Seite nach PDF (via HocrConverter.py)
Einzelseiten-PDFs zum Buch machen (pdftk)
Bis auf HocrConverter.py gibts alles fertig im Debian-Repo; das
HocrConverter.py-Script gibts hier:
http://xplus3.net/2009/04/02/convert-hocr-to-pdf/#more-207
> > Jetzt wärs noch schön, wenn das alles schon als Debian-Pakete
> > vorhanden wär'...
>
> Hast Du u.U. vom OCR-Programm ein *.deb gebaut, das Du zur Verfügung
> stellen könntest?
ocropus und tesseract gibts beide apt-get install'ierbar als DEBs.
Im Anhang ist mal das Script, das den obrigen Workflow implementiert.
Erwartet *.tiff im aktuellen Verzeichnis und braucht im Moment noch
ein paar Anpassungen oben (Sprache, Auflösung und Position von
HocrConverter.py . Auflösung könnte man auch direkt aus den initialen
TIFFs holen.)
MfG, JBG
--
Jan-Benedict Glaw jbglaw at lug-owl.de +49-172-7608481
Signature of: The course of history shows that as a government grows, liberty
the second : decreases." (Thomas Jefferson)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2_landscape_a5_pages_per_portrait_a4_page.sh
Type: application/x-sh
Size: 2094 bytes
Desc: not available
URL: <http://lug-owl.de/pipermail/linux/attachments/20090421/c0929b63/attachment.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lug-owl.de/pipermail/linux/attachments/20090421/c0929b63/attachment.sig>
More information about the Linux
mailing list