public static void ShredOcr(Shred[] shreds, string lang = "eng")
{
Bitmap[] images = new Bitmap[shreds.Length];
Bitmap[] reversed = new Bitmap[shreds.Length];
int index = 0;
foreach (Shred shred in shreds)
{
images[index] = new Bitmap(shred.Filepath);
reversed[index] = Filter.Reverse(images[index]);
index += 1;
}
Tuple<long, OcrData, OcrData>[] results = ParallelDetectOrientation(images, reversed, Accuracy.Low, lang);
for (int ii = 0; ii < results.Length; ii++)
{
long confidence = results[ii].Item1;
if (confidence > 0)
{
shreds[ii].AddOcrData(results[ii].Item2, Math.Abs(confidence), false);
}
else if (confidence <= 0)
{
shreds[ii].AddOcrData(results[ii].Item3, Math.Abs(confidence), true);
}
}
}