Re: convolution using a gaussian kernel



Well,it seems attacking other people is your hobby.I wont engage you
in any way but to clear a few things,
(1)I m not new to Matlab.I have written more than 50 m files in the
past year alone (yes!) but I am new in the area of image signal
processing.
(2)I dont cheat.I didnt claim I made a discovery with that code,I was
simply asking for how to change the way I was moving my window from
simple corner alignment to centred window.
(3)It is not a crime to say you I dont understand something.Infact,a
person who asks is better than one who claims to know it all and
doesnt consult with others.
It looks my crime was asking other Matlab users for their views.What
world do we live in????

I rest my case.By the way,I have managed to do that without your
help.Next time dont read my post.

Eitan Hirsch wrote:


it's all a matter of attitude. you are the one who's cheating and
i'm
the one who's making the world a horrible place????
had u been honest and written:
"i'm new to matlab, i got this assignment, can someone help me, and
explain to me ....."
believe me, i would be the first to answer (u can check previous
posts i've made).
anyone who has written more than 3 m files in his life can tell
this
code was not written by u.
Oh, one more thing, i dont feel i'm wasting any bits, maybe next
time
u'll learn.
eitan

Cliff wrote:


Why dont you save bits and stop transmitting rubbish.I d rather
be
silent that say what u said.It would have been better if you
ignored
my post rather than post such a silly reply.Its people like you
that
make the world a horrible place.Pity yourself,whoever you are!

Eitan Hirsch wrote:


i really think, that if u've written that code yourself,
u should know the answer....

Cliff wrote:


Hi,
I have a (n,n) gaussian kernel with variance sigma and
want
to
use
it
to convolve an image.I want to achieve this without
using
any
built-in function.So in my implementation i have the
following;

Image=[x x x x x x x
x x x x x x x
x x x x x x x]

where size(Image)=M,N;

Say my kernel has values
win = [0.179 0.45 0.17
0.230 0.55 0.34
0.179 0.45 0.17]

My convolution code follows:

[M,N]=size(Image) %get image dim

kern = win; %gaussian kernel

[m,n] = size(kern); %size of kernel

New_Im =[];

for i=1:M-n+1 %i from 1:M-m+1 where
for j=1:N-n+1
New_Im(i,j)=0;
for k=1:n
for l=1:n
New_Im(i,j) = New_Im(i,j)+Img(i+k-1,j+l-1)*kern(k,l);

end
end

end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Suppose I want to calculate the new pixel in location
(i,j).In
my
implementation the old pixel (i,j) of the image is
aligned
with
point
(1,1) of the kernel.In other words pixel (i,j) is
always
aligned
with
the top left hand entry in the kernel.
How do I modify this code so that old pixel (i,j) is
aligned
with
the
centre of the gaussian kernel.

Many thanks
.



Relevant Pages

  • Re: Precalculated Z - buffer
    ... "black muxing magic" in the pixel shader, ... you have to fall back to the XYZ vertex method. ... You can convert your depth-image to any of the formats above (if they dont ... I think lots of people want z buffer control and could live ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: convolution using a gaussian kernel
    ... Cliff wrote: ... I have a gaussian kernel with variance sigma and want ... My convolution code follows: ... Suppose I want to calculate the new pixel in location ...
    (comp.soft-sys.matlab)
  • Re: convolution using a gaussian kernel
    ... silent that say what u said.It would have been better if you ignored ... I have a gaussian kernel with variance sigma and want to ... My convolution code follows: ... Suppose I want to calculate the new pixel in location.In ...
    (comp.soft-sys.matlab)
  • Re: convolution using a gaussian kernel
    ... I have a gaussian kernel with variance sigma and want to use ... My convolution code follows: ... =size%get image dim ... Suppose I want to calculate the new pixel in location.In my ...
    (comp.soft-sys.matlab)
  • Re: TBitmap - how to copy an "object"
    ... > i'm trying to copy an "object" of one color out of a TBitmap, ... > the problem i got is that i dont know when a pixel belongs to ... If you know where to start, you can search outwards in all directions ... from the starting pixel, adding neighbouring pixels to your region ...
    (comp.lang.pascal.delphi.misc)