From: mira on 7 Apr 2010 12:02 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
From: Roger Stafford on 7 Apr 2010 13:49 "mira " <files(a)mathworks.com> wrote in message <hpiaa3$q5l$1(a)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
From: Matt J on 7 Apr 2010 14:30 "mira " <files(a)mathworks.com> wrote in message <hpiaa3$q5l$1(a)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. ============== This is contradictory. You claim that the diff() function both does and doesn't do what you want in the same sentence.
From: mira on 7 Apr 2010 14:42 "Roger Stafford" <ellieandrogerxyzzy(a)mindspring.com.invalid> wrote in message <hpigj5$3u8$1(a)fred.mathworks.com>... > "mira " <files(a)mathworks.com> wrote in message <hpiaa3$q5l$1(a)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 thank you Roger for your reply I didn't really know that there are many types of derivatives the one I need is the first derivative to get frequency of gray scale changes in the binary image ( original image was .png and I made it binary using im2bw ) and from that I need the second derivative. I need the results in numbers because they will be input for a neural network classifier. Could you please tell me exactly how to get derivative for my image ( I knew it in calculas but not in images). thanks in advance, regards, mira
From: ImageAnalyst on 7 Apr 2010 14:52 You can do it with the conv2() function - just pass in the correct kernel, for example -1 -1 -1 -1 8 -1 -1 -1 -1
|
Next
|
Last
Pages: 1 2 Prev: How to choose step size in pde Next: how to access the webcam from gui using matlab? |