Kernel Package


Package Name

DvmKernel

Description

The Dalì kernel data type allows the user to apply a convolution kernel to a ByteImage.The kernel's values are stored in an array of integers, and the parameters offset and divfactor scale and shift the range of the kernel's values. When a convolution kernel is applied to a ByteImage, each pixel in the output image is calculated by taking each value in the kernel's table and multiplying it with the associated pixel value in the source image. For example if you were to apply the following 3*3 kernel { {1,0,0}, {0,1,0}, {1,1,1}} with a divfactor of   0.1 and a offset of 100 to a source image then

result(1,1) = (1*src(1,1) + 0*src(1,2) + 1*src(1,3) + 
               0*src(2,1) + 1*src(2,2) + 1*src(2,3)  +
               1*src(3,1) + 1*src(3,2) + 1*src(3,3))/10 + 100. 

where result(1,1) is the pixel value of the resultant image at row 1, column 1 and src(2,3) is the pixel value of the source image at row 2, column 3.

The Dali kernel package support kernel operations such as create and free (C| Tcl), and apply and compose. (C| Tcl). Initializing a Kernel in Tcl requires using kernel_set while in C it can be done using built-in macros or by directly writing to the C Kernel data structure.

Detailed Specification

Tcl specification
C API specification

Dependencies

Needs DvmBasic

Example

Using a Kernel to blur a image [ tcl | C ]


Last Updated :

Copyright © 1997-1998 by Cornell University. See the file license.txt for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.