Re: Bayer to RGB conversion [message #74044 is a reply to message #73964] |
Wed, 15 December 2010 17:34   |
David Grier
Messages: 35 Registered: July 2010
|
Member |
|
|
On 12/15/10 2:25 PM, Karl wrote:
> On Dec 15, 8:10 am, David Fanning<n...@dfanning.com> wrote:
>> nata writes:
>>> Ok, maybe I didn't understand the question.
>>
>> Well, I didn't understand the question either. :-)
>>
>
> Color quantization has nothing to do with it.
>
> Bayer sensors, or more accurately perhaps, sensors that output Bayer-
> format images are often found in smartphones as part of their built-in
> camera system. The phone probably has a DSP or other specialized
> hardware to convert the Bayer image to RGB and then eventually to the
> JPEG file or whatever ends up storing your photo.
>
> Wikipedia has a decent article about it, including links to GPL
> software that might do the conversion.
>
> I've not looked at the algorithms involved, but if performance is
> important, then I'd doubt that coding it in IDL would work well.
> Matlab has a built-in function for it and there are GPU
> implementations out there. If I could use the GPL code, I'd probably
> put it in a DLM and call it from IDL, if it is not already in IDL or
> ENVI.
>
> Karl
>
I'm using a home-brew dlm to read raw (Bayer-encoded) images from
a Prosilica GigE video camera. This is a reasonably high-end
scientific camera that my group plans to use for holographic
video microscopy. I just finished wrapping an open-source
implementation of the 5x5 Malvar-He-Cutler Bayer conversion
algorithm in a dlm, and am reasonably happy with the result.
I was just hoping for a "pure" IDL implementation.
The most popular conversion algorithms aren't too sophisticated, but
involve some detailed bookkeeping. They'd be a pain to recode.
Mostly, I'm surprised that IDL doesn't support conversions from
this fairly common class of image formats. As Karl mentioned,
Matlab comes with quite sophisticated Bayer conversion algorithms
in the demosaic.m package. Matlab also has read/write support for
all sorts of video formats. Python has all this (and more) through its
opencv bindings.
Sometimes IDL starts to feel a little old and creaky.
TTFN,
David
|
|
|