A simple image processing demo

When Mathematica 7 first came out about 3 years ago, I was very excited about the new image processing library that was introduced and I thought I should be able to do something interesting with it. I thought it would be an educational exercise to apply image filters to one of the three color channels and see how the result looked like. The idea was very simple. The spatial resolution of the S signal (or, the “blue channel”) from the retina is lower than that of the other two cones, because the S-cones in the retina are sparsely distributed. But the three color channels in digital cameras are evenly distributed, which means that the spatial resolution of the blue channel in digital photos is too high for human vision. It follows that we should be able to blur the blue channel without changing the image too much.

It only took one line of code in Mathematica to test this idea. The first image of each row in the following figure is a 744×1000 image scaled down from a photo I took with a cheap compact camera (capturing some very unhappy street performers in a shopping mall). The second shows the original imaged filtered by a gaussian filter of 40-pixel radius and the third by a gaussian filter of 100-pixel radius. In the first row, the filters were applied to the red channel; but in the second row, they were applied to the green channel. In the third row, the blue channel. (Click to see a larger image)

 

Aha! The theory was confirmed!  You can clearly see that the filters have major effect on the image quality of the first and the second row, but not so much on the third.

Of course, this is a very rough demo. The blue channel of a digital photo only roughly corresponds to the S signal from the retina. To do it right I’d have to use the correct spectral sensitivity functions of the cones and a lot can be improved in spatial sampling. I am also assuming that my digital camera didn’t already remove the high frequency informations in the blue channel. But still, it was a fun exercise.

Advertisements

~ by hhyu on January 8, 2011.

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 )

Google+ photo

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

Connecting to %s

 
%d bloggers like this: