02.08.2013 Views

Image and Video Processing Libraries in Ptolemy II by ... - CiteSeerX

Image and Video Processing Libraries in Ptolemy II by ... - CiteSeerX

Image and Video Processing Libraries in Ptolemy II by ... - CiteSeerX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

P2<br />

#comments<br />

10 10<br />

15<br />

5 0 0 5 0 0 10 10 10 0<br />

5 0 0 5 0 0 0 10 0 0<br />

5 0 0 5 0 0 0 10 0 0<br />

5 0 0 5 0 0 0 10 0 0<br />

5 5 5 5 0 0 0 10 0 0<br />

5 0 0 5 0 0 0 10 0 0<br />

5 0 0 5 0 0 0 10 0 0<br />

5 0 0 5 0 0 0 10 0 0<br />

5 0 0 5 0 0 0 10 0 0<br />

5 0 0 5 0 0 10 10 10 0<br />

Figure 3.3: A sample PGM file. The P2 specifies that it is a PGM ASC<strong>II</strong> file.<br />

To specify the file with RAW data, the magic number would be P5. Characters<br />

follow<strong>in</strong>g a pound sign are ignored. The width of the image is then specified<br />

with ASC<strong>II</strong> characters as a decimal number. This is followed <strong>by</strong> a whitespace.<br />

Then the height is specified with ASC<strong>II</strong> characters as a decimal number. This<br />

is followed <strong>by</strong> another whitespace. Then the maximum gray value is specified,<br />

aga<strong>in</strong> as a ASC<strong>II</strong> decimal. Then width times height gray values are specified<br />

<strong>by</strong> ASC<strong>II</strong> decimals separated <strong>by</strong> whitespaces. No l<strong>in</strong>e should be longer then 70<br />

characters.<br />

P3<br />

4 4<br />

15<br />

0 0 0 0 0 0 0 0 0 15 0 15<br />

0 0 0 0 15 7 0 0 0 0 0 0<br />

0 0 0 0 0 0 0 15 7 0 0 0<br />

15 0 15 0 0 0 0 0 0 0 0 0<br />

Figure 3.4: A sample PPM file. The P3 specifies that it is a PPM ASC<strong>II</strong> file.<br />

To specify the file with RAW data, the magic number would be P6. Character<br />

follow<strong>in</strong>g a pound sign are ignored. The width <strong>and</strong> height of the image are<br />

specified like a PGM file, however the value follow<strong>in</strong>g these <strong>in</strong>tegers is the maximum<br />

color value. The three values for each pixel represent red, green, <strong>and</strong> blue<br />

respectively.<br />

22

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!