Forums > Jitter

reduce camera noise?

September 11, 2007 | 4:43 pm

Hi all.

Without resorting to jit.slide on the image itself, does anyone have a
handy (and not too cpu intensive) means of removing noise from a
firewire camera image? I am doing some background subtraction, and
while i can clean up the noise around the person I am looking for, the
camera itselfis kicking out some stray funky pixels.

I vaguely remember a discussion on the list from a year or 2 ago about
this, but I can’t find it. Any suggestions?

Thanks :)

~s


September 11, 2007 | 7:27 pm

On Sep 11, 2007, at 9:43 AM, Scott Fitzgerald wrote:

> Without resorting to jit.slide on the image itself, does anyone have a
> handy (and not too cpu intensive) means of removing noise from a
> firewire camera image?

The first things to consider before you get to processing your image
are the standard things for reducing thermal noise:

1. Use as much light as possible in the space you are filming (so
that the ratio of light to thermal noise is as high as possible)
2. Use as large a CCD camera as possible
3. Try to keep the camera cool somehow (obviously not always possible
or practical)

Then, it would make sense to start processing. The following doesn’t
work for all situations, but one thing that I’ve used successfully
recently is a threshold based slide implementation. Small amounts of
difference between frames only affect the output a little bit, but
larger changes are visibly immediately. I’ve cleaned up and uploaded
a CPU and GPU based version below. It uses floating point values so
that the "slide" is effective, which means that it is slow on the
CPU, and for a decent GPU version, your card will need to support
floating point textures.

http://www.musorkvision.com/jkc/temp-denoise-example.zip

You can also use adaptive filtering spatially (perhaps combined with
temporal analysis/processing). I’ve included a version which uses a
kind of multipass adaptive median filter to smooth small change (this
sort of thing can also be used for things like skin tone smoothing
filters and such). The shader can easily be modified to be an
adaptive mean filter if that works better for your material.

More advanced denoising algorithms also incorporate optical flow in
the analysis/processing. For this sort of thing, you can perhaps use
Jean Marc Pelletier’s cv.jit objects for. Might be tricky and CPU
intensive, however.

Hope this helps.

-Joshua


September 11, 2007 | 8:11 pm

here is a gpu based background subtraction i use often. ill try to implement
your recommendations.
i use a slide based averaging technique for the background, having control
over your lighting is a crucial point, more light, less noise. the slide
routine i use accept a nice range of lighting conditions, i use the infra
red spectrum, and the sun is a major source for ir. but ir is not good for
everything.

patch + a basic luma shader hacked from on of the others.

On 9/11/07, Joshua Kit Clayton wrote:
>
>
> On Sep 11, 2007, at 9:43 AM, Scott Fitzgerald wrote:
>
> > Without resorting to jit.slide on the image itself, does anyone have a
> > handy (and not too cpu intensive) means of removing noise from a
> > firewire camera image?
>
> The first things to consider before you get to processing your image
> are the standard things for reducing thermal noise:
>
> 1. Use as much light as possible in the space you are filming (so
> that the ratio of light to thermal noise is as high as possible)
> 2. Use as large a CCD camera as possible
> 3. Try to keep the camera cool somehow (obviously not always possible
> or practical)
>
> Then, it would make sense to start processing. The following doesn’t
> work for all situations, but one thing that I’ve used successfully
> recently is a threshold based slide implementation. Small amounts of
> difference between frames only affect the output a little bit, but
> larger changes are visibly immediately. I’ve cleaned up and uploaded
> a CPU and GPU based version below. It uses floating point values so
> that the "slide" is effective, which means that it is slow on the
> CPU, and for a decent GPU version, your card will need to support
> floating point textures.
>
> http://www.musorkvision.com/jkc/temp-denoise-example.zip
>
> You can also use adaptive filtering spatially (perhaps combined with
> temporal analysis/processing). I’ve included a version which uses a
> kind of multipass adaptive median filter to smooth small change (this
> sort of thing can also be used for things like skin tone smoothing
> filters and such). The shader can easily be modified to be an
> adaptive mean filter if that works better for your material.
>
> More advanced denoising algorithms also incorporate optical flow in
> the analysis/processing. For this sort of thing, you can perhaps use
> Jean Marc Pelletier’s cv.jit objects for. Might be tricky and CPU
> intensive, however.
>
> Hope this helps.
>
> -Joshua
>


