Free, Open Source Optical Character Recognition with gImageReader

Optical Character Recognition (OCR) is a powerful tool to transform scanned, static images of text into machine-readable data, making it possible to search, edit, and analyze text. If you’re using OCR, chances are you’re working with either ABBYY FineReader or Adobe Acrobat Pro. However, both ABBYY and Acrobat are propriety software with a steep price tag, and while they are both available in the Scholarly Commons, you may want to perform OCR beyond your time at the University of Illinois.

Thankfully, there’s a free, open source alternative for OCR: Tesseract. By itself, Tesseract only works through the command line, which creates a steep learning curve for those unaccustomed to working with a command-line interface (CLI). Additionally, it is fairly difficult to transform a jpg into a searchable PDF with Tesseract.

Thankfully, there are many free, open source programs that provide Tesseract with a graphical user interface (GUI), which not only makes Tesseract much easier to use, some of them come with layout editors that make it possible to create searchable PDFs. You can see the full list of programs on this page.

The program logo for gImageReader

The program logo for gImageReader

In this post, I will focus on one of these programs, gImageReader, but as you can see on that page, there are many options available on multiple operating systems. I tried all of the Windows-compatible programs and decided that gImageReader was the closest to what I was looking for, a free alternative to ABBYY FineReader that does a pretty good job of letting you correct OCR mistakes and exporting to a searchable PDF.

Installation

gImageReader is available for Windows and Linux. Though they do not include a Mac compatible version in the list of releases, it may be possible to get it to work if you use a package manager for Mac such as Homebrew. I have not tested this though, so I do not make any guarantees about how possible it is to get a working version of gImageReader on Mac.

To install gImageReader on Windows, go to the releases page on Windows. From there, go to the most recent release of the program at the top and click Assets to expand the list of files included with the release. Then select the file that has the .exe extension to download it. You can then run that file to install the program.

Manual

The installation of gImageReader comes with a manual as an HTML file that can be opened by any browser. As of the date of this post, the Fossies software archive is hosting the manual on its website.

Setting OCR Mode

gImageReader has two OCR modes: “Plain Text” and “hOCR, PDF”. Plain Text is the default mode and only recognizes the text itself without any formatting or layout detection. You can export this to a text file or copy and paste it into another program. This may be useful in some cases, but if you want to export a searchable PDF, you will need to use hOCR, PDF mode. hOCR is a standard for formatting OCR text using either XML or HTML and includes layout information, font, OCR result confidence, and other formatting information.

To set the recognition to hOCR, PDF mode, go to the toolbar at the top. It includes a section for “OCR mode” with a dropdown menu. From there, click the dropdown and select hOCR, PDF:

gImageReader Toolbar

This is the toolbar for gImageReader. You can set OCR mode by using the dropdown that is the third option from the right.

Adding Images, Performing Recognition, and Setting Language

If you have images already scanned, you can add them to be recognized by clicking the Add Images button on the left panel, which looks like a folder. You can then select multiple images if you want to create a multipage PDF. You can always add more images later by clicking that folder button again.

On that left panel, you can also click the Acquire tab button, which allows you to get images directly from a scanner, if the computer you’re using has a scanner connected.

Once you have the images you want, click the Recognize button to recognize the text on the page. Please note that if you have multiple images added, you’ll need to click this button for every page.

If you want to perform recognition on a language other than English, click the arrow next to Recognize. You’ll need to have that language installed, but you can install additional languages by clicking “Manage Languages” in the dropdown appears. If the language is already installed, you can go to the first option listed in the dropdown to select a different language.

Viewing the OCR Result

In this example, I will be performing OCR on this letter by Franklin D. Roosevelt:

Raw scanned image of a typewritten letter signed by Franklin Roosevelt

This 1928 letter from Franklin D. Roosevelt to D. H. Mudge Sr. is courtesy of Madison Historical: The Online Encyclopedia and Digital Archive for Madison County Illinois. https://madison-historical.siue.edu/archive/items/show/819

Once you’ve performed OCR, there will be an output panel on the right. There are a series of buttons above the result. Click the button on the far right to view the text result overlaid on top of the image:

