Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Foo(const Area: TBox): String;
- var
- img, imgCopy, Wid, Hei, i: Integer;
- t: TPointArray;
- a: T2DPointArray;
- begin
- img := BitmapFromClient(Area);
- imgCopy := CopyBitmap(img);
- GetBitmapSize(imgCopy, Wid, Hei);
- ThresholdAdaptiveBitmap(imgCopy, 0, 255, False, TM_Mean, 60);
- FindColorsBitmap(imgCopy, t, 255);
- a := ClusterTPAEx(t, 3, 1);
- for i := 0 to High(a) do
- if (MiddleTPA(a[i]).y <= 3) then
- DrawTPABitmap(img, a[i], 0);
- ResizeBitmapEx(img, RM_Bilinear, Wid * 5, Hei * 5);
- ThresholdAdaptiveBitmap(img, 0, 255, False, TM_Mean, 60);
- Result := Tesseract_GetText(img);
- FreeBitmap(imgCopy);
- FreeBitmap(img);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement