Interpolating the Bayer matrix Green layer.

<Previous page Next Page>

On the previous page I used a simple averaging routine to fill in the missing colors in the bayer matrix. There are lots of methods which try to improve on this. The complexity of some seem hard to justify when you see the results. I doubt there is a one best method for all images. I want to play with some simple(ish) ones to try to tweek my G2 images a little bit. I think the G2 is just a bit behind film @ the moment so with a "bit" of tweaking it might match it. The algorithm I want to try starts with the missing green pixels being filled in. If we could do this perfectly we would double the resolution of the green layer. This is not possible but we will gain something.


This is what I'm using as a test image. Note that every second pixel is missing and the known values are in a diagonal arrangement.


Here the missing pixels have been filled in by simply averaging the neighboring four pixels.


The first alternative method (right) I've tried is to find the neighboring pixel which is most different from the average and discard it. I then average the remaining three pixels. This work well in the situation where one pixel lays on one side of an edge and three on the other side. You want to avoid averaging across edges. However when two pixels lay of each side of and edge it becomes worse than an average of all four pixels. Overall it has sharpened up the test image a little bit. Nothing too exciting but it's a start.


Here I used a weighted average. The weighting is based of difference between the pixel value and the plain vanilla average. The difference is squared divided by a fudge factor and subtracted from one. Samples which equal the mean have a weight of one and ones that are very different have a weight of zero.





This is the same as above except I iterated a few times feeding the new mean back into the routine to try to converge on a more accurate one. It is different but not necessarily better. This test image has portions which are very difficult to interpret. Some of the lines are only one pixel wide with a gap of one pixel in between lines.

There are other things to try yet - but for now it is more important to see if I can make sense of the chroma information.

NEXT PAGE>