<< back to home || created with weditor
 
Project 1 - Grain Removal
 
Download the Program - Note that grain remover is a C# application. In you get an error when trying to start it, you will probably need to install dotnetfx.exe (the .NET runtime). You can also download the runtime from Microsoft here.
 
Abstract
 
Rather than doing blurring for my first project (which I've already done in graphics class), I decided to do something more interesting.... grain removal to be specific. Anyone who has ever taking a picture with a digital camera (or scanned in a photograph) and looked carefuly at the image has seen that the images are really grainy, and don't have the smooth colors that you see in real life. This is usually due to random noise that occurs in the CCD during image capture and processing. This is made even worse by JPEG image compression which throws out a lot of information in the color space. Due to this, the images have a lot of color noise (red, green and blue blotches everywhere). The grain remover can clean up both the colors, and the black/white components of the image without blurring the image.
 
Here is a screenshot of the application:
 
Top Window - The original image.
Bottom Window - The final image (shows the effects of grain removal).
Open Button - Press to load an image in any format.
Save Button - Press to save the image in .png format (I might add more formats later).
Color Blend >> Button - Press to blend colors. You can press this multiple times for more blending.
     Factor - How strong the blending is (use a factor of < 1 for less blending... factors of > 1 will produce unpredictable results).
     100%, 80%, 20%, 0% - Explained below (the defaults should be good for most brightly lit images).
BW Blend >> Button - Press to blend black and white. You can press this multiple times for more blending.
     Factor - How strong the blending is (use a factor of < 1 for less blending... factors of > 1 will produce unpredictable results).
     100%, 80%, 20%, 0% - Explained below (the defaults should be good for most brightly lit images).
 
Suggested Operation
 
1. Load the image using the "Open" button.
2. Adjust Color Blend parameters if necessary. Press "Color Blend >>" repeatedly until color blotches go away.
3. Adjust BW Blend parameters if necessary. Press "BW Blend >>" repeatedly until black/white blotches go away.
4. Press "Save" to save the image to ".png" format.
 
How it Works
 
When the image is loaded, it gets converted into YUV format (Y is the b/w channel, U and V are the color channels). When you press color blend, the software blends all adjacent pixels (but affects only the color channels). We want to avoid blending different colors, and only want to blend color noise. To do this, we blend only when colors are not too different... the less different we are, the more we blend. This is controlled by the blend controls. 100% [0] means that with a difference of zero or less in color value, there will be 100% blending, the 80% [6] means that with a color difference of 6, there will be 80% blending, and so on. The color differences are interpolated, thus with a color difference of 3, there will be 90% blending. With a color difference of 16, there will be no blending. If an image has very high amplitude color noise, these values can be increased. If you press the button repeatedly, the blend operation will be repeated. This has the effect of widening the area of the blend. All of this also applies to the BW Blend feature, except this only blends the black and white component. Typically, you want less blending on the BW component because it is more accurately represented in JPEG images, and because blurriness in the BW component is more visible.
 
Results
 
Picture of kitchen before grain removal:
 
Picture of Kitchen after Grain Removal:
 
Picture of Grand Canyon before grain removal:
 
Picture of Grand Canyon after grain removal:
 
Picture of MGM before grain removal:
 
Picture of MGM after grain removal:
 
Conclusion
 
I was very happy with the results of the image smoothing algorithm. The only problem with the program is that it is pretty slow. Also, for the picture of the MGM Grand, the color blending didn't seem to be effective enough. For better color blending, it would be better if we could blend with not just the adjacent pixels, but also with pixels farther out. However, the difficulty with this, is detecting when the pixel is significantly different and stopping blending in that direction. To do this, we can go out from the center pixel in a star shape (N, NE, E, SE, S, SW, W, NW), and abandon a direction if a pixel with a significantly different color is hit. Or, we could do a regular convolution in the color channel (which might look bad). This sort of approach might also work for the B/W channel, although it might produce obvious blurriness. Another improvement we could make is to automatically detect the amplitude of noise and set the blending parameters upon opening the image. This would be as simple as comparing adjacent pixels, and getting mean and standard deviation for their differences.
 
This web page, and the program contained in it is Copyrighted 2003 by Ilya Rosenberg. My email address without the @ and .s is: ilya cs nyu edu
I designed this web page using Weditor.