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

Copyright(c) Alexey Kuleshevich 2016
LicenseBSD3
MaintainerAlexey Kuleshevich <lehins@yandex.ru>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Graphics.Image.Processing.Complex

Contents

Description

 

Synopsis

Rectangular form

(!+!) :: (Applicative (Pixel cs), 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 #

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

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

realPartI :: (Applicative (Pixel cs), 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.

imagPartI :: (Applicative (Pixel cs), 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

mkPolarI :: (Applicative (Pixel cs), 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.

cisI :: (Applicative (Pixel cs), Array arr cs e, Array arr cs (Complex e), RealFloat e) => Image arr cs e -> Image arr cs (Complex e) Source #

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

polarI :: (Applicative (Pixel cs), 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.

magnitudeI :: (Applicative (Pixel cs), 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.

phaseI :: (Applicative (Pixel cs), 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

conjugateI :: (Applicative (Pixel cs), 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

makeFilter Source #

Arguments

:: (Array 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.

applyFilter Source #

Arguments

:: (Applicative (Pixel cs), Array arr cs e, Array arr cs (Complex e), Fractional (Pixel cs (Complex e)), Floating (Pixel cs 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 :: (Applicative (Pixel cs), Array arr cs (Complex e), Fractional (Pixel cs (Complex e)), Floating (Pixel cs e), RealFloat e) => Image arr cs (Complex e) -> Image arr cs (Complex e) Source #

Fast Fourier Transform

ifft :: (Applicative (Pixel cs), Array arr cs (Complex e), Fractional (Pixel cs (Complex e)), Floating (Pixel cs e), RealFloat e) => Image arr cs (Complex e) -> Image arr cs (Complex e) Source #

Inverse Fast Fourier Transform