Next: , Previous: , Up: Image Processing   [Contents][Index]


Filter

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-median-filter
im-median-filter-channel
im-convolve
im-convolve-channel
im-nl-means
im-nl-means-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-median-filter image w-width w-height [#:obs 'repeat]
Procedure: im-median-filter-channel channel width height w-width w-height [#:obs 'repeat]

Returns a new image or channel.

In the new image or channel, each pixel value is the ‘median’ value of neighboring entries. The pattern of neighbors is called a ‘window’, the size of which is given by w-width and w-height (see Median Filter for more information). Both w-width and w-height 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

repeat

repeat the nearest pixels

mirror

mirror the nearest pixels

wrap

wrap image around (periodic boundary conditions)

zero

out-of-bound pixel values to be 0.0

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

out-of-bound pixel values to be 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.

Procedure: im-nl-means image arg...
Procedure: im-nl-means-channel channel width height arg...

Returns a new image or channel.

The new image or new channel is the result of a non-local means denoising as described here18. The following table lists the optional keyword arguments and their default values:

Policy arguments:

#:policy-type 1

accepts 0 (ratio policy) or 1 (norm policy)

#:sigma 15.0

default to 5.0 if the policy-type is 0

#:mean-ratio 5.0

default to 0.95 if the policy-type is 0

#:variance-ratio 0.5
#:epsilon 1.0e-5

Filter arguments:

#:spatial-sigma 2.0
#:search-radius 3
#:patch-radius 1

the patch-radius can be either 1 or 2

#:mean-sigma 1.0
#:step-size 2
#:n-iteration 1

The im-nl-means-channel procedure accepts one additional optional keyword argument:

#:n-thread (- (current-processor-count) 1)

FIXME need to describe the parameters


Footnotes

(18)

P. Coupe, P. Yger, S. Prima, P. Hellier, C. Kervrann, C. Barillot. An Optimized Blockwise Non Local Means Denoising Filter for 3D Magnetic Resonance Images . IEEE Transactions on Medical Imaging, 27(4):425-441, Avril 2008.


Next: Process, Previous: Particles, Up: Image Processing   [Contents][Index]