- How To Detect and Track Multiple Targets Simultaneously
- How To Edit the Properties of a Target
- Best Practices for Large Device Databases
How many targets can be recognized and tracked by a Vuforia Engine app?
The number of targets that your app can recognize and track simultaneously will depend on the types of databases that you utilize and also the target types.
Vuforia Engine supports both local and online target databases for Image Targets. These are referred to as device and cloud databases respectively, See: Comparison of Device and Cloud Databases
Device Databases are stored on the device with your app. You can load and unload Device Databases programmatically, and activate or deactivate them using the ObjectTracker API. Activating a loaded database enables Vuforia Engine to detect any of the targets included in that database.
The number of targets that can be active simultaneously, across one or more loaded Device Databases, is constrained by the device context and its available resources.
Image Targets in Cloud Databases are recognized using the Cloud Recognition service. A single Cloud Database can contain up to 1 million Image Targets. When an image in your Cloud Database is recognized, it's associated Image Target is returned to your app. Cloud Recognition does not support simultaneous image tracking and Cloud Databases only support Image Targets.
The same Device Database rules that apply to Image Targets also apply to Multi-Targets. Since a Multi-Target is made of up a combination of multiple Image Targets, the number of Image Targets in a Multi-Target determines its target count for the purpose of determining the Multi-Target capacity of a Device Database. For example, a cube or cuboid Multi-Target with six faces (6 Image Targets) is equivalent to six targets in a Device Database.
A single device database can contain up to 20 Object Targets. A maximum of 2 Object Targets can be tracked simultaneously.
Can I manually change the size in the dataset XML?
Yes, it is possible to edit the dataset XML file and change the target size manually. However, be aware that you should still take care of maintaining the original aspect ratio (width and height). For instance, if you make the width twice as large, you should also double the height.
What does the target size represent?
The target size represents the actual size of the target in meters. Do not get confused by the fact that it is a 2D size (width and height). This is because your image target is a flat rectangular 2D shape, but if you think of such a rectangle in 3D space (with some position and orientation), its width and height become actual 3D dimensions. Note that the third dimension (the thickness) is null and is not relevant simply because the target is a flat rectangle (it has no thickness).
What is the relationship between the image resolution (size in pixels) and the target size?
There is no direct relationship between these attributes. The target size represents the size of the target rectangle in meters. For example, if your image has a resolution of 1024 x 512 pixels, this does not mean that you have to enter 1024 as target width in the target manager.
The only indirect relationship between image size (pixels) and target size is the aspect ratio, so the target width/height ratio must be the same as the image width/height ratio.
What image resolution should I use for target images?
During the resizing process, anti-aliasing is performed on the uploaded image. This action is perfectly acceptable for photos, but the results may affect the detectability of Image Targets.
To avoid experiencing the anti-aliasing impact, you can ensure that the uploaded image is at least 320 pixels in width.
Stretching and softening in the image due to a server-side scaling step results in a lower feature count and worse local contrast in the image. This may not be visible immediately, but such targets can result in poor target detection and tracking.
What image file formats are supported for Image Targets?
The file must be 8 or 24-bit PNG or JPG. A JPG file must be RGB or greyscale. Maximum image file size is 2.25MB.
Can I change my target size programmatically?
If you want to change the size of your Image Targets at run time (programmatically using script code), and you want Vuforia Engine to take into account the new size and change the tracked target distance accordingly, you need to:
- use the ImageTarget.SetSize( Vector2 new_size ) API
- Deactivate the Dataset before changing the size
- Reactivate the Dataset after changing the size
This sample code shows how to check and set target sizes using the Vuforia Engine API