ChristianS
01-11-2008, 06:27 AM
Hello,
Hopefully some of you can help me out! I have to use the Full Multigrid Algorithm from chapter 20.6.
For my master's thesis I have to reimplement a paper about gradient domain high dynamic range compression. In this paper the gradient field of a luminance image is manipulated by attenuating the magnitudes of large gradients. Then a low dynamic range image is obtained by solving a Poisson equation on the modified gradient field. The paper uses the Full Multigrid Algorithm from NR3 for this.
The Poisson equation:
V²I = div G
with
V = triangle upside down
I = image
G = gradient field
The Laplacian of the equation is approximated as follows:
V²I(x, y) = I(x + 1, y) + I(x - 1, y) + I(x, y + 1) + I(x, y - 1) - 4 * I(x, y)
The gradient is approximated using forward difference:
VH(x, y) = (H(x + 1, y) - H(x, y), H(x, y + 1) - H(x, y))
div G is approximated using backward difference:
div G = Gx(x, y) - Gx(x - 1, y) + Gy(x, y) - Gy(x, y - 1)
from the paper:
"the difference scheme yields a large system of linear equations - one for each pixel in the image, but the corresponding matrix has only five nonzero elements in each row, since each pixel is coupled only with its four neighbours."
Questions:
I have not the slightest idea how to put these equations into the input matrix for the mglin function :( Which format is necessary for the algorithm to perform correctly?
The comment in the code listing mglin.h says "On input u[0..n-1][0..n-1] contains the right-hand side p,..."
Is p = div G ?
What does the output look like? Does each row of u contains the new luminance value for the corresponding pixel?
Thanks in advance for any help you can give me.
The paper:
http://www.cs.huji.ac.il/%7Edanix/hdr/hdrc.pdf
PS: If you help me, I'll send you a post card from my home town :)
Hopefully some of you can help me out! I have to use the Full Multigrid Algorithm from chapter 20.6.
For my master's thesis I have to reimplement a paper about gradient domain high dynamic range compression. In this paper the gradient field of a luminance image is manipulated by attenuating the magnitudes of large gradients. Then a low dynamic range image is obtained by solving a Poisson equation on the modified gradient field. The paper uses the Full Multigrid Algorithm from NR3 for this.
The Poisson equation:
V²I = div G
with
V = triangle upside down
I = image
G = gradient field
The Laplacian of the equation is approximated as follows:
V²I(x, y) = I(x + 1, y) + I(x - 1, y) + I(x, y + 1) + I(x, y - 1) - 4 * I(x, y)
The gradient is approximated using forward difference:
VH(x, y) = (H(x + 1, y) - H(x, y), H(x, y + 1) - H(x, y))
div G is approximated using backward difference:
div G = Gx(x, y) - Gx(x - 1, y) + Gy(x, y) - Gy(x, y - 1)
from the paper:
"the difference scheme yields a large system of linear equations - one for each pixel in the image, but the corresponding matrix has only five nonzero elements in each row, since each pixel is coupled only with its four neighbours."
Questions:
I have not the slightest idea how to put these equations into the input matrix for the mglin function :( Which format is necessary for the algorithm to perform correctly?
The comment in the code listing mglin.h says "On input u[0..n-1][0..n-1] contains the right-hand side p,..."
Is p = div G ?
What does the output look like? Does each row of u contains the new luminance value for the corresponding pixel?
Thanks in advance for any help you can give me.
The paper:
http://www.cs.huji.ac.il/%7Edanix/hdr/hdrc.pdf
PS: If you help me, I'll send you a post card from my home town :)