Object tracking allows you to attach a virtual object made in Blender to a real object that is moving in a video of the real world. Don't confuse object tracking with camera tracking. In camera tracking the real-world camera is in motion and the motion of everything in the video has to be calculated whereas in object tracking only the motion of one specific object has to be analyzed.
As an example of object tracking, you could track the motion of a person's head and that attach to that head a mask that exists only in Blender, as I did in the video below. Thanks to Maxime for lending his head!
The next video shows a virtual pair of glasses being attached to another moving head - it gives a better ide of the process involved in object tracking:
This 9 minute YouTube video will get you started with object tracking:
The above movie does not explain the last step in object tracking: preparing for rendering. I have included instructions for this below. Please note that converting the movie file (a single file onto the computer) into an image sequence (each frame becomes a separate file on the computer, so there will be hundreds of them) is an OPTIONAL STEP which is nevertheless recommended in order to get the best results.
OBJECT TRACKING (OPTIONAL)
To convert a movie file into an image sequence (each frame of the movie will be saved a separate image file)
1. This is recommended because if you try to use the movie file in the movie Blender may not interpret the movie footage accurately.
2. In Blender, in the render panel, set the frame rate to match the movie you will use (my camera films 50 frames per second)
3. In Blender, switch the 3D window into a Video Sequence Editor window.
4. Use the Add menu at the bottom of the Video Sequencer Editor window to add your movie into the window, being sure to import the movie into frame 1. It does not matter whether or not you import the sound track with the video track – in any case the sound will be lost when you save the movie as an image sequence.
5. If you did not import into frame 1 then drag the beginning of the movie to frame by pressing G (grab and move) and dragging the movie into position.
6. In the render panel, select the still image format that you want to use for the image sequence. (I suggest jpeg because it is compressed and compact. Some people prefer Targa format.)
7. Choose a destination for the image sequence (drive H?). You may want to create a new directory (folder) to hold the image sequence.
8. Render the image sequence by pressing Shift-F12 or pressing the Animation button in the render panel.
9. Start Blender or, if Blender is already open, start a new project.
10. In the Blender panel, set the frame rate to match the frame rate of the movie you will use (my movie files are normally 50 frames per second (50fps).
11. Switch the 3D window into a Movie Clip window.
12. Open the movie using the ‘Open’ button at the bottom of the Movie Clip Window (do not choose File>Open). If the movie is in the form of an image sequence then just select the first image in the sequence – the others will be imported also.
13. Using the timeline, seek the end of the movie and then set the ‘end’ value of the timeline to match the final frame of the movie.
14. IMPORTANT. Open the properties panel of the Move Clip Window by pressing ‘N’. In the ‘objects’ section, make a new object by pressing the ‘+’ button and name the new objet ‘face’. Leave this new object selected so the markers will be associated with it and not with the camera.
15. You need to place at least 8 tracking markers on the video so that Blender can analyze the motion. Place a marker on a high contrast point (such as a white dot on a dark background) by Ctrl-left clicking the chosen point. Alternatively, click the ‘Place marker and move’ button in the tool shelf and then drag the marker to the chosen location.
16. You may wish to adjust the size of the marker by pulling the handle at the right of the marker so that it encloses an easy-to-recognize shape.
17. If you enlarge the marker significantly you will also want to enlarge the search area. First make the search area visible in the ‘marker display’ section of the properties panel of the movie clip window (press ‘N’ if the panel is not visible). Then pull the handle at the bottom-right of the search box to enlarge the search area.
18. You may also wish to limit the number of color channels that are used for tracking the marker so as to obtain maximum contrast. For example, if you are trying to track red dots on a green surface then choosing to use only the red channel will maximize the contract (giving bright dots against a very dark background).
19. Once you have placed at least 8 markers you can try to track the markers one by one or all at once (most users track them one by one). Select a marker (or multiple markers) and press the ‘Track forward’ button in the tracking section of the tool shelf (looks like a ‘play’ button).
20. Once you have successfully tracked at least eight markers you are ready to solve (analyze) the object motion.
Solve the object motion
21. Before you attempt to solve for the object motion you need to give information about the camera and you need to select two ‘keyframes’ which Blender will use to figure out where each marker is in 3D space relative to the other markers. Choose two frames that are sharp, that both share at least eight tracked markers, and that have markers that have significant differences in their relative positions. Set the Keyframe A and Keyframe B values accordingly.
22. In the properties panel (press ‘N’ if you don’t see it), open the camera settings section and enter the sensor size and focal length settings. My camera is equivalent to a combination of 36mm sensor size and 28mm focal length. (Note that ‘35mm cameras’ have a sensor size of 36mm – the value of 35mm refers to the width of the old-style celluloid film and not to the sensor size.)
23. In the toolbox; click the Object Motion button in the Solve section and wait – solving can take a minute or two. An error number will appear at the bottom of the window. An error of less than 1 is considered to be very good. An error of 1 to 3 is considered to be less good but unusable. An error of more than 3 is considered to be so poor that jittering will be visible in the finished result unless you work to reduce the error by re-doing some of the tracking.
24. IMPORTANT In versions up to 2.66 you will not see the solution for the object motion in the 3D viewport (i.e. the solved markers) unless you apply a camera solve constraint to the camera (even though there is no data for a camera tracking solution. If you move the camera then the points will move with it.
TO BE CONTINUED...