September 11, 2007 | 8:12 pm

On 9/11/07, yair reshef wrote:
>
> here is a gpu based background subtraction i use often. ill try to
> implement your recommendations.
> i use a slide based averaging technique for the background, having control
> over your lighting is a crucial point, more light, less noise. the slide
> routine i use accept a nice range of lighting conditions, i use the infra
> red spectrum, and the sun is a major source for ir. but ir is not good for
> everything.
>
> patch + a basic luma shader hacked from on of the others.
>
>
>
> On 9/11/07, Joshua Kit Clayton wrote:
> >
> >
> > On Sep 11, 2007, at 9:43 AM, Scott Fitzgerald wrote:
> >
> > > Without resorting to jit.slide on the image itself, does anyone have a
> > > handy (and not too cpu intensive) means of removing noise from a
> > > firewire camera image?
> >
> > The first things to consider before you get to processing your image
> > are the standard things for reducing thermal noise:
> >
> > 1. Use as much light as possible in the space you are filming (so
> > that the ratio of light to thermal noise is as high as possible)
> > 2. Use as large a CCD camera as possible
> > 3. Try to keep the camera cool somehow (obviously not always possible
> > or practical)
> >
> > Then, it would make sense to start processing. The following doesn’t
> > work for all situations, but one thing that I’ve used successfully
> > recently is a threshold based slide implementation. Small amounts of
> > difference between frames only affect the output a little bit, but
> > larger changes are visibly immediately. I’ve cleaned up and uploaded
> > a CPU and GPU based version below. It uses floating point values so
> > that the "slide" is effective, which means that it is slow on the
> > CPU, and for a decent GPU version, your card will need to support
> > floating point textures.
> >
> > http://www.musorkvision.com/jkc/temp-denoise-example.zip
> >
> > You can also use adaptive filtering spatially (perhaps combined with
> > temporal analysis/processing). I’ve included a version which uses a
> > kind of multipass adaptive median filter to smooth small change (this
> > sort of thing can also be used for things like skin tone smoothing
> > filters and such). The shader can easily be modified to be an
> > adaptive mean filter if that works better for your material.
> >
> > More advanced denoising algorithms also incorporate optical flow in
> > the analysis/processing. For this sort of thing, you can perhaps use
> > Jean Marc Pelletier’s cv.jit objects for. Might be tricky and CPU
> > intensive, however.
> >
> > Hope this helps.
> >
> > -Joshua
> >
>
>


September 11, 2007 | 9:05 pm

Wow, these are pretty swell, thanks Joshua.

however, I’m running this on an Intel mac mini, so too much on the gpu
isn’t really going to fly. Right now I’m playing with the camera’s
settings, tryig to finesse it as much as possible, particularly since
the lighting is fixed (and they didn’t exactly listen to me).

But perhaps the small slide would work well.

I’m getting the refernce frame with cv.jit.ravg @alpha .1 and doing
some dilation and erosion on the mask to clean up the sides a bit.
Obviously works better in some situations than others.

Thnaks again,

~s

On 9/11/07, Joshua Kit Clayton wrote:
>
> On Sep 11, 2007, at 9:43 AM, Scott Fitzgerald wrote:
>
> > Without resorting to jit.slide on the image itself, does anyone have a
> > handy (and not too cpu intensive) means of removing noise from a
> > firewire camera image?
>
> The first things to consider before you get to processing your image
> are the standard things for reducing thermal noise:
>
> 1. Use as much light as possible in the space you are filming (so
> that the ratio of light to thermal noise is as high as possible)
> 2. Use as large a CCD camera as possible
> 3. Try to keep the camera cool somehow (obviously not always possible
> or practical)
>
> Then, it would make sense to start processing. The following doesn’t
> work for all situations, but one thing that I’ve used successfully
> recently is a threshold based slide implementation. Small amounts of
> difference between frames only affect the output a little bit, but
> larger changes are visibly immediately. I’ve cleaned up and uploaded
> a CPU and GPU based version below. It uses floating point values so
> that the "slide" is effective, which means that it is slow on the
> CPU, and for a decent GPU version, your card will need to support
> floating point textures.
>
> http://www.musorkvision.com/jkc/temp-denoise-example.zip
>
> You can also use adaptive filtering spatially (perhaps combined with
> temporal analysis/processing). I’ve included a version which uses a
> kind of multipass adaptive median filter to smooth small change (this
> sort of thing can also be used for things like skin tone smoothing
> filters and such). The shader can easily be modified to be an
> adaptive mean filter if that works better for your material.
>
> More advanced denoising algorithms also incorporate optical flow in
> the analysis/processing. For this sort of thing, you can perhaps use
> Jean Marc Pelletier’s cv.jit objects for. Might be tricky and CPU
> intensive, however.
>
> Hope this helps.
>
> -Joshua
>


September 11, 2007 | 9:07 pm

and yair,

also nice. thanks, i’ll see if I can’t adapt any of the above
solutions to this situation.

~s

On 9/11/07, yair reshef wrote:
>
>
> On 9/11/07, yair reshef
wrote:
> > here is a gpu based background subtraction i use often. ill try to
> implement your recommendations.
> > i use a slide based averaging technique for the background, having control
> over your lighting is a crucial point, more light, less noise. the slide
> routine i use accept a nice range of lighting conditions, i use the infra
> red spectrum, and the sun is a major source for ir. but ir is not good for
> everything.
> >
> > patch + a basic luma shader hacked from on of the others.
> >
> >
> >
> >
> >
> > On 9/11/07, Joshua Kit Clayton wrote:
> > >
> > > On Sep 11, 2007, at 9:43 AM, Scott Fitzgerald wrote:
> > >
> > > > Without resorting to jit.slide on the image itself, does anyone have a
> > > > handy (and not too cpu intensive) means of removing noise from a
> > > > firewire camera image?
> > >
> > > The first things to consider before you get to processing your image
> > > are the standard things for reducing thermal noise:
> > >
> > > 1. Use as much light as possible in the space you are filming (so
> > > that the ratio of light to thermal noise is as high as possible)
> > > 2. Use as large a CCD camera as possible
> > > 3. Try to keep the camera cool somehow (obviously not always possible
> > > or practical)
> > >
> > > Then, it would make sense to start processing. The following doesn’t
> > > work for all situations, but one thing that I’ve used successfully
> > > recently is a threshold based slide implementation. Small amounts of
> > > difference between frames only affect the output a little bit, but
> > > larger changes are visibly immediately. I’ve cleaned up and uploaded
> > > a CPU and GPU based version below. It uses floating point values so
> > > that the "slide" is effective, which means that it is slow on the
> > > CPU, and for a decent GPU version, your card will need to support
> > > floating point textures.
> > >
> > >
> http://www.musorkvision.com/jkc/temp-denoise-example.zip
> > >
> > > You can also use adaptive filtering spatially (perhaps combined with
> > > temporal analysis/processing). I’ve included a version which uses a
> > > kind of multipass adaptive median filter to smooth small change (this
> > > sort of thing can also be used for things like skin tone smoothing
> > > filters and such). The shader can easily be modified to be an
> > > adaptive mean filter if that works better for your material.
> > >
> > > More advanced denoising algorithms also incorporate optical flow in
> > > the analysis/processing. For this sort of thing, you can perhaps use
> > > Jean Marc Pelletier’s cv.jit objects for. Might be tricky and CPU
> > > intensive, however.
> > >
> > > Hope this helps.
> > >
> > > -Joshua
> > >
> >
> >
>
>
>
>
>


September 13, 2007 | 10:58 am

hi yair,

would like to try your de-noising-approach, but unfortunately
i can’t see the attachment in the forum…

could you try to upload it from within there (or whatever helps in cases like this)?

many thanks,

jan klug


