The answer to both data sets is an OCR application with some post-processing, but a more specialized program than a generic low-quality or an open source OCR. Essentially the harder the problem, the more capable and advanced tools need to be used to solve it.
There will be two major stages in this task: digitizing the data (image to text, i.e. OCR) and processing the data (performing the actual count). Look at them separately in order to select the best method for each stage.
The main challenges in these images and generic OCR are:
a) images have low resolution. For example the # 1 image has resolution of about 72 dpi. Suggested resolution for such text quality is to scan at 300 to 400 dpi, but it is clear that re-scanning or controlling scan resolution is not applicable now. That’s why one option is to clean and increase the size using image pre-processing tools. This is what the original #1 image snippet looks like after adaptive binarization and zoomed at 300%. It is clear that each character has too few pixels and characters can be easily misread.
b) GIF format in #1 is not supported by many OCR applications. Images need to be batch-converted to a different format, such as PNG or TIF.
c) in these scans the backgrounds and bleed-through (shadow from the text on the other side of the paper) is visible. Good binarization needs to be used to remove background and bleed-through, but not remove vital parts of actual characters.
After implementing specific pre-processing solutions for the items listed above, and then using a high quality OCR system, such as www.ocr-it.com API, highest possible results can be achieved. Result is far from perfect, but it is as high accuracy as it could be achieved with a modern OCR engine on these images.
Luckily for this project, the data needs to be counted, so the second stage has all necessary data for reliable data post-processing analysis. Contrary to other basic OCR engines, the OCR provided by www.ocr-it.com API, which I used to produce the above recognition. OCR-IT API is free to develop with, and very inexpensive to use per page, so that may be a very economical but powerful solution for this project. It returns formatted text layout, including preserving line breaks and overall format structure. This makes text post-processing easier.
A simple algorithm can be run to count the number of lines, resulting in the necessary for the research count.
The above describes a two-stage approach: getting best possible OCR result, and using an applicable method to process data for the required task
Bat wait, there is more…
There is a second option to use an even more specialized OCR application called FlexiCapture with FlexiLayout technology. This powerful and intelligent data capture technology has built-in high-accuracy OCR, and it has a powerful rules and data analytics engine to perform very specialized user-defined chains of actions and tasks.
The implementation of this method using FlexiCapture with FlexiLayout takes the following logical steps.
First, full page OCR is performed and all objects are extracted, including characters, noise, black horizontal and vertical lines, white gaps, and objects (which could be pictures, logos, handwriting, etc.). This produces objects upon which we can apply our search criteria.
Next, the following constraints are applied to the post-OCR data analysis and search criteria: separate image into three vertical columns and run the following logic per column, use line-start as individual count, skip header/footer/indented lines (county names), assume each name to have at least three characters, find recursively every name starting from top to bottom in every column, exclude previously found lines.
While the above logic sounds complex to setup, the actual setup takes just a few minutes and requires minimal work through user interface (UI) environment. No coding or programming is necessary. The following search elements and criteria have been created.
RepeatingGroup consisting of a CharacterString search object.
This setup produces the following search result for the first column of data:
As the last step, FlexiCapture is instructed to return the number of total found elements that fit our search criteria, effectively producing the necessary data for the research task.
There are other logic alternatives that can be setup in FlexiCapture, such as finding the number of white spaces between lines, or searching for the fixed-length fixed-placement 3-letter combinations at the end of every column linen.
In conclusion, there are several options (which is always nice) how this task can be achieved with relative ease in effort and high quality, but the success depends on the quality of tools used and necessary knowledge how to use them.
If you believe some of these tools and processes can be beneficial to your project, please contact my directly. I specialize in these workflows. Ilya @ WiseTREND. My company may be able to help with the setup or guidance. We have participated in various research initiatives, some through donations to a good cause.