Monday, May 10, 2010

Image Processing

I always wanted to learn Image Processing as that is very base of Post processing effects such as motion blur, High Dynamic Range Lighting, Edge Detection & even Post Process glow & Screen Space Ambient Occlusion. I had a very hard time when i started coding directly for these Post Process effects since my very base in Image Processing was not to the mark. So, I decided to spend some time dealing with my weakness, Image Processing.

I studied various Kernels responsible for making Image Processing possible. Basically, roots of Image processing lie in Signal Processing. We use math base of Convolution Theory to mix to discrete or continuous signals to produce a new signals. With respect to Image Processing, every pixel is treated as Discrete signal & is convolved with Impulse Signal to produce the desired result. More on this Math fundamentals can be easily googled up & digested.

Here, I am posting Base Image along with Processed Image with Respective Filter Kernel applied over it. For simplicity sake, I have considered only Black and white images but algorithm can be easily applied to color images by applying it over individual channel & then merging to produce the final color.

Base Image :

1. Emboss Kernel :

float Kernel[9] = { 0,0,0,0,1,0,0,0,-1}

2. Sharpening Kernel :

float Kernel[9] = { 0,-1,0,-1,5,-1,0,-1,0 };

3. Edge Detection Kernel :

float Kernel[9] = { -1,-1,-1,-1,8,-1,-1,-1,-1 }

Incoming ... Gauss Kernel for blurring, Image tone Processing ... stay tuned :)

No comments: