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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.5.2 JA<strong>II</strong>DFT<br />

1 1 0<br />

1 0 -1<br />

0 -1 -1<br />

0 1 1<br />

-1 0 1<br />

-1 -1 0<br />

Figure 3.13: Diagonal <strong>and</strong> Backdiagonal Masks<br />

The Inverse Discrete Fourier Transform [5] transforms an image from the frequency<br />

doma<strong>in</strong> to the spatial doma<strong>in</strong>. Generally, images def<strong>in</strong>ed <strong>in</strong> the frequency<br />

doma<strong>in</strong> conta<strong>in</strong> complex data. The default sett<strong>in</strong>g is to attempt to transform<br />

this data <strong>in</strong>to a real image. The JA<strong>II</strong>DFT actor can also transform the data <strong>in</strong>to<br />

complex data <strong>by</strong> switch<strong>in</strong>g the dataNature parameter to ComplexToComplex.<br />

For a s<strong>in</strong>gle-b<strong>and</strong>ed image, the Inverse Discrete Fourier Transform is def<strong>in</strong>ed to<br />

be:<br />

⎧<br />

⎪⎨<br />

x(n1, n2) =<br />

⎪⎩<br />

1<br />

N1−1 <br />

N2−1 <br />

N1N2<br />

k1=0 k2=0<br />

X(k1, k2)e j(2π/N1)k1n1 e j(2π/N2)k2n2 , for 0 ≤ n1 ≤ N1 − 1,<br />

0 ≤ n2 ≤ N2 − 1<br />

0, otherwise<br />

The JA<strong>II</strong>DFT actor uses a 2 dimensional Inverse Fast Fourier Transform<br />

(IFFT). This means that each dimension is padded with zeros up to the next<br />

power of two, if it is not a power of two itself. Note that the JAI<strong>Image</strong>Token at<br />

the output of the JAIDFT encapsulates a RenderedOp that conta<strong>in</strong>s an image<br />

with a data type of double. The JA<strong>II</strong>DFT preserves the data type of the <strong>in</strong>put,<br />

therefore, at the end of a DFT-IDFT cha<strong>in</strong>, the JAI<strong>Image</strong>Token at the output<br />

encapsulates an image with data type double.<br />

Currently, the only two actors to display images are the <strong>Image</strong>Display <strong>and</strong><br />

Monitor<strong>Image</strong> actors. When asAWT<strong>Image</strong>() is called on a JAI<strong>Image</strong>Token, if<br />

the data type of the encapsulated is anyth<strong>in</strong>g else but <strong>by</strong>te, the image will not<br />

render properly.<br />

The JAIDataConvert actor can be used to convert the <strong>in</strong>ternal data type to<br />

<strong>by</strong>te.<br />

40

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

Saved successfully!

Ooh no, something went wrong!