sh0dan // VoxPod

Sunday, March 06, 2005

Camera RAW Experiments

Even though the tests I did when trying to utilize 3D hardware for video processing were pretty promising, I got an idea for a new and interesting way of using it. For processing RAW footage fra digital cameras. This is a far more obvious usage of modern 3D hardware, and it seems to be a lot better than current software implementations.

So I used the last weekend to throw together something that would enable me to try out some stuff and compare software processing to hardware processing. I haven't gotten too far yet, but I managed to get a test version running, using a hacked up version of dcraw and ufraw to read and decode the binary streams.

So basicly what I have now is the unfiltered and unconverted camera data which I plan to throw at my 3D hardware to see if it will be able to perform better than current software. What you see below is a pretty crude implementation, where I only read one color channel and maps it to luma on a texture.

Though I wont get too much into things that might not happend, I think 3D-accelleration is big win, and I get great performance so far, though no actual filtering is done yet. I need to get a DirectX 9.0c capable card again, so I can begin the real experiments, but the worst part seems to be done by now.

So far the Bayer pattern removal seems to be the biggest challenge, as dcraw uses a very sophisticated algorithm to remove Bayer patterns, that will probably be hard to do as is in hardware. But I hope to come up with something with the same quality. It is also quite a mystery to me how dcraw stores the Bayer pattern for each camera - dcraw might be small and very good at its task - but readable to humans is not one of its qualities. ;)

Anyway - gotta get some sleep. Here is a screenshot for the records:

Screenshot from the test application. The image is a RAW file imported from my Canon EOS 20D. It's not my happy face, though! ;)


Post a Comment

<< Home