The text result of performing OCR on the FDR letter overlaid on the original scan.

Here is the the text overlaid on an image of the original scan. Note how the scan is slightly transparent now to make the text easier to read.

Correcting OCR

The OCR process did a pretty good job with this example, but it there are a handful of errors. You can click on any of the words of text to show them on the right panel. I will click on the “eclnowledgment” at the end of the letter to correct it. It will then jump to that part of the hOCR “tree” on the right:

hOCR tree in gImageReader, which shows the recognition result of each word in a tree-like structure.

The hOCR tree in gImageReader, which also shows OCR result.

Note in this screenshot I have clicked the second button from the right to show the confidence values, where the higher the number, the higher the confidence Tesseract has with the result. In this case, it is 67% sure that eclnowledgement is correct. Since it obviously isn’t correct, we can type new text by double-clicking on the word in this panel and type “acknowledgement.” You can do this for any errors on the page.

Other correction tips:

  1. If there are any regions that are not text that it is still recognizing, you can right click them on the right and delete them.
  2. You can change the recognized font and its size by going to the bottom area labeled “Properties.” Font size is controlled by the x_fsize field, and x_font has a dropdown where you can select a font.
  3. It is also possible to change the area of the blue word box once it is selected, simply by clicking and dragging the edges and corners.
  4. If there is an area of text that was not captured by the recognition, you can also right click in the hOCR “tree” to add text blocks, paragraphs, textlines, and words to the document. This allows you to draw a box on image and then type what the text says.

Exporting to PDF

Once you are done making OCR corrections, you can export to a searchable PDF. To do so, click the Export button above the hOCR “tree,” which is the third button from the left. Then, select export to PDF. It then gives you several options to set the compression and quality of the PDF image, and once you click OK, it should export the PDF.

Conclusion

Unfortunately, there are some limitations to gImageViewer, as can often be the case with free, open source software. Here are some potential problems you may have with this program:

  1. While you can add new areas to recognize with OCR, there is not a way to change the order of these elements inside the hOCR “tree,” which could be an issue if you are trying to make the reading order clear for accessibility reasons. One potential workaround could be to use the Reading Order options on Adobe Acrobat, which you can read about in this libguide.
  2. You cannot show the areas of the document that are in a recognition box unless you click on a word, unlike ABBYY FineReader which shows all recognition areas at once on the original image.
  3. You cannot perform recognition on all pages at once. You have to click the recognition button individually for each page.
  4. Though there are some image correction options to improve OCR, such as brightness, contrast, and rotation, it does not have as many options as ABBYY FineReader.

gImageViewer is not nearly as user friendly or have all of the features that ABBYY FineReader has, so you will probably want to use ABBYY if it is available to you. However, I find gImageViewer a pretty good program that can meet most general OCR needs.

Statistical Analysis at the Scholarly Commons

The Scholarly Commons is a wonderful resource if you are working on a project that involves statistical analysis. In this post, I will highlight some of the great resources the Scholarly Commons has for our researchers. No matter what point you are at in your project, whether you need to find and analyze data or just need to figure out which software to use, the Scholarly Commons has what you need!

Continue reading

Scholarly Commons Software: Open Source Alternatives

Hello from home to all my fellow (new) work-from-homers!

In light of measures taken to protect public health, it can feel as though our work schedules have been shaken up. However, we are here to help you get back on track and the first thing to do is make sure you have all the tools necessary to be successful at home.

Continue reading

Stata vs. R vs. SPSS for Data Analysis

As you do research with larger amounts of data, it becomes necessary to graduate from doing your data analysis in Excel and find a more powerful software. It can seem like a really daunting task, especially if you have never attempted to analyze big data before. There are a number of data analysis software systems out there, but it is not always clear which one will work best for your research. The nature of your research data, your technological expertise, and your own personal preferences are all going to play a role in which software will work best for you. In this post I will explain the pros and cons of Stata, R, and SPSS with regards to quantitative data analysis and provide links to additional resources. Every data analysis software I talk about in this post is available for University of Illinois students, faculty, and staff through the Scholarly Commons computers and you can schedule a consultation with CITL if you have specific questions.

