Android Question B4A/Tesseract compile fails

drgottjr

Expert
Licensed User
Longtime User
i've been working with the tesseract in-line java library (thanks to user joilts) in a B4A project. to my surprise and delight, it works quite well. the example is straight forward, and it's pretty simple to research tesseract's c++ calls and convert them to java. they seem to behave as expected.

one of the api calls allows you to capture the various "blocks" that tesseract has recognized as such in
the image you give it to ocr. that call (in c++) is:
Boxa * tesseract::TessBaseAPI::GetComponentImages (PageIteratorLevel level, bool text_only, Pixa **pixa, int **blockids);

what the various parameters mean is not particularly relevant to the problem, but the examples i see use NULL for the last 2 parameters, eg:
boxa = api.GetComponentImages(RIL_TEXTLINE, true, NULL, NULL);

when i try to compile my B4A project with the in-line java code i get an error indicating that NULL is defined in both leptonica and tesseract (they both are imported). and although they are apparently defined identically, they are multiply defined. so no compile.

my question is: how do i work around this? i think trying to substitute real variables for the NULL's opens a can of worms since the function would then be expecting those variables to be populated. but maybe someone more familiar with either this type of conflict or with the actual function might shed some light. thanks in advance.

-go

note to erel: i apologize for not offsetting the code example. i don't see any icon along the top of this text box that i can use.
 

drgottjr

Expert
Licensed User
Longtime User
Can you post the full error message?
code and error attached as jpg's. i don't know if i can post both in 1 reply, so maybe you get 2 replies... thanks
-go
 

Attachments

  • code.jpg
    code.jpg
    242.6 KB · Views: 224
  • error.jpg
    error.jpg
    126.3 KB · Views: 225
Upvote 0
Top