To anyone else who may run across this, it is because of the way C++ uses 
scope to optimize the code when it compiles. Things that are within the 
scope of the for loop will run faster than things that have larger scope.

On Wednesday, September 9, 2015 at 6:14:05 PM UTC-7, [email protected] 
wrote:
>
> I have a loop that calls SetImage() and GetUTF8Text() once for each 
> iteration of the loop. 
>
> I have found that when I call tesseract::TessBaseAPI *api = new tesseract
> ::TessBaseAPI() and api->End() at the beginning and end of the loop, I 
> actually get about .1 second improvement in time performance than if I only 
> init and end tesseract once. 
>
> Why would this counterintuitive thing happen? Based on these timings I'm 
> assuming the process of clearing the contents of the previous call must be 
> significantly slower than reinitializing tesseract, but this would still be 
> quite counterintuitive.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/2c4dc11e-1980-44fc-9424-bcb1acafe632%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to