Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy of iterator #25

Closed
Gankov opened this issue May 29, 2013 · 7 comments
Closed

Copy of iterator #25

Gankov opened this issue May 29, 2013 · 7 comments
Labels

Comments

@Gankov
Copy link

Gankov commented May 29, 2013

I need make copy of iterator. I see that it isn't implemented.
I try implement it like:

public ResultIterator Clone()
{
        return new ResultIterator(Interop.TessApi.ResultIteratorCopy (handle));
}

But it seems not work. When i try call GetText method of coped iterator, application crash. What is wrong?
Thanks for any help.

@charlesw
Copy link
Owner

Can you please include the error details?

@charlesw
Copy link
Owner

Also check the standard error output (Console.Error?), I believe this is were tesseract writes most of it's error details to.

@Gankov
Copy link
Author

Gankov commented May 30, 2013

With SharpDevelop i have exception:
System.AccessViolationException: Попытка чтения или записи в защищенную память. Это часто свидетельствует о том, что другая память повреждена.
в Tesseract.Interop.TessApi.ResultIteratorGetUTF8TextInternal(IntPtr handle, PageIteratorLevel level)
в Tesseract.Interop.TessApi.ResultIteratorGetUTF8Text(IntPtr handle, PageIteratorLevel level) в c:\Projects\tesseract-test\Tesseract.Net20\Interop\BaseApi.cs:строка 168
в Tesseract.ResultIterator.GetText(PageIteratorLevel level) в c:\Projects\tesseract-test\Tesseract.Net20\ResultIterator.cs:строка 19
в BaseApiTester.Program.Main(String[] args) в c:\Projects\tesseract-test\BaseApiTester\Program.cs:строка 51

Sorry for Russian words. I don't know how make it on English.

@charlesw
Copy link
Owner

Hi there the translation is "Attempt to read or write to the protected memory . It is often indicative of the fact that the other memory is corrupted.". I'll have a look this weekend. Is this running the standard BaseApiTester or your implementation of Clone above? If the former would you be able to provide a failing test case in a push request?

@Gankov
Copy link
Author

Gankov commented May 30, 2013

Yes of course.
https://github.com/Gankov/tesseract

@charlesw
Copy link
Owner

charlesw commented Jun 1, 2013

Hi there,
I can confirm your code works fine. The problem turned out to be on tesseract's side. I've filed an a bug report with them (https://code.google.com/p/tesseract-ocr/issues/detail?id=934).

While I have built a copy of tesseract with this fix applied I don't want to add this to our solution since I built it with VS2010, since I don't have VS2008, which would change the VS runtime dependency to 2010 which I'd prefer not to do.

Regards,
Charles

@charlesw
Copy link
Owner

FYI this will be fixed in the next release of tesseract-ocr. If you need a fix before then you'll need to build tesseract-ocr from it's latest source. I just cannot build it myself at the moment since I don't have VS 2008. I'll leave this issue open till then.

@charlesw charlesw modified the milestones: Tesseract 3.04, 2.0 Sep 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants