Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?
share|improve this question

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$$

share|improve this answer

this one: has a Matlab Code for Poisson Image Reconstruction from Image Gradients. Maybe it can help you.

share|improve this answer
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). – Libor Oct 17 '13 at 14:11

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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