public static Tuple<long, OcrData, OcrData>[] ParallelDetectOrientation(
Bitmap[] regs,
Bitmap[] revs,
Accuracy mode = Accuracy.High,
string lang = "eng",
bool enableTimer = false)
{
if (regs.Length != revs.Length)
{
throw new ArgumentException("Input Arrays must be same length!");
}
// create new array and copy over image references
int pivot = regs.Length;
Bitmap[] images = new Bitmap[regs.Length + revs.Length];
Array.Copy(regs, images, pivot);
Array.Copy(revs, 0, images, pivot, pivot);
// Run Parallel Recognition on the arrays
OcrData[] datas = ParallelRecognize(images, pivot + pivot, mode, lang, enableTimer);
// Extract results and calculate confidence
Tuple<long, OcrData, OcrData>[] results = new Tuple<long, OcrData, OcrData>[pivot];
for (int ii = 0; ii < pivot; ii++)
{
OcrData reg = datas[ii];
OcrData rev = datas[ii + pivot];
// If postive we are confident about the current orientation
// if negative we are not confident about the current orientation
long confidence = rev.Cost - reg.Cost;
results[ii] = new Tuple<long, OcrData, OcrData>(confidence, reg, rev);
}
return results;
}