Sign in to follow this  

Moments of two dimensional functions

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by Julian90
dx, and dy are your variables of integration

i.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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by Zipster
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.


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

Understanding is awesome. :D

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Folks,

Although this is a schoolwork post, I am allowing it to remain open since the poster did not ask for an answer per-say, just hints/insight. And it seems to have helped Endar understand the math. And, the underlying subject matter is related to game development.

That said...I invite everyone to periodically read the Forum FAQ so that you understand my current policy on schoolwork. Sometimes I am more flexible about this, and sometimes I am not.

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this