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

Is ChoiceIterator implemented in the wrapper? #129

Closed
ArtGardner opened this issue Oct 29, 2014 · 15 comments
Closed

Is ChoiceIterator implemented in the wrapper? #129

ArtGardner opened this issue Oct 29, 2014 · 15 comments

Comments

@ArtGardner
Copy link

This is about ChoiceIterator, as in this reference:

https://code.google.com/p/tesseract-ocr/wiki/APIExample#Example_of_iterator_over_the_classifier_choices_for_a_single_sym

I can find no mention of it in the wrapper source, nor in these discussions. Is someone working on it?

Actually, it's not clear that this class is in libtesseract302.dll either, just based on scanning the symbols with depends22.

@charlesw
Copy link
Owner

From memory this functionality wasn't exposed through the CAPI in version
3.02 which is why I haven't been able to expose it. I'll have another look
into this over the weekend and let you know what I find out.
On 30 Oct 2014 01:25, "ArtGardner" notifications@github.com wrote:

I'm referring to alternative choices for a single symbol, please see:

https://code.google.com/p/tesseract-ocr/wiki/APIExample#Example_of_iterator_over_the_classifier_choices_for_a_single_sym

I can find no mention of it in the wrapper source, nor in these
discussions. Is someone working on it?


Reply to this email directly or view it on GitHub
#129.

@ArtGardner
Copy link
Author

Awesome, thanks!

@charlesw
Copy link
Owner

charlesw commented Nov 3, 2014

I've checked out the source in 3.04 (master branch) and this functionality
is not currently exposed. I'll see if I can get it added however this will
have to wait till the official 3.04 release of tesseract.

On 4 Nov 2014 01:46, "ArtGardner" notifications@github.com wrote:

Awesome, thanks!


Reply to this email directly or view it on GitHub
#129 (comment).

@ArtGardner
Copy link
Author

Fair enough, thanks again. For my own understanding, what was I looking at via the above link? At the top of the page, I see "This wiki provide simple example how to use tesseract-ocr API (v3.02.02) in C++". Are there multiple CAPI's for tesseract?

@charlesw
Copy link
Owner

charlesw commented Nov 4, 2014

No there's only one CAPI, however there is also a C++ API which is what the
sample you mentioned uses.

@ArtGardner
Copy link
Author

That clears it up. Thanks again!

@charlesw charlesw added this to the Tesseract 3.04 milestone Nov 23, 2014
@charlesw
Copy link
Owner

FYI, this functionality has since been added to the capi. So should be able to add support for this ince Tesseract 3.04 is released.

@ddobrev
Copy link

ddobrev commented Feb 21, 2015

Hello. I'd like to ask about any news on ChoiceIterator.

@charlesw
Copy link
Owner

Sorry still waiting on official 3.04 release of Tesseract.

@ddobrev
Copy link

ddobrev commented Feb 22, 2015

@charlesw I need it right now so I compiled Tesseract 3.04 from source. I want to try wrapping ChoiceIterator myself so could you please give me some hints? Do I need to wrap it manually or do you use a generator?

@charlesw
Copy link
Owner

Hi Dimitar, you best bet would be to mirror the current result iterator
only returning the various choices instead of results. In general you'll
need to do the folling:

  • Declare the functions in the TesseractAPI interface that correspond to
    the caoi functions for the iterator
  • Create a wrapper class that takes the choice iterators handle and
    destroys the iterator on disposal
    Note that none of these builds are supported and I don't believe that all
    the Tesseract languages for 3.04 have been trained/generated yet which may
    be a problem for you, though I could be mistaken about that.

Feel free to submit a pull request with your changes :)

@charlesw https://github.com/charlesw I need it right now so I compiled
Tesseract 3.04 from source. I want to try wrapping ChoiceIterator myself so
could you please give me some hints? Do I need to wrap it manually or do
you use a generator?


Reply to this email directly or view it on GitHub
#129 (comment).

@jhuntsman
Copy link
Contributor

Hi, I needed this also, so I compiled the latest tesseract 3.04 to use to add the wrapper. I created a fork and branch here: https://github.com/jhuntsman/tesseract/tree/feature_3.04/choice-iterator, you are welcome to it if it helps.

@charlesw
Copy link
Owner

Great, would you be able to create a pull request so I can merge your changes?

@jhuntsman
Copy link
Contributor

@charlesw Absolutely I will do that. I cleaned things up and also used your Dev_3.0.3 branch as my base so as not to conflict since it does depend on 3.03+. Pull request is forthcoming

@charlesw
Copy link
Owner

Merged fix, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants