Gaussian Implementation



Hi ,
I am here to get some direction from you guys. Please help me to
know about this . I am trying to do a 2d[5*5] convolution by gaussian
filter. Actually i have to scale down my image from 800*600 to
640*480.I read several pages but all are saying that :

The first step is to create a kernel. A Kernel is a grid through which
you filter the color values. The inner-most pixel is called the
"destination pixel" and it receives colors from the surrounding
"source pixels"
In some example i seen that for 256*256 image the 5*5 kernel will be :

---------> int kernelInt[25] = { 1, 4, 6, 4, 1,
4, 16, 24, 16, 4,
6, 24, 36, 24, 6,
4, 16, 24, 16, 4,
1, 4, 6, 4, 1 };


--1)how they desigend this??

// define 5x5 Gaussian kernel

----------->float kernel[25] = { 1/256.0f, 4/256.0f, 6/256.0f,
4/256.0f, 1/256.0f,
4/256.0f, 16/256.0f, 24/256.0f, 16/256.0f,
4/256.0f,
6/256.0f, 24/256.0f, 36/256.0f, 24/256.0f,
6/256.0f,
4/256.0f, 16/256.0f, 24/256.0f, 16/256.0f,
4/256.0f,
1/256.0f, 4/256.0f, 6/256.0f, 4/256.0f,
1/256.0f };

2)Here in this pice of code it is divide the matrix by 1/256.
but for my image which is which 800*600 then how will i calulate this
(that floating point division).


Please let me know about this calcaulation.


Thanks in Advance
Arthur

.



Relevant Pages

  • Re: Filtering kernel width
    ... of kernel function becomes irrelevant for 2 pixels, 2x2 pixels, etc. ... Suppose I was using a sinc filter, that has 1 lobe and is 0 outside ... Why should a pixel ... So then basically that's what these filters do: they "blur" the image ...
    (comp.graphics.algorithms)
  • Re: Rookie having problems with some filter code. Any help?
    ... The negative coefficients in your kernel ... The kernel you have here is an edge detection filter. ... input pixel value. ... the signed int filter result to the source pixel and then apply clipping. ...
    (sci.image.processing)
  • Re: Gaussian Implementation
    ... The first step is to create a kernel. ... you filter the color values. ... The inner-most pixel is called the ... // define 5x5 Gaussian kernel ...
    (comp.graphics.algorithms)
  • Re: Gaussian Implementation
    ...   I am here to get some direction from you guys. ... you filter the color values. ... The inner-most pixel is called the ... A 5*5 kernel leaves 2 rows and 2 columns at all edges unfiltered. ...
    (comp.graphics.algorithms)
  • Re: why we want to do folding while performing convolution
    ... only be done for kernels of an odd size ... ... Let's say you have a first order difference filter (two ... shift theorem tells you how much to shift to eliminate the linear phase ... The indices themselves are shifts and the entire kernel can be ...
    (comp.dsp)

Loading