"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

Region of interest for object detection

Hello,

      If there are many image targets on the screen - for example, 4 Image targets on A4 page, Vuforia detects one the targets randomly. I've attached picture for easier explanation. Let's say there is A4 page with targets "Image Target 1", "Image Target 2", "Image Target 3", "Image Target 4". "Max Simaltaneous Tracked Images"=1. When Vuforia see whole page it starts to track one of the images randomly. 

      I need Vuforia to detect object in the center of the screen - region of interest (ROI). So when it sees more then one image targets, it starts to track the one in region of interest. If there is no image target in the ROI Vuforia has to wait until the one appears in ROI. For example, on the attached picture "Image Target 3" is inside ROI, so Vuforia can start to track only "Image Target 3".

      I haven't found ROI parameter in Vuforia's API, so I'm trying to implement ROI by myself. I'm using Vuforia for Unity.

I'm using DefaultTrackableEventHandler. My idea is: 1. "OnTrackableStateChanged" check the object coordinates on the sceen.

2. if theobject is inside defined ROI, then Vuforia can track this object as usual and function OnTrackingFound() is called. Now the object can be tracked (even if it moves outside from ROI), until it dissapears from the screen.

3. if the object is not inside ROI all tracking information is reseted

4. Vuforia stops tracking detected object and tries to detect an object again. on new detected object go to "step 1"

 

I've implemented step 1 and step 2. However, i don't understand how to reset tracking information.

I've tried to stop and start ObjectTracker, but it doesn't reset tracking info and Vuforia keeps tracking detected object.

TrackerManager.Instance.GetTracker<ObjectTracker>().Stop();

TrackerManager.Instance.GetTracker<ObjectTracker>().Start();

heaven7even

Mon, 02/12/2018 - 23:44

I've solved the problem by myself.

In case, someone has to solve same problem here is the solution:

0.1 enable simultaneous object tracking (in my case 4 - i had up to 4 objects on one A4 page)

0.2 use two global variables isDetected=false, DetectedObjectName=""

Attachment