摘要 |
Apparatuses and methods are provided for locating and straightening horizontal and vertical lines in digitized documents by first identifying horizontal or vertical elements, each of which may represent part of a longer line, according to several adjustable criteria. This approach confines use of precise, computationally intensive line-fixing routines to image regions likely to contain a line. In one aspect, the invention performs pixel-by-pixel scanning only in those regions likely to contain a line segment. Given a threshold number of pixels defining the smallest possible line segment, the invention begins with an initial pixel and tests the pixel linearly displaced therefrom by a distance equal to the threshold. If the displaced pixel is uncolored, a consecutive threshold-length run of colored pixels cannot exist between the initial and displaced pixels, so all of these pixels are considered evaluated and the displaced pixel becomes a new initial pixel. If both the initial and displaced pixels are colored, the invention examines a series of pixels progressively closer to the initial pixel; if any of these is found to be uncolored, it is defined as a new initial pixel, once again skipping over intervening pixels.
|