三个关键词:1、kernelSize——卷积核大小2、padding——边缘扩充3、step——卷积核移动步长
卷积核会按步长遍历图像,把卷积核框住的像素进行卷积(对应像素相乘求和)得到1个中心像素值(9个像素用1个像素代表)。
如果遍历后图像尺寸不变,那么步长取1。
为了使卷积核的中心可以遍历边缘的像素,所以通过padding扩充原图。
【巧记】卷积就是把卷积核范围内的像素变成中心一个像素。
公式:(图像尺寸+padding尺寸-卷积核尺寸)/步长+1