September 13, 2007 | 3:12 pm

patch and shader follows

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 474 105 148 9109513 uyvy becuase of input buttleneck;
#P window linecount 4;
#P comment 430 183 100 9109513 < < dynaimc avreging , fast change on new
objects , very slow fade ot.;
#P window linecount 1;
#P comment 201 83 243 9109513 a bug , if no fw camera conected ,
dx.grabwill crash max;
#P comment 173 340 272 9109513 crude , lean barrel distortoin for the wide
angle 2.2 unibrain lens.;
#P comment 173 355 192 9109513 could probebl change it with the new shader.;
#P newex 141 153 260 9109513 t l l;
#N vpatcher 346 155 732 397;
#P origin -53 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 30 177 109 9109513 jit.matrix 1 char 320 240;
#P window linecount 0;
#P newex 30 131 182 9109513 jit.slide @slide_up 10. @slide_down 1000.;
#P outlet 30 205 15 0;
#P inlet 30 34 15 0;
#P newex 30 77 66 9109513 jit.rgb2luma;
#P newex 30 54 66 9109513 jit.uyvy2argb;
#P newex 30 102 120 9109513 jit.matrix 1 float32 320 240;
#P connect 3 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P connect 0 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 4 0;
#P pop;
#P newobj 391 181 35 9109513 p arvg;
#P newex 141 278 218 9109513 jit.gl.slab table @file cf.dilate.jxs @param
width 1.;
#P newex 141 255 211 9109513 jit.gl.slab table @file cf.blur.jxs @param
width 1.;
#P inlet 66 38 15 0;
#P window setfont "Sans Serif" 12.;
#N vpatcher 74 280 824 592;
#P origin 0 -11;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 336 60 116 9109513 route pos scale rot grid;
#P newex 336 34 90 9109513 r keystone_position;
#P objectname receive;
#P window setfont "Sans Serif" 14.;
#P comment 296 191 118 9109518 center and zoom;
#P comment 608 136 100 9109518 flip;
#P window setfont "Sans Serif" 9.;
#P flonum 385 216 35 9 0 0 0 139 0 0 0 255 227 23 222 222 222 0 0 0;
#P objectname flonum[11];
#P flonum 347 216 35 9 0 0 0 139 0 0 0 255 227 23 222 222 222 0 0 0;
#P objectname flonum[10];
#P flonum 307 216 35 9 0 0 0 139 0 0 0 255 227 23 222 222 222 0 0 0;
#P objectname flonum[9];
#P newex 308 233 95 9109513 pak position 0. 0. 0.;
#P flonum 561 138 35 9 0 0 0 139 0 0 0 255 92 174 222 222 222 0 0 0;
#P objectname flonum[3];
#P newex 608 158 27 9109513 * -1.;
#P objectname /;
#P newex 110 119 45 9109513 loadbang;
#P newex 110 241 104 9109513 jit.op @op + pass pass;
#P objectname jit.op[1];
#N vpatcher 95 381 578 727;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 98 79 60 9109513 unpack 0. 0.;
#P window linecount 1;
#P newex 32 47 109 9109513 route theta zoom anchor;
#P window linecount 0;
#P newex 353 98 27 9109513 t b l;
#P flonum 32 127 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 190 219 27 9109513 * 1.;
#P newex 370 178 27 9109513 * -1.;
#P newex 227 219 27 9109513 * 1.;
#P newex 32 219 27 9109513 * 1.;
#P newex 370 123 60 9109513 unpack 0. 0.;
#P newex 353 76 60 9109513 vexpr 1./$f1;
#P newex 69 219 27 9109513 * -1.;
#P newex 32 149 81 9109513 expr 0.5*cos($f1);
#P newex 209 149 78 9109513 expr 0.5*sin($f1);
#P flonum 301 244 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 264 244 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 227 244 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 190 244 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 191 267 128 9109513 pak tex_plane_t 0. 0.5 0. 0.5;
#P flonum 143 245 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 106 245 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 69 245 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 32 245 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 33 267 130 9109513 pak tex_plane_s 0.5 0. 0. 0.5;
#P inlet 32 25 15 0;
#P outlet 33 297 15 0;
#P connect 1 0 23 0;
#P connect 23 0 21 0;
#P fasten 22 0 21 0 358 122 37 122;
#P connect 21 0 13 0;
#P connect 13 0 17 0;
#P connect 17 0 3 0;
#P fasten 7 0 0 0 196 291 38 291;
#P connect 2 0 0 0;
#P fasten 16 0 17 1 375 171 54 171;
#P fasten 3 0 2 1 37 263 68 263;
#P fasten 12 0 14 0 214 182 74 182;
#P connect 14 0 4 0;
#P fasten 19 0 14 1 375 208 91 208;
#P fasten 4 0 2 2 74 263 98 263;
#P connect 23 2 24 0;
#P fasten 5 0 2 3 111 263 128 263;
#P fasten 24 0 6 0 103 104 148 104;
#P fasten 6 0 2 4 148 263 158 263;
#P fasten 12 0 20 0 214 182 195 182;
#P connect 20 0 8 0;
#P fasten 16 1 20 1 425 213 212 213;
#P fasten 21 0 12 0 37 145 214 145;
#P fasten 8 0 7 1 195 263 225 263;
#P fasten 13 0 18 0 37 193 232 193;
#P connect 18 0 9 0;
#P fasten 16 1 18 1 425 213 249 213;
#P fasten 9 0 7 2 232 263 254 263;
#P fasten 10 0 7 3 269 263 283 263;
#P fasten 24 1 11 0 153 108 306 108;
#P fasten 11 0 7 4 306 263 312 263;
#P fasten 23 1 15 0 70 71 358 71;
#P connect 15 0 22 0;
#P connect 22 1 16 0;
#P connect 16 0 19 0;
#P pop;
#P newobj 428 233 94 9109513 p TexCoordMagic;
#P message 428 206 56 9109513 theta $1;
#P newex 428 181 107 9109513 expr $f1*3.14/180;
#P flonum 608 181 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname flonum[2];
#P flonum 561 181 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname flonum[1];
#P newex 531 204 70 9109513 pak zoom 1. 1.;
#P flonum 428 161 35 9 0 0 0 139 0 0 0 255 227 23 222 222 222 0 0 0;
#P objectname flonum;
#P newex 110 218 144 9109513 jit.op @op * * * @val 1.62 2. 0.5;
#P objectname jit.op;
#P window linecount 2;
#P newex 110 179 173 9109513 jit.matrix 3 float32 25 25 @usesrcdim 1
@srcdimstart 0 15 @srcdimend 25 25;
#P objectname jit.matrix;
#P newex 110 143 140 9109513 jit.gl.gridshape @matrixoutput 1 @dim 25 25
@automatic 0;
#P objectname jit.gl.gridshape;
#P outlet 308 275 15 0;
#P window setfont "Sans Serif" 14.;
#P window linecount 1;
#P comment 464 159 100 9109518 rotate;
#P connect 13 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P fasten 4 0 12 0 115 233 115 233;
#P fasten 12 0 1 0 115 269 313 269;
#P fasten 11 0 1 0 433 269 313 269;
#P connect 16 0 1 0;
#P connect 22 0 23 0;
#P connect 23 0 16 1;
#P connect 17 0 16 1;
#P connect 18 0 16 2;
#P connect 19 0 16 3;
#P fasten 23 2 5 0 393 106 433 106;
#P connect 5 0 9 0;
#P connect 9 0 10 0;
#P fasten 6 0 11 0 536 228 433 228;
#P connect 10 0 11 0;
#P fasten 23 1 15 0 367 89 566 89;
#P connect 15 0 7 0;
#P connect 7 0 6 1;
#P fasten 8 0 6 2 613 200 596 200;
#P fasten 15 0 14 0 566 155 613 155;
#P connect 14 0 8 0;
#P pop;
#P newobj 157 406 89 9109516 p sphereStone;
#P objectname sphereStone;
#P window setfont "Sans Serif" 9.;
#P newex 141 384 318 9109513 jit.gl.texture table @dim 320 240 @wrap
clampborder @bordercolor 0 0 0 0;
#N vpatcher 45 100 234 235;
#P window setfont "Sans Serif" 12.;
#P flonum 51 50 67 12 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P message 50 74 81 9109513 param amount $1;
#P outlet 50 96 15 0;
#P connect 2 0 1 0;
#P connect 1 0 0 0;
#P pop;
#P newobj 97 232 42 9109513 p param;
#N vpatcher 45 100 287 274;
#P window setfont "Sans Serif" 9.;
#P flonum 122 50 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 122 69 61 9109513 contrast $1;
#P flonum 50 53 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 50 72 70 9109513 brightness $1;
#P outlet 93 110 15 0;
#P connect 2 0 1 0;
#P connect 3 0 0 0;
#P connect 1 0 0 0;
#P connect 4 0 3 0;
#P pop;
#P newobj 328 129 42 9109513 p param;
#P newex 141 129 184 9109513 jit.brcosa @brightness 1.23 @contrast 0.6;
#P newex 66 486 144 9109513 jit.gl.slab table @file co.luma.jxs;
#P objectname jit.gl.slab[4];
#N vpatcher 36 384 439 555;
#P inlet 167 51 15 0;
#P window setfont "Sans Serif" 9.;
#P flonum 340 104 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 302 104 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 265 104 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 228 104 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 214 134 133 9109513 pak param in2scale 1. 1. 1. 1.;
#P flonum 343 48 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 305 48 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 268 48 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 231 48 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 217 78 128 9109513 pak param inscale 1. 1. 1. 1.;
#P flonum 127 50 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P message 127 68 65 9109513 param inscale $1 $1 $1 $1;
#P flonum 51 50 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 50 68 73 9109513 param outscale $1 $1 $1 $1;
#P outlet 50 103 15 0;
#P connect 2 0 1 0;
#P connect 3 0 0 0;
#P connect 1 0 0 0;
#P connect 10 0 0 0;
#P connect 5 0 0 0;
#P connect 4 0 3 0;
#P connect 15 0 3 0;
#P connect 11 0 10 2;
#P connect 6 0 5 2;
#P connect 7 0 5 3;
#P connect 12 0 10 3;
#P connect 8 0 5 4;
#P connect 13 0 10 4;
#P connect 9 0 5 5;
#P connect 14 0 10 5;
#P pop;
#P newobj 98 300 42 9109513 p param;
#P message 141 72 28 9109513 open;
#P newex 141 21 48 9109513 r lbangGL;
#P objectname receive[2];
#P outlet 66 512 15 0;
#P newex 141 232 260 9109513 jit.gl.slab table @file
co.difference.jxs@param amount
1.05;
#P objectname jit.gl.slab[3];
#P newex 66 338 30 9109513 t b b;
#N vpatcher 35 269 554 655;
#P outlet 35 318 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P comment 122 195 206 9109513 scale and bias controls in RGB colorspace;
#P flonum 299 219 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 337 246 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 299 246 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 259 246 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 211 272 125 9109513 pak param bias 0. 0. 0. 0.;
#P flonum 155 219 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 193 246 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 155 246 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 115 246 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 67 272 130 9109513 pak param scale 1. 1. 1. 1.;
#P flonum 92 126 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 208 126 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 321 126 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 321 149 102 9109513 param saturation $1;
#P message 208 149 94 9109513 param contrast $1;
#P message 92 149 103 9109513 param brightness $1;
#P connect 0 0 17 0;
#P connect 1 0 17 0;
#P connect 2 0 17 0;
#P connect 11 0 17 0;
#P connect 6 0 17 0;
#P connect 5 0 0 0;
#P connect 10 0 7 0;
#P connect 7 0 6 2;
#P connect 8 0 6 3;
#P connect 10 0 8 0;
#P connect 9 0 6 4;
#P connect 10 0 9 0;
#P connect 4 0 1 0;
#P connect 12 0 11 2;
#P connect 15 0 12 0;
#P connect 13 0 11 3;
#P connect 15 0 13 0;
#P connect 14 0 11 4;
#P connect 3 0 2 0;
#P connect 15 0 14 0;
#P pop;
#P newobj 98 181 42 9109513 p param;
#P newex 141 207 144 9109513 jit.gl.slab table @file co.luma.jxs;
#P objectname jit.gl.slab[2];
#P message 460 252 74 9109513 setall 255 , bang;
#P newex 460 271 89 9109513 jit.matrix 4 char 2 2;
#P objectname jit.matrix[5];
#P newex 66 70 45 9109513 t b b;
#P newex 141 300 413 9109513 jit.gl.slab table @file op.gt.jxs @param
inscale 21. @automatic 0 @param inscale 21. 21. 21. 21.;
#P objectname jit.gl.slab[1];
#P newex 66 463 268 9109513 jit.gl.texture table @name boo @dim 320 240
@automatic 0;
#P objectname jit.gl.texture;
#P newex 141 433 384 9109513 jit.gl.mesh table @color 1. 1. 1. @automatic 0
@scale 1. 1. 1. @capture boo @tex_map 1;
#P objectname jit.gl.nurbs;
#P newex 141 43 329 9109513 t b b;
#P newex 141 181 241 9109513 jit.gl.slab table @file
cc.uyvy2rgba.jxs@dimscale 2. 1.;
#P objectname jit.gl.slab;
#P newex 141 102 324 9109513 jit.dx.grab_f 320 240 @vdevice 0 @format 2
@colormode uyvy @unique 1;
#P objectname jit.dx.grab[3];
#P comment 535 252 100 9109513 compare to solid white;
#P user panel 128 124 445 208;
#X brgb 189 189 208;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 135 373 401 87;
#X brgb 240 222 222;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P fasten 10 0 8 1 465 294 549 294;
#P connect 11 0 10 0;
#P connect 5 1 11 0;
#P connect 29 0 15 1;
#P connect 30 1 29 0;
#P fasten 24 0 6 0 146 423 146 423;
#P fasten 14 1 6 0 91 409 146 409;
#P fasten 25 0 6 0 162 429 146 429;
#P fasten 8 0 24 0 146 386 146 386;
#P connect 28 0 8 0;
#P hidden fasten 19 0 8 0 103 298 146 298;
#P connect 27 0 28 0;
#P connect 15 0 27 0;
#P connect 12 0 15 0;
#P hidden fasten 23 0 15 0 102 228 146 228;
#P connect 4 0 12 0;
#P connect 30 0 4 0;
#P hidden fasten 13 0 4 0 103 184 146 184;
#P connect 21 0 30 0;
#P connect 3 0 21 0;
#P fasten 22 0 21 0 333 127 146 127;
#P fasten 18 0 3 0 146 95 146 95;
#P fasten 9 1 3 0 106 99 146 99;
#P connect 5 0 18 0;
#P connect 17 0 5 0;
#P connect 20 0 16 0;
#P connect 7 0 20 0;
#P connect 14 0 7 0;
#P connect 9 0 14 0;
#P connect 26 0 9 0;
#P window clipboard copycount 36;

