Computing first derivative--image processing
36 次查看（过去 30 天）
Image Analyst 2014-11-23
It's just the (n+1)st element minus the nth element. Same as you'd get from diff(). There are also imgradient(), and imgradientxy() functions in the Image Processing Toolbox.
Youssef Khmou 2014-11-23
In general diff(X,n) of N by 1 vector returns an N-n by 1 vector, second derivative is diff(X,2), using gradient is better because it offers a possibility to choose the sample rate, if its 1 then :