Skip to content

Commit b55ab82

Browse files
authored
Update README.md
1 parent f90f23f commit b55ab82

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

README.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,39 @@ The actual character recognition is quite similar to using Simba's `FindBitmap`
1111
## Exported Methods
1212

1313
```pascal
14+
procedure TFontSet.Load(FileName: String; Space: Integer = 4);
15+
1416
function TSimpleOCR.Recognize(Area: TBox; Filter: TOCRFilter; Font: TFontSet): String;
1517
function TSimpleOCR.RecognizeStatic(Area: TBox; Filter: TOCRFilter; Font: TFontSet; MaxWalk: Integer = 20): String;
1618
function TSimpleOCR.RecognizeLines(Area: TBox; Filter: TOCRFilter; Font: TFontSet; out TextBounds: TBoxArray): TStringArray; overload;
1719
function TSimpleOCR.RecognizeLines(Area: TBox; Filter: TOCRFilter; Font: TFontSet): TStringArray; overload;
18-
function TSimpleOCR.RecognizeUpText(Area: TBox; Filter: TOCRFilter; Font: TFontSet; MaxWalk: Integer = 20): String;
1920
function TSimpleOCR.RecognizeNumber(Area: TBox; Filter: TOCRFilter; Font: TFontSet): Int64;
2021
21-
function TSimpleOCR.LocateText(Area: TBox; Font: TFontSet; Filter: TOCRFilter; out Bounds: TBox): Single; overload;
22-
function TSimpleOCR.LocateText(Area: TBox; Font: TFontSet; out Bounds: TBox): Single; overload;
22+
function TSimpleOCR.LocateText(Area: TBox; Text: String; constref Font: TFontSet; Filter: TOCRFilter; out Bounds: TBox): Single; overload;
23+
function TSimpleOCR.LocateText(Area: TBox; Text: String; constref Font: TFontSet; Filter: TOCRFilter; MinMatch: Single): Boolean; overload;
24+
25+
function TSimpleOCR.TextToMatrix(Text: String; constref Font: TFontSet): TIntegerMatrix;
26+
function TSimpleOCR.TextToTPA(Text: String; constref Font: TFontSet): TPointArray;
2327
```
2428

2529
----
2630

2731
## Filters
2832

33+
- ### AnyColor Filter
34+
35+
The first pixel (highlighted in red) of the character being checked is the color used, all other of the character must fall within `Tolerance` of that.
36+
37+
If the fontset has a shadow each RGB value of a possible shadow point must be below `MaxShadowValue`.
38+
```pascal
39+
function TOCRAnyColorFilter.Create(Tolerance: Integer; MaxShadowValue: Integer): TOCRAnyColorFilter; static;
40+
```
41+
![Example](images/anycolor.png)
42+
43+
This filter is generally used for uptext reading.
44+
45+
---
46+
2947
- ### Color filter
3048

3149
Basic color finding.
@@ -94,7 +112,6 @@ function TSimpleOCR.LocateText(Area: TBox; Font: TFontSet; out Bounds: TBox): Si
94112

95113
## Locate Text
96114

97-
The `LocateText` function does **not** OCR! An image of the desired text is generated and searched for. Again quite similar to Simba's `FindBitmap`.
98-
- A filter is not required if each pixel of the text is the exact same color. Although this is quite a lot slower.
115+
The `LocateText` function does **not** OCR! An "image" of the desired text is generated with `TextToMatrix/TextToTPA` and searched for. Again quite similar to Simba's `FindBitmap`.
116+
- Works well with `TOCRAnyColorFilter`. Although this is slower.
99117
- Will not work if the spacing between characters is dynamic.
100-

0 commit comments

Comments
 (0)