Re: Gaussian Implementation
- From: "mcarthybn@xxxxxxxxx" <mcarthybn@xxxxxxxxx>
- Date: Thu, 9 Apr 2009 12:16:58 -0700 (PDT)
On Apr 9, 9:21 am, hoffm...@xxxxxxxxxxxx wrote:
mcarth...@xxxxxxxxx schrieb:
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
The implementation doesn't depend on the image pixel width and
height.
Some answers are here on p.3:http://www.fho-emden.de/~hoffmann/gauss25092001.pdf
A 5*5 kernel leaves 2 rows and 2 columns at all edges unfiltered.
If this should be relevant and cropping isn't possible, then the
original
image should be enlarged by mirroring all edges beyond the original
size in advance to filtering.
Best regards --Gernot Hoffmann- Hide quoted text -
- Show quoted text -
Then how will i decide this matrix values of the(5*5) kernel?
Arthur
.
- References:
- Gaussian Implementation
- From: mcarthybn@xxxxxxxxx
- Re: Gaussian Implementation
- From: hoffmann
- Gaussian Implementation
- Prev by Date: B-spline tensor product?
- Next by Date: Re: Algorithms for hidden-line perspective
- Previous by thread: Re: Gaussian Implementation
- Next by thread: Re: Gaussian Implementation
- Index(es):
Relevant Pages
|
Loading