Return >  Addon.OCR.SetPageSetMode

Addon.OCR.SetPageSetMode()

Description

Sets the mode for OCR page layout analysis. Determines how pages are determined when processing OCR.

Syntax

.Addon.OCR.SetPageSetMode(OCRPageSetMode);

Parameters

<int> OCRPageSetMode: Specifies the OCR Page layout analysis mode.

Allowed Values EnumDWT_OCRPageSetMode enumeration Description
0 EnumDWT_OCRPageSetMode.OCRPSM_OSD_ONLY Script detection only(OSD).
1 EnumDWT_OCRPageSetMode.PSM_AUTO_OSD Automatic page segmentation with orientation and script detection. (OSD)
2 EnumDWT_OCRPageSetMode.PSM_AUTO_ONLY Automatic page segmentation, but no OSD, or OCR.
3 EnumDWT_OCRPageSetMode.PSM_AUTO Fully automatic page segmentation, but no OSD. (Default)
4 EnumDWT_OCRPageSetMode.PSM_SINGLE_COLUMN Assume a single column of text of variable sizes.
5 EnumDWT_OCRPageSetMode.PSM_SINGLE_BLOCK_VERT_TEXT Assume a single uniform block of vertically aligned text.
6 EnumDWT_OCRPageSetMode.PSM_SINGLE_BLOCK Assume a single uniform block of text.
7 EnumDWT_OCRPageSetMode.PSM_SINGLE_LINE Treat the image as a single text line.
8 EnumDWT_OCRPageSetMode.PSM_SINGLE_WORD Treat the image as a single word.
9 EnumDWT_OCRPageSetMode.PSM_CIRCLE_WORD Treat the image as a single word in a circle.
10 EnumDWT_OCRPageSetMode.PSM_SINGLE_CHAR Treat the image as a single character.

Remarks

The default value is 3, which indicates automatic page detection. That is fine for most applications.

Example

DWObject.Addon.OCR.SetPageSetMode(EnumDWT_OCRPageSetMode.PSM_AUTO);