IMCONV(1)

NAME
imconv - 2D convolution

SYNOPSIS
Outm = imconv(Img, mask [, form])

PARAMETERS

Img M x N Grayscale (intensity) image in any range.

mask
    n x n matrix, n odd. This is the spatial convolution kernel.

Outm
    The convolved matrix (grayscale image).

form
    determines the size of Outm. It assumes be one of the following values:
    'same'
        Outm has the same size as the original image, M x N. The image is assumed to be 0 outside its bounds.
    'full'
        Outm contains the full convolution, (M+n-1) x (N+n-1). The image is assumed to be 0 outside its bounds.
    'valid'
        Outm contains only the results of the convolution which have been computed within the bounds of Img. Outm will be (M-n+1) x (N-n+1).

DESCRIPTION
Function imconv performs 2D spatial convolution of a grayscale image and a mask.

edge(Img) Detects edges in Img, using the sobel gradient estimator, 0.5 threshold level and in both horizontal and vertical directions.

The other parameters are optional and non-positional. That is, they may be passed to the function by their name. The following example illustrates this.

EXAMPLE
initial_dir = PWD;
chdir (SIPDIR + 'examples');
// Detect horizontal lines
h = [ -1  -1 -1
       2   2  2
      -1  -1 -1]
img = imread('gra.jpg');
res = imconv(img,h);
imshow(res,[]);
// Detect diagonal lines
d = [ -1  -1  2
      -1   2 -1
       2  -1 -1]
res = imconv(img,d);
imshow(res,[]);
chdir(initial_dir);

AUTHORS
Ricardo Fabbri <rfabbri@if.sc.usp.br>, with help from Scilab Group <Scilab@inria.fr>

AVAILABILITY
The latest version of the Scilab Image Processing toolbox can be found at

    http://cyvision.if.sc.usp.br/~rfabbri/sip/

SEE ALSO
mkfilter, edge