An image kernel (also known as a filter) is a small matrix that is used to apply filters to an image, e.g edge detection, sharpening, blurring, etc. They are typically square arrays that consist of numbers which let you compute a given pixel value using only the surrounding neighbours’ values.
Example filter that makes an image more “sharp”:
[
[0, -1, 0],
[-1, 5,-1],
[0, -1, 0],
]
This is achieved by walking / striding / convolving over the source image and building each new pixel value by multiplying the respective values and summing them up The stride amount defines the step size when convolving across the input image. A higher stride will result in a smaller output.