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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.