hip-1.0.0.0: Haskell Image Processing (HIP) Library.

Graphics.Image.Processing.Complex

Synopsis

# Rectangular form

(!+!) :: (Array arr cs e, Array arr cs (Complex e)) => Image arr cs e -> Image arr cs e -> Image arr cs (Complex e) infix 6 Source

Constrcut a complex image from two images representing real and imaginary parts.

````>>> ````frog <- readImageRGB "images/frog.jpg"
````>>> ````frog !+! 0
```<Image VectorUnboxed RGB (Complex Double): 200x320>
`>>> ````frog !+! frog
```<Image VectorUnboxed RGB (Complex Double): 200x320>
```

realPart' :: (Array arr cs e, Array arr cs (Complex e), RealFloat e) => Image arr cs (Complex e) -> Image arr cs e Source

Extracts the real part of a complex image.

imagPart' :: (Array arr cs e, Array arr cs (Complex e), RealFloat e) => Image arr cs (Complex e) -> Image arr cs e Source

Extracts the imaginary part of a complex image.

# Polar form

mkPolar' :: (Array arr cs e, Array arr cs (Complex e), RealFloat e) => Image arr cs e -> Image arr cs e -> Image arr cs (Complex e) Source

Form a complex image from polar components of magnitude and phase.

cis' :: (Array arr cs e, Array arr cs (Complex e), RealFloat e) => Image arr cs e -> Image arr cs (Complex e) Source

`cis' t` is a complex image with magnitude 1 and phase t (modulo `2*pi`).

polar' :: (Array arr cs e, Array arr cs (Complex e), RealFloat e) => Image arr cs (Complex e) -> (Image arr cs e, Image arr cs e) Source

The function `polar'` takes a complex image and returns a (magnitude, phase) pair of images in canonical form: the magnitude is nonnegative, and the phase in the range `(-pi, pi]`; if the magnitude is zero, then so is the phase.

magnitude' :: (Array arr cs e, Array arr cs (Complex e), RealFloat e) => Image arr cs (Complex e) -> Image arr cs e Source

The nonnegative magnitude of a complex image.

phase' :: (Array arr cs e, Array arr cs (Complex e), RealFloat e) => Image arr cs (Complex e) -> Image arr cs e Source

The phase of a complex image, in the range `(-pi, pi]`. If the magnitude is zero, then so is the phase.

# Conjugate

conjugate' :: (Array arr cs e, Array arr cs (Complex e), RealFloat e) => Image arr cs (Complex e) -> Image arr cs (Complex e) Source

The conjugate of a complex image.

# Processing

Arguments

 :: (ManifestArray arr cs e, RealFloat e) => (Int, Int) Dimensions of the filter. Both `m` and `n` have to be powers of `2`, i.e. `m == 2^k`, where `k` is some integer. -> ((Int, Int) -> Pixel cs e) -> Image arr cs e

Make a filter by using a function that works around a regular `(x, y)` coordinate system.

Arguments

 :: (ManifestArray arr cs e, ManifestArray arr cs (Complex e), RealFloat e) => Image arr cs e Source image. -> Image arr cs e Filter. -> Image arr cs e

Apply a filter to an image created by `makeFilter`.

## Fourier Transform

fft :: (ManifestArray arr cs (Complex e), Num e, RealFloat e) => Image arr cs (Complex e) -> Image arr cs (Complex e) Source

Fast Fourier Transform

ifft :: (ManifestArray arr cs (Complex e), Num e, RealFloat e) => Image arr cs (Complex e) -> Image arr cs (Complex e) Source

Inverse Fast Fourier Transform