Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: value of first and second derivative for image
Date: Wed, 7 Apr 2010 17:49:25 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 19
Message-ID: <hpigj5$3u8$1@fred.mathworks.com>
References: <hpiaa3$q5l$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1270662565 4040 172.30.248.35 (7 Apr 2010 17:49:25 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 7 Apr 2010 17:49:25 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:624342

"mira " <files@mathworks.com> wrote in message <hpiaa3$q5l$1@fred.mathworks.com>...
> hey everybody,
> 
> I have a problem finding the first and second derivative of an image, I think the the diff() method does that, but I don't want to apply it to the image what I want is to find the value ( numerical one ) of the 1'st & 2'nd derivative for the image. Is there any way to do that.
> Any help is appreciated and thanks a lot.
> 
> mira

  In a two-dimensional situation, which would be the case for images, there are three different second partial derivatives involved: 1) the second derivative with respect to x, 2) the second derivative with respect to y, and 3) the cross second derivative with respect first to x and then to y (or visa versa.)  Which of these are you interested in?  For example, if you have the function

 f(x,y) = 3*x^2 - 7*x*y + 4*y^2

these three second derivatives would be 6, 8, and -7, respectively.

  You can use the 'gradient' function to find the two first derivatives of a quantity numerically.  Then you can apply this function to each of these two results to get all four second derivatives.  (The two cross derivatives should be substantially equal.)

  By the way, what quantity are you taking the derivatives of, the image intensity?

Roger Stafford