//shader


Luminance based keying

Target luminance

Luminance coefficients (RGBA)



/>

< ![CDATA[

// texcoords
varying vec2 texcoord0;

// samplers
uniform sampler2DRect tex0;

// blend amount
uniform float luma;
uniform vec4 lumcoeff;

// entry point
void main()
{
vec4 one = vec4(1.0);

vec4 a = texture2DRect(tex0, texcoord0);

// calculate our luminance
float luminance = dot(a,lumcoeff);

gl_FragColor = vec4(luminance);
// setting the fragment color is a useful means of debugging
//gl_FragColor = vec4(luminance);
}

]]>

On 9/13/07, Jan Klug wrote:
>
>
> hi yair,
>
> would like to try your de-noising-approach, but unfortunately
> i can’t see the attachment in the forum…
>
> could you try to upload it from within there (or whatever helps in cases
> like this)?
>
> many thanks,
>
>
> jan klug
>


December 19, 2007 | 12:44 pm

Hello,
I would like to try Yair’s patch.
It must be obvious, but I don’t understand where is the code or files for the shaders needed in his patch.
co.luma.jxs
co.difference.jxs
co.luma.jxs
cc.uyvy2rgba.jxs

Sorry, I’m new to OpenGl …
can anyone help me?
Thanks
Felix