Short video loop of a kid sitting at a computer and putting on sun glasses

Rock your research with the right tools!


STATA

Stata logo. Blue block lettering spelling out Stata.

Among researchers, Stata is often credited as the most user-friendly data analysis software. Stata is popular in the social sciences, particularly economics and political science. It is a complete, integrated statistical software package, meaning it can accomplish pretty much any statistical task you need it to, including visualizations. It has both a point-and-click user interface and a command line function with easy-to-learn command syntax. Furthermore, it has a system for version-control in place, so you can save syntax from certain jobs into a “do-file” to refer to later. Stata is not free to have on your personal computer. Unlike an open-source program, you cannot program your own functions into Stata, so you are limited to the functions it already supports. Finally, its functions are limited to numeric or categorical data, it cannot analyze spatial data and certain other types.

 

Pros

Cons

User friendly and easy to learn An individual license can cost
between $125 and $425 annually
Version control Limited to certain types of data
Many free online resources for learning You cannot program new
functions into Stata

Additional resources:


R logo. Blue capital letter R wrapped with a gray oval.

R and its graphical user interface companion R Studio are incredibly popular software for a number of reasons. The first and probably most important is that it is a free open-source software that is compatible with any operating system. As such, there is a strong and loyal community of users who share their work and advice online. It has the same features as Stata such as a point-and-click user interface, a command line, savable files, and strong data analysis and visualization capabilities. It also has some capabilities Stata does not because users with more technical expertise can program new functions with R to use it for different types of data and projects. The problem a lot of people run into with R is that it is not easy to learn. The programming language it operates on is not intuitive and it is prone to errors. Despite this steep learning curve, there is an abundance of free online resources for learning R.

Pros

Cons

Free open-source software Steep learning curve
Strong online user community Can be slow
Programmable with more functions
for data analysis

Additional Resources:

  • Introduction to R Library Guide: Find valuable overviews and tutorials on this guide published by the University of Illinois Library.
  • Quick-R by DataCamp: This website offers tutorials and examples of syntax for a whole host of data analysis functions in R. Everything from installing the package to advanced data visualizations.
  • Learn R on Code Academy: A free self-paced online class for learning to use R for data science and beyond.
  • Nabble forum: A forum where individuals can ask specific questions about using R and get answers from the user community.

SPSS

SPSS logo. Red background with white block lettering spelling SPSS.

SPSS is an IBM product that is used for quantitative data analysis. It does not have a command line feature but rather has a user interface that is entirely point-and-click and somewhat resembles Microsoft Excel. Although it looks a lot like Excel, it can handle larger data sets faster and with more ease. One of the main complaints about SPSS is that it is prohibitively expensive to use, with individual packages ranging from $1,290 to $8,540 a year. To make up for how expensive it is, it is incredibly easy to learn. As a non-technical person I learned how to use it in under an hour by following an online tutorial from the University of Illinois Library. However, my take on this software is that unless you really need a more powerful tool just stick to Excel. They are too similar to justify seeking out this specialized software.

Pros

Cons

Quick and easy to learn By far the most expensive
Can handle large amounts of data Limited functionality
Great user interface Very similar to Excel

Additional Resources:

Gif of Kermit the frog dancing and flailing his arms with the words "Yay Statistics" in block letters above

Thanks for reading! Let us know in the comments if you have any thoughts or questions about any of these data analysis software programs. We love hearing from our readers!

 

What’s In A Name?: From Lynda.com to LinkedIn Learning

LinkedIn Learning Logo

Lynda.com had a long history with libraries. The online learning platform offered video courses to help people “learn business, software, technology and creative skills to achieve personal and professional goals.Lynda.com paired well with other library services and collections, offering library users the chance to learn new skills at their own pace in an accessible and varied medium. 

However, in 2015—twenty years after its initial launch—Lynda.com⁠⁠ was purchased by LinkedIn. A year later, Microsoft purchased LinkedIn for $26.2 billion. And now, in 2019, Lynda.com content is available through the newly-formed LinkedIn Learning.

