Forrest logo
back to the tesseract tool

tesseract:tldr:2ce65

tesseract: Specify a custom page segmentation mode (default is 3).
$ tesseract -psm ${0_to_10} ${image-png} ${output}
try on your machine

The command you mentioned is used for invoking the Tesseract OCR (Optical Character Recognition) engine with specific options and parameters. Here's a breakdown of the command:

  • tesseract: This is the command to run the Tesseract OCR engine.

  • -psm ${0_to_10}: This option specifies the Page Segmentation Mode (PSM) to be used by Tesseract. The value ${0_to_10} should be replaced with a number between 0 and 10, which determines the page layout analysis mode. The PSM affects how Tesseract interprets and segments the input image. For example, 3 is the default mode for most pages of text.

  • ${image-png}: This is the path or filename of the input image file in PNG format. The ${image-png} placeholder should be replaced with the actual path or filename of the image you want to perform OCR on.

  • ${output}: This is the path or filename for the output file where Tesseract will store the recognized text. Again, the ${output} placeholder should be substituted with the desired path or filename for the output.

By running this command with the appropriate values filled in, Tesseract will analyze the input image using the specified PSM and generate an output file containing the extracted text.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the tesseract tool