-
Notifications
You must be signed in to change notification settings - Fork 0
Home
ssppkenny edited this page Oct 18, 2019
·
20 revisions
The problem Flow Reader is supposed to resolve is fitting of printable page size of electronic book into device screen. Existing readers suggests two approaches for this case:
First approach is to zoom print page to squeeze it into device screen:

Backside of this is font size which makes text hardly readable.
Second approach is to show part of the page and allow user to scroll it to view other parts:

Suggested solution is to recognise text glyphs and reflow them into given device screen:

- Do some image pre-processing: binarise the image, invert
- Use recursive xy-cut algorithm to segment the image in blocks.
- For each block
- Find all connected components of pixels and their bounding boxes
- Remove bounding completely included in larger boxes Make a histogram of the component heights
- Filter out components which are bigger than some threshold
- Create an empty graph, which will represent a page
- Connect all the components horizontally so that left component is connected to a component immediately to the right, if nothing is to the right, no connection should be made.
- Find all connected components in that graph, they will represent the text lines.
- Each text line will contain connected pixel components.
- Find bounding rectangle for each pixel component.
- Make a histogram of the upper and lower coordinates of that rectangle.
- Maximums of the histogram will show us the upper and lower baselines.
- Split each line using the whitespace between symbols.
- Produce a list of symbol rectangles.
- Reflow can now be made using found symbol rectangles.
References: