Random Tip: Enlarging the Captured Image Helps With OCR

Just found that enlarging an image helped tremendously to correctly OCR'd it using the KM OCR macro.

Normal size: Abysmal OCR results
Duplicated image size dimensions: Great OCR

2 Likes

Would you mind sharing a macro that does a screen capture, enlarges the image, then does the OCR?

You could use this one to start with:
MACRO: OCR -- User-Selected Area by @ccstone

ah, I used Preview to enlarge some images, not KM :slight_smile:

Don't know if it'd be useful to use KM, unless KM supports a % increase.

Unfortunately my old system isn't Retina, so I can't test the true efficacy of this.

Image Events is slow too, so I'll take a look at sips and see if I can improve the speed.

-Chris


Capture Image ⇢ Scale to 1.5 ⇢ OCR v1.50.kmmacros (7.7 KB)

Hey Folks,

Here's the sips version.

I'm not sure it's much faster than the Image Events version, but it's handier to do everything in the shell in this case.

-Chris


Capture Image ⇢ Scale to 1.5 ⇢ SIPS ⇢ OCR v2.00.kmmacros (6.8 KB)

1 Like

nice!
With more time I'll do more tests using a small image, but must be good. I'll change to 2.0 and test

1 Like

I'd be curious to know what the minimum enlargement that makes a significant difference is because 1) that would be a faster enlargement process and 2) you're adding the fewest false pixels to "connect the dots."

That may depend on the image size, too. So you might want to try 1.25x for images whose longest side is over a certain number of pixels and 1.1x for those under. Something like that.

1 Like

One issue, that might be a good task for KM to handle, is how big you might want the enragement to be.
Because images come in all sizes, some pretty small, the larger ones might not need a bigger enlargement.

I think a simple input to select between 1.25, 1.5, 2 (or even larger) might be a good manual workaround.

1 Like