title: How does Richardson–Lucy algorithm work? Code example?
body: <p>I am trying to figure out how deconvolution works. I understand the idea behind it but I want to understand some of the actual algorithms which implement it - algorithms which take as input a blurred image with its point sample function (blur kernel) and produce as output the latent image.</p>
  
  <p>So far I found <a href="http://en.wikipedia.org/wiki/Richardson%E2%80%93Lucy_deconvolution" rel="nofollow">Richardson–Lucy</a> algorithm where the math does not seem to be that difficult however I can't figure how the actual algorithm works. At Wikipedia it says:</p>
  
  <blockquote>
    <p>This leads to an equation for  which can be solved <strong>iteratively</strong> according...</p>
  </blockquote>
  
  <p>however it does not show the actual loop. Can anyone point me to a resource where the actual algorithm is explained. On Google I only manage to find methods which use Richardson–Lucy as one of its steps, but not the actual Richardson–Lucy algorithm.</p>
  
  <p>Algorithm in any language or pseudo-code would be nice, however if one is available in Python, that would be amazing.</p>
  
  <p>Thanx in advance.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Essentially what I want to figure out is given blurred image (nxm):</p>
  
  <pre><code>x00 x01 x02 x03 .. x0n
  x10 x11 x12 x13 .. x1n
  ...
  xm0 xm1 xm2 xm3 .. xmn
  </code></pre>
  
  <p>and the kernel (ixj) which was used in order to get the blurred image:</p>
  
  <pre><code>p00 p01 p02 .. p0i
  p10 p11 p12 .. p1i
  ...
  pj0 pj1 pj2 .. pji
  </code></pre>
  
  <p>What are the exact steps in the Richardson–Lucy algorithm in order to figure out the original image.</p>