down vote
I have written a program for monitoring and cancelling tesseract progress of OCRing at link <http://naharsisodia.blogspot.in/2016/09/monitoring-tesseract-process-of-ocring.html> ! Program written in C++ and takes image as input and output as hOCR file. Two threads are used to progress for demonstrate the functionality of tesseract progress monitoring; i have set 70% progress where tesseract processing cancelled. On Sunday, September 2, 2012 at 5:42:10 PM UTC+5:30, shah dipen wrote: > > Thanks for information. > On 2 Sep 2012 17:39, "patrickq" <[email protected] <javascript:>> > wrote: > >> I don't think so: the C++ code in Tesseract will consume memory from the >> same heap as any other parts of the app so if you just kill the OCR thread >> nothing will automatically release that memory and you just created a >> memory leak - a large one too considering you are working on a large image. >> >> On Sunday, September 2, 2012 5:46:32 AM UTC-4, shah dipen wrote: >>> >>> I don't have any perticular idea about tesseract. But as per my >>> knowledge in programming that should be possible. You can create new thread >>> for tesseract engine and can stop or dispose that thread on some event like >>> click of cancel button. >>> On 2 Sep 2012 15:11, "fulberto100" <[email protected]> wrote: >>> >>>> is it impossible to stop/cancel the OCRing? >>>> >>>> >>>> On Monday, August 27, 2012 1:43:35 PM UTC+3, fulberto100 wrote: >>>>> >>>>> hi, >>>>> im using tesseract on my iPhone app. >>>>> >>>>> i want to stop/cancel the ocr process. is there a way to do it? >>>>> i wrote in backPressed method: >>>>> tesseract->Clear(); >>>>> tesseract->End(); >>>>> >>>>> but when the ocr starts and i hit the back button, it crashes, cos it >>>>> is still OCRing. >>>>> >>>>> here is my iOS code: >>>>> >>>>> - (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]; >>>>> >>>>> } >>>>> >>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "tesseract-ocr" group. >>>> To post to this group, send email to [email protected] >>>> To unsubscribe from this group, send email to >>>> [email protected] >>>> For more options, visit this group at >>>> http://groups.google.com/group/tesseract-ocr?hl=en >>>> >>> -- >> You received this message because you are subscribed to the Google >> Groups "tesseract-ocr" group. >> To post to this group, send email to [email protected] >> <javascript:> >> To unsubscribe from this group, send email to >> [email protected] <javascript:> >> For more options, visit this group at >> http://groups.google.com/group/tesseract-ocr?hl=en >> > -- 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 https://groups.google.com/group/tesseract-ocr. To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/c03f3a26-4598-460f-b145-c7e078da6ed6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

