"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

QCAR Failed to Initialize

We have created an application that uses the same procedure as TextReco to start scanning words.  When finshed, we run a method that duplicates the shutdown procedure in TextReco as follows:

 

- (void)shutDownQCAR {

    

    QCARControl *control = [QCARControl getInstance];

    

    // Stop the camera

    [control stopCamera];

    qcarCameraIsActive = NO;

    

    // Pause and deinitialize QCAR

    [control pauseQCAR];

    [control deinitTextTracker];

    [control deinitQCAR];

    

    // Inform the root view controller that the EAGLView should finish any OpenGL ES commands

    [self finishOpenGLESCommands];

    

    // free any easily recreated OpenGL ES resources

    [self freeOpenGLESResources];

}

 

Then when we want to scan words again we just start as before.  The problem we're having is that the camera does not always come up and when it doesn't we are getting the following error messages in our log:

 

2013-07-01 12:22:16.617 PronounceWords[566:907] ERROR: failed to initialise QCAR

2013-07-01 12:22:17.551 PronounceWords[566:b353] INFO: successfully stopped tracker

2013-07-01 12:22:17.824 PronounceWords[566:b353] QCARControl pauseQCAR

2013-07-01 12:22:18.112 PronounceWords[566:b353] QCARControl deinitQCAR

 

This frequently leads to a crash when we attempt to exit the text recognition portion of our app.  Please let me know if you have any suggestions.

 

Thanks!

 

When finshed, we run a method that duplicates the shutdown procedure in TextReco as follows:

Could you please check, because when I compare to the TextReco sample, the code is different (and shown below)

I was working off the beta code.  I inserted the changes that you suggested below.  I also needed to update the QCARControl.h and .mm classes with the version from the latest TextReco.  The scanning view comes up, but now no words are found.

I updated our project to reflect the latest TextReco application.  Now our application detects words as before.  However, after exiting the 3rd time on an iPhone, the camera will not restart and I am getting a "failed to initialise QCAR" error.  Attached is our log.

The problem has stopped occuring.  We had expected a pauseQCAR and deinitQCAR command to be issued.  These were not in the log that was sent.  But, in more recent trials, the commands appear in the logs and the problem no longer occurs.

Thanks!

Sorry to bring this up again, but we're still seeing situations where the camera does not restart whe we shut down and restart the scanner.  In these cases the pauseQCAR and deinitQCAR are not seen in the logs after the deinitTracker.  I've attached our exit code below.

Thanks for the reply.  I've been on vacation and another project.  Sounds like just execute through the [control pauseQCAR] and then turn the camera and QCAR back on when starting.  

Have a look at the samples for some examples, but typically you do not store the state per se, and instead use pause/resume etc. and the delegates to let you know what is happening.

Then if need be you can store your own state.

 

N

Will do.  The samples I've seen are all stand alone applications.  The Vuforia functionality is a small, but important part of our app.  Thus the interest in maintaining state.

Thanks,

We are finding that this problem is specific to the iPhone 4 which has a slower processor.  Would it be possible to elaborate on system resources that are shared in QCAR that would prevent the deinitTracker from completing or delay the pauseQCAR command?

Hi Jack

Apologies for the delay, but I am looking at this.

I am wondering whether you can simply create a single instance of the ViewController that handles the text recognition, and invoke it's pause / resume functionality when it hides/appears.