work on new crop

This commit is contained in:
Boki 2026-02-12 22:07:54 -05:00
parent 9845e7f9bf
commit a7fab55d44
22 changed files with 975 additions and 10 deletions

View file

@ -91,7 +91,6 @@ static class TestRunner
continue;
}
var options = new OcrOptions();
List<string> actualSet;
if (!string.IsNullOrWhiteSpace(tc.BeforeImage))
@ -115,7 +114,6 @@ static class TestRunner
var response = ocrHandler.HandleDiffOcr(new Request
{
File = imagePath,
Ocr = options,
Path = savePath,
});
@ -136,7 +134,7 @@ static class TestRunner
else
{
using var bitmap = new Bitmap(imagePath);
using var processed = ImagePreprocessor.PreprocessForOcr(bitmap, options);
using var processed = ImagePreprocessor.PreprocessForOcr(bitmap);
if (!string.IsNullOrEmpty(savePreDir))
{
@ -146,7 +144,7 @@ static class TestRunner
using var pix = ImageUtils.BitmapToPix(processed);
using var page = engine.Process(pix);
var lines = ImageUtils.ExtractLinesFromPage(page, offsetX: 0, offsetY: 0, minConfidence: options.MinConfidence);
var lines = ImageUtils.ExtractLinesFromPage(page, offsetX: 0, offsetY: 0);
var actualLines = lines.Select(l => Normalize(l.Text)).Where(s => s.Length > 0).ToList();
var rawText = page.GetText() ?? string.Empty;