Charmander evolving into Charmeleon

Sometimes, evolution is simple (like when it gets you one step closer to an Elite-Four-wrecking Charizard). Sometimes, it’s a little more complicated (like when Microsoft buys LinkedIn which just bought Lynda.com).

The good news is that this change from Lynda.com to LinkedIn Learning includes access to all of the same content previously available. This means that, through the University Library’s subscription, you still have access to courses on software like R, SQL, Tableu, Python, InDesign, Photoshop, and more (many of which are available to use on campus at the Scholarly Commons). There are also courses on broader, related topics like data science, database management, and user experience

Setting up your own personal account to access LinkedIn Learning is where things get just a little trickier. As a result of the transition from Lynda.com to LinkedIn Learning, users are now strongly encouraged to link their personal LinkedIn accounts with their LinkedIn Learning accounts. Completing courses in LinkedIn Learning will earn you badges that are automatically carried over to your LinkedIn account. However, this additional step—using a personal LinkedIn account to access these course—also makes the information about your LinkedIn Learning as public as your LinkedIn profile. Because Lynda.com only required a library card and PIN, this change in privacy has received push-back from libraries and library organizations across the country.

Obi-Wan Kenobi looking confused with caption reading [visible confusion]

This new policy change doesn’t mean you should avoid LinkedIn Learning, it just means you should use it with care and make an informed decision about your privacy settings. Maybe you want potential employers to see what you’re proactively learning about on the platform, maybe you to keep that information private. Either way, you can get details on setting up accounts and your privacy settings by consulting this guide created by Technology Services.

LinkedIn Learning can be accessed through the University Library here.

Spotlight on DiRT Directory: Digital Research Tools

The DiRT logo.

As a researcher, it can sometimes be frustrating knowing that someone out there has created a useful tool that will help you with what you’re working on, but being unable to find it. Google searches prove fruitless, and your network of friends don’t necessarily know what you’re talking about. In that moment of panic and frustration, you may just need to get a little DiRT-y.

DiRT Directory: Digital Research Tools is a directory of research tools for scholarly use. Using TaDiRAH (the Taxonomy of Digital Research Activities in the Humanities), DiRT breaks down the stages of a research project, and groups tools that are relevant to each stage: Capture, Creation, Enrichment, Analysis, Interpretation, Storage, and Dissemination. Users can either search for tools using these categories — broken down into subcategories whose specificity helps to narrow down the many tools found in the DiRT Directory — through a search box or by tag. Personally, I feel that searching through the TaDiRAH categories allows you to find relevant tools, but also allows you to explore options that you may not have previously thought of as being available, making it the most fruitful way to browse tools.

One nice aspect of DiRT is its search platform. After you choose your category, you have the option to search within the category for these criteria: Platform, Cost, Exclude, License, and Research Objects, as well as sort order. For researchers concerned with cost, this tool is especially useful, as you can limit your search to what is in your budget.

After you complete your search, you are offered a list of different tools. Tools range from well-known sources, like Google Docs, to things you have probably never heard of before. Each source includes a description, outlining what kind of tool it is — online, software, etc. — what its capabilities are, and in many cases, a note on its past or future development. Each entry also includes a link to the tool’s website, their license, and the date of DiRT’s most recent update on the source information.

An example tool entry on DiRT for Scrivener writing software.

An example tool entry on DiRT for Scrivener writing software on the search page.

Finally, each tool has its own page that you can access from the search function. This page holds a wealth of information, including an expanded description that outlines the nitty gritty aspects of the tool — from platforms to cost bracket to tags. It also includes screenshots of the tool in action, a list of recent edits to the page, and a comments section. However, not all tools have the same level of detail in their pages.

capture2

Scrivener’s page, which includes a description, screenshots, a list of contributors, and a comments section.

While the selection presented on DiRT can be almost overwhelming, digging through DiRT can help you find the perfect tools for your project.

If you still can’t find what you want in DiRT Directory, or need some guidance in what to search for in the first place, stop by the Scholarly Commons, located in Main Library Room 306, open from 9am-6pm on weekdays. Or, email us! We are always happy to help you with your research needs.