Hello, I run exact in the same error. I didn't found a solution until now. Did you found something or have a idea?
cu Carsten Am Montag, 25. März 2019 12:59:54 UTC+1 schrieb Shobhit Kapil: > > Hi Team, > > I am using Tesseract 4.0.0.0 version in c#. > > In which i am using the below code.... > > So i am processing a pdf scanned image instead of processing the whole > image i am making the height of image = img.height /3 in that case i > getting the below exception in page1.GetIterator(), > I am not getting error in all the file just in fewer files and when i am > not making the height /3 and passing the complete height it is working for > all the images. > > system.accessviolationexception: 'attempted to read or write protected > memory. this is often an indication that other memory is corrupt. > > Any help!!! > > _engine = new TesseractEngine( > > Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) > > + > "\\tessdata", "eng", EngineMode.Default); > > using (var ocr = Engine) > { > using (var page1 = ocr.Process(img1, > PageSegMode.SparseText)) > { > using (var iterator = page1.GetIterator()) > { > iterator.Begin(); > do > { > processWord = > iterator.GetText(PageIteratorLevel.Word); > > iterator.TryGetBoundingBox(PageIteratorLevel.Word, out Rect bounds); > OCRWords = new OCRObjects(); > OCRWords.index = _index; > OCRWords.key = processWord; > OCRWords.bounds = bounds; > ocrObjects.Add(OCRWords); > _index++; > } while > (iterator.Next(PageIteratorLevel.Word)); > } > } > } // End of OCR iteration. > -- You received this message because you are subscribed to the Google Groups "tesseract-ocr" group. To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-ocr+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/506ca6f4-bb65-4212-83f0-cc8a7325876d%40googlegroups.com.