Integration Error?


bc69
11-26-2004, 10:39 PM
I'm implementing a paper on HDR tone mapping which involves integration of the gradient of image brightness (Fattal, Siggraph 2002).

I'm getting some strange results when I use mglin. The results are workable, but I want to know if it's something I'm doing wrong, or if I should expect this.

As a test, I fed it some vertical lines to be compressed, where the result should have lines which are roughly the same brightness, and the brightness within the lines should be constant in the vertical direction. I checked, and the data going in is correct (meaning that the values vertically before setting up the mglin array are consistent with expectiations).

See this link for an image:
http://www-viz.tamu.edu/students/bc/mglinQuestion

I am expecting this result, except the lines should be the same brightness from top to bottom. The difference in brightness between different lines should be (and is) very small. It's just this major dropout toward the edge (and the minor ones in the middle) that bother me.

There's a noticable difference between an ncycle of 2 and 3 (this is 3). The law of diminishing returns sets in after 3. 4 is very slightly better, and 5 isn't really noticable.

Is this just inherent error from integration? Or am I feeding the data in wrong?

I set up my mglin grid to be the next power of 2 larger than the width (or height if it's a portrait mode picture). I'm integrating gradients, so beyond the edge of the image, I just fill with 0 (signifying that the difference between the boudnary pixel and outside the boundary is 0).

Is this the way to do it? I guess I could stretch the image to fully fill the grid, but then I'd have to stretch it back, and that would give me aliasing and reconstruction errors, which would blur the image.

Perhaps I'm doing something else wrong. I'm open to suggestions...

Thanks,
bc