repa-algorithms-3.4.1.4: Algorithms using the Repa array library.
Safe HaskellNone
LanguageHaskell2010

Data.Array.Repa.Algorithms.Convolve

Description

Generic stencil based convolutions.

If your stencil fits within a 7x7 tile and is known at compile-time then using the built-in stencil support provided by the main Repa package will be 5-10x faster.

If you have a larger stencil, the coefficients are not statically known, or need more complex boundary handling than provided by the built-in functions, then use this version instead.

Synopsis

Arbitrary boundary handling

convolveP Source #

Arguments

:: (Num a, Unbox a, Monad m) 
=> (DIM2 -> a)

Function to get border elements when the stencil does not apply.

-> Array U DIM2 a

Stencil to use in the convolution.

-> Array U DIM2 a

Input image.

-> m (Array U DIM2 a) 

Image-kernel convolution, which takes a function specifying what value to return when the kernel doesn't apply.

Specialised boundary handling

type GetOut a Source #

Arguments

 = (DIM2 -> a)

The original get function.

-> DIM2

The shape of the image.

-> DIM2

Index of element we were trying to get.

-> a 

A function that gets out of range elements from an image.

outAs :: a -> GetOut a Source #

Use the provided value for every out-of-range element.

outClamp :: GetOut a Source #

If the requested element is out of range use the closest one from the real image.

convolveOutP Source #

Arguments

:: (Num a, Unbox a, Monad m) 
=> GetOut a

How to handle out-of-range elements.

-> Array U DIM2 a

Stencil to use in the convolution.

-> Array U DIM2 a

Input image.

-> m (Array U DIM2 a) 

Image-kernel convolution, which takes a function specifying what value to use for out-of-range elements.