Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8481099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:28:23+00:00 2026-06-10T19:28:23+00:00

im using tesseract for image OCRing in my iPhone app. i want to stop

  • 0

im using tesseract for image OCRing in my iPhone app.
i want to stop all OCR process while its running.

here is my code:

in .h file:

dispatch_queue_t main;
tesseract::TessBaseAPI *tesseract;
uint32_t *pixels;

in .m file:

- (void)processOcrAt:(UIImage *)image
{
    [self setTesseractImage:image];

    //char* utf8Text = tesseract->GetUTF8Text();
    //[self performSelector:@selector(ocrProcessingFinished:) withObject:[NSString stringWithUTF8String:utf8Text]];
    //dispatch_queue_t queue = dispatch_queue_create("com.awesome", 0);

    main = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
    dispatch_async(main, ^{
        tesseract->Recognize(NULL);
        char* utf8Text = tesseract->GetUTF8Text();
        [self performSelectorOnMainThread:@selector(ocrProcessingFinished:)
                               withObject:[NSString stringWithUTF8String:utf8Text]
                               waitUntilDone:NO];
        delete [] utf8Text;
    });


}

-(IBAction)backPressed:(id)sender{
    dispatch_release(main);
    tesseract->Clear();
    //tesseract->End();

    delete tesseract;
    tesseract = nil;
    delete pixels;
    [self.navigationController popViewControllerAnimated:YES];
}

When i tap to back button while ocr is running it crashes. because ocr is still running. How can i stop it? i couldnt find any method in tesseract.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:28:24+00:00Added an answer on June 10, 2026 at 7:28 pm

    here is the answer from tesseract form:
    https://groups.google.com/forum/?fromgroups=#!topic/tesseract-ocr/1uLF4BmmmUg

    I think the crux of the problem is your attempt to stop the OCR thread at a random spot in its execution yet expect the state of the Tesseract instance to be consistent. You are right to want to delete the instance otherwise you would have a memory leak but it looks like you can’t do that after stopping the OCR thread abnormally. In our own iPhone app (ScanBizCards) what we do in that case is to let the OCR thread finish its work in the background even though its results will be ignored and not shown to the user. The downside is mostly that if the user starts a new scan right after aborting one we delay the start of the new scan until the previous (aborted) scan finishes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was incorporating the OCR in my iPhone app using open source library tesseract.I
I'm using tesseract in my iPhone application. I tried several filters on my image
I'm using the Tesseract OCR for an application I'm writing. I just want to
I am using Tesseract OCR (via pytesser ) and PIL (Python Image Library) for
i'm using c# tessnet2 wrapper for Tesseract OCR engine to capture chracters of image
I 'm using Tesseract OCR engine in an iPhone application to read specific numeric
I am trying to develop my first OCR app using tesseract. I'm developing under
I'm using tesseract on a project and want to know the best image input
I am trying to use tesseract-2.04 in my iPhone application and just want to
We are using Tesseract OCR Java library called Tess4J. It works fine if run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.