OCR

This page is about WaspLib’s OCR.


TOCR

Record wrapping TPixelOCR with convenience methods for text recognition.


OCR.RecognizeStatic

function TOCR.RecognizeStatic(bounds: TBox; constref font: TPixelFont; colors: TColorArray; tolerance: Single): String;

Recognizes static text (non-moving) within bounds using specified font and colors.


OCR.RecognizeStaticInvert

function TOCR.RecognizeStaticInvert(bounds: TBox; constref font: TPixelFont; colors: TColorArray): String;

Recognizes static text with inverted colors (background becomes text).


OCR.Recognize

function TOCR.Recognize(bounds: TBox; constref font: TPixelFont; colors: TColorArray; tolerance: Single): String;

Recognizes text within bounds using specified font and colors.


OCR.RecognizeLines

function TOCR.RecognizeLines(bounds: TBox; constref font: TPixelFont; colors: TColorArray; tolerance: Single): TStringArray;

Recognizes multiple lines of text, returning each line as a separate string.


OCR.RecognizeShadow

function TOCR.RecognizeShadow(bounds: TBox; constref font: TPixelFont; tolerance: Single): String;

Recognizes text by detecting shadow pixels and finding adjacent text colors.


OCR.RecognizeNumber

function TOCR.RecognizeNumber(bounds: TBox; constref font: TPixelFont; colors: TColorArray; tolerance: Single): Integer;

Recognizes and extracts an integer from text within bounds.


OCR variable

Global TOCR variable.


TRSFonts

Record containing pre-loaded RuneScape fonts and common text colors.