-
Notifications
You must be signed in to change notification settings - Fork 12
The BTF tracking format is a simple and easily extensible method for organizing tracking information in flat files used by all of the programs and utilities in the BioTrack Pack. Tracking information can be thought of as a table, where rows correspond to a single object (an ant) being tracked and columns to the parameters that describe that object at a specific point in time (id, (x,y) location, orientation, and timestamp).
| ID | X | Y | THETA | TIME |
|---|---|---|---|---|
| 0 | 24 | 45 | 0.091 | 33 |
| 1 | 100 | 50 | 2.331 | 33 |
| 0 | 30 | 41 | 0.103 | 66 |
BTF represents this table as a collection of files, where each file corresponds to one column, and each line in the file corresponds to a row. By representing each column as a separate file, it's easy to add or modify individual columns without processing all of the other columns. The MultiTrack application produces BTF output with the following columns:
- id.btf - The ID of an object. ID's are guaranteed to be unique at any specific point in time, but may not be consistant (A single object may have different ID's throughout, but two distinct objects will not be marked with the same ID number at the same time)
- timage.btf - The orientation of the object. Orientation and (x,y) location is given in the video reference frame using standard image coordinates (origin is at the top left corner of the image, positive x is to the right, positive y is down, positive rotation is clockwise)
- ximage.btf - The x coordinate of the object
- yimage.btf - The y coordinate of the object
- timestamp.btf - The time in the video for this track. Time is given in milliseconds
There is also a BTF metadata format we use in order to keep track of things like which units the values of a particular column are in, which parameters were used by which tracker to generate the data, or other information such as scene information for a video. Here's an example of what one of these metadata files would look like:
<project>
<comment>Aphaenogaster Cockerelli milling around</comment>
<environment width="0.360" height="0.204">
<object type="obstacle" x="0.01" y="0.01" width="0.001" height="0.002" />
<object type="point-of-interest" name="nest" x="0.18" y="0.01" width="0.008" height="0.008" />
</environment>
<tracking>
<source filename="MVI_8480.avi" type="video" config_filename="lab-aphaeno-mvi8480.ini">
<trackfile filename="ximg.btf" units="pixel" parameter="x" comment="X position of the tracked model in image coordinates"/>
<trackfile filename="yimg.btf" units="pixel" parameter="y"/>
<trackfile filename="timage.btf" units="radian" parameter="theta"/>
<trackfile filename="timestamp.btf" units="milliseconds" parameter="time"/>
<trackfile filename="id.btf" units="none" parameter="id"/>
</source>
</tracking>
</project>
Note that all values specified in the metadata file are in SI units (distance in meters). Here's the formal DTD:
<!DOCTYPE project [
<!ELEMENT project (comment?,environment,tracking)>
<!ELEMENT comment (#PCDATA)>
<!ELEMENT environment (object+)>
<!ELEMENT object EMPTY>
<!ELEMENT tracking (source+)>
<!ELEMENT source (trackfile+)>
<!ELEMENT trackfile EMPTY>
<!ATTLIST environment width CDATA #REQUIRED>
<!ATTLIST environment height CDATA #REQUIRED>
<!ATTLIST object type CDATA #REQUIRED>
<!ATTLIST object x CDATA #REQUIRED>
<!ATTLIST object y CDATA #REQUIRED>
<!ATTLIST object width CDATA #REQUIRED>
<!ATTLIST object height CDATA #REQUIRED>
<!ATTLIST object name CDATA #IMPLIED>
<!ATTLIST source filename CDATA #REQUIRED>
<!ATTLIST source type CDATA #REQUIRED>
<!ATTLIST source config_filename CDATA #IMPLIED>
<!ATTLIST trackfile filename CDATA #REQUIRED>
<!ATTLIST trackfile units CDATA #REQUIRED>
<!ATTLIST trackfile parameter CDATA #REQUIRED>
<!ATTLIST trackfile comment CDATA #IMPLIED>
]>