λ
home posts study uses projects

Image Kernel

Jul 18, 2024

image-processing

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.

Examples

Example filter that makes an image more “sharp”:

[
	[0, -1, 0],
  	[-1, 5,-1],
  	[0, -1, 0],
]

cheems.jpg|500cheems_edge.jpg|500

How it works

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 750710_QS1ArBEUJjjySXhE.png|800 image.png|800 The stride amount defines the step size when convolving across the input image. A higher stride will result in a smaller output.

References

LλBS

All systems up and running

Commit c0daef5, deployed on Oct 01, 2024.