Merging Files and Tracks

Merging Files and Tracks
When you are working on scenarios with multiple shots or objects, you may wish to combine different SynthEyes .sni files together. For example, you may track a wide reference shot, and want to use those trackers as indirect links for several other shots. You can save the tracked reference shot, then use the File/Merge option to combine it with each of several other files.
Alternatively, you can transfer 2-D or 3-D data from one file to another, in the process making a variety of adjustments to it as discussed in the second subsection. You can track a file in several different auto-track sections, and recombine them using the scripts.
File/Merge
After you start File/Merge and select a file to merge, you will be asked whether or not to rename the trackers as necessary, to make them unique. If the current scene has Camera01 with trackers Tracker01 to Tracker05, and the scene being merged also has Camera01 with trackers Tracker01 to Tracker05, then answering yes will result in Camera01 with Tracker01 to Tracker05 and Camera02 with Tracker06 to Tracker10. If you answer no, Camera01 will have Tracker01 to Tracker05 and Camera02 will also have (different) Tracker01 to Tracker05, which is more confusing to people than machines.
As that example shows indirectly, cameras, objects, meshes, and lights are always renamed to be unique. Renaming is always done by appending a number: if the incoming and current scenes both have a TrashCan, the incoming one will be renamed to TrashCan1.
If you are combining a shot with a previously-tracked reference, you will probably want to keep the existing tracker names, to make it easiest to find matching ones. Otherwise, renaming them with yes is probably the least confusing unless you have a particular knowledge of the TrackerNN assignments (in which case, giving them actual names such as Scuff1 is probably best).
You might occasionally track one portion of a shot in one scene file, and track a different portion of the same shot in a separate file. You can combine the scene files onto a single camera as follows:
  1. Open the first shot
  2. File/Merge the second shot.
  3. Answer yes to make tracker names unique (important!)
  4. Select Camera02 from the Shot menu.
  5. Hit control-A to select all its trackers.
  6. Go to the Coordinate System Panel .
  7. Change the trackers’ host object from Camera02 to *Camera01. (The * before the camera name indicates that you are moving the tracker to a different, but compatible, shot.)
  8. Delete any moving objects, lights, or meshes attached to Camera02.
  9. Select Remove Object on the Shot menu to delete Camera02.
