4
$\begingroup$

According to Wikipedia:

In image processing, a kernel, convolution matrix, or mask is a small matrix.

I am wondering, why the matrix is called a kernel? Does it has anything to do with kernel concepts in mathematics (e.g., as those mentioned in this post)?

$\endgroup$
  • 1
    $\begingroup$ I don't think there's a strict mathematical connection here. In everyday English, kernel is just the core of a fruit – just as the kernel is the core of a e.g. Gaussian blur filter. $\endgroup$ – Marcus Müller Sep 7 '17 at 8:11
  • $\begingroup$ Then can we also called a correlation matrix as kernel? $\endgroup$ – engr May 14 at 18:41
4
$\begingroup$

In general, a discrete (1D) transform can be defined as:

$$ y[k] = \sum_n \phi[k,n] x[n] $$

where the input function $x[n]$ is mapped into the output function $y[k]$, by the kernel, $\phi[k,n]$, of the transform. For example, the kernel for DFT (discrete Fourier transform) is $\phi[k,n] = e^{-j \frac{2\pi}{N}kn}$.

In essence the kernel acts on the input and produces the output by modifying it, like in the sum above. Therefore the kernel defines the character of the mapping.

Programmatically, a kernel is the core portion of a function which accepts a sequence as its input and returns a computed output whan called.

The input-output relationship for a discrete-space 2D LTI system (typically an image filter) is expressed as a convolution sum :

$$ y[n_1,n_2] = \sum_{k_1=-\infty}^{\infty} \sum_{k_2=-\infty}^{\infty} h[n_1-k_1, n_2-k_2]x[k_1,k_2] $$

The convolution operation is similar to the transform considered above with its kernel being the impulse response $h[n_1, n_2]$ of the LSI system.

For a discrete-time 2D LSI system whose impulse reponse $h[n_1, n_2]$ has a finite domain of support; i.e, finite size, then programmatically the system can be represented as a matrix as well. And the convolution operation than is performed by calling a function which contains the impulse response matrix as its kernel and producing the output pixels per call. And here is the most typical meaning of a (filter) kernel in image processing.

Furthermore, a matrix called mask operates on a block of pixels (sample wise) on the image being processed. They are more of a programming concept than of signal processing, but also find applications such as windowing or frequency domain filtering. Masks find extensive usage for image processing effects. Their operating matrix can also be called as a kernel.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks for your reply, Fat32. Yes I was refering to convolution matrix in image processing..AFAIK, in the general integral transformation scenarios as you mentioned (FT or LT), what you called a "kernel" is known as an othorgonal basis, that the transformation projects/correlates the original function to the new basis, and there is no need to "flip" the basis, as it would required for kernels in convolution; In vector space, the kernel (of a linear transformation) is its null space, while the transformation is usually represented as a matrix which is called its skeleton... $\endgroup$ – bruin Sep 8 '17 at 7:38
  • 1
    $\begingroup$ a kernel has nothing to do with the base vectors of an orthogonal / orthonormal basis. What you mention is an inner product of a given function with memebers of the basis so as to find the coefficients of decomposition of the signal into its base vectors. A transform in general maps a function into another function by the kernel. Nevertheless the concept of a kernel is a general one and is not bound to any special transform or operator in general. Finally, the Laplace kernel $e^{st}$ does not consitutde an orthogonal basis for example. $\endgroup$ – Fat32 Sep 8 '17 at 8:30
  • $\begingroup$ Ok, thanks... I guess "A transform in general maps a function into another function by the kernel. Nevertheless the concept of a kernel is a general one and is not bound to any special transform or operator in general" addressed my original question directly. As the kernel concept discussed here is in its very general sense, now I tend to agree with what Marcus commented, that "I don't think there's a strict mathematical connection here". Thanks again. $\endgroup$ – bruin Sep 8 '17 at 8:53
  • $\begingroup$ Also thanks for pointing out that "Laplace kernel $e^{st}$ does not consitutde an orthogonal basis", which I was not aware of... $\endgroup$ – bruin Sep 8 '17 at 9:01
  • 2
    $\begingroup$ Later today I also took a look of Integral Transform on wikipedia, although I am not able digest most of details at the moment, I am a bit more convinced (or tend to think of) that the term "kernel" in convolution may have some connection with integral transformations in general, as you explained :) $\endgroup$ – bruin Sep 8 '17 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.