![]() |
Department of Computer Science University of Otago Dunedin, New Zealand |
|||||||
|
|
PCM/PFM Format
Back to Optical Flow Page The optical flow maps produced by either the ray-tracer of TCL/Tk tool are in PCM format. (`Portable Complex map'- this is not an official format!). The format of these files is very similar to PPM/PGM/PBM files: each file has a text header describing the dimensions of the image, followed by the data (in binary). The format of the text header is as follows: PC
The flow data is written in rows - just like a PPM. Each flow vector is a pair of 4-byte floats, the first is the x component, the second is the y component. PFM files are used to represent depth maps in our system (`Portable Float Maps' - again, not an official format). The format of these files is very similar: a text header, followed by an array of floats. The format of the text header is PF
Source Code The .pcm files can be converted into a visual representation (`needle maps') with the flotoneedle program. This program takes a .pcm file and writes a .ppm file (most graphics packages can read these). Download the RedHat Linux 5.2 binary here, or the C++ source code here. If you want to process the .pcm files yourself, download the source for a simple C++ class from here. This code will also attempt to read and write floats properly regardless of what `Endian' your machine is (all of the sequences on this site were produced on Intel based machines, so the floats will have a Little Endian byte ordering - this is different from Sun, SGI and Macintosh).
|
|||||||
|
Maintained by Brendan
McCane
Last Modified: 25st
August 1999
|
|