Convolution Matrix and Image Filters
July 27, 2011
I’ve been wondering how to apply a convolution matrix to an image; most tutorials on the web simply stated apply the convolution matrix to the individual points of the image, but what exactly constitutes a point? Is it the value of the pixel (32bit), or the individual rgba channels (8 bits each) of the image?
Turns out its the latter. Apply the convolution matrix to each channel of the image and you’ll get the filtered image. Don’t forget to clamp down the values to 0 and 255 or you’ll get a seriously colour messed up image.
Guess I should have realised but image processing has a seriously steep learning curve.
Advertisement