אָריגינאַל׃
http://hocr.berlios.de
נײַער׃
http://code.google.com/p/hebocr/
דאָס איז אַ פֿרײַ אָפֿן-קאָד פּראָגראַם װי װאָלונטירן האָבן געשריבן. ער איז אַ נײַער עדיציע אָבער איך האָב געפּרוװט די אָלטער עדיציע. דאָס איז די שװערסטער צו אַרײַנשטעלן. מען מוזט פֿאָרשטײן אַ ביסל װעגן לינוקס און קאָמפּוטאָרן. אָבער, די פּראָגראַם אַלײַן איז זײער עלעגאַנט און כּוחדיק.
מאַך אַ בעצמדיק מאַשין און אַרײַנשטעל לינוקס. װײַטער, נאָכפֿאַלג דאָס ינסטרוקציעס׃
#ssh from the virtualbox
#install a bunch of required tools
root@core~$ apt-get update
root@core~$ apt-get install lib
root@core~$ apt-get install libtiff-tools
root@core~$ apt-get install libhocr-python
root@core~$ apt-get install gcc
root@core~$ apt-get install libhocr-dev
root@core~$ apt-get install swig
root@core~$ apt-get install make
root@core~$ apt-get install imagemagick
#download hocr
root@core~$ wget http://archive.ubuntu.com/ubuntu/pool/universe/h/hocr/hocr_0.8.2.orig.tar.
root@core~$tar -xvzf libhocr_0.8.2.orig.tar.gz
#install hocr
root@core~$ cd hocr-0.8.2/
root@core~$ ./configure --prefix=/usr
root@core~$ make all
root@core~$ make install
root@core~$ hocr -h #should see see help message
root@core~$ cd ~
#Software is installed and ready
From the desktop. Rotate the TIF file, crop it, and save it as a png image.
#Transfer the png image from the desktop to the virtualbox server
Boston: andy$ scp /Users/andy/Downloads/nybc210429_orig_tif/nybc210429_orig_0274.tif root@140.247.149.38:~/
From the virtual box:
#Convert png image into pnm format
root@core~$ convert nybc210429_orig_0274.png nybc210429_orig_0274.pnm
#Do the image recognition
root@core~$ hocr -i nybc210429_orig_0274.pnm -n -o nybc210429_orig_0274.txt -p nybc210429_orig_0274_annotated.pnm
#convert the annotated image back
root@core~$ convert nybc210429_orig_0274_annotated.pnm nybc210429_orig_0274_annotated.png
From Desktop, transfer the annotated images and text back:
Boston: andy$ scp root@140.247.149.38:~/nybc210429_orig_0274.txt ./
Boston: andy$ scp nybc210429_orig_0274.png root@140.247.149.38:~/
#open up the text in vim
Boston: andy$ vim nybc210429_orig_0274.txt
אין סאָפֿ, מען האָט די טעקסט און אַ בילדונג מיט אַנאָטאַציעס פֿונ די פּראָגראַם. די פּראָגראַם פֿאַרשטײ די ניקודים אונ, איך מײן אַז דאָס איז בעססער װי אַדאָבי.

* כ*יו*ל **ן ביה וץ* *ילכיקן *** מ***
יי*יי** יי* ייי ייי י
לכבוד צו מי_ין געליבטן *_ערן פרי_ינד ר’ *לום עליכם, גאָ*
זאל י_יך געבן *עזונ* און פּדנסה *יש אי_יע* דוי_יכ *ון קינדער, איר
זאָלט האָבן גרויס נ*ת וווּ איר וועש זיך קערן און *וענדן, אָמן *לה!
ק*נתּי י * – באַדאַרף איך אי_יך ז ?ן *יטן לשון. וואָס יעקב
*בי*ו הא* געז ג* אין דער סדרז וי*לח כ**ת ער האָש זיך געלאָז*
גיין קעגן עשֹון, להכ*יל… צאז *אַמעכ איז *אס *פשר ניש אַז*י גלי_יך,
בע* *יך אי_יך, פּאַני *לו* צליכ*, איר זאָלפ אוי* *יר קיין פאַר-
איבל ני*ט הא*ן. איך כין אַ *אסשער תי’וקי*. איר ווייס* אַוו*אי
מץר ;פּוִן מי* – וואפ איז דא וואָפ צו *ייזן? אין אַ דאָרץ, מישטייצ*
געזאָפ*, מע ווערש פאַרגרעכט. ווִער ה?ש *י_יט אַרי_ינצוקוקן אין אַ
פפר, צי אפּלערנען אַ ;ר*ה *ומז מיש ר*י, צי וואָס? אַ **יקל
גליק, עס קומ* דער זומער, *ארן זיך צוצ*יף זי יצזוע*ער נגידי*
קיין *ויכעריק אוי* די דאַפשעס, קאָן פען זיך *אַגעגענען אַ מאָל
מיטִ אַן איידעלן מעצ*שן, האָרפן אַ גוט וואָ**. אי* עג* *יר
גלייֹבן, אַז איך דערמ?ן מיך זין יעצע שעג, ווצן איר ז_ש געזעסן
נעבן *יר אין וואַלד, אויסגעהעד* מי_יצצ נאַרי*ע מעזֹיות, *יז בי_י
*יכ גלי_יך, ווי יך זאָל פאַרדינ*ן מי י*דע וויפל! איד ווייס ני* מיט
י ז****י* פ”*, י*ז ק***י *** ה***י*… *ש* *יָי* יָי* ****ל **ין
** קלייז, ה** *י** *י **צ**, *יו *יש* ****י**.
~
~
~
די פּראָגראַם אױך איז גוט פֿאָר פּראָצעסירן אַ סאָך פֿאָטאָגראַפֿיעס אַלצ אין אײַן מאָל.
Original: http://hocr.berlios.de
Newer fork: http://code.google.com/p/hebocr/
HOCR is a free open source program written by volunteers. There is a newer fork of HOCR called hebocr, but I tried the original HOCR program. HOCR is the the hardest of the OCR programs discussed in this blog to install. One must be comfortable with Linux and using the command line. But the program itself is very elegant and powerful. The first step is to make a virtual machine and install Linux. I used Sun/Oracle VirtualBox and installed Turnkey Linux Core which contains a stripped down version of Ubuntu 10. Follow the command line instructions above. Note that here I am switching between a desktop and the Linux virtual machine to transfer files on and off.
In the end we have an illustration of the the annotated text. The program understands the vowels and I think that the result is better than Adobe.