Core Concept

Convolution

Change the kernel, change the filter

Definition
Convolution makes an image in which each output pixel is a weighted sum of nearby input pixels. The weights live in a small grid called the kernel, typically 3×3, 5×5 or 7×7. Center the kernel on an input pixel, multiply each weight by the pixel beneath it, and sum the products to get one output pixel. Slide one pixel over and repeat until every input pixel is covered.
Supporting
H&EDSPTCH
Video · Supporting
The kernel is the filter
Same operation, different weights
Kernel size is window size
Bigger kernel, broader smoothing
Sum-of-weights = brightness scaling
Don't accidentally darken your image

What happens at the edges

Near the image boundary, part of the kernel hangs off the edge of the input. There is no value there to multiply by, so one has to be invented. The common choices are to pad with zeros, which darkens the edges, to repeat the boundary pixel, or to reflect the image. Each choice gives slightly different values in the first few pixels of the output.

In StrataQuest, most filters have no border setting of their own. The Basic Operations Module sets it once, on its Options tab: Border Input borrows a border of Border Size pixels from neighboring fields of view, and Border Option chooses Fill with black, Fill with white, Mirror, or Copy last pixels. Only Bilateral filter and Sobel filter (cross) carry their own Border type (default Wrap Border) and Border Value (default 0). If the corners of your output look slightly off, the border handling is the likely reason.

The morphological operationsLoading... meet the same edge question with their structuring elementLoading..., applied to binary masks instead of grayscale intensities.

Share This Term
Term Connections