All the trackers will now be on the single Camera01. Notice how Remove Object can be used to remove a moving object or a camera and its shot. In each case, however, any other moving objects, trackers, lights, meshes, etc, must be removed first or the Remove Object will be ignored.
Tracker Data Transfer
You can transfer tracking data from file to file using SynthEyes export scripts, File/Export/Export 2-D Tracker Paths, and File/Import/Import 2-D Tracker Paths. These scripts can be used to interchange with other programs that support similar tracking data formats. The scripts can be used to make a number of remedial transforms as well, such as repairing track data if the source footage is replaced with a new version that is cropped differently.
The simple data format, a tracker name, frame number, horizontal and vertical positions, and an optional status code, also permits external manipulations by UNIX-style scripts and even spreadsheets.
Exporting
Initiate the Export 2-D Tracker Paths script, select a file, and a script-generated dialog box will appear:
As can be seen, it affords quite a bit of control.
The first three fields control the range of frames to be exported, in this case, frames 10 from 15. The offset allows the frame number in the file to be somewhat different, for example, -10 would make the first exported frame appear to be frame zero, as if frame 10 was the start of the shot.
The next four fields, two scales and two offsets, manipulate the horizontal (U) and vertical (V) coordinates. SynthEyes defines these to range from -1 to +1 and from left to right and top to bottom. Each coordinate is multiplied by its scale and then the offset added. The normal defaults are scale=1 and offset=0. The values of 0.5 and 0.5 shown rework the ranges to go from 0 to 1, as may be used by other programs. A scale of -0.5 would change the vertical coordinate to run from bottom to top, for example.
The scales and offsets can be used for a variety of fixes, including changes in the source imagery. You’ll have to cook up the scale and offset on your own, though. Note that if you are writing a tracker file on SynthEyes and will then read it back in with a transform, it is easiest to write it with scale=1 and offset=0, then make changes as you read in, since if you need to try again you can retry the import, without having to reexport.
Continuing with the controls, Even when missing causes a line to be output even if the tracker was not found in that frame. This permits a more accurate import, though other programs are less likely to understand the file. Similarly, the Include Outcome Codes checkbox controls whether or not a small numeric code appears on each line that indicates what was found; it permits a more accurate import, though is less likely to be understood elsewhere.
The 2-D tracks box controls whether or not the raw 2-D tracking data is output; this is not necessarily mandatory, as you’ll see.
The 3-D tracks box controls whether or not the 3-D path of each tracker is included―this will be the 2-D path of the solved 3-D position, and is quite smooth. In the example, 3-D paths are exported and 2-D paths are not, which is the reverse of the default. When the 3-D paths are exported, an extra Suffix for 3-D can be added to the tracker names; usually this is _3D, so that if both are output, you can tell which is which.
Finally, the Extra Points box controls whether or not the 2-D paths of an extra helper points in the scene are output.
Importing
The File/Import/Import 2-D Tracker Paths import can be used to read the output of the 2-D exporter, or from other programs as well. The import script offers a similar set of controls to the exporter:
The import runs roughly in reverse of the export. The frame offset is applied to the frame numbers in the file, and only those within the selected first and last frames are stored.
The scale and offset can be adjusted; by default they are 1 and 0 respectively. The values of 2 and -1 shown undo the effect of the 0.5/0.5 in the example export panel.
If you are importing several different tracker data files into a single moving object or camera, you may have several different trackers all named Tracker1, for example, and after combining the files, this would be undesirable. Instead, by turning on Force unique names, each would be assigned a new unique name. Of course, if you have done supervised tracking in some different files to combine, you might well leave it off, to combine the paths together.
If the input data file contains data only for frames where a tracker has been found, the tracker will still be enabled past the last valid frame. By turning on Truncate enables after last, the enable will be turned off after the last valid frame.
After each tracker is read, it is locked up. You can unlock and modify it as necessary. The tracking data file contains only the basic path data, so you will probably want to adjust the tracker size, search size, etc.
If you will be writing your own tracker data file for this script to import, note that the lines must be sorted so that the lines for each specific tracker are contiguous, and sorted in order of ascending frame number. This convention makes everyone's scripts easier. Also, note that the tracker names in the file never contain spaces, they will have been changed to underscores.
Transferring 3-D Paths
The path of a camera or object can be exported into a plain file containing a frame number, 3 positions, 3 rotations, and an optional zoom channel (field of view or focal length).
Like the 2-D exporter, the File/Export/Plain Camera Path exporter provides a variety of options:
First Frame. First frame to export
Last Frame. Last frame to export.
Frame Offset. Add this value to the frame number before storing it in the file.
World Scaling. Multiplies the X,Y, Z coordinates, making the path bigger or smaller.
Axis Mode. Radio-buttons for Z Up; Y Up, Right; Y Up, Left. Adjust to select the desired output alignment, overriding the current SynthEyes scene setting.
Rotation Order. Radio buttons: XYZ or ZXY. Controls the interpretation of the 3 rotation angles in the file.
Zoom Channel. Radio buttons: None, Field of View, Vertical Field of View, Focal Length. Controls the 7th data channel, namely what kind of field of view data is output, if any.
Look the other way. SynthEyes camera looks along the –Z axis; some systems have the camera look along +Z. Select this checkbox for those other systems.
The 3-D path importer, File/Import/Camera/Object Path, has the same set of options. Though this seems redundant, it lets the importer read flexibly from other packages. If you are writing from SynthEyes and then reading the same data back in, you can leave the settings at their defaults on both export and import (unless you want to time-shift too, for example). If you are changing something, usually it is best to do it on the import, rather than the export.
Writing 3-D Tracker Positions
You can output the trackers’ 3-D positions using the File/Export/Plain Trackers script with these options:
Tracker Names. Radio buttons: At beginning, At end of line, None. Controls where the tracker names are placed on each output line. The end of line option allows tracker names that contain spaces. Spaces are changed to underscores if the names are at the beginning of the line.
Include Extras. If enabled, any helper points are also included in the file.
World Scaling. Multiplies the coordinates to increase or decrease overall scaling.
Axis Mode. Temporarily changes the coordinate system setting as selected.
Reading 3-D Tracker Positions
On the input side, there is an File/Import/Tracker Locations option and an File/Import/Extra Points option. Neither has any controls; they automatically detect whether the name is at the beginning or end of the line. Putting the names at the end of each line is most flexible, because then there is no problem with spaces embedded in the file name. A sample file might consist of lines such as:
0 0 0 Origin
10 0 0 OnXAxis
13 -5 0 OnGroundPlane
22 10 0 AnotherGroundPlane
3 4 12 LightPole
When importing trackers, the coordinates are automatically set up as a seed position on the tracker. You may want to change it to a Lock constraint as well. If a tracker of the given name does not exist, a new tracker will be created.

 

タグ:

+ タグ編集
  • タグ:

このサイトはreCAPTCHAによって保護されており、Googleの プライバシーポリシー利用規約 が適用されます。

最終更新:2009年03月29日 15:22
ツールボックス

下から選んでください:

新しいページを作成する
ヘルプ / FAQ もご覧ください。