Tonight I finally tried to put in practice some thoughts about the dreaded CMOS cameras static noise.The need came from the poor quality of Aibo’s camera. However, for the time being, I’m using a relatively cheap USB camera. With this camera, much like in Aibo’s case, the temporal noise reduction doesn’t maximize the quality of a single image. So, I finally tried to write some code to try locate the static noise.To make things easier, I decided to sample the noise in complete darkness (..with a finger covering the objective 8). This does not give complete darkness, however. There is of course the noise that I want to detect, plus the camera driver fiddling with white balance.. adding artificial brightness to the image.
At the current stage, my algorithm is very simple: I take the average color of all pixels in the image and subtract it from the reference “dark” frame. The one captured with my thumb covering the camera 8P. This goes for red, green and blue components. The result is an RGB image comprised of values that need to be subtracted from the subsequent frames.. those that I want to correct by removing the static noise.
Actually, I added slightly more complexity by subdividing the image in a grid of 32×32 pixel squares and calculating color averages by those squares rather than globally for the whole image. But I’m not sure that that’s helping much.This is a very simple approach. In fact, a simple subtraction isn’t the best solution. To suppress the noise, it’s very likely that I’ll need to scale values (multiplication/division), rather than offset them (addition/subtraction). Or possibly scale and offset at the same time..
In any case, I think that the early experiments are very promising ! I’m actually pretty excited about the results.
Here are a couple of examples, please keep in mind that the image quality is not meant to be good. I kept the environment relatively dark on purpose, to strengthen the noise effect and the countering effect of the algorithm.
| A mousepad… | |
As it came from the driver. |
With temporal NR and dark-frame subtraction.
|
| A sleepy programmer ! | |
|
As it came from the driver.
|
With temporal NR and dark-frame subtraction.
(Gone is the rGbRgBRGbeard 8)
|
Posted by Davide Pasca in Image-processing




