tr?ocr (beta)

Extract and translate text from images using optical character recognition (OCR)

This command extracts text from an image and optionally translate the text. The image can either be an attachment or a link.

This is a beta feature and functionality may change over time.

Detect / Extract Text

Specify the language you want to detect from the image.

Translate Text

Translate text by specifying the image's language, then the destination language.

PSM Adjustment

The PSM determines how the text is detected from the image. The default is 11 (psm-11).

This is useful if you want to detect vertically aligned text, text that's formatted as one singular block, or want to just play around with the values to help increase accuracy.

The table below are a list of valid PSM values to use in the command.

Value

Description

psm-0

Orientation and script detection (OSD) only.

psm-1

Automatic page segmentation with OSD.

psm-2

Automatic page segmentation, but no OSD, or OCR

psm-3

Fully automatic page segmentation, but no OSD.

psm-4

Assume a single column of text of variable sizes.

psm-5

Assume a single uniform block of vertically aligned text.

psm-6

Assume a single uniform block of text.

psm-7

Treat the image as a single text line.

psm-8

Treat the image as a single word.

psm-9

Treat the image as a single word in a circle.

psm-10

Treat the image as a single character.

psm-11

Sparse text. Find as much text as possible in no particular order. (Default)

psm-12

Sparse text with OSD.

psm-13

Raw line. Treat the image as a single, raw text line. For debug purposes only.

PSM Usage Example

Confidence Filter Adjustment

Adjusting the confidence filter may be helpful if the bot isn't extracting all the text that's in the image. By using a lower value, the bot will extract text that it's less "confident" about. Keep in mind that this may also include garbage data as well.

The range is 0-100, and the default is 90. Similar to PSM, add the value with a "conf-" prefix, such as conf-85 to use a confidence level of 85.

Confidence Filter Example

Last updated