header source
my icon
esplo.net
ぷるぷるした直方体
Cover Image for Making Images in Eagle Searchable by OCR Results

Making Images in Eagle Searchable by OCR Results

だいたい4分で読めます

Background

Eagle is a user-friendly image management software.
With its comfortable operability and the ability to search using classifications such as folders and tags, it's invaluable when managing a large number of images.

However, Eagle lacks an OCR function, so it's not possible to search for text contained within images.
While you can make text searchable by entering it in the Notes... section, it's extremely tedious to input each one manually.

Therefore, I decided to make OCR results searchable using the Cloud Vision API, which supports Japanese and has high accuracy.

What I Did

The script is published here:

https://github.com/esplo/eagle_ocr

Each image in Eagle is stored with a metadata.json in a one-folder-one-image structure.
This metadata has an annotations item, and by inputting and rewriting a string here, it's reflected in the Notes... section.
Note that when rewriting metadata like this, you need to Force Reload Library for it to be accessible from Eagle.

After traversing the directory containing the images, the OCR results are obtained by sending them to the Cloud Vision API.
It can be easily executed using GCP's library (@google-cloud/vision).
The target images are all images without annotations, so there might be concerns if you have a large number of images, but at $1.5/1,000 images, I decided not to worry about it.

Here's an example of executing it on a Wikipedia image:

Wikipedia_result

It recognizes the text on the sphere, but it also correctly captures the desired text, and the accuracy for Japanese is sufficiently high.
With input like this, searches for terms like "Wiki" will yield hits.

Conclusion

Now that text-containing images can be searched, Eagle has become even more convenient to use.
It's handy that metadata can be easily manipulated.

Share