Next: , Previous: , Up: Guile-CV   [Contents][Index]


3.2.6 Filters

The Guile-CV procedures and methods to filter images.

Procedures

im-gaussian-blur
im-gaussian-blur-channel
im-gaussian-gradient
im-gaussian-gradient-channel
im-gaussian-sharp
im-gaussian-sharp-channel
im-sharpen
im-sharpen-channel
im-convolve
im-convolve-channel
Procedure: im-gaussian-blur image sigma
Procedure: im-gaussian-blur-channel channel width height sigma

Returns a new image or channel.

The new image or new channel is the result of the computation of the Gaussian blurring, also known as the Gaussian smoothing, by means of a convolution of image or channel with a 2D Gaussian function, where sigma is the standard deviation of the Gaussian distribution.

Procedure: im-gaussian-gradient image sigma
Procedure: im-gaussian-gradient-channel channel width height sigma

Returns a new image or channel.

The new image or new channel is the result of the computation of the strength of the first order partial derivatives by means of a convolution of image or channel with the first order derivative of a 2D Gaussian function, where sigma is the standard deviation of the Gaussian distribution.

Procedure: im-gaussian-sharp image factor scale
Procedure: im-gaussian-sharp-channel channel width height factor scale

Returns a new image or channel.

The new image or new channel is the result of the computation of the Gaussian sharpening: the procedure does (a) perform a Gaussian smoothing at the given scale to create a temporary image smooth and (b) blends image and smooth according to the formula (- (* (+ factor 1) image) (* smooth factor)).

Procedure: im-sharpen image factor
Procedure: im-sharpen-channel channel width height factor

Returns a new image or channel.

This procedure performs a ‘simple sharpening’ operation on image. It actually calls im-convolve with the following kernel:

            -1/16  -1/8  -1/16      0  0  0
( * factor  -1/8    3/4  -1/8  ) +  0  1  0
            -1/16  -1/8  -1/16      0  0  0

and uses mirror as the ‘out of bound strategy’.

Procedure: im-convolve image kernel [#:obs 'repeat]
Procedure: im-convolve-channel channel width height kernel k-width k-height [#:obs 'repeat]

Returns a new image or channel.

The new image or new channel is the result of the convolution of image using kernel. The kernel k-width and k-height values can be different, but they must be odd numbers, inferior to width and height respectively.

The optional keyword argument #:obs determines the ‘out-of-bound strategy’. Valid #:obs symbols are:

avoid

do not operate on pixels upon which (centering) the kernel does not fit in the image

clip

clip the kernel when operating on pixels upon which (centering) the kernel does not fit in the image (this is only useful if the kernel is >= 0 everywhere)

repeat

repeat the nearest pixels

mirror

mirror the nearest pixels

wrap

wrap image around (periodic boundary conditions)

zero

assume out-of-bound pixel values is 0.0

Kernel data structure, accessors, procedures and predefined kernels are all described in this node of the Guile-CV manual: Kernel Structure and Accessors.


Next: , Previous: , Up: Guile-CV   [Contents][Index]