Start a new topic

Creating a Trackable at Runtime with a specific Image Target

Hello,


I am writing a script in Unity that will create an Image Tracker and Image Trackable for that tracker at runtime. I noticed that tracking multiple image targets will not work if there is only one trackable that references all targets in a .wtc file. 


Is there a way to instantiate an Image Trackable prefab at runtime and have it reference a specific target from the .wtc file? And if not, then how can I allow multiple targets to be tracked if I am creating the Image Tracker at runtime?


Hi,


Please send the wtc files at support@wikitude.com and I'll have a look at them there.


Thank you,

Alexandru

Hello,


Is there an email I can send the images to? And would you like the image files individually, or as a wtc file?

Hi, 


This is definitely not expected and we'd like to take a closer look at the issue, if you can share the project with us, or at least the images you were having issues with.


Thank you,

Alexandru

Hello,


I just tried it out on a different .wtc file and it worked perfectly fine. So my guess is that the image targets that I was originally testing on were not suitable for image recognition. 


However, they got 3 stars on the wikitude database, as did the new image targets that I just tested with. Does this issue come up often, where one set of 3 star image targets have a difficult time being recognized compared to another set of 3 star image targets?

Hi, 


The number of targets in a .wtc file shouldn't make a difference.


It might be the multiple tracker setup that affects performance, although this is not expected. I would like to have a look at the issue, and it would be very helpful if you could send us a project that reproduces the problem to us. You can send it to our support email if you don't want to share it publicly in the forums.


Thank you,
Alexandru

Hello,


I'm using a single trackable to track all targets from a database. Does it matter how many targets are in a .wtc file or should that not make a difference? 


I've tested it on my Android phone, and yes, I have enabled ARM64 support. I did run the Image Tracking - Multiple Targets sample, and it worked perfectly fine.


My application is currently creating 2 different Image Trackers on runtime, each one referencing a different .wtc database. I'm also running a coroutine that toggles between enabling one tracker at a time, and if it finds the image in its database, it will stop the coroutine and continue to track the image. It works fine for a single target, but my multiple target tracker is so slow and jittery. Would having multiple image trackers be an issue that might be causing this?

Hi,


Performance will start to degrade the more targets are being tracked, but it shouldn't matter if you're using one trackable per target, or a single trackable that tracks all targets. 

On which devices have you tested? If you're running on Android, have you enabled ARM64 support? 

If possible, could you please run our sample project and compare the performance of our "Image Tracking - Multiple Targets" sample with your use case? Is the performance the same, or worse?


Thank you,

Alexandru

Thank you so much for your reply. It's strange because even though I'm only using one trackable to track multiple targets and that shouldn't be a problem, when I try to track multiple targets, it's very jittery... it won't recognize all 4 targets at the same time, even with the concurrent targets set to 4.


Best,

Grace 

Hi, 


I'm not really sure if I understand you issue correctly.

Tracking multiple image targets with just one trackable should work fine, as long as you set the ImageTracker.MaximumNumberOfConcurrentTrackableTargets to something higher than 1. 

If you need to specify a subset of targets that should be matched by a trackable, the ImageTrackable.TargetPattern property allows you to do just that. You can either:


 - specify a single target name:

// Matches only targets named "diplodocus"
imageTrackable.TargetPattern = "diplodocus";


- specify multiple targets, using the | character to separate them:

// Matches only targets named "diplodocus" or "triceratops"
imageTrackable.TargetPattern = "diplodocus|triceratops";


- specify a more advanced pattern using the * wildcard:

// Matches only targets whose name ends in us
imageTrackable.TargetPattern = "*us";


Best regards,

Alexandru



Login or Signup to post a comment