Before you choose a target image for your target tracking effect, it’s a good idea to check these best practices. Not all images make good targets. Choosing a bad target image could mean your effect doesn’t respond to it. You also need to move your device correctly to trigger tracking.
Tracking is more successful and consistent on higher-end devices. Encourage users to avoid trying effects on Android ARClass 50 and lower and iPhone 8 and lower.
This guide will help you:
- Consider the number of targets to use.
- Move your device to begin tracking.
- Choose a target image the camera can easily identify.
- Consider the placement of the target in the world — for example its proximity to the camera and the target’s surroundings.
Adding multiple targets
The target tracker tracks up to five unique images in a scene, however you should keep in mind the impact on performance across mobile devices is recommended. We recommend:
- A maximum of 5 targets in the same effect.
- Reduce the number of targets further if you want your effect to work on low-end devices.
When you can see the target in the camera you may need to move your camera to get the tracking started and to make sure it carries on tracking when you move the camera away. Encourage users or clients to move the camera in a slow and steady circular motion. Try not to make any sudden, fast movements and don’t rotate the camera.
Keep in mind that initialization may take significantly longer on lower devices and it’s easier to lose tracking on these devices, especially when the target is out of view.
Choosing a good target image
Make sure your target image follows these principles, so your effect will work when the target is detected by the camera.
Both color and black and white images will work. Either way, all images should have high tonal contrast. This means avoiding images with lots of pastel colors.
The image on the left would make a good target as there’s lots of contrast. The image on the right wouldn’t:
Try turning your target image to grayscale to check there’s enough contrast. If it’s all a similar shade, there probably isn’t.
Make sure your image has a resolution of at least 300×300 pixels.
The image on the left would make a good target. The image on the right wouldn’t:
Try to stay away from smooth or soft edges and textures with a lot of gradients.
The image on the left is a good example of a target with lots of sharp edges:
Asymmetrical patterns and compositions
Avoid symmetry and repeated patterns. Images that can easily be inverted might not track as well.
The image on the left is a good example of an image that will track well. The image on the right has a lot of symmetry, so would not make a good target:
Simple images might not work well. You should also avoid repeating the same motifs.
The image on the left has enough complexity, plus other good practices like high contrast and sharp details. The image on the right is too simple with too much repetition:
Find flat surfaces
Images on curved surfaces like bottles won’t work well, as target tracking is meant for flat surface images.
In the image on the left the target is flat against the front of the can. This will make a good target. With the can on the right the image is curved along the side which won’t be easily detected by the camera:
Clear target shapes
Target images can be all sorts of shapes. They don’t have to be rectangular or square. However, you should still think about how clear the target image will be.
For example, a target image on thin paper like money will move and distort because the paper is thin, making it difficult for the camera to identify the target. With the image on the left, the target is flat and static, creating a clear target.
Avoid blank space or transparency
Avoid targets with lots of transparency or blank space around the actual image, like in the image below on the right:
The placement of the target
Target AR effects work best when the camera is closer to the image. The camera shouldn’t be further away than 3 times the width of the target image. The image should fill a large portion of the device frame, at least half the image should be visible in the camera view.
Large targets work better too. Small images like stickers might not work even when in the full frame.
In a fixed target tracking effect, the effect will appear at the point where the target image was first detected by the camera. If the target leaves the camera’s view, the effect will still be displayed and tracked correctly.
To make sure these kinds of effects work, place the target in a rich environment with lots of detail and contrast in the surroundings. For example, display the target on a highly-decorative background as opposed to a plain white table or wall.
Good target placement
The examples below are a movie poster and cereal box. These are fairly large objects that people can easily get close to for a good length of time:
Bad target placement
The examples below, a highway billboard and a sticker, might not work well. It’s unlikely someone could get close enough to the billboard for a good length of time, and the sticker is too small: