Commit graph

151 commits

Author SHA1 Message Date
Andrey Golovizin
5babd24450 Save glyph database on exit, load on startup. 2014-08-21 21:19:57 +02:00
Andrey Golovizin
a929d1011b Accept a single directory argument on the command line. 2014-08-21 21:09:01 +02:00
Andrey Golovizin
a666a9f85b Change Line.glyphs to be a list instead of an iterator. 2014-08-18 19:02:01 +02:00
Andrey Golovizin
f79d6da2c7 Move Image.combine() and friends to module level, add support for more than 2 images. 2014-08-18 19:00:53 +02:00
Andrey Golovizin
6d824a46d6 Scroll to highlighted glyphs. 2014-08-18 17:52:39 +02:00
Andrey Golovizin
ae20b22229 Do not center on new pages (preserve current position instead). 2014-08-18 17:48:13 +02:00
Andrey Golovizin
d54c28fbc1 Make PageView properly update its scroll position when a new page is displayed. 2014-08-18 17:47:50 +02:00
Andrey Golovizin
47dcb5be7f Implement proper diacritic detection. 2014-08-18 15:50:43 +02:00
Andrey Golovizin
ada771b5c9 Rename Letter to Glyph. 2014-08-18 15:44:36 +02:00
Andrey Golovizin
c5cb68f063 Implement basic learning mode. 2014-08-15 18:10:49 +02:00
Andrey Golovizin
a537f2140c Remove Image.key, add Letter.key. 2014-08-15 18:09:43 +02:00
Andrey Golovizin
08a6d004e7 Add OCREngine class. 2014-08-15 18:09:28 +02:00
Andrey Golovizin
6c3c93a39d Add GlyphEdit class. 2014-08-15 18:09:20 +02:00
Andrey Golovizin
34d7d123d1 Strip trailing spaces from license headers. 2014-08-15 16:47:23 +02:00
Andrey Golovizin
f9be7be65e Tweak display colors. 2014-08-15 14:42:07 +02:00
Andrey Golovizin
c4b170cc21 Implement correction for optical distance between letters. 2014-08-15 14:40:02 +02:00
Andrey Golovizin
ce4252e361 Split lines into letters according to letter distances, ditch page.Word. 2014-08-15 14:25:02 +02:00
Andrey Golovizin
50b40458bc Add Image.space(). 2014-08-15 14:21:38 +02:00
Andrey Golovizin
5f7e6abcb9 Add Image.bbox(), Image.overlaps() and Image.combine(). 2014-08-15 14:21:20 +02:00
Andrey Golovizin
3407bac38b Add utils.pairwise(). 2014-08-15 14:20:34 +02:00
Andrey Golovizin
26ba867089 Mask adjacent blobs when extracting blob images. 2014-08-15 11:57:33 +02:00
Andrey Golovizin
4ff37720d9 Use x, y, top, bottom instead of x1, y1, x2, y2. Add aliases: left=x, top=y. 2014-08-13 22:43:55 +02:00
Andrey Golovizin
360ed844c2 Use absolute coordinates in Line.baseline. 2014-08-13 20:25:01 +02:00
Andrey Golovizin
cd4aec6f11 GUI: make Ctrl-C in console work. 2014-08-13 20:00:10 +02:00
Andrey Golovizin
3ceda0a73f Reduce min_space between words from 10 to 5. 2014-08-13 19:59:17 +02:00
Andrey Golovizin
a15cd7c4a2 Add Word.baseline and Letter.elevation. 2014-08-13 19:55:31 +02:00
Andrey Golovizin
e3217d28b8 Make baseline be exactly _below_ the letter.
The letter now "sits" on the baseline. This is to make indexing more convenient.
2014-08-13 19:53:29 +02:00
Andrey Golovizin
3d2b2ba30a Get rid of image.SubImage.
Every Image now stores its own data itself.
2014-08-13 19:13:05 +02:00
Andrey Golovizin
37c38cb9b2 Correct the dimensions of displayed letter boxes. 2014-08-13 18:01:17 +02:00
Andrey Golovizin
7ce6fa42c1 Add Line.baseline property. 2014-08-13 15:30:04 +02:00
Andrey Golovizin
b756ea484b Add Page.lines, Line.words, Line.letters and Word.letters properties. 2014-08-13 15:20:35 +02:00
Andrey Golovizin
e8d7d1f4d1 Add utils.collect_iterable decorator. 2014-08-13 15:19:44 +02:00
Andrey Golovizin
9155905398 Remove extra margins from GUI. 2014-08-12 20:28:28 +02:00
Andrey Golovizin
b05cc3853e Use connected-component labeling for finding letters. 2014-08-12 18:20:45 +02:00
Andrey Golovizin
74570e6760 Organize imports. 2014-08-10 23:07:53 +02:00
Andrey Golovizin
e9f034f54b Add proof-of-concept GUI. 2014-08-10 22:57:08 +02:00
Andrey Golovizin
163d02e6c6 Remove duplicate code. 2014-08-10 21:40:43 +02:00
Andrey Golovizin
ed159cc2e6 Fix a typo. 2014-08-10 21:40:25 +02:00
Andrey Golovizin
2450f7f002 Move _iter_lines() method from SubImage to Image. 2014-08-10 21:40:10 +02:00
Andrey Golovizin
0ae6f19e60 Make Image.unframe() return a new image, not a SubImage.
This is to make line and letter absolute positions relative to the page, not to the original framed image.
2014-08-10 21:39:41 +02:00
Andrey Golovizin
b5194ca018 Add image.SubImage, move page-related logic to page.* classes. 2014-08-09 13:53:37 +02:00
Andrey Golovizin
e3a68c3043 Add more classifiers to setup.py. 2014-08-09 00:24:08 +02:00
Andrey Golovizin
00590bd644 Add license information. 2014-08-09 00:23:52 +02:00
Andrey Golovizin
79769a7770 Add setup.py. 2014-08-08 23:09:40 +02:00
Andrey Golovizin
ee22008820 Strip vertical whitespace from letters. 2014-08-08 17:24:32 +02:00
Andrey Golovizin
81147f8a50 Reorder Letter, Line and Page classes to get dependencies right. 2014-08-08 17:01:27 +02:00
Andrey Golovizin
2012da7957 Clarify Image._iter_children() a little. 2014-08-08 17:00:14 +02:00
Andrey Golovizin
3d6c3de316 Add Page, Line and Letter classes. 2014-08-08 15:53:23 +02:00
Andrey Golovizin
bd86367606 Move _repr_png_ closer to the top. 2014-08-08 13:11:29 +02:00
Andrey Golovizin
c427d60030 Add docstrings. 2014-08-08 13:08:18 +02:00