Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: conv2(..) fault ???
Date: Mon, 12 Mar 2012 08:09:11 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <jjkav6$18b$1@newscl01ah.mathworks.com>
References: <jjk5d7$ecs$1@newscl01ah.mathworks.com> <jjk8id$nbh$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1331539751 1291 172.30.248.47 (12 Mar 2012 08:09:11 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 12 Mar 2012 08:09:11 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3368253
Xref: news.mathworks.com comp.soft-sys.matlab:760642

"Roger Stafford" wrote in message <jjk8id$nbh$1@newscl01ah.mathworks.com>...
> "Le Tuan" wrote in message <jjk5d7$ecs$1@newscl01ah.mathworks.com>...
> > I write:
> > I=[-5 5 0 5;
> >      5 5 0 0;
> >      0 5 0 5;
> >      5 5 5 5]
> > 
> > h=[-1 -1 -1;
> >        0 0 0;
> >        1 1 1]
> > 
> > c=conv2(I,h,'valid')
> > 
> > and output of c is:
> > -5    0
> > -5  -10
> > c(1,2), c(2,1), c(2,2) is right results. But why c(1,1)=-5, I think it must be 5 ???
> - - - - - - - - -
>   I disagree, c(1,1) = -5 looks right to me:
> 
>  (-5)*1+5*1+0*1+5*0+5*0+0*0+0*(-1)+5*(-1)+0*(-1) = -5
> 
> Roger Stafford
I don't understand.
According to:
http://docs.gimp.org/en/plug-in-convmatrix.html
I think c(1,1)=(-5)*(-1)+5*(-1)+0*(-1)+5*0+5*0+0*0+0*1+5*1+0*1=5