4
$\begingroup$

I am implementing reconstruction of image from gradient domain. This requires solving the following partial differential equation (a Poisson equation) on a 2D grid:

$$\nabla^{2}I=\mathbb{div} G$$

$\mathbb{div} G$ is divergence of a gradient field, which is simply an image with Laplacian operator applied (second-order derivative):

enter image description here

The original image have range of values 0 to 255 (8-bit image). The divergence image has values ranging from -341 to +318, which is expected.

However, when I solve the above equation for $I$, the result have very small scale. The values of reconstructed image range from -0.000038 to +0.000029.

I know the gradient domain stores information up to a constant. In this case however, the scale has been changed considerably.

When I stretch the reconstructed image to 0-255 interval, the correct result is obtained:

enter image description here

I am using Poisson solver based on the Full Multigrid Method (FMG) which works spectacularly in different application (HDR images). Here the values are stretched anyway so I never noticed the huge change of scale.

Is this scale change normal for gradient domain reconstruction or may there be

My ideas:

  1. Some glitch in the numerical solution.
  2. The $\mathbb{div} G$ image is padded with zeros so its size conforms with the solver - could this affect the scale?
$\endgroup$

3 Answers 3

2
$\begingroup$

The Poisson equation may suffer from ill-posedness if the boundary condition is not sufficient to yield a unique solution to the problem. The most often used boundary condition is Dirichlet boundary condition, in which the values of $I(x,y)$ are specified for those points $(x,y)$ on the boundary of $I$.

In your case, after you stretch your solution to another scale, you got the correct solution. It is possible the solution to your Poisson equation is not unique, and your algorithm just found out the correct one based on some restrained part (such as minimal norm of least square) in the optimization. It is much much more possible that it is already sufficient to determine $I(x,y)$ up to an arbitrary additive constant, and this constant is determined by the solution of Laplacian equation: $$\nabla^{2}\hat I= 0$$

$\endgroup$
0
$\begingroup$

this one: http://web.media.mit.edu/~raskar/photo/code.pdf has a Matlab Code for Poisson Image Reconstruction from Image Gradients. Maybe it can help you.

$\endgroup$
1
  • $\begingroup$ Thanks. I am actually using Gauss-Seidel iteration with multigrid preconditioner - this should be near optimal in terms of speed, and the results should be similar no matter what solver is used. I am wondering why the reconstruction does not provide scale (it should be computed up to a constant, but scale should be retained). $\endgroup$
    – Libor
    Oct 17, 2013 at 14:11
0
$\begingroup$

I guess you have minus signs on the output, which prevent the result from appearing correctly. Clip your output so that the results are between [0, 255].

The numerical solver works in floating point precision and doesn't respect the byte image constraint. So you have to post-process your numerical result.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.