Do not be afraid, "convolution" is actually very simple (under)

 
 

CSDN articles from my blog of the same name, welcome attention ~ the end the scan code

 

definition

Based on an article popularized example, we learned from the basic concept of convolution, then the more restrictive definition of what is it?

Mathematically speaking, just a convolution operation, many have not studied for signal processing, automatic control of a variety of professional students who can not understand the terms, then we continue. Convolution is essentially a function of the binary function rolled into yuan, commonly known as dimension reduction blow.

1. how volume?

Considering the functions f and g should be on an equal footing, or the variables x and y should be equal status, a desirable way is a straight line

 

Rolled up

2. The volume of what's the use?

It can be used for multi-digit multiplication, for example:

 

 

Sequence (14,34,14,4) Note that the second parentheses on the right of the equal sign coefficient of each constituent, in fact, the sequence (2,4) and (7,3,1) convolution. When the multiplier is not doing so it seemed a bit boring, but very long to calculate the product of two numbers long, then this treatment can come in handy, because you can use a Fast Fourier Transform (FFT) to obtain convolution , faster than the example in the hard ride and more

There is a less rigorous understanding of:

 

X is a "group", a is an expansion coefficient in this group. On the basis expansion coefficients of the two polynomial product of two polynomials is the convolution coefficients are each deployed on the substrate.

a different frequency corresponding to exp (IKT) , which corresponds to the Fourier transform coefficients. Nature is equal to the product of the Fourier transform of the convolution of the Fourier transform.

 

Convolution kernel (involving derivation process can be skipped)

 

First we have to understand such a concept: the inner product integration, the three projection is actually a meaning from a certain point of view.

Define a set of vectors

Another set of vectors

 
 

Then the inner product can be expressed as:

 

Look, this is the inner product that is also accumulating (points). Is to be understood that the concept of a projection vector as a set of projection on a base vector b, the coordinates of

 

This is a point in three-axis projection coordinates 3D Euclidean space is a reason.

In this way, we can take a look at the way the Fourier transform what to do:

 

Reintroducing a perfect formula, Euler's formula:

 

从Fourier的定义式可以看出是对f(t)和exp(-jwt)相乘后在无穷域上对其进行积分,那么其实就是将f(t)投影在exp(-jwt)上,如果不理解是什么鬼就变换为两个正交的三角函数(欧拉公式就在这里起作用~)

所以这就明朗了:Fourier把f(t)投影到了两个为正交关系的正弦和余弦空间中。也可以从周期信号的Fourier级数分解表达式更容易看出这个投影关系。

这个投影有点奇怪,它在投影之前先把g(T)做了一个反对称,然后再投影。对应到前面推导的系统卷积表达式:

 

相当于在投影之前,先把输入信号r(t)在时间轴上翻转了180°,然后与系统f(t)进行投影。投影的概念我们可以很好理解,无论是向量内积运算相当于线投影,或者空间的一个多面体在三维空间平面上的投影面,这种投影运算就相当于一种重合面积。

如果从这个角度去看输入、系统和输出三者之间的关系,那么就可以从图形角度去理解为什么一个一阶系统在阶跃响应输出下是一条单调上升的曲线了。这里用一张wikipedia里关于卷积的一张图形化解释,想要了解更多的同学可以自行查阅相关教材

(感谢知乎学霸王尼莫的帮助)

 

 
 

卷积的应用

 

用一个模板和一幅图像进行卷积,对于图像上的一个点,让模板的原点和该点重合,然后模板上的点和图像上对应的点相乘,然后各点的积相加,就得到该点的卷积值。对图像上的每个点都这样处理。

由于多数模板都对称,所以模板不旋转。卷积是一种积分运算,用来求两个曲线重叠区域面积。可以看作加权求和,可以用来消除噪声、特征增强。把一个点的像素值用它周围的点的像素值的加权平均代替。

 

卷积也可以理解为一种线性运算,图像处理中常见的mask运算都是卷积,广泛应用于图像滤波。 卷积关系最重要的一种情况,就是在信号与线性系统或数字信号处理中的卷积定理。

利用该定理,可以将时间域或空间域中的卷积运算等价为频率域的相乘运算,从而利用FFT等快速算法,实现有效的计算,节省运算代价。

下面是来自sselssbh博客的一个例子,非常形象的解释了卷积在图像领域的作用

有这么一副图像,可以看到,图像上有很多噪点: 

 

高频信号,就好像平地耸立的山峰: 

 

看起来很显眼。平滑这座山峰的办法之一就是,把山峰刨掉一些土,填到山峰周围去。用数学的话来说,就是把山峰周围的高度平滑以下得到

 

卷积可以实现这个平滑算法。有噪点的原图,可以把它转为一个矩阵: 

 

然后用下面这个平均矩阵(说明下,原图的处理实际上用的是正态分布矩阵,这里为了简单,就用了算术平均矩阵)来平滑图像:

 

记得刚才说过的算法,把高频信号与周围的数值平均一下就可以平滑山峰。比如我要平滑a1,1 点,就在矩阵中,取出a1,1点附近的点组成矩阵 f ,和 g 进行卷积计算后,再填回去 

 

要注意一点,为了运用卷积, g虽然和f同维度,但下标有点不一样: 

 

写成卷积公式就是:

 

这样相当于实现了 g 这个矩阵在原来图像上的划动(准确来说,下面这个二维卷积的例子把 g 矩阵旋转了180∘ )

 

2维卷积

在图像识别中,2 维卷积是一个最常用,也是相当简单的操作:从卷积核开始,这是一个小的权值矩阵。这个卷积核在 2 维输入数据上「滑动」,对当前输入的部分元素进行矩阵乘法,然后将结果汇为单个输出像素。

立体的角度来看,二维层面的卷积就是移动和映射(自上而下)

 

而从平面展开则是如下的过程,每一个蓝色9宫格的数字都对应了一个绿色各自的数字,这个对应过程就是卷积的具体计算。

 

再比如做馒头

楼下早点铺子生意太好了,供不应求,就买了一台机器,不断的生产馒头。 

假设馒头的生产速度是 f(t) ,那么一天后生产出来的馒头总量为: 

 

馒头生产出来之后,就会慢慢腐败,假设腐败函数为 g(t) ,比如,10个馒头,24小时会腐败:

 

想想就知道,第一个小时生产出来的馒头,一天后会经历24小时的腐败,第二个小时生产出来的馒头,一天后会经历23小时的腐败。 如此,我们可以知道,一天后,馒头总共腐败了: 

 

 
 

 

 

 

Guess you like

Origin www.cnblogs.com/y1ran/p/12119041.html