|
|
1.1 root 1: .TH OCR 1 cetus,hydra,coma
2: .CT 1 graphics
3: .SH NAME
4: ocr \- optical character recognition
5: .SH SYNOPSIS
6: .B ocr
7: [
8: .I option ...
9: ]
10: [
11: .I file
12: ]
13: .SH DESCRIPTION
14: .I Ocr
15: reads a black-and-white image of a page from
16: .IR file ,
17: and writes ASCII to the standard output.
18: If no
19: .I file
20: is specified, it reads from the standard input.
21: .PP
22: The input is a
23: .IR picfile (5)
24: image of one column of machine-printed text, normally
25: scanned in by
26: .IR cscan (1).
27: Fonts, sizes, and line-spacings may vary within the column,
28: but each line should have a constant text size and baseline.
29: Lines should be parallel and roughly horizontal.
30: .PP
31: In the output, white space approximates the original page layout.
32: Words that
33: .IR spell (1)
34: are preferred, and hyphenations across lines are recombined.
35: .PP
36: The options are:
37: .nr xx \w'\fL-pn,m\ \ '
38: .TP \n(xxu
39: .BI -a s
40: The alphabet is the union of symbol sets selected by characters in string
41: .IR s ,
42: from among:
43: .RS
44: .PD
45: .nr yy \w'\fLA\ \ '
46: .TP \n(yyu
47: .B A
48: ABCDEFGHIJKLMNOPQRSTUVWXYZ
49: .PD0
50: .TP
51: .B a
52: abcdefghijklmnopqrstuvwxyz
53: .PD0
54: .TP
55: .B 0
56: 0123456789
57: .PD0
58: .TP
59: .B .
60: .ie t \&.\^,\|-\^:\^;\|*\^'\|\^"\|?\^!\|/\|&\|$\^(\^)\^[\|\^]\|#\|@\|% \0\0\0\0\0\0\0\0\0\0\0 \kz(basic punctuation)
61: .el \&.\^,\|-\^:\^;\|*\^'\|\^"\|?\^!\|/\|&\|$\^(\^)\^[\|\^]\|#\|@\|% \0\0\0\0\0\0\0 \kz(basic punctuation)
62: .ig
63: should include ` /(em + ???
64: shouldn't include []#@% ???
65: ..
66: .PD0
67: .TP
68: .B ^
69: ^\|\f(CW~\fR\^`\|\^\\\||\|\^{\|}\|_ \h'|\nzu'(extended punct'n)
70: .ig
71: should include []#@% ???
72: shouldn't include ` ???
73: ..
74: .PD0
75: .TP
76: .B +
77: +\^\-\^*\|/\|<\^>\^=\^.\^E\|e\|[\|] \h'|\nzu'(numerical punct'n)
78: .PD0
79: .TP
80: .B s
81: .ie t \(sc\^\(dg\^\(dd\^\(ct\|\(bu\|\(co\|\(rg\|\(de\^\(fm\^\(en\|\^\(mi\|\(em \h'|\nzu'(selected non-ASCII)
82: .el \\(sc\\(dg\\(dd\\(ct\\(bu\\(co ... \h'|\nzu'(selected non-ASCII)
83: .PD0
84: .TP
85: .B l
86: .ie t \(fi\|\(fl\|f\h'-.1m'f\|f\h'-.1m'\(fi\|f\h'-.1m'\(fl\|\N'114'\|\N'115'\|\N'105'\|\N'106' \h'|\nzu'(ligatures and digraphs)
87: .el fi fl ff ffi ffl ae oe ... \h'|\nzu'(ligatures, digraphs)
88: .PD0
89: .TP
90: .B g
91: .ie t \(*a\(*b\(*g\(*d\(*e\(*z\(*y\(*h\(*i\(*k\(*l\(*m\(*n\(*c\(*o\(*p\(*r\(*s\(*t\(*u\(*f\(*x\(*q\(*w \h'|\nzu'(Greek lower case)
92: .el \\(*a\\(*b\\(*g\\(*d\\(*e\\(*z ... \h'|\nzu'(Greek lower case)
93: .PD0
94: .TP
95: .B G
96: .ie t AB\(*G\(*DEZH\(*HIK\(*LMN\(*CO\(*PP\(*STY\(*FX\(*Q\(*W \h'|\nzu'(Greek upper case)
97: .el AB\\(*G\\(*DEZ ... \h'|\nzu'(Greek upper case)
98: .PD
99: .PP
100: The default is
101: .BR -aAa0.+^ ,
102: the full printable-ASCII set, which may be abbreviated as
103: .BR -ap .
104: Thus,
105: .B -apslgG
106: selects all of the above.
107: .RE
108: .PD
109: .TP \n(xxu
110: .B -c
111: Find columns in complex nested layouts using greedy white covers algorithm.
112: .TP
113: .BI -m l[,r]
114: Trim the left and right margins of the image by
115: .I l
116: and
117: .I r
118: inches, respectively, before looking for columns.
119: If
120: .I r
121: is omitted, it is assumed to equal
122: .IR l.
123: .TP
124: .BI -n n
125: Find the
126: .I n
127: largest columns by analysis of a single vertical projection.
128: Each column should be compactly-printed
129: and separated from the others by at least 2 ems of horizontal white space.
130: .TP
131: .BI -p n,m
132: Point sizes lie in the range [
133: .I n, m
134: ]; other sizes are discarded.
135: The default is
136: .BR -p6,24 .
137: .TP
138: .B -s
139: Defeat spelling check (but continue to favor numeric strings and good punctuation).
140: .TP
141: .B -t
142: Write
143: .IR troff (1)
144: format.
145: Each column is shown on a separate page, lines at their original height,
146: words at their original horizontal location, and
147: characters roughly original size in Times roman.
148: Hyphenated words are not recombined.
149: .TP
150: .B -u
151: Unspellable words are prefixed with `?' or, if
152: .B -t
153: is specified, printed boldface.
154: .TP
155: .BI -w w
156: Find the largest column of width
157: .I w
158: inches, within a single vertical projection.
159: .SS Fonts
160: Trained on over 100 Latin-alphabet book fonts in various italic, bold, etc styles.
161: Only one font of Greek, without diacriticals.
162: Also Swedish and Tibetan, on request.
163: .SH SEE ALSO
164: .IR bcp (1),
165: .IR cscan (1),
166: .IR font (6),
167: .IR picfile (5),
168: .IR spell (1),
169: .IR troff (1)
170: .SH BUGS
171: For best results, use images of high-contrast, cleanly-printed original
172: documents digitized at a resolution of 400 pixels/inch or higher.
173: It may help to restrict the alphabet and sizes to what's there.
174: .ig
175: 8.7 CPU minutes on pipe to read this page, September 1989.
176: ..
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.