# Help With an Algortihm

• 10-19-2007
Tonto
Help With an Algortihm
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&#233; patterns as a heightmap. These

http://en.wikipedia.org/wiki/Moir&#37;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&#233; 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.
• 10-19-2007
brewbuck
Quote:

Originally Posted by Tonto
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.

What exactly do you mean by relative density of blackness? It sounds like you are talking about a gradient.

Gradient was in fact what was used in the final demos of the content-aware image resizer. They used a few more sophisticated measures and didn't find that they performed significantly better.
• 10-20-2007
Tonto
Yeah, it definitely uses the gradiant vector in the article, I just um, should I just search that? I'm a little lost, I guess I should just research