> For the complete documentation index, see [llms.txt](https://aadv1k.gitbook.io/computer-vision-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aadv1k.gitbook.io/computer-vision-guide/convolutions-and-filters.md).

# Convolutions and Filters

## What is a Convolution?

To better understand all the sections which follow, Let's understand some of the jargon present within this space; A **Convolution** is a function which takes in an image and an **Area** let's call this `N`

`N` refers to what is known as a **Kernel size** in context of CV we perform modifications to the pixels across an area or the Kernel, think of it as a stencil -- you place it on a 2D list of pixels and do some calculation on whatever pixels are contained within this stencil, this would mean that a kernel of dimensions 3x3 would encapsulate the current pixel, and eight other neighboring pixels. Rinse and repeat for every pixel within the image and you've got yourself a Convolution. Here is a visualization of what a kernel is.

<div><figure><img src="https://1119901190-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmtkBruvWiL80eAdJOUJG%2Fuploads%2FeS1Cs8NkOEAwaMrDa9nt%2Fkernel-2x2.png?alt=media&amp;token=ea195faf-47d8-41fc-900e-d2b9a9c99287" alt=""><figcaption><p>Kernel 2x2</p></figcaption></figure> <figure><img src="https://1119901190-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmtkBruvWiL80eAdJOUJG%2Fuploads%2FDhgoXDxHJRZRdg4bg9dG%2Fkernel-3x3.png?alt=media&amp;token=ec4ac85e-142a-4e0d-bee0-f291a49ec305" alt=""><figcaption><p>Kernel 3x3</p></figcaption></figure></div>

> **Note** I will use pixels and array of integers interchangeably, when I say pixel it always implies it encapsulates three integers for RGB (for most cases)

The terms **filter** and **mask** can also be used interchangeably with convolution functions. You may see me do this in the modules that follow.
