title: Creating Filter's Laplacian Matrix and Solving the Linear Equation for Image Filtering
body: <p>I have an optimization problem to solve in order to filter an image.<br>
  I created a Linear Equation of the problem which deals with Sparse Matrices.</p>
  
  <p>At first I will show the problem.<br>
  First, the Laplacian (Adjacency) matrix of the problem:</p>
  
  <p><img src="https://i.stack.imgur.com/Cmuxl.png" alt="enter image description here"></p>
  
  <p>The matrix Dx / Dy is the forward difference operator -> Hence its transpose is the backward difference operator.<br>
  The matrix Ax / Ay is diagonal matrix with weights which are function of the gradient of the image (Point wise, namely the value depends only on the gradient on that pixel by itself).<br>
  The weights are:<br>
  <img src="https://i.stack.imgur.com/2V37P.png" alt="enter image description here"><br>
  Where Ix(i) is the horizontal gradient of the input image at the i-th pixel (When you vectorize the input image).</p>
  
  <p>Assuming input Image G -> g = vec(G) = G(:).<br>
  I want to find and image U -> u = vec(U) = U(:) s.t.:</p>
  
  <p><img src="https://i.stack.imgur.com/chh3q.png" alt="enter image description here"></p>
  
  <p>My questions are:</p>
  
  <ol>
  <li>How can I build the matrices Dx / Dy / Ax / Ay effectively (They are all sparse)?</li>
  <li>By setting M = (I + \lambda * {L}_{g}), Is there an optimized way to create M directly?</li>
  <li>What would be the best way to solve this linear problem in MATLAB? Is there a way to by pass memory limitations (Namely, dealing with large images and still be able to solve it)?</li>
  <li>Is there an Open Source library to solve it under limited memory resources? Any library with MATLAB API?</li>
  </ol>
  
  <p>Thank You.</p>