waveform80 / picamera

A pure Python interface to the Raspberry Pi camera module
https://picamera.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.57k stars 356 forks source link

Add more advanced demosaicing algorithms #356

Open TuomLarsen opened 7 years ago

TuomLarsen commented 7 years ago

It would be awesome if we could use different/more advanced algorithms for demosaicing the data from camera's Bayer sensor.

Possible additions (in Python) are included in the Colour library:

https://github.com/colour-science/colour-demosaicing/blob/develop/BIBLIOGRAPHY.rst https://github.com/colour-science/colour-demosaicing/tree/develop/colour_demosaicing/bayer/demosaicing

waveform80 commented 7 years ago

I can't say it's something I'm terribly motivated to add (the PiBayerArray stuff is largely there as a nice base for people to build upon), but if someone wants to post a PR which, for example, adds an algorithm parameter to PiBayerArray.demosaic I'll happily merge it if it doesn't add any onerous dependencies.

For example, the scipy dependency in the linked repo might be a little much: that's a very long compile for venv users - unless it was made optional by only importing it in the demosaic method, or the convolve stuff (which looks fairly simple: just pure Python plus some numpy stuff) was duplicated.