Syntax of the COS526 Image Configuration File Format

For this project we define a rudimentary file format for specifying camera paramers, rectangular surfaces, and sets of images. Each line begins with keyword and goes on until the end of the line. All values are assumed to be reals unless indicated.
 


dataset cos526

This command is a simple header indicating the format of the file. It should be the first line of every file.
 


intrinsics_matrix m00 m01 m02 m10 m11 m12 m20 m21 m22

This command specifies an intrinsics camera matrix, where m00 and m11 specify the camera focal lengths (in pixels) for x and y directions, and m03 and m13 specify the camera center in x and y, respectively.
 


depth_directory directory_name

This command specifies the directory where depth images can be found. The default is the current directory if this line does not appear in the file. This command must appear before any "image" commands in the same file.
 


image_directory directory_name

This command specifies the directory where image images can be found. The default is the current directory if this line does not appear in the file. This command must appear before any "image" commands in the same file.
 


texture_directory directory_name

This command specifies the directory where texture images can be found. The default is the current directory if this line does not appear in the file. This command must appear before any "rectangle" commands in the same file.
 


image depth_filename color_filename m00 m01 m02 m03 m10 m11 m12 m13 m20 m21 m22 m23 m30 m31 m32 m33

This command defines an image, where the depth filename should be a 16-bit png file in the previously specified "depth_directory," the color_filename should be a .jpg file in the previously specified "color_directory", and the following extrinsics matrix has 16 real values representing a 4x4 matrix in row-major order. The extrinsics matrix pre-multiplies points in a right-handed coordinate system -- i.e., m[0][3] m[1][3] m[2][3] specifies the translation. The matrix translates and rotates a canonical coordinate camera frame looking towards -Z and with Y up and X right to world coordinates.
 


rectangle texture_filename resolution cx cy cz nx ny nz ux uy uz r1 r2

This command defines a rectangle centered at (cx,cy,cz) in world coordinates, with normal (nx,ny,nz), inplane axis as (ux,uy,uz), and extents r1 and r2. r1 specifies 1/2 of the width of the rectangle (distance from the center to the edge in the axis perpendicular to both the normal and specified inplane axis). r2 specifies 1/2 of the height of the rectangle (distance from the center to the edge in the specified inplane axis). The rectangle will be used to define a textured surface with the specified resolution (in meters). The surface's texture file will be read/written to/from the given texture_filename (or "-" if none).