## Debayering / demosaicing

May 19 2008 | 5:22 pm
Hello list,
Do you know if it's possible to implement (and eventually how) a debayering (or demosaicing / demosaicking) algorithm in Jitter ? I got an Allied Tecs. color camera which works in RAW format. I searched the forum but didn't find anything about that.
Any idea or help would be greatly appreciated... Best
Thierry
---------------------------------------- Thierry Fournier http://www.thierryfournier.net

• May 21 2008 | 4:27 am
• May 21 2008 | 2:16 pm
• Jun 13 2008 | 10:33 am
im aiming for a simple linear debayer conversion. if anyone like to help that'll be great. its impossible
tags: demosaic, debayer, fail
• Jun 13 2008 | 1:00 pm
tighter, the wikipedia image source was not pixel accurate, now it looks better, but jaggy. need interpolation or fancier algo.
On Fri, Jun 13, 2008 at 12:33 PM, yair reshef wrote:
• Jun 14 2008 | 10:55 pm
i've been reading about this demosaicing thing, and its a bitch. tons of different concepts. demosaicing on gpu- http://rw4.cs.uni-sb.de/~phlucas/pubs/Diss.pdf (see p. 146) RAW decoder comparison - http://users.tkk.fi/%7Estanhua/rawcomp/
im aiming low and skip cross gradient checking, group ranking etc etc for a simple working one. but I'm failing with implementing some basic ideas with jitter matrices.
1.how do i write an efficient exprop that for every ON pixel will copy the value of the ON pixel to the one to its right (and latter, to which one of its nine neighbours) like if getcell(x,y)>0 then cell(x+1,y)=getcell(x,y)
2. how do i preform a sum of pixels with fixed distribution (not sure about the usage of Distro here), like set of {0 0 1 0 0 1 0 0 1 0 0 1} sum every 3rd member. [jit.demultiplex @scan_a 3] > cv.jit.sum
zl for matrices.
• Jun 16 2008 | 4:43 pm
for the interested, a repos version, but this is going nowhere
On Sun, Jun 15, 2008 at 12:55 AM, yair reshef wrote:
> i've been reading about this demosaicing thing, and its a bitch. tons of > different concepts. > demosaicing on gpu- http://rw4.cs.uni-sb.de/~phlucas/pubs/Diss.pdf(see p. 146) > RAW decoder comparison - http://users.tkk.fi/%7Estanhua/rawcomp/ > > im aiming low and skip cross gradient checking, group ranking etc etc for a > simple working one. but I'm failing with implementing some basic ideas with > jitter matrices. > > 1.how do i write an efficient exprop that for every ON pixel will copy the > value of the ON pixel to the one to its right (and latter, to which one of > its nine neighbours) > like > if getcell(x,y)>0 then cell(x+1,y)=getcell(x,y) > > 2. how do i preform a sum of pixels with fixed distribution (not sure about > the usage of Distro here), > like > set of {0 0 1 0 0 1 0 0 1 0 0 1} sum every 3rd member. > [jit.demultiplex @scan_a 3] > cv.jit.sum > > > zl for matrices. > > >
• Jun 16 2008 | 6:05 pm
Hrm. This sounds fun, Im at work so cant check it out too much, but for your "1.how do i write an efficient exprop that for every ON pixel will copy the value of the ON pixel to the one to its right (and latter, to which one of its nine neighbours)?"
Perhaps you could do a jit.op @op > 1, and then a convolution filter, which would move all values to the left, a filter something like?
0 0 0 1 1 0 0 0 0
? for a 9 point convolution kernel?
This sounds like a really fun challenge.
• Jun 16 2008 | 8:11 pm
Unfortunately, I don't have too much time to play around with this right now,but in looking at some of the links you provided, I came up with a quick fragment shader that (I think) does what you are trying to accomplish. Check out the attached patch and shader file.
Best, Andrew B.
• Jun 16 2008 | 8:13 pm