Hey I'm was looking for an algorithmic device to measure the relative density of blackness in an area of a picture. I am using it to model Moiré patterns as a heightmap. These

http://en.wikipedia.org/wiki/Moir%C3%A9_pattern
http://www.jstor.org/view/07468342/di020744/02p0043o/0

I basically am simulating this in a way where I graph the family of curves x^2 + y^2 = nr^2 where n is iterated and forms a collection of concentric circles. I sample this data at every x and y in a region, and the this basically simulates a Moiré patterns created by a checkerboard grid kind of like this figure in the article

http://www.jstor.org/cgi-bin/jstor/g.../12b.jpg?jstor

I could not figure out the math for the familys of ellipses and hyperbolas as are described in the article, so I considered the option of using an 'energy function' like those seen in content-aware image resizing to interpret the texture as sort of a height map that is measured by the density or 'amount' of black in the region to determine the height.

In any case, I was wondering if anyone had any algorithmic device to measure the relative density of blackness in an area of a picture.