Revert "fixed padding tooltip for all"
This reverts commit 6242220, which broke tooltip detection.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f9b8ef9158
commit
b8f5637c49
4 changed files with 123 additions and 260 deletions
|
|
@ -15,14 +15,12 @@ static class ImageUtils
|
|||
return Pix.LoadFromMemory(ms.ToArray());
|
||||
}
|
||||
|
||||
public static List<OcrLineResult> ExtractLinesFromPage(Page page, int offsetX, int offsetY, int minConfidence = 50)
|
||||
public static List<OcrLineResult> ExtractLinesFromPage(Page page, int offsetX, int offsetY)
|
||||
{
|
||||
var lines = new List<OcrLineResult>();
|
||||
using var iter = page.GetIterator();
|
||||
if (iter == null) return lines;
|
||||
|
||||
int minConf = Math.Clamp(minConfidence, 0, 100);
|
||||
|
||||
iter.Begin();
|
||||
|
||||
do
|
||||
|
|
@ -34,7 +32,7 @@ static class ImageUtils
|
|||
if (string.IsNullOrWhiteSpace(wordText)) continue;
|
||||
|
||||
float conf = iter.GetConfidence(PageIteratorLevel.Word);
|
||||
if (conf < minConf) continue; // reject low-confidence garbage from background bleed
|
||||
if (conf < 50) continue; // reject low-confidence garbage from background bleed
|
||||
|
||||
if (iter.TryGetBoundingBox(PageIteratorLevel.Word, out var bounds))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue