# Moments of two dimensional functions

This topic is 4369 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

For one of my classes, we've been given a handout that we're supposed to use to calculate some useful data for a digital image that is invariant to translations, rotations and scaling. I'm mostly in the dark about it, and since sometimes my eyes glaze over when talking to this lecturer, I'm asking here first. :D There is a larger version of this image here. Now, I just don't understand about the m variable. I think that the xbar (x with a bar over) and ybar are the averages, but I'm not sure what they are the averages of. And, in the second image, is f(x,y) supposed to be a pixel value at the point x,y if we're calculating the moments for a digital (RGB, or greyscale) image? Can anyone shed some light on this for me?

##### Share on other sites
The mean of x and the mean of y are the center of the image. Your image is probably rectangular and these quantities are easy to deal with.

The text that you are reading should clearly specify this somewhere, but it probably deals only with greyscale images, so f(x,y) is just a real number.

##### Share on other sites
For a gray-scale image, f(x,y) is the intensity at pixel (x,y). Think of the image as a mass distribution of a flat plate with density f(x,y) at the location (x,y). In the case of discrete images, the m-quantities are obtained from the displayed mpq equation but with the integral signs replaced by summation signs. m00 is the total mass of the plate. m10 and m01 are the first-order moments. Just as you find in physics books, the coordinates of the center of mass are obtained by dividing the first-order moments by the total mass. The center of mass is (xbar,ybar) = (m10/m00,m01/m00).

##### Share on other sites
Oh, actually, Wasting Time's interpretation of what the mean of x and y are makes more sense.

##### Share on other sites
What about the dx and dy? Is that supposed to be the change in x and the change in y? If so, the change from where (and I'm assuming the to would be the current position)?

##### Share on other sites
dx, and dy are your variables of integration

i.e. integrate wrt x then integrate wrt y

##### Share on other sites
Quote:
 Original post by Julian90dx, and dy are your variables of integrationi.e. integrate wrt x then integrate wrt y

Care to explain more? It's been a while since I've had to do integration.

Is 'wrt' == "with respect to" ?

##### Share on other sites
In integration, you're trying to find the area under a function. The thought process is that you can take a bunch of rectangles of equal width, fit them underneath the function, and then add up their areas. But how wide should these rectangles be? The answer is infinitesimally small! The dx and dy are a way of indicating the width and depth of an infinitesimally small rectangle (or rectangular prism in this case). So you can just consider them notation most of the time, but for some more complicated integration problems you need to manipulate them.

Since you're working with pixels, the function isn't truly continuous, so instead of integration you use summation. You can also think of this as using rectangles, only where the width is an implicit 1.

##### Share on other sites
Quote:
 Original post by ZipsterIn integration, you're trying to find the area under a function. The thought process is that you can take a bunch of rectangles of equal width, fit them underneath the function, and then add up their areas. But how wide should these rectangles be? The answer is infinitesimally small! The dx and dy are a way of indicating the width and depth of an infinitesimally small rectangle (or rectangular prism in this case). So you can just consider them notation most of the time, but for some more complicated integration problems you need to manipulate them.Since you're working with pixels, the function isn't truly continuous, so instead of integration you use summation. You can also think of this as using rectangles, only where the width is an implicit 1.

Zipster, when I read this, I swear a light bulb appeared above my head.

Understanding is awesome. :D

##### Share on other sites
Here is an animation showing exactly what Zipster is talking about. It's always nice to have an image to help you visualize. As the rectangles become smaller and more numerous, the sum of their areas converges to the area under the curve. Loosely speaking, the limit of the sum of the rectangles' areas as the widths of the rectangles go to zero is the area under the curve. This notion is formalized in Riemann sums, which are used to define the Riemann integral.

1. 1
2. 2
Rutin
20
3. 3
4. 4
frob
14
5. 5

• 12
• 9
• 17
• 18
• 9
• ### Forum Statistics

• Total Topics
632597
• Total Posts
3007329

×