Image Processing

Created a pixelating and blurring algorithm in Python and C.

cropped image
Fig 1: Original Image (Cropped)
pixelated image
Fig 2: Pixelated Image

The algorithm works by sliding a window over the input image and calculating the average value in that window and then setting all pixels in that window equal to the average value. This is done for each channel (B, G, R). This was done in Python using NumPy and OpenCV, as well as other libraries like scikit-image.

web-based radio
Fig 3: Input Image
web-based radio
Fig 4: Blurred Image

The blurring algorithm was written in C. I had an input image of type PGM where I had to write my own read and write routines to read the PGM file and then write to a PGM file. I also had separate routines to actually perform the blurring algorithm. I wrote a Makefile to make my life easier. The algorithm considers every 2x2 patch in the image and averages those pixels to create a smoothing average in the image as you can see in Figure 4.