in debug mode problem was appeared in code " _document.OcrResultId = _gdPictureOcr.RunOCR()"
it say Attempted to read or write protected memory
i test Persian language and same problem (probably in other unicode languages)
but in English we have no problem
Code: Select all
private void StartOCR(int roiLeft, int roiTop, int roiWidth, int roiHeight)
{
SetOcrParameters(roiLeft, roiTop, roiWidth, roiHeight);
Cursor.Current = Cursors.WaitCursor;
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
_document.OcrResultId = _gdPictureOcr.RunOCR(); <====== Booom
stopWatch.Stop();
if (_gdPictureOcr.GetStat() == GdPictureStatus.OK)
{
this.Text = InitialText + " - Elapsed: " + stopWatch.Elapsed.ToString() + ". Average confidence: " + _gdPictureOcr.GetAverageWordConfidence(_document.OcrResultId) + " %";
}
else
{
this.Text = InitialText;
}
Cursor.Current = Cursors.Default;
UpdateControlsOcrResultCreated();
}