"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

TextTracker always null

I'm trying to set up the region of interest using the SetRegionOfInterest from TextTracker class and having a problem with the TextTracker initialization. 

TextTracker textTracker = (TextTracker)TrackerManager.Instance.GetTracker<TextTracker>(); //return null

Rect regionOfInterestTracking =  new Rect(Screen.width * 0.1f, Screen.height * 0.1f,

	                                  Screen.width * 0.8f, Screen.height * 0.4f);

Rect regionOfInterestDetection = new Rect(Screen.width * 0.2f, Screen.height * 0.2f,

	                                  Screen.width * 0.6f, Screen.height * 0.2f);

textTracker.SetRegionOfInterest(regionOfInterestDetection, regionOfInterestTracking);

 

But it always returns a null reference error, what would be the possible approach for solving this?

 

Hello VY09,

I'm not seeing this issue when I test it locally. Could you check out the sample project's Text Reco scene and see if there is anything in the TextEventHandler.cs script that you might not be doing?

Thanks,

It seems that I don't have the TextEventHandler.cs & TextTracker.cs inside the Scripts folder (path: myProgram/Assets/Vulforia/Scripts/)

Maybe there is an installation error? But it can detect words from the whole screen as expected.

The implementation of TextTracker isn't accessible publicly, but TextEventHandler is a class present in the samples. It isn't part of the Vuforia/Scripts folder, but instead under SampleResources/TextReco/Scripts.