December 19, 2007 | 10:09 pm

On Dec 19, 2007 2:44 PM, Felix wrote:

>
> Hello,
> I would like to try Yair’s patch.
> It must be obvious, but I don’t understand where is the code or files for
> the shaders needed in his patch.
> co.luma.jxs
> co.difference.jxs
> co.luma.jxs
> cc.uyvy2rgba.jxs
>
this are included with the jitter original distro.
the first patch should be copy pasted into a new patch. it will automagicly
appear.
the shader should be copy pasted and put somewhere in the max folder. look
in the max tutorial for more on this.
have fun and proser.

>
> Sorry, I’m new to OpenGl …
> can anyone help me?
> Thanks
> Felix
> –
> Felix Luque
> http://www.othersounds.net
> felix@othersounds.net
>


December 20, 2007 | 1:15 pm

Thanks Yair,
the problem is that i was searching for co.luma.jxs, and i don’t find it in the max shaders folder. Is it the same shader as co.lumakey.jxs?.
thanks
F


December 20, 2007 | 1:45 pm

i can remember, probebly not as this is just a one liner i took from another
shader.

On Dec 20, 2007 5:15 AM, Felix wrote:

>
> Thanks Yair,
> the problem is that i was searching for co.luma.jxs, and i don’t find it
> in the max shaders folder. Is it the same shader as co.lumakey.jxs?.
> thanks
> F
> –
> Felix Luque
> http://www.othersounds.net
> felix@othersounds.net
>


December 20, 2007 | 3:05 pm

I don’t see the problem. The co.luma.jxs shader is attached earlier in this
thread. Or am I missing something?

Thijs

On Dec 20, 2007 1:45 PM, yair reshef wrote:

> i can remember, probebly not as this is just a one liner i took from
> another shader.
>
>
> On Dec 20, 2007 5:15 AM, Felix wrote:
>
> >
> > Thanks Yair,
> > the problem is that i was searching for co.luma.jxs, and i don’t find it
> > in the max shaders folder. Is it the same shader as co.lumakey.jxs?.
> > thanks
> > F
> > –
> >
> >


December 20, 2007 | 3:44 pm

Hi Thijs,
I don’t see any attachment, but yes Yair wrote this as the shader:
//shader
Luminance based keying
Target luminance
Luminance coefficients (RGBA)
/>
I’m sorry, I don’t know much about shader’s syntax, but this doesn’t look like a shader to me, it looks more like a note of how to make the shader, combining 3 basic shaders. Am I right?. …
Sorry for my complete lack of knowledge in openGL …
Felix


December 20, 2007 | 4:31 pm

ho, i posted this to the list, shader syntax dont play well with the forum.

here is the shader , save as luma.jxs and put somewhere in max search path

//shader


Luminance based keying

Target luminance

Luminance coefficients (RGBA)



< ![CDATA[

// texcoords
varying vec2 texcoord0;

// samplers
uniform sampler2DRect tex0;

// blend amount
uniform float luma;
uniform vec4 lumcoeff;

// entry point
void main()
{
vec4 one = vec4(1.0);

vec4 a = texture2DRect(tex0, texcoord0);

// calculate our luminance
float luminance = dot(a,lumcoeff);

gl_FragColor = vec4(luminance);
// setting the fragment color is a useful means of debugging
//gl_FragColor = vec4(luminance);
}

]]>


December 20, 2007 | 4:33 pm

thanks, ;-)


February 23, 2013 | 12:52 am

Oops my link above is dead. Haven’t looked at this zip file in years, but I’m uploading it here for posterity.


February 23, 2013 | 4:49 am

cool thanks!


February 23, 2013 | 10:51 am

but also remember the first piece of advice: Crank up the light while you’re recording. Nothing beats actual light.


Viewing 19 posts - 1 through 19 (of 19 total)