Community

How To stop text Capture Service In iOS Objective C Answered

Hi, 
I was Trying to stop text Capture Service when I m getting particular Keyword in (NSArray*)textlines. 

Ex: I am looking for Anup in a textlines if I find then I want to stop the task. I don't need 
RTRResultStabilityStatus. Because I m only looking for the Keyword Anup. if I find Anup then my task is over. 

So I am Doing [_textCaptureService stopTasks];  

but this is not Stoping text Capture Service 


So How I can achieve this?


 
#pragma mark - RTRRecognitionServiceDelegate

 

- (void)onBufferProcessedWithTextLines:(NSArray*)textLines resultStatus:(RTRResultStabilityStatus)resultStatus

{

    performBlockOnMainThread(0, ^{

        if(!self.isRunning) {

            return;

        }

        [self.progressIndicatorView setProgress:resultStatus color:[self progressColor:resultStatus]];

        for(RTRTextLine* textLine in textLines) {

            NSString* recognizedString = textLine.text;

                if ([recognizedString isEqualToString:@"Anup"]) {

                    NSLog(@"resultStatus:::%ld",(long)resultStatus);

                    NSLog(@"YES I m here");

                    [_textCaptureService stopTasks];

                }

        }

 

    });

}

This is My code Snippet. 

Was this article helpful?

0 out of 0 found this helpful

Comments

3 comments

  • Avatar
    anup gupta

     

     

    By self.running = NO; need to call first then [_textCaptureService stopTasks];


    To stop the process. 

    0
  • Avatar
    Oksana Serdyuk

    Hi Anup,

    It seems that for your usage scenario it is more appropriate to use the the Data Capture scenario (please see Capture a Custom Data Field: iOS for details) with the regular expressions for this. Using a regular expression, you can describe a word that you are looking for, and then when you point the camera at the text, containing the necessary word, ABBYY RTR SDK will extract only the word that corresponds to the specified regular expression.

    1
  • Avatar
    anup gupta

    Hi Oksana,

    Thank you. I will Check This. 

    0

Please sign in